From 29a6f0c3f14b5899fc00a94b08eeaeb5ffa18c61 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 17:14:47 -0800 Subject: [PATCH 01/63] fix(global-db): name drifted workflow schema objects in refusals A store whose workflow schema this binary refuses reported only that its workflow tables were "absent, incomplete, or not exact", so four refused stores could not be told apart or traced to a cause. The refusal still fails closed through the existing typed reset path but now says what differs: the missing and altered contract tables, the stored workflow identity next to the required one, the differing identity fields, or the first differing column. Only contract names and numbers are echoed; stored SQL, column text, and unrecognized digests never reach the message, and lists are bounded. RefusedAuthorityV1 carries the reason as a Cow so static refusals stay constant. Co-Authored-By: Claude Sonnet 5.5 --- .../src/observation/schema.rs | 4 +- crates/tracedecay-global-db/src/registered.rs | 24 +- .../tracedecay-global-db/src/schema_stages.rs | 471 +++++++++++++++++- 3 files changed, 470 insertions(+), 29 deletions(-) diff --git a/crates/tracedecay-global-db/src/observation/schema.rs b/crates/tracedecay-global-db/src/observation/schema.rs index 55a46b790b..2348a02cd0 100644 --- a/crates/tracedecay-global-db/src/observation/schema.rs +++ b/crates/tracedecay-global-db/src/observation/schema.rs @@ -30,7 +30,9 @@ pub(crate) const OBSERVATION_ADMISSION_MARKERS: [&str; 2] = [ pub(crate) const OBSERVATIONS_PREDATE_UNIFIED_IDENTITY: crate::registered::RefusedAuthorityV1 = crate::registered::RefusedAuthorityV1::Shape { authority: "observations", - reason: "observation rows predate the unified observation identity and cannot be read; reset the profile so ingestion can rebuild them from host transcripts", + reason: std::borrow::Cow::Borrowed( + "observation rows predate the unified observation identity and cannot be read; reset the profile so ingestion can rebuild them from host transcripts", + ), }; const OBSERVATION_SCHEMA_OPERATION: &str = "ensure observation authority schema"; diff --git a/crates/tracedecay-global-db/src/registered.rs b/crates/tracedecay-global-db/src/registered.rs index 64dfb5ef25..c869e88525 100644 --- a/crates/tracedecay-global-db/src/registered.rs +++ b/crates/tracedecay-global-db/src/registered.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::future::Future; use std::path::Path; use std::pin::Pin; @@ -40,12 +41,13 @@ type SessionRelationGraphStateV1 = RwLock< /// A session authority inside an admitted store whose persisted shape this /// binary refuses to read. The store serves its other authorities; every /// session feature gets [`Self::error`] until the store is reset. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub(crate) enum RefusedAuthorityV1 { - /// Rows or tables whose shape nothing converts. + /// Rows or tables whose shape nothing converts. `reason` names the + /// drifted objects but never carries stored SQL or row payloads. Shape { authority: &'static str, - reason: &'static str, + reason: Cow<'static, str>, }, /// A recorded schema version other than the one this binary writes. Version { @@ -214,7 +216,7 @@ impl RegisteredGlobalDbOwnerV1 { Arc::clone(&self.project_graph), Arc::clone(&self.session_relation_graph), Arc::clone(&self.transcript_progress_proofs), - self.refused_authority, + self.refused_authority.clone(), ), )) } @@ -223,7 +225,9 @@ impl RegisteredGlobalDbOwnerV1 { /// to read, `None` when every authority it holds is admissible. #[must_use] pub fn reset_required(&self) -> Option { - self.refused_authority.map(RefusedAuthorityV1::error) + self.refused_authority + .clone() + .map(RefusedAuthorityV1::error) } /// Issues a mode-reduced client that can never regain write authority. @@ -234,7 +238,7 @@ impl RegisteredGlobalDbOwnerV1 { Arc::clone(&self.project_graph), Arc::clone(&self.session_relation_graph), Arc::clone(&self.transcript_progress_proofs), - self.refused_authority, + self.refused_authority.clone(), ), )) } @@ -248,7 +252,7 @@ impl RegisteredGlobalDbOwnerV1 { project_graph: Arc::clone(&self.project_graph), session_relation_graph: Arc::downgrade(&self.session_relation_graph), transcript_progress_proofs: Arc::downgrade(&self.transcript_progress_proofs), - refused_authority: self.refused_authority, + refused_authority: self.refused_authority.clone(), } } @@ -302,7 +306,7 @@ impl RegisteredGlobalDbWeakLeaseIssuerV1 { Arc::clone(&self.project_graph), session_relation_graph, transcript_progress_proofs, - self.refused_authority, + self.refused_authority.clone(), ), )) } @@ -457,7 +461,9 @@ impl RegisteredGlobalDb { /// refuses to read, `None` when every authority it holds is admissible. #[must_use] pub fn reset_required(&self) -> Option { - self.refused_authority.map(RefusedAuthorityV1::error) + self.refused_authority + .clone() + .map(RefusedAuthorityV1::error) } /// Wraps an already-published guarded database for WAL maintenance tests. diff --git a/crates/tracedecay-global-db/src/schema_stages.rs b/crates/tracedecay-global-db/src/schema_stages.rs index d6dee305a8..b960adb50b 100644 --- a/crates/tracedecay-global-db/src/schema_stages.rs +++ b/crates/tracedecay-global-db/src/schema_stages.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::future::Future; use std::pin::Pin; use std::time::{Duration, Instant}; @@ -36,7 +37,7 @@ use tracedecay_rusqlite_runtime::work::{ }; use tracedecay_rusqlite_runtime::workflow::{ WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_SCHEMA_IDENTITY_V1, WORKFLOW_SCHEMA_VERSION_V1, - WORKFLOW_TABLE_CONTRACTS_V1, + WORKFLOW_TABLE_CONTRACTS_V1, WorkflowTableContractV1, }; use tracedecay_sessions::runtime::git_correlation::{ GIT_CORRELATION_SCHEMA_VERSION, recorded_git_correlation_schema_version, @@ -509,7 +510,7 @@ macro_rules! impl_registered_schema_admission_classify { .map_err(configuration_schema_error( "inspect configuration schema freshness", )) - .map_err(surface(refused_lcm))?; + .map_err(surface(refused_lcm.clone()))?; let temporal_admission: Pin< Box< dyn Future< @@ -528,9 +529,12 @@ macro_rules! impl_registered_schema_admission_classify { configuration_fresh.as_ref(), ), ); - let temporal_admission = - temporal_admission.await.map_err(surface(refused_lcm))?; - let refused = refused_lcm.or(temporal_admission.err()); + let temporal_admission = temporal_admission + .await + .map_err(surface(refused_lcm.clone()))?; + let refused = refused_lcm + .clone() + .or(temporal_admission.as_ref().err().cloned()); let session_features = if hosts_session_features || configuration_fresh.is_some() { let workflow: Pin< @@ -545,12 +549,12 @@ macro_rules! impl_registered_schema_admission_classify { > = Box::pin(inspect_workflow_schema_for_admission(self)); workflow .await - .map_err(surface(refused))? + .map_err(surface(refused.clone()))? .map(|workflow| SessionFeatureSchema::Hosted { workflow }) } else { Ok(SessionFeatureSchema::NotHosted) }; - let refused = refused.or(session_features.err()); + let refused = refused.or(session_features.as_ref().err().cloned()); let refused_git_correlation = if hosts_session_features { let refused_git: Pin< Box< @@ -562,7 +566,7 @@ macro_rules! impl_registered_schema_admission_classify { + '_, >, > = Box::pin(git_correlation_schema_refusal(self)); - refused_git.await.map_err(surface(refused))? + refused_git.await.map_err(surface(refused.clone()))? } else { None }; @@ -580,7 +584,7 @@ macro_rules! impl_registered_schema_admission_classify { admitted .await .map_err(configuration_schema_error("admit configuration schema")) - .map_err(surface(refused))?; + .map_err(surface(refused.clone()))?; // An existing catalog whose remote-deletion tombstone table drifted from the // contract cannot be trusted to gate replay or admission, so admission fails // closed with the tip's typed reset authority rather than silently @@ -594,7 +598,7 @@ macro_rules! impl_registered_schema_admission_classify { >, > = Box::pin(validate_remote_deletion_schema_contract(self)); if let Err(error) = remote.await { - return Err(surface(refused)( + return Err(surface(refused.clone())( tracedecay_domain::errors::TraceDecayError::reset_required( "remote deletion tombstones", error.to_string(), @@ -1535,9 +1539,18 @@ async fn inspect_workflow_schema_for_admission( .map(|contract| (contract.name, Some(contract.sql))) .collect::>(); if actual_workflow_tables != expected_workflow_tables { - return Ok(Err(workflow_schema_refusal( - "workflow tables are absent, incomplete, or not exact", - ))); + let identity = if actual_workflow_tables + .iter() + .any(|(name, _)| *name == "workflow_schema") + { + Some(recorded_workflow_identity(conn).await) + } else { + None + }; + return Ok(Err(workflow_schema_refusal(workflow_table_drift_reason( + &actual_workflow_tables, + identity, + )))); } let mut schema = conn @@ -1577,7 +1590,12 @@ async fn inspect_workflow_schema_for_admission( || extra_identity { return Ok(Err(workflow_schema_refusal( - "workflow schema identity does not match the final contract", + workflow_identity_drift_reason( + singleton, + schema_version, + &definition_digest, + extra_identity, + ), ))); } @@ -1618,20 +1636,217 @@ async fn inspect_workflow_schema_for_admission( && actual.3 == expected.primary_key }); if !exact { - return Ok(Err(workflow_schema_refusal( - "workflow table columns do not match the final contract", - ))); + return Ok(Err(workflow_schema_refusal(workflow_column_drift_reason( + table, + &actual_columns, + )))); } } Ok(Ok(WorkflowSchemaAdmission::Complete)) } -fn workflow_schema_refusal(reason: &'static str) -> RefusedAuthorityV1 { +fn workflow_schema_refusal(reason: impl Into>) -> RefusedAuthorityV1 { RefusedAuthorityV1::Shape { authority: "workflow", - reason, + reason: reason.into(), + } +} + +/// Most object names one workflow refusal lists. The contract has a fixed, +/// small table set, so the cap only bounds the message if that set grows. +const WORKFLOW_REFUSAL_NAME_LIMIT: usize = 8; + +fn bounded_name_list(names: &[&str]) -> String { + let shown = names + .iter() + .take(WORKFLOW_REFUSAL_NAME_LIMIT) + .map(|name| format!("`{name}`")) + .collect::>() + .join(", "); + match names.len().checked_sub(WORKFLOW_REFUSAL_NAME_LIMIT) { + Some(rest) if rest > 0 => format!("{shown} and {rest} more"), + _ => shown, + } +} + +/// A digest echoes only in the exact form this binary writes; any other +/// stored text is reported as unrecognized rather than copied out. +fn workflow_digest_label(digest: &str) -> String { + let hex = digest.strip_prefix("sha256:"); + if hex.is_some_and(|hex| { + hex.len() == 64 && hex.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f')) + }) { + digest.to_owned() + } else { + "an unrecognized digest".to_owned() + } +} + +fn required_workflow_identity() -> String { + format!( + "this binary requires version {WORKFLOW_SCHEMA_VERSION_V1} with digest \ + {WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}" + ) +} + +/// The identity a store with drifted workflow tables records, read only to +/// make the refusal actionable: comparing it with the required digest tells +/// a store written by another release from a damaged one. +async fn recorded_workflow_identity(conn: &impl QueryExecutor) -> String { + let read = async { + let mut rows = conn + .query( + "SELECT schema_version, definition_digest FROM workflow_schema + ORDER BY singleton LIMIT 2", + (), + ) + .await + .ok()?; + let first = rows.next().await.ok()??; + let version = first.get::(0).ok()?; + let digest = first.get::(1).ok()?; + let extra = rows.next().await.ok()?.is_some(); + Some((version, digest, extra)) + }; + match read.await { + Some((version, digest, false)) => format!( + "the store records version {version} with {}", + workflow_digest_label(&digest) + ), + Some((version, digest, true)) => format!( + "the store records several identity rows, the first version {version} with {}", + workflow_digest_label(&digest) + ), + None => "the store's recorded workflow identity is unreadable".to_owned(), + } +} + +fn workflow_table_drift_reason( + actual: &[(&str, Option<&str>)], + identity: Option, +) -> String { + let missing = WORKFLOW_TABLE_CONTRACTS_V1 + .iter() + .filter(|contract| !actual.iter().any(|(name, _)| *name == contract.name)) + .map(|contract| contract.name) + .collect::>(); + let altered = WORKFLOW_TABLE_CONTRACTS_V1 + .iter() + .filter(|contract| { + actual + .iter() + .any(|(name, sql)| *name == contract.name && *sql != Some(contract.sql)) + }) + .map(|contract| contract.name) + .collect::>(); + if actual.is_empty() { + return format!( + "workflow tables are absent from a store that holds other tables: all {} \ + contract tables ({}) are missing", + missing.len(), + bounded_name_list(&missing), + ); + } + let mut parts = Vec::new(); + if !missing.is_empty() { + parts.push(format!( + "missing {} ({})", + missing.len(), + bounded_name_list(&missing) + )); + } + if !altered.is_empty() { + parts.push(format!( + "definition differs from the final contract for {} ({})", + altered.len(), + bounded_name_list(&altered) + )); + } + if parts.is_empty() { + parts.push("table set differs from the final contract".to_owned()); + } + let mut reason = format!("workflow tables are not exact: {}", parts.join("; ")); + if let Some(identity) = identity { + reason.push_str(&format!("; {identity}; {}", required_workflow_identity())); } + reason +} + +fn workflow_identity_drift_reason( + singleton: i64, + schema_version: i64, + definition_digest: &str, + extra_identity: bool, +) -> String { + let mut parts = Vec::new(); + if singleton != 1 { + parts.push(format!("identity row key is {singleton}, not 1")); + } + if schema_version != WORKFLOW_SCHEMA_VERSION_V1 { + parts.push(format!( + "version is {schema_version}, not {WORKFLOW_SCHEMA_VERSION_V1}" + )); + } + if definition_digest != WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1 { + parts.push(format!( + "digest is {}, not {WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}", + workflow_digest_label(definition_digest) + )); + } + if extra_identity { + parts.push("more than one identity row is recorded".to_owned()); + } + format!( + "workflow schema identity does not match the final contract: {}", + parts.join("; ") + ) +} + +fn workflow_column_drift_reason( + table: &WorkflowTableContractV1, + actual: &[(String, String, i64, i64)], +) -> String { + let detail = if actual.len() != table.columns.len() { + format!( + "{} columns are stored, {} are required", + actual.len(), + table.columns.len() + ) + } else { + actual + .iter() + .zip(table.columns) + .enumerate() + .find_map(|(index, (actual, expected))| { + let mut differs = Vec::new(); + if actual.0 != expected.name { + differs.push("name"); + } + if actual.1 != expected.sql_type { + differs.push("type"); + } + if actual.2 != expected.not_null { + differs.push("not-null flag"); + } + if actual.3 != expected.primary_key { + differs.push("primary-key position"); + } + (!differs.is_empty()).then(|| { + format!( + "column {} (required `{}`) differs in {}", + index + 1, + expected.name, + differs.join(", ") + ) + }) + }) + .unwrap_or_else(|| "column set differs".to_owned()) + }; + format!( + "workflow table columns do not match the final contract: `{}`: {detail}", + table.name + ) } /// Wall-clock budget for one diagnostic run of the exhaustive authority audit. @@ -1738,8 +1953,12 @@ pub async fn audit_observation_authority( mod tests { use tempfile::TempDir; use tracedecay_lcm::LCM_SCHEMA_VERSION; + use tracedecay_rusqlite_runtime::workflow::{ + WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_TABLE_CONTRACTS_V1, + }; use tracedecay_sessions::runtime::git_correlation::GIT_CORRELATION_SCHEMA_VERSION; + use super::WORKFLOW_REFUSAL_NAME_LIMIT; use crate::tests::harness::open_registered_test_database_fixture; use tracedecay_runtime_core::db::TestDatabaseRuntimeScope; use tracedecay_runtime_core::db::engine::{QueryExecutor, TestConnection, params}; @@ -2325,4 +2544,218 @@ mod tests { "admission must restore every dropped guard trigger" ); } + + /// The workflow payload table and identity digest a store written by + /// beta.90 through beta.92 carries: the shape before the artifact size + /// ceiling was removed. + const BETA_92_ARTIFACT_PAYLOADS_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( + payload_digest TEXT NOT NULL PRIMARY KEY, + byte_length INTEGER NOT NULL CHECK ( + byte_length = length(payload) AND byte_length <= 4194304 + ), + payload BLOB NOT NULL +) STRICT"; + const BETA_92_WORKFLOW_DIGEST: &str = + "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; + + /// Admit a fresh session store, run `shape` against it, and return the + /// workflow refusal the next admission reports. + async fn workflow_refusal_after(shape: &str) -> (std::path::PathBuf, TempDir, String) { + let directory = TempDir::new().unwrap(); + let database_path = directory.path().join("sessions.db"); + install_registered_schema(&database_path).await; + rusqlite::Connection::open(&database_path) + .unwrap() + .execute_batch(shape) + .expect("shape the stored workflow schema"); + let (lease, owner) = open_registered_test_database_fixture( + &database_path, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .expect("a refused workflow schema must not stop the store's other authorities"); + let refusal = owner + .reset_required() + .expect("drifted workflow schema must refuse session features"); + drop((lease, owner)); + let Some(("workflow", reason)) = refusal.reset_required_context() else { + panic!("workflow drift refused with the wrong typed state: {refusal}"); + }; + let reason = reason.to_owned(); + (database_path, directory, reason) + } + + /// A store a published release wrote, whose workflow payload table still + /// carries the artifact size ceiling, has no in-place upgrade: it is + /// refused for its workflow features, and the refusal names the drifted + /// table and both identities so an operator can tell it from damage. + #[asupersync::test] + async fn published_workflow_shape_refusal_names_the_table_and_both_identities() { + let shape = format!( + "DROP TABLE workflow_artifact_payloads; + {BETA_92_ARTIFACT_PAYLOADS_SQL}; + UPDATE workflow_schema SET definition_digest = '{BETA_92_WORKFLOW_DIGEST}';" + ); + let (database_path, _directory, reason) = workflow_refusal_after(&shape).await; + + assert!( + reason.contains( + "definition differs from the final contract for 1 (`workflow_artifact_payloads`)" + ), + "{reason}" + ); + assert!(!reason.contains("missing"), "{reason}"); + assert!( + reason.contains(&format!( + "the store records version 1 with {BETA_92_WORKFLOW_DIGEST}" + )), + "{reason}" + ); + assert!( + reason.contains(&format!( + "this binary requires version 1 with digest {WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}" + )), + "{reason}" + ); + assert!( + !reason.contains("CREATE TABLE") && !reason.contains("4194304"), + "stored schema SQL must not leak into the refusal: {reason}" + ); + // Admission stays read-only: the refused table is left as found. + let stored: String = rusqlite::Connection::open(&database_path) + .unwrap() + .query_row( + "SELECT sql FROM sqlite_master WHERE name = 'workflow_artifact_payloads'", + [], + |row| row.get(0), + ) + .unwrap(); + assert_eq!(stored, BETA_92_ARTIFACT_PAYLOADS_SQL); + } + + #[asupersync::test] + async fn missing_workflow_table_is_named_without_blaming_present_tables() { + let (_database_path, _directory, reason) = + workflow_refusal_after("DROP TABLE workflow_handoffs;").await; + + assert!( + reason.contains("workflow tables are not exact: missing 1 (`workflow_handoffs`)"), + "{reason}" + ); + assert!(!reason.contains("definition differs"), "{reason}"); + assert!( + reason.contains(&format!( + "the store records version 1 with {WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}" + )), + "{reason}" + ); + } + + #[asupersync::test] + async fn store_without_any_workflow_table_reports_them_absent() { + let drops = WORKFLOW_TABLE_CONTRACTS_V1 + .iter() + .map(|table| format!("DROP TABLE {};", table.name)) + .collect::(); + let (_database_path, _directory, reason) = workflow_refusal_after(&drops).await; + + assert!( + reason.contains("workflow tables are absent from a store that holds other tables"), + "{reason}" + ); + assert!( + reason.contains(&format!( + "all {} contract tables", + WORKFLOW_TABLE_CONTRACTS_V1.len() + )), + "{reason}" + ); + assert!(!reason.contains("the store records"), "{reason}"); + } + + #[asupersync::test] + async fn workflow_identity_refusal_names_the_differing_fields_and_hides_foreign_text() { + // The stored table pins `schema_version = 1`, so a digest is the one + // identity field a store can disagree on while its tables stay exact. + let (_database_path, _directory, reason) = workflow_refusal_after( + "UPDATE workflow_schema SET definition_digest = 'operator secret token';", + ) + .await; + + assert!( + reason.contains("workflow schema identity does not match the final contract"), + "{reason}" + ); + assert!(!reason.contains("version is"), "{reason}"); + assert!( + reason.contains(&format!( + "digest is an unrecognized digest, not {WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}" + )), + "{reason}" + ); + assert!(!reason.contains("operator secret token"), "{reason}"); + } + + #[test] + fn workflow_identity_refusal_reports_every_differing_field() { + let reason = super::workflow_identity_drift_reason(2, 3, BETA_92_WORKFLOW_DIGEST, true); + assert!(reason.contains("identity row key is 2, not 1"), "{reason}"); + assert!(reason.contains("version is 3, not 1"), "{reason}"); + assert!( + reason.contains(&format!( + "digest is {BETA_92_WORKFLOW_DIGEST}, not {WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}" + )), + "{reason}" + ); + assert!(reason.contains("more than one identity row"), "{reason}"); + } + + #[test] + fn workflow_table_refusal_lists_a_bounded_number_of_names() { + let names = (0..WORKFLOW_REFUSAL_NAME_LIMIT + 3) + .map(|index| format!("t{index}")) + .collect::>(); + let names = names.iter().map(String::as_str).collect::>(); + let listed = super::bounded_name_list(&names); + assert!(listed.starts_with("`t0`, `t1`"), "{listed}"); + assert!(listed.ends_with("and 3 more"), "{listed}"); + assert_eq!(listed.matches('`').count(), WORKFLOW_REFUSAL_NAME_LIMIT * 2); + } + + #[test] + fn workflow_column_refusal_names_the_required_column_and_attributes() { + let table = WORKFLOW_TABLE_CONTRACTS_V1 + .iter() + .find(|table| table.name == "workflow_artifact_payloads") + .unwrap(); + let mut columns = table + .columns + .iter() + .map(|column| { + ( + column.name.to_owned(), + column.sql_type.to_owned(), + column.not_null, + column.primary_key, + ) + }) + .collect::>(); + columns[1].1 = "secret-type-text".to_owned(); + columns[1].2 = 1 - columns[1].2; + let reason = super::workflow_column_drift_reason(table, &columns); + assert!( + reason.contains( + "`workflow_artifact_payloads`: column 2 (required `byte_length`) differs in type, not-null flag" + ), + "{reason}" + ); + assert!(!reason.contains("secret-type-text"), "{reason}"); + + columns.pop(); + let reason = super::workflow_column_drift_reason(table, &columns); + assert!( + reason.contains("2 columns are stored, 3 are required"), + "{reason}" + ); + } } From ac6047e23848268d097af94f50c67e1c9fd8e581 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 17:15:37 -0800 Subject: [PATCH 02/63] fix(sqlite): share pinned descriptors across live workers Refs #4513. Keep each physical SQLite pin under one shared descriptor so tearing down a reader or writer owner cannot release POSIX locks that belong to another live SQLite connection. Defer pin release on file loss until all affected workers have stopped. Cover rollback and WAL locking with independent-process regression probes. --- .../src/connection/mod.rs | 27 +++---- .../src/connection/path_identity_tests.rs | 72 +++++++++++++++++++ .../src/reader/locator.rs | 6 -- .../src/reader/pool/mod.rs | 9 ++- 4 files changed, 87 insertions(+), 27 deletions(-) diff --git a/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs b/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs index c7192aa660..0a6daa8ce7 100644 --- a/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs +++ b/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs @@ -6,7 +6,7 @@ use std::{ io, panic::{AssertUnwindSafe, catch_unwind, resume_unwind}, path::{Path, PathBuf}, - sync::Mutex, + sync::{Arc, Mutex}, time::Duration, }; @@ -65,8 +65,10 @@ const RETAINED_WAL_BYTES: i64 = WAL_SOFT_LIMIT_BYTES as i64; /// pathname stat. #[derive(Debug)] pub(crate) struct OpenedDatabaseFile { - /// `None` once [`Self::release`] closed the descriptor of a lost file. - file: Mutex>, + /// One descriptor shared by every attachment worker. Duplicating this + /// descriptor and closing a clone while SQLite holds POSIX locks would + /// release locks belonging to other live connections to the same inode. + file: Arc>>, identity: u64, } @@ -91,21 +93,11 @@ impl OpenedDatabaseFile { } let identity = opened_file_identity(&file)?; Ok(Self { - file: Mutex::new(Some(file)), + file: Arc::new(Mutex::new(Some(file))), identity, }) } - /// Closes the pinned descriptor of a file that was unlinked or replaced, - /// for every holder of this handle at once. The identity stays readable; - /// anything that needs the descriptor afterwards reports `Replaced`. - pub(crate) fn release(&self) { - self.file - .lock() - .unwrap_or_else(std::sync::PoisonError::into_inner) - .take(); - } - pub(crate) const fn identity(&self) -> u64 { self.identity } @@ -123,9 +115,12 @@ impl OpenedDatabaseFile { } pub(crate) fn try_clone(&self) -> Result { - let file = self.with_file(|file| file.try_clone())?; + // Share the *same* raw descriptor instead of dup(2): closing any + // duplicate descriptor after a SQLite connection acquires POSIX locks + // can silently release that connection's locks process-wide. + self.with_file(|_| ())?; Ok(Self { - file: Mutex::new(Some(file.map_err(|_| OpenedDatabaseFileError::Open)?)), + file: Arc::clone(&self.file), identity: self.identity, }) } diff --git a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs index 49e570e75a..47681217a7 100644 --- a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs +++ b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs @@ -262,6 +262,78 @@ fn external_read_only_wal_reader_survives_live_writer_identity_checks() { assert_committed_data(&path); } + +#[test] +fn dropping_secondary_identity_pins_never_releases_rollback_writer_locks() { + let temp = TempDir::new().expect("tempdir"); + let path = temp.path().join("shared-pin-rollback.db"); + let pinned = OpenedDatabaseFile::create_new(&path).expect("pin database"); + let reader_pin = pinned.try_clone().expect("share reader identity"); + let writer_pin = pinned.try_clone().expect("share writer identity"); + let connection = Connection::open(&path).expect("open SQLite connection"); + connection + .execute_batch( + "PRAGMA journal_mode = DELETE; + CREATE TABLE sample(value INTEGER); + INSERT INTO sample VALUES (1); + BEGIN IMMEDIATE; + UPDATE sample SET value = 2;", + ) + .expect("hold writer transaction"); + probe_external_connection(&path, "write", true); + + // In the old implementation these were independent dup(2) descriptors. + // Dropping either one discarded SQLite's unrelated process-wide lock. + drop(reader_pin); + probe_external_connection(&path, "write", true); + drop(writer_pin); + probe_external_connection(&path, "write", true); + pinned + .verify_connection(&connection, &path) + .expect("shared pin still identifies the live file"); + probe_external_connection(&path, "write", true); + + connection.execute_batch("COMMIT").expect("commit"); + probe_external_connection(&path, "write", false); + drop(connection); + drop(pinned); + assert_committed_data(&path); +} + +#[test] +fn dropping_secondary_identity_pins_never_unlocks_live_wal_journal() { + let temp = TempDir::new().expect("tempdir"); + let path = temp.path().join("shared-pin-wal.db"); + let pinned = OpenedDatabaseFile::create_new(&path).expect("pin database"); + let reader_pin = pinned.try_clone().expect("share reader identity"); + let writer_pin = pinned.try_clone().expect("share writer identity"); + let connection = Connection::open(&path).expect("open SQLite connection"); + connection + .execute_batch( + "PRAGMA journal_mode = WAL; + CREATE TABLE sample(value INTEGER); + INSERT INTO sample VALUES (1); + BEGIN IMMEDIATE; + UPDATE sample SET value = 2;", + ) + .expect("hold WAL write transaction"); + probe_external_connection(&path, "journal", true); + + drop(reader_pin); + probe_external_connection(&path, "journal", true); + drop(writer_pin); + probe_external_connection(&path, "journal", true); + pinned.verify_current_path(&path).expect("original file identity"); + probe_external_connection(&path, "journal", true); + + connection.execute_batch("COMMIT").expect("commit"); + probe_external_connection(&path, "journal", true); + drop(connection); + drop(pinned); + probe_external_connection(&path, "journal", false); + assert_committed_data(&path); +} + #[test] fn path_checks_keep_pinned_identity_and_reject_missing_or_replaced_files() { let temp = TempDir::new().expect("tempdir"); diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs index c736348d65..c5f996d4b3 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs @@ -55,12 +55,6 @@ impl ExistingReaderLocator { self.opened_database = Some(Arc::new(opened_database)); self } - /// Closes the pinned descriptor for this locator and every clone of it. - pub(crate) fn release_opened_database(&self) { - if let Some(opened) = &self.opened_database { - opened.release(); - } - } pub(crate) fn expected_file_identity(&self) -> Option { self.opened_database .as_deref() diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs b/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs index eb5267f8a2..cddd0cc8c5 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs @@ -812,10 +812,10 @@ impl ReaderPool { self.inner.capacity_changed.notify_all(); } - /// Fences admission, closes the pinned descriptor, and tells every worker - /// to interrupt its statement and exit, which closes its connection. The - /// pool object may outlive this call inside a lease, but no longer holds - /// the unlinked file open. Never waits, so a pool task may call it. + /// Fences admission and tells every worker to interrupt its statement + /// and exit. The shared inode pin must outlive every SQLite connection: + /// closing it here could release process-wide POSIX locks while another + /// worker is still shutting down. Never waits, so a pool task may call it. pub(crate) fn close_for_lost_file(&self) { // Draining and `lost` flip under one lock, so a waiter the wake below // releases never sees the pool draining without the file being lost. @@ -835,7 +835,6 @@ impl ReaderPool { .collect() }; self.inner.capacity_changed.notify_all(); - self.inner.locator.release_opened_database(); for client in clients { client.shutdown(); } From 09c1f81e9c508719d88df2055dc1bfbdf6be7714 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 17:17:03 -0800 Subject: [PATCH 03/63] style(sqlite): normalize regression test spacing --- .../src/connection/path_identity_tests.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs index 47681217a7..2c8c824c47 100644 --- a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs +++ b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs @@ -262,7 +262,6 @@ fn external_read_only_wal_reader_survives_live_writer_identity_checks() { assert_committed_data(&path); } - #[test] fn dropping_secondary_identity_pins_never_releases_rollback_writer_locks() { let temp = TempDir::new().expect("tempdir"); From e675fd08495a0b5a50255ba8a0be1feeed919fef Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 17:55:28 -0800 Subject: [PATCH 04/63] fix(runtime): preserve bootstrap refusals and storage deadlines --- .../src/commands/profile_storage.rs | 72 +++++- crates/tracedecay/src/daemon/branch_admin.rs | 233 ++++++++++++++++-- 2 files changed, 280 insertions(+), 25 deletions(-) diff --git a/crates/tracedecay-cli/src/commands/profile_storage.rs b/crates/tracedecay-cli/src/commands/profile_storage.rs index bb87394e71..35a2bec1e2 100644 --- a/crates/tracedecay-cli/src/commands/profile_storage.rs +++ b/crates/tracedecay-cli/src/commands/profile_storage.rs @@ -1,3 +1,4 @@ +use std::future::Future; use std::path::{Path, PathBuf}; use std::time::Duration; use tracedecay_runtime_core::config::ProfileRoot; @@ -258,13 +259,7 @@ async fn brokered_storage_report( ), tracing::trace_span!("cli.profile_storage.report_page"), ); - let result = native_runtime::timeout(Duration::from_secs(10), request) - .await - .map_err(|error| tracedecay_domain::errors::TraceDecayError::Config { - message: format!( - "daemon storage report authority did not answer within 10 seconds: {error}" - ), - })??; + let result = storage_report_page(request).await?; let AdminCliResultV1::StorageReport(page) = result else { return Err(super::daemon::admin_cli_result_mismatch("storage_report")); }; @@ -286,6 +281,27 @@ async fn brokered_storage_report( Ok(report) } +async fn storage_report_page( + request: impl Future>, +) -> tracedecay_domain::errors::Result { + const DEADLINE: Duration = Duration::from_secs(10); + native_runtime::timeout(DEADLINE, request) + .await + .map_err(|error| match error { + native_runtime::TimeoutError::Elapsed => { + tracedecay_mcp::tools::dispatch_ceiling::tool_dispatch_deadline_error( + "storage_report", + DEADLINE, + ) + } + native_runtime::TimeoutError::TimerUnavailable(message) => { + tracedecay_domain::errors::TraceDecayError::Config { + message: format!("storage report deadline timer unavailable: {message}"), + } + } + })? +} + fn merge_storage_report_page(report: &mut StorageReport, page: StorageReport) { // Project pages and empty directory pages carry no backlog sample. Their // default Complete coverage is neutral, not evidence of measured bytes. @@ -687,6 +703,48 @@ fn footprint_lines( .collect() } +#[cfg(test)] +mod storage_report_deadline_tests { + use super::*; + use tracedecay_domain::errors::TraceDecayError; + + #[tokio::test] + async fn storage_report_page_timeout_is_retryable_deadline() { + let error = storage_report_page(std::future::pending()) + .await + .unwrap_err(); + assert_eq!( + error + .project_route_context() + .map(|(code, retryable, _)| (code, retryable)), + Some(("tool_dispatch_deadline_exceeded", true)) + ); + assert_eq!( + tracedecay_mcp::tool_errors::project_route_problem_kind( + "tool_dispatch_deadline_exceeded" + ), + Some("deadline_exceeded") + ); + assert!(error.to_string().contains("storage_report")); + } + + #[tokio::test] + async fn storage_report_page_preserves_completed_authority_refusal() { + let error = storage_report_page(async { + Err(TraceDecayError::reset_required( + "profile", + "incompatible schema", + )) + }) + .await + .unwrap_err(); + assert_eq!( + error.reset_required_context(), + Some(("profile", "incompatible schema")) + ); + } +} + #[cfg(test)] mod footprint_output_tests { use tracedecay_maintenance::retention::footprint::{ diff --git a/crates/tracedecay/src/daemon/branch_admin.rs b/crates/tracedecay/src/daemon/branch_admin.rs index 652d713901..d0cae8b43e 100644 --- a/crates/tracedecay/src/daemon/branch_admin.rs +++ b/crates/tracedecay/src/daemon/branch_admin.rs @@ -401,24 +401,11 @@ impl ProfileHostAdmissionBootstrapContext { }) .await .map(Arc::clone) - .map_err(|error| { - TraceDecayError::project_route( - "registered_authority_unavailable", - true, - error.to_string(), - ) - })?; - let user_session_db = - session_runtime_registry - .profile_sessions() - .await - .map_err(|error| { - TraceDecayError::project_route( - "registered_authority_unavailable", - true, - error.to_string(), - ) - })?; + .map_err(profile_bootstrap_open_error)?; + let user_session_db = session_runtime_registry + .profile_sessions() + .await + .map_err(profile_bootstrap_open_error)?; let broker_path = authority::canonical_identity_path(user_session_db.db_path()).map_err(|error| { TraceDecayError::project_route( @@ -447,6 +434,35 @@ impl ProfileHostAdmissionBootstrapContext { } } +/// Preserve the opening authority's disposition; only unclassified operational +/// failures need the bootstrap route's availability context. +fn profile_bootstrap_open_error(error: TraceDecayError) -> TraceDecayError { + if error.is_store_reset_required() + || error.project_route_context().is_some() + || error.hook_runtime_context().is_some() + { + return error; + } + let retryable = match &error { + TraceDecayError::Database { .. } | TraceDecayError::LockDeadline { .. } => true, + TraceDecayError::Io(error) => matches!( + error.kind(), + std::io::ErrorKind::Interrupted + | std::io::ErrorKind::WouldBlock + | std::io::ErrorKind::TimedOut + | std::io::ErrorKind::ConnectionReset + | std::io::ErrorKind::ConnectionAborted + | std::io::ErrorKind::ConnectionRefused + ), + _ => return error, + }; + TraceDecayError::project_route( + "registered_authority_unavailable", + retryable, + error.to_string(), + ) +} + /// Returns the cached broker for `path`, opening its runtime at most once. /// Openers of one path share its in-flight open; a slow spool open never /// delays the first open of another path. @@ -2198,6 +2214,187 @@ mod tests { (meta_path, bytes) } + #[tokio::test] + async fn profile_bootstrap_preserves_session_store_reset_dispositions() { + for (filename, malformed_schema, expected_authority) in [ + ( + tracedecay_runtime_core::storage::USER_SESSIONS_DB_FILENAME, + "DROP TABLE workflow_effect_journal; CREATE TABLE workflow_effect_journal (broken TEXT);", + "workflow", + ), + ( + tracedecay_runtime_core::storage::USER_SESSIONS_DB_FILENAME, + "UPDATE tracedecay_schema_version SET version = version + 1 WHERE component = 'lcm';", + "LCM", + ), + ] { + let temp = tempfile::tempdir().unwrap(); + let profile_root = temp.path().join("profile"); + let identity = profile_identity::load_or_create(&profile_root).unwrap(); + let database_path = profile_root.join(filename); + let registry = + tracedecay_store_runtime::DaemonSessionRuntimeRegistryV1::open(identity.clone()) + .await + .unwrap(); + drop(registry.profile_sessions().await.unwrap()); + drop(registry); + rusqlite::Connection::open(&database_path) + .unwrap() + .execute_batch(malformed_schema) + .unwrap(); + let administration = StoreAdministration::default().with_profile_identity(identity); + administration + .ensure_profile_host_admission_bootstrap(&profile_root) + .await + .unwrap(); + assert_eq!( + administration + .profile_host_admission_replay + .wait_bootstrap_completed(&profile_root, None) + .await, + BootstrapCompletion::Completed + ); + let Some(ProfileHostAdmissionBootstrapStatus::Terminal(error)) = administration + .profile_host_admission_bootstrap_status(&profile_root) + .await + .unwrap() + else { + panic!("{filename}: refused schema must stop bootstrap"); + }; + assert!(error.is_store_reset_required(), "{filename}: {error:?}"); + if expected_authority == "LCM" { + assert!( + matches!( + &*error, + TraceDecayError::ProfileResetRequired { + component: "LCM", + .. + } + ), + "{error:?}" + ); + } else { + assert_eq!( + error + .reset_required_context() + .map(|(authority, _)| authority), + Some(expected_authority) + ); + } + assert!(error.project_route_context().is_none(), "{error:?}"); + let registries = administration.session_runtime_registries.lock().await; + assert!( + registries + .get(&std::fs::canonicalize(&profile_root).unwrap()) + .unwrap() + .registry + .get() + .is_some(), + "the refusal must originate at the selected opening boundary" + ); + drop(registries); + assert_eq!( + administration + .profile_host_admission_replay + .bootstrap_attempt_count(&profile_root) + .await, + 1 + ); + assert_eq!( + administration + .profile_host_admission_replay + .bootstrap_backoff_count(&profile_root) + .await, + 0 + ); + administration.shutdown_host_admission_replay().await; + } + } + + #[tokio::test] + async fn profile_bootstrap_operational_open_failure_remains_retryable() { + for registry_open in [true, false] { + let temp = tempfile::tempdir().unwrap(); + let profile_root = temp.path().join("profile"); + let identity = profile_identity::load_or_create(&profile_root).unwrap(); + let obstruction = if registry_open { + // A failed node census is operational, not a persisted-shape verdict. + std::fs::create_dir_all(profile_root.join("remote")).unwrap(); + let path = profile_root.join("remote/nodes"); + std::fs::write(&path, b"not a directory").unwrap(); + path + } else { + let path = tracedecay_sessions::runtime::user_sessions_db_path(&profile_root); + std::fs::create_dir(&path).unwrap(); + path + }; + let replay = Arc::new(ProfileHostAdmissionReplayRegistry::default()); + let context = ProfileHostAdmissionBootstrapContext { + profile_root, + profile_identity: identity, + session_runtime_registry: Arc::new(tokio::sync::OnceCell::new()), + host_admission_brokers: Arc::new(tokio::sync::Mutex::new(HashMap::new())), + profile_host_admission_replay: Arc::downgrade(&replay), + }; + let error = context.ensure().await.unwrap_err(); + assert_eq!( + error + .project_route_context() + .map(|(code, retryable, _)| (code, retryable)), + Some(("registered_authority_unavailable", true)) + ); + assert_eq!( + context.session_runtime_registry.get().is_none(), + registry_open + ); + if registry_open { + std::fs::remove_file(obstruction).unwrap(); + } else { + std::fs::remove_dir(obstruction).unwrap(); + } + context.ensure().await.unwrap(); + assert!(context.session_runtime_registry.get().is_some()); + replay.shutdown().await; + } + } + + #[tokio::test] + #[cfg(not(windows))] + async fn profile_bootstrap_invalid_registry_authority_is_terminal() { + let temp = tempfile::tempdir().unwrap(); + let profile_root = temp.path().join("profile"); + let identity = profile_identity::load_or_create(&profile_root).unwrap(); + std::fs::write(profile_root.join("daemon-authority.json"), b"not json").unwrap(); + let administration = StoreAdministration::default().with_profile_identity(identity); + administration + .ensure_profile_host_admission_bootstrap(&profile_root) + .await + .unwrap(); + assert_eq!( + administration + .profile_host_admission_replay + .wait_bootstrap_completed(&profile_root, None) + .await, + BootstrapCompletion::Completed + ); + let Some(ProfileHostAdmissionBootstrapStatus::Terminal(error)) = administration + .profile_host_admission_bootstrap_status(&profile_root) + .await + .unwrap() + else { + panic!("invalid authority record must not be retried as unavailable"); + }; + assert!(error.project_route_context().is_none(), "{error:?}"); + assert_eq!( + administration + .profile_host_admission_replay + .bootstrap_backoff_count(&profile_root) + .await, + 0 + ); + administration.shutdown_host_admission_replay().await; + } + /// Rank 1 regression: a git-watch sync of project A used to hold the one /// daemon-wide gate across a full `cg.sync()`, so the first request for /// project B parked behind it for as long as the sync ran. From 4755a36ed52eb05d0a11f8259a82b1fa656b13ed Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:27:45 -0800 Subject: [PATCH 05/63] fix(sqlite): release shared lost-file pins after workers exit --- .../src/connection/mod.rs | 9 +++++++++ .../src/connection/path_identity_tests.rs | 4 +++- .../src/reader/locator.rs | 5 +++++ .../src/reader/pool/mod.rs | 9 +++++++++ .../src/repository/attachment.rs | 12 ++++++++++-- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs b/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs index 0a6daa8ce7..fd4dae1b6f 100644 --- a/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs +++ b/crates/tracedecay-rusqlite-runtime/src/connection/mod.rs @@ -98,6 +98,15 @@ impl OpenedDatabaseFile { }) } + /// Close the physical descriptor only after every SQLite worker holding + /// this inode has exited. All shared locator clones then refuse reuse. + pub(crate) fn release_after_workers_exit(&self) { + self.file + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .take(); + } + pub(crate) const fn identity(&self) -> u64 { self.identity } diff --git a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs index 2c8c824c47..ea0b123c72 100644 --- a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs +++ b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs @@ -322,7 +322,9 @@ fn dropping_secondary_identity_pins_never_unlocks_live_wal_journal() { probe_external_connection(&path, "journal", true); drop(writer_pin); probe_external_connection(&path, "journal", true); - pinned.verify_current_path(&path).expect("original file identity"); + pinned + .verify_current_path(&path) + .expect("original file identity"); probe_external_connection(&path, "journal", true); connection.execute_batch("COMMIT").expect("commit"); diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs index c5f996d4b3..7f5e694a60 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs @@ -55,6 +55,11 @@ impl ExistingReaderLocator { self.opened_database = Some(Arc::new(opened_database)); self } + pub(crate) fn release_opened_database_after_workers_exit(&self) { + if let Some(opened) = &self.opened_database { + opened.release_after_workers_exit(); + } + } pub(crate) fn expected_file_identity(&self) -> Option { self.opened_database .as_deref() diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs b/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs index cddd0cc8c5..5f0219c554 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs @@ -840,6 +840,15 @@ impl ReaderPool { } } + /// Release the shared descriptor after every lost-file SQLite worker exits. + /// Held reader-pool handles must not keep an unlinked inode alive. + pub(crate) fn release_lost_file_pin_after_workers_exit(&self) { + debug_assert!(self.workers_exited()); + self.inner + .locator + .release_opened_database_after_workers_exit(); + } + /// Test-only: run `hook` once, between the next growing acquire's worker /// spawn and its registration. #[cfg(test)] diff --git a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs index e907ff1118..8a0108172c 100644 --- a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs +++ b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs @@ -459,11 +459,19 @@ impl RepositoryRuntimePhysicalAttachment { { return false; } + if state.file_lost { + // A retained reader lease may keep its pool alive after every + // SQLite worker exits. Close the shared pin in-place so that + // held pool handles cannot pin an unlinked inode indefinitely. + if let Some(readers) = state.lost_readers.as_ref() { + readers.release_lost_file_pin_after_workers_exit(); + } + } state.lost_readers = None; state.lost_writer = None; if state.file_lost { - // Both worker groups have exited; no live SQLite lock can be - // released by closing the retained identity descriptor. + // All workers are gone, so releasing the physical descriptor + // cannot disturb live SQLite POSIX locks. state.retained_file_pin.take(); } true From e8f20f072a51db001818b5d8ef89e7b88977d89e Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:32:55 -0800 Subject: [PATCH 06/63] fix(sqlite): centralize shared-pin teardown at attachment Preserve the concurrent shared-pin release and formatting repair. Invoke that release directly from the attachment that already owns the shared pin and verifies both worker groups have exited, including final close. Remove the now-unneeded reader pool and locator forwarding methods. Strengthen the held-writer regression with a retained pin handle: it must remain usable while the writer is held and be revoked after exit. Keep the held-reader-pool descriptor regression and existing deadlines. Native Bazel validation is still required. --- .../src/reader/locator.rs | 5 --- .../src/reader/pool/mod.rs | 9 ----- .../src/repository/attachment.rs | 37 ++++++++++++------- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs index 7f5e694a60..c5f996d4b3 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs @@ -55,11 +55,6 @@ impl ExistingReaderLocator { self.opened_database = Some(Arc::new(opened_database)); self } - pub(crate) fn release_opened_database_after_workers_exit(&self) { - if let Some(opened) = &self.opened_database { - opened.release_after_workers_exit(); - } - } pub(crate) fn expected_file_identity(&self) -> Option { self.opened_database .as_deref() diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs b/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs index 5f0219c554..cddd0cc8c5 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/pool/mod.rs @@ -840,15 +840,6 @@ impl ReaderPool { } } - /// Release the shared descriptor after every lost-file SQLite worker exits. - /// Held reader-pool handles must not keep an unlinked inode alive. - pub(crate) fn release_lost_file_pin_after_workers_exit(&self) { - debug_assert!(self.workers_exited()); - self.inner - .locator - .release_opened_database_after_workers_exit(); - } - /// Test-only: run `hook` once, between the next growing acquire's worker /// spawn and its registration. #[cfg(test)] diff --git a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs index 8a0108172c..a7444620c1 100644 --- a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs +++ b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs @@ -459,20 +459,12 @@ impl RepositoryRuntimePhysicalAttachment { { return false; } - if state.file_lost { - // A retained reader lease may keep its pool alive after every - // SQLite worker exits. Close the shared pin in-place so that - // held pool handles cannot pin an unlinked inode indefinitely. - if let Some(readers) = state.lost_readers.as_ref() { - readers.release_lost_file_pin_after_workers_exit(); - } - } state.lost_readers = None; state.lost_writer = None; - if state.file_lost { - // All workers are gone, so releasing the physical descriptor - // cannot disturb live SQLite POSIX locks. - state.retained_file_pin.take(); + if state.file_lost && let Some(pin) = state.retained_file_pin.take() { + // Both worker groups have exited. Clear the shared descriptor, + // not just this handle: a caller may still retain a closed pool. + pin.release_after_workers_exit(); } true } @@ -816,9 +808,11 @@ impl RepositoryRuntimePhysicalAttachment { .lost_writer .as_ref() .is_none_or(|writer| writer.worker_exited()); - if !state.file_lost || lost_workers_exited { + if (!state.file_lost || lost_workers_exited) + && let Some(pin) = state.retained_file_pin.take() + { // An uncommitted initialization retains its separate cleanup pin. - state.retained_file_pin.take(); + pin.release_after_workers_exit(); } Ok(()) } @@ -1397,6 +1391,13 @@ mod tests { fn a_lost_file_is_not_closed_while_the_lost_writer_still_holds_its_connection() { let directory = TempDir::new().unwrap(); let attachment = Arc::new(attach_seeded_store(directory.path(), &binding(), 0)); + let held_pin = attachment + .lock_state() + .retained_file_pin + .as_ref() + .unwrap() + .try_clone() + .unwrap(); let (hold, held) = mpsc::channel::<()>(); attachment.lock_state().after_lost_notice = Some(Box::new(move || { let _ = held.recv(); @@ -1437,6 +1438,10 @@ mod tests { attachment.lock_state().retained_file_pin.is_some(), "closing a lost-file attachment must retain its pin until the writer exits" ); + assert!( + held_pin.try_clone().is_ok(), + "the shared descriptor must remain open while the writer is held" + ); hold.send(()).unwrap(); let deadline = std::time::Instant::now() + Duration::from_secs(10); @@ -1451,6 +1456,10 @@ mod tests { thread::sleep(Duration::from_millis(5)); } assert!(attachment.lost_file_closed()); + assert!( + held_pin.try_clone().is_err(), + "retaining a pin handle must not retain the descriptor after worker exit" + ); assert!( deleted_descriptors(directory.path()).is_empty(), "the last lost worker exiting must release every deleted-file descriptor" From d83bc0e5e387d610f3bbadd6ac4ce27e7331fa0d Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:35:53 -0800 Subject: [PATCH 07/63] fix(sqlite): refuse reader locators after shared pin release Refs #4513. Require a live shared pin before reader path selection and connection verification so retained locators cannot regain authority from a surviving canonical pathname after shutdown. Preserve the concurrent attachment-owned teardown. Add a real reader fixture regression for both the original locator and its retained clone; release through an attachment pin only after all SQLite connections exit. Keep the historical identity for diagnostics. Source-reviewed; Bazel/Rust execution requires hosted CI. --- .../src/reader/locator.rs | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs index c5f996d4b3..0b34b4e3bc 100644 --- a/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs +++ b/crates/tracedecay-rusqlite-runtime/src/reader/locator.rs @@ -65,8 +65,11 @@ impl ExistingReaderLocator { connection: &rusqlite::Connection, ) -> Result<(), ReaderStartError> { self.opened_database.as_deref().map_or(Ok(()), |opened| { + // A released pin cannot be replaced by a pathname-only proof, + // even when that pathname still names the original inode. opened - .verify_connection(connection, &self.path) + .try_clone() + .and_then(|opened| opened.verify_connection(connection, &self.path)) .map_err(ReaderStartError::OpenedDatabaseIdentity) }) } @@ -74,8 +77,12 @@ impl ExistingReaderLocator { self.opened_database.as_deref().map_or_else( || Ok(self.path.clone()), |opened| { + // Canonical-path platforms do not otherwise touch the pin + // while choosing the worker path. Refuse a released owner + // before opening another SQLite connection. opened - .reader_open_path(&self.path) + .try_clone() + .and_then(|opened| opened.reader_open_path(&self.path)) .map_err(ReaderStartError::OpenedDatabaseIdentity) }, ) @@ -151,3 +158,52 @@ impl Error for ReaderStartError { } } } + +#[cfg(test)] +mod tests { + use super::{ + ExistingReaderLocator, OpenedDatabaseFile, OpenedDatabaseFileError, ReaderStartError, + }; + use crate::reader::tests::TestStore; + + #[test] + fn released_pin_refuses_retained_reader_locators() { + let store = TestStore::new(); + let locator = store.locator(); + let path = locator.path().to_path_buf(); + let pinned = OpenedDatabaseFile::pin(&path).expect("pin reader database"); + let attachment_pin = pinned.try_clone().expect("share attachment pin"); + let locator: ExistingReaderLocator = locator.with_opened_database(pinned); + let retained = locator.clone(); + let identity = locator.expected_file_identity(); + assert!(identity.is_some()); + + let connection = rusqlite::Connection::open(&path).expect("open original database"); + locator + .verify_connection(&connection) + .expect("live pin verifies the original database"); + assert!(retained.worker_open_path().is_ok()); + // Release only after the SQLite worker has exited. A retained + // locator must not become reusable merely because the file remains. + drop(connection); + attachment_pin.release_after_workers_exit(); + assert!(path.is_file()); + + let connection = rusqlite::Connection::open(&path).expect("reopen same inode for probe"); + for closed in [&locator, &retained] { + assert_eq!(closed.expected_file_identity(), identity); + assert!(matches!( + closed.worker_open_path(), + Err(ReaderStartError::OpenedDatabaseIdentity( + OpenedDatabaseFileError::Replaced + )) + )); + assert!(matches!( + closed.verify_connection(&connection), + Err(ReaderStartError::OpenedDatabaseIdentity( + OpenedDatabaseFileError::Replaced + )) + )); + } + } +} From 8dd26c68c694f782584844f2792f67f1e763f72c Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:35:18 -0800 Subject: [PATCH 08/63] fix(automation): stop retrying blocked scheduler ticks A backend with no executable bound and a store refusing until its reset cannot recover by repeating work, yet both retried on every tick. Report the unbound executable as a typed backend_unconfigured skip and scheduler status, before any run is admitted, so nothing accumulates and the next tick after a configuration change admits the task. The retry ladder also stops at one attempt for it. Park the loop on a reset refusal until a project open or reconcile wakes it. Log tick and task failures as state changes, which also quiets failures that stay on cadence. Co-Authored-By: Claude Opus 5.5 --- .../src/automation/backend.rs | 34 +++ .../src/automation/scheduler.rs | 118 ++++++++++ crates/tracedecay-automation/src/backend.rs | 7 + .../sdk/results/automation/terminal.rs | 3 + .../src/automation_scheduler_api.rs | 74 ++++++- crates/tracedecay/src/daemon/engine.rs | 2 + crates/tracedecay/src/daemon/scheduler.rs | 141 ++++++++++-- .../src/daemon/scheduler/effect_admission.rs | 64 +++++- .../daemon/scheduler/host_receipt_review.rs | 8 + .../src/daemon/tests/scheduler_config.rs | 2 + .../scheduler_config/reset_blocked_tick.rs | 201 ++++++++++++++++++ .../schemas/dashboard-contracts.schema.json | 2 + dashboard/src/contracts/decoders.ts | 4 +- dashboard/src/contracts/types.ts | 4 +- .../src/workspaces/automations/ledger.test.ts | 1 + .../src/workspaces/automations/ledger.ts | 7 + 16 files changed, 626 insertions(+), 46 deletions(-) create mode 100644 crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs diff --git a/crates/tracedecay-automation-runtime/src/automation/backend.rs b/crates/tracedecay-automation-runtime/src/automation/backend.rs index cb951920e2..5b04a30662 100644 --- a/crates/tracedecay-automation-runtime/src/automation/backend.rs +++ b/crates/tracedecay-automation-runtime/src/automation/backend.rs @@ -171,6 +171,7 @@ pub async fn run_agent_task_with_retry_report( let backoff = policy.backoff_before_attempt(attempt + 1); let should_retry = attempt < max_attempts && classification.is_retryable() + && backend.retry_can_recover() && start.elapsed().saturating_add(backoff) < policy.budget; report.attempts.push(AgentTaskRetryAttempt { attempt, @@ -301,6 +302,10 @@ impl AgentTaskBackend for CodexAppServerBackend { .as_ref() .map(|config| config.codex_bin.as_path()) } + + fn retry_can_recover(&self) -> bool { + self.config.is_some() + } } #[cfg(test)] @@ -328,6 +333,35 @@ mod tests { } } + #[tokio::test] + async fn unconfigured_executable_settles_on_its_first_attempt() { + let backend = + CodexAppServerBackend::new(None, 60, &LcmSummarizerExecutableV1::Unconfigured); + let request = AgentTaskRequest::new( + "run_unconfigured".to_string(), + AgentTaskKind::SkillWriter, + "backend prompt".to_string(), + None, + json!({}), + ); + let mut report = AgentTaskRetryReport::default(); + let started = Instant::now(); + + let error = run_agent_task_with_retry_report( + &backend, + &request, + &BackendRetryPolicy::from_timeout_secs(60), + &mut report, + ) + .await + .unwrap_err(); + + assert_eq!(error.failure_class(), AgentTaskFailureClass::Unavailable); + assert_eq!(report.attempt_count(), 1); + assert_eq!(report.attempts()[0].backoff_millis, 0); + assert!(started.elapsed() < AGENT_TASK_RETRY_BACKOFFS[0]); + } + impl AgentTaskBackend for FlakyBackend { fn run_task( &self, diff --git a/crates/tracedecay-automation-runtime/src/automation/scheduler.rs b/crates/tracedecay-automation-runtime/src/automation/scheduler.rs index 88b1684c63..ffc3abd33e 100644 --- a/crates/tracedecay-automation-runtime/src/automation/scheduler.rs +++ b/crates/tracedecay-automation-runtime/src/automation/scheduler.rs @@ -26,6 +26,7 @@ use super::run_ledger::{ latest_record_by_canonical_completion, latest_record_by_canonical_completion_key, }; use tracedecay_contracts::retained_surfaces::AutomationSkipReasonV1; +use tracedecay_domain::configuration::LcmSummarizerExecutableV1; use tracedecay_domain::errors::{Result, TraceDecayError}; use tracedecay_global_db::RegisteredGlobalDb; use tracedecay_private_fs::FileLease; @@ -279,6 +280,42 @@ pub fn schedule_decision( schedule_decision_or_history_denial(config, executable, task, records, activity, now_secs, true) } +/// Whether the configured backend has no executable bound for it. Only a +/// configuration revision can change this, so spawning a run to rediscover it +/// on every cadence would only accumulate failures. +pub fn backend_executable_unconfigured( + config: &AutomationSettingsV1, + codex: &LcmSummarizerExecutableV1, +) -> bool { + config.backend == AutomationBackendV1::CodexAppServer && codex.canonical_path().is_none() +} + +/// [`schedule_decision`] for the backend the configuration snapshot binds: a +/// task that would be due reads `backend_unconfigured` instead. Nothing is +/// recorded, so the next tick after a configuration change admits the task +/// with no failure history or cooldown to outlast. +pub fn configured_backend_schedule_decision( + config: &AdmittedAutomationConfig, + codex: &LcmSummarizerExecutableV1, + task: AgentTaskKind, + records: &[AutomationRunLedgerRecord], + activity: SessionActivity, + now_secs: i64, +) -> AutomationScheduleDecision { + let decision = schedule_decision( + config, + codex.canonical_path(), + task, + records, + activity, + now_secs, + ); + if decision.is_due() && backend_executable_unconfigured(config, codex) { + return AutomationScheduleDecision::skipped(AutomationSkipReasonV1::BackendUnconfigured); + } + decision +} + pub fn host_receipt_decision( config: &AdmittedAutomationConfig, executable: Option<&Path>, @@ -1268,6 +1305,87 @@ disconnected: config error: codex app-server closed stdout before completing"; } } + #[test] + fn unconfigured_backend_blocks_a_due_task_until_configuration_binds_an_executable() { + let config = curator_config(); + let admitted = tracedecay_automation::config::admit_config(&config).unwrap(); + let unconfigured = LcmSummarizerExecutableV1::Unconfigured; + let decide = |codex: &LcmSummarizerExecutableV1, records: &[_], now_secs| { + configured_backend_schedule_decision( + &admitted, + codex, + AgentTaskKind::MemoryCurator, + records, + SessionActivity::none(), + now_secs, + ) + }; + + // The ledger stays empty across ticks: the block itself writes nothing. + for now_secs in [2_000, 2_060, 2_000 + 86_400] { + assert_eq!( + decide(&unconfigured, &[], now_secs).skip_reason(), + Some(AutomationSkipReasonV1::BackendUnconfigured), + ); + } + + // Binding an executable admits the very next tick. + let executable = tempfile::NamedTempFile::new().expect("codex placeholder"); + let configured = + LcmSummarizerExecutableV1::configured(executable.path().to_path_buf()).unwrap(); + assert!(decide(&configured, &[], 2_060).is_due()); + + // The failures unconfigured runs recorded before this state existed + // do not outlast it: once their cooldown has passed the block reads + // as itself, and the configured backend is admitted. + let historical = settled_backend_failure( + &config, + None, + crate::automation::backend::CODEX_EXECUTABLE_UNCONFIGURED, + AgentTaskFailureClass::Unavailable, + 3, + 2_000, + None, + ); + let elapsed = 2_000 + DEFAULT_FAILURE_COOLDOWN_SECS as i64; + assert_eq!( + decide(&unconfigured, std::slice::from_ref(&historical), elapsed).skip_reason(), + Some(AutomationSkipReasonV1::BackendUnconfigured), + ); + assert!(decide(&configured, std::slice::from_ref(&historical), elapsed).is_due()); + } + + #[test] + fn only_a_backend_that_needs_an_executable_reads_unconfigured() { + let unconfigured = LcmSummarizerExecutableV1::Unconfigured; + let disabled = AutomationSettingsV1 { + backend: AutomationBackendV1::Disabled, + ..AutomationSettingsV1::default() + }; + assert!(!backend_executable_unconfigured(&disabled, &unconfigured)); + assert!(backend_executable_unconfigured( + &curator_config(), + &unconfigured + )); + // An operator's own switch is reported as itself, not as a missing binary. + assert_eq!( + configured_backend_schedule_decision( + &tracedecay_automation::config::admit_config(&AutomationSettingsV1 { + enabled: false, + ..AutomationSettingsV1::default() + }) + .unwrap(), + &unconfigured, + AgentTaskKind::MemoryCurator, + &[], + SessionActivity::none(), + 2_000, + ) + .skip_reason(), + Some(AutomationSkipReasonV1::AutomationDisabled), + ); + } + #[test] fn an_unstamped_legacy_failure_keeps_the_ordinary_cooldown() { let config = curator_config(); diff --git a/crates/tracedecay-automation/src/backend.rs b/crates/tracedecay-automation/src/backend.rs index 38eab0adbb..d0e23ff4f8 100644 --- a/crates/tracedecay-automation/src/backend.rs +++ b/crates/tracedecay-automation/src/backend.rs @@ -600,6 +600,13 @@ pub trait AgentTaskBackend: Send + Sync { /// backend identity stamps the opened file behind this path so replacing /// the binary in place re-admits a settled deterministic failure. fn executable(&self) -> Option<&std::path::Path>; + + /// Whether another attempt in the same run could observe a different + /// outcome. A backend whose executable is unbound by the run's pinned + /// configuration cannot recover inside that run, whatever its failure class. + fn retry_can_recover(&self) -> bool { + true + } } /// Availability state returned by runtime adapters. This crate does not probe diff --git a/crates/tracedecay-contracts/src/retained_surfaces/sdk/results/automation/terminal.rs b/crates/tracedecay-contracts/src/retained_surfaces/sdk/results/automation/terminal.rs index a37b792635..8215bbed7d 100644 --- a/crates/tracedecay-contracts/src/retained_surfaces/sdk/results/automation/terminal.rs +++ b/crates/tracedecay-contracts/src/retained_surfaces/sdk/results/automation/terminal.rs @@ -50,6 +50,7 @@ automation_skip_reasons! { (JobLockActive, "job_lock_active"), (DelegatedHostMode, "delegated_host_mode"), (BackendDisabled, "backend_disabled"), + (BackendUnconfigured, "backend_unconfigured"), (BackendIdentitySuppressed, "backend_identity_suppressed"), (SchedulerLockActive, "scheduler_lock_active"), (SchedulerPaused, "scheduler_paused"), @@ -107,6 +108,7 @@ impl AutomationSkipReasonV1 { | Self::UserJobDisabled | Self::DelegatedHostMode | Self::BackendDisabled + | Self::BackendUnconfigured | Self::BackendIdentitySuppressed | Self::SchedulerLockActive | Self::SchedulerPaused @@ -195,6 +197,7 @@ impl AutomationSkipReasonV1 { Self::AutomationDisabled | Self::DelegatedHostMode | Self::BackendDisabled + | Self::BackendUnconfigured | Self::BackendIdentitySuppressed | Self::SchedulerLockActive | Self::SchedulerPaused diff --git a/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs b/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs index fe96fc00fd..3f564786fa 100644 --- a/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs +++ b/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs @@ -16,8 +16,9 @@ use tracedecay_automation_runtime::automation::run_ledger::{ AutomationRunLedgerRecord, AutomationRunLedgerTaskSummary, load_run_ledger_task_summary, }; use tracedecay_automation_runtime::automation::scheduler::{ - AutomationSchedulerControl, SessionActivity, load_scheduler_control, load_session_activity, - save_scheduler_control, schedule_decision, scheduler_control_path, + AutomationSchedulerControl, SessionActivity, backend_executable_unconfigured, + configured_backend_schedule_decision, load_scheduler_control, load_session_activity, + save_scheduler_control, scheduler_control_path, }; use tracedecay_contracts::retained_surfaces::AutomationSkipReasonV1; use tracedecay_domain::configuration::LcmSummarizerExecutableV1; @@ -55,6 +56,7 @@ pub(super) enum AutomationSchedulerAvailabilityV1 { AutomationDisabled, DelegatedHost, BackendDisabled, + BackendUnconfigured, Configured, } @@ -131,7 +133,7 @@ async fn scheduler_status_payload(state: &DashboardState) -> ApiResult { None => SessionActivity::none(), }; Ok(Json(AutomationSchedulerStatusV1 { - status: scheduler_status_label(&effective, control.paused), + status: scheduler_status_label(&effective, &codex, control.paused), paused: control.paused, enabled: effective.enabled, scheduler_tick_secs: effective.scheduler_tick_secs, @@ -187,14 +189,7 @@ fn task_status( AutomationSkipReasonV1::SchedulerPaused, ) } else { - schedule_decision( - config, - codex.canonical_path(), - task, - summary.records(), - activity, - now, - ) + configured_backend_schedule_decision(config, codex, task, summary.records(), activity, now) }; AutomationTaskStatusV1 { task: task_key(task).to_string(), @@ -206,6 +201,7 @@ fn task_status( fn scheduler_status_label( config: &AutomationSettingsV1, + codex: &LcmSummarizerExecutableV1, paused: bool, ) -> AutomationSchedulerAvailabilityV1 { if paused { @@ -224,6 +220,9 @@ fn scheduler_status_label( { return AutomationSchedulerAvailabilityV1::BackendDisabled; } + if backend_executable_unconfigured(config, codex) { + return AutomationSchedulerAvailabilityV1::BackendUnconfigured; + } AutomationSchedulerAvailabilityV1::Configured } @@ -263,6 +262,59 @@ mod tests { .unwrap() } + #[test] + fn status_reports_an_unconfigured_backend_until_an_executable_is_bound() { + let mut config = AutomationSettingsV1 { + enabled: true, + backend: AutomationBackendV1::CodexAppServer, + ..AutomationSettingsV1::default() + }; + config.tasks.memory_curator = AutomationTaskSettingsV1 { + enabled: true, + schedule: Some("every:1m".to_string()), + ..AutomationTaskSettingsV1::default() + }; + let admitted = tracedecay_automation::config::admit_config(&config).unwrap(); + let empty = AutomationRunLedgerTaskSummary::default(); + let read = |codex: &LcmSummarizerExecutableV1| { + task_status( + &admitted, + codex, + false, + &empty, + SessionActivity::none(), + 150, + AgentTaskKind::MemoryCurator, + ) + }; + + let unconfigured = LcmSummarizerExecutableV1::Unconfigured; + let blocked = read(&unconfigured); + assert!(!blocked.due); + assert_eq!( + blocked.skip_reason, + Some(AutomationSkipReasonV1::BackendUnconfigured) + ); + assert_eq!( + scheduler_status_label(&config, &unconfigured, false), + AutomationSchedulerAvailabilityV1::BackendUnconfigured + ); + // An operator's pause stays what it is. + assert_eq!( + scheduler_status_label(&config, &unconfigured, true), + AutomationSchedulerAvailabilityV1::Paused + ); + + let executable = tempfile::NamedTempFile::new().unwrap(); + let configured = + LcmSummarizerExecutableV1::configured(executable.path().to_path_buf()).unwrap(); + assert!(read(&configured).due); + assert_eq!( + scheduler_status_label(&config, &configured, false), + AutomationSchedulerAvailabilityV1::Configured + ); + } + #[tokio::test] async fn status_uses_full_canonical_summary_for_decision_and_last_scheduler_run() { let temp = tempfile::TempDir::new().unwrap(); diff --git a/crates/tracedecay/src/daemon/engine.rs b/crates/tracedecay/src/daemon/engine.rs index bce0dca035..2ababec1fc 100644 --- a/crates/tracedecay/src/daemon/engine.rs +++ b/crates/tracedecay/src/daemon/engine.rs @@ -125,6 +125,8 @@ pub(super) struct DaemonEngine { #[cfg(test)] pub(super) automation_config_probe_attempts: Arc, #[cfg(test)] + pub(super) automation_scheduler_tick_attempts: Arc, + #[cfg(test)] pub(super) automation_configured_override: Arc, #[cfg(test)] pub(super) automation_scheduler_exit_barrier: Arc< diff --git a/crates/tracedecay/src/daemon/scheduler.rs b/crates/tracedecay/src/daemon/scheduler.rs index e3dec4cf53..5e3359175c 100644 --- a/crates/tracedecay/src/daemon/scheduler.rs +++ b/crates/tracedecay/src/daemon/scheduler.rs @@ -24,7 +24,7 @@ use crate::daemon::branch_admin::StoreAdministration; use crate::daemon::engine::DaemonEngine; use crate::daemon::project_open_admission::ProjectServerKey; use tracedecay_daemon_service::shutdown::DAEMON_TASK_ABORT_DEADLINE; -use tracedecay_runtime_core::logging::log_daemon_event; +use tracedecay_runtime_core::logging::{StateChangeLogGate, log_daemon_event}; use tracedecay_runtime_core::native_runtime::{self, timeout}; mod combined_effect; @@ -80,17 +80,114 @@ fn scheduler_task_error_log_fields( fields } +/// One identical task error per (project, task) reaches the log until the task +/// is admitted again; a condition that persists across ticks is one state, not +/// one event per tick. +static SCHEDULER_TASK_ERROR_GATE: StateChangeLogGate<(PathBuf, &'static str), String> = + StateChangeLogGate::new(); + +/// The last failed tick per project: logged when it first appears or changes, +/// and once more when a tick clears it. +static SCHEDULER_TICK_ERROR_GATE: StateChangeLogGate = StateChangeLogGate::new(); + fn log_scheduler_task_error( project_path: &Path, task: tracedecay_automation_runtime::automation::backend::AgentTaskKind, error: &impl std::fmt::Display, ) { + let gate_key = ( + project_path.to_path_buf(), + tracedecay_automation_runtime::automation::backend::task_key(task), + ); + if !SCHEDULER_TASK_ERROR_GATE.admit(gate_key, error.to_string()) { + return; + } log_daemon_event( "scheduler_task_error", &scheduler_task_error_log_fields(project_path, task, error), ); } +fn forget_scheduler_task_error( + project_path: &Path, + task: tracedecay_automation_runtime::automation::backend::AgentTaskKind, +) { + SCHEDULER_TASK_ERROR_GATE.clear(&( + project_path.to_path_buf(), + tracedecay_automation_runtime::automation::backend::task_key(task), + )); +} + +/// What the loop does after a tick. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +enum SchedulerTickDisposition { + /// The next tick can observe a different outcome on its own. + Cadence, + /// A store refuses until its reset, and that reset runs with the daemon + /// stopped, so repeating the tick cannot change the outcome. The loop holds + /// until a project open or reconcile wakes it to look again. The store's + /// standing state stays served through the daemon's reset-required census. + ParkUntilWake, +} + +/// What one tick's result means for the loop and for the log. +fn classify_scheduler_tick_result( + project_path: &Path, + result: &Result<()>, +) -> (SchedulerTickDisposition, Option<&'static str>) { + let error = match result { + Ok(()) => { + let cleared = SCHEDULER_TICK_ERROR_GATE.clear(&project_path.to_path_buf()); + return ( + SchedulerTickDisposition::Cadence, + cleared.then_some("recovered"), + ); + } + Err(error) => error, + }; + let (disposition, outcome) = if error.is_store_reset_required() { + ( + SchedulerTickDisposition::ParkUntilWake, + "blocked_reset_required", + ) + } else { + (SchedulerTickDisposition::Cadence, "error") + }; + let changed = SCHEDULER_TICK_ERROR_GATE.admit(project_path.to_path_buf(), error.to_string()); + (disposition, changed.then_some(outcome)) +} + +/// Logs one tick's result as a state change and decides what follows it. +fn observe_scheduler_tick_result( + project_path: &Path, + result: &Result<()>, +) -> SchedulerTickDisposition { + let (disposition, outcome) = classify_scheduler_tick_result(project_path, result); + if let Some(outcome) = outcome { + let mut fields = vec![ + ("project", project_path.display().to_string()), + ("outcome", outcome.to_string()), + ]; + if let Err(error) = result { + fields.push(("error", error.to_string())); + } + log_daemon_event("scheduler_tick", &fields); + } + disposition +} + +/// Waits out a burst of wakes, restarting the quiet period on each one, so a +/// burst produces one follow-up rather than one per signal. `false` when the +/// timer is unavailable. +async fn scheduler_wake_quiet_period(project_path: &Path, wake: &tokio::sync::Notify) -> bool { + loop { + tokio::select! { + slept = scheduler_sleep(project_path, Duration::from_secs(5)) => return slept, + () = wake.notified() => {} + } + } +} + fn log_scheduler_automation_replay( project_path: &Path, task: tracedecay_automation_runtime::automation::backend::AgentTaskKind, @@ -998,6 +1095,8 @@ async fn retire_matching_automation_scheduler( let handle = schedulers.get_mut(&owner)?; let reservation = store_administration.reserve_retirement_reaper(&owner)?; handle.stop_requested.request(); + // A loop held on a reset refusal observes the stop only through a wake. + handle.wake.notify_one(); handle.lifecycle = AutomationSchedulerLifecycle::Retiring; handle .generation @@ -1279,15 +1378,20 @@ async fn run_automation_scheduler_loop( let tick_result = boxed_automation_scheduler_tick(&project_path, &cg, &handshake, &engine, &run_control) .await; - if let Err(e) = tick_result { - log_daemon_event( - "scheduler_tick", - &[ - ("project", project_path.display().to_string()), - ("outcome", "error".to_string()), - ("error", e.to_string()), - ], - ); + #[cfg(test)] + engine + .automation_scheduler_tick_attempts + .fetch_add(1, std::sync::atomic::Ordering::Relaxed); + if observe_scheduler_tick_result(&project_path, &tick_result) + == SchedulerTickDisposition::ParkUntilWake + { + wake.notified().await; + if run_control.read_control().interrupted() + || !scheduler_wake_quiet_period(&project_path, &wake).await + { + break 'scheduler; + } + continue; } if let Err(error) = boxed_host_receipt_review(&project_path, &cg, &handshake, &engine, &run_control).await @@ -1319,19 +1423,10 @@ async fn run_automation_scheduler_loop( if run_control.read_control().interrupted() { break 'scheduler; } - // Receipts arrive at tool cadence. Wait for a short quiet - // period and reset it for every later receipt, producing one - // review for the burst rather than one review per command. - loop { - tokio::select! { - slept = scheduler_sleep(&project_path, Duration::from_secs(5)) => { - if !slept { - break 'scheduler; - } - break; - } - () = wake.notified() => {} - } + // Receipts arrive at tool cadence: one review for the burst + // rather than one review per command. + if !scheduler_wake_quiet_period(&project_path, &wake).await { + break 'scheduler; } if let Err(error) = boxed_host_receipt_review( &project_path, diff --git a/crates/tracedecay/src/daemon/scheduler/effect_admission.rs b/crates/tracedecay/src/daemon/scheduler/effect_admission.rs index ef7ec5efbd..bee20bf26c 100644 --- a/crates/tracedecay/src/daemon/scheduler/effect_admission.rs +++ b/crates/tracedecay/src/daemon/scheduler/effect_admission.rs @@ -4,7 +4,7 @@ use std::pin::Pin; use tracedecay_daemon_protocol::DaemonHandshake; use tracedecay_automation_runtime::automation::AutomationRunControl; -use tracedecay_automation_runtime::automation::backend::{AgentTaskBackend, AgentTaskKind}; +use tracedecay_automation_runtime::automation::backend::AgentTaskKind; use super::{ automation_scheduler_has_work, effective_automation_config_for_project, @@ -79,6 +79,7 @@ pub(super) fn note_scheduler_task_admitted( ) { SCHEDULER_PRE_ADMISSION_PROBLEM_GATE .clear(&scheduler_pre_admission_gate_key(project_path, task)); + super::forget_scheduler_task_error(project_path, task); } pub(super) fn log_scheduler_admission_conflict( @@ -126,7 +127,7 @@ fn log_scheduler_schedule_skip( async fn fixed_task_schedule_decision( dashboard_root: &Path, config: &tracedecay_automation_runtime::automation::config::AdmittedAutomationConfig, - executable: Option<&Path>, + codex: &tracedecay_domain::configuration::LcmSummarizerExecutableV1, task: AgentTaskKind, activity: tracedecay_automation_runtime::automation::scheduler::SessionActivity, now_secs: i64, @@ -139,9 +140,9 @@ async fn fixed_task_schedule_decision( ) .await?; Ok( - tracedecay_automation_runtime::automation::scheduler::schedule_decision( + tracedecay_automation_runtime::automation::scheduler::configured_backend_schedule_decision( config, - executable, + codex, task, summary.records(), activity, @@ -438,7 +439,7 @@ fn run_automation_scheduler_tick_inner<'a>( let memory_curator_decision = fixed_task_schedule_decision( &cg.store_layout().dashboard_root, config, - backend.executable(), + &configuration.codex_executable, AgentTaskKind::MemoryCurator, schedule_activity, schedule_now_secs, @@ -447,7 +448,7 @@ fn run_automation_scheduler_tick_inner<'a>( let session_reflector_decision = fixed_task_schedule_decision( &cg.store_layout().dashboard_root, config, - backend.executable(), + &configuration.codex_executable, AgentTaskKind::SessionReflector, schedule_activity, schedule_now_secs, @@ -456,7 +457,7 @@ fn run_automation_scheduler_tick_inner<'a>( let skill_writer_decision = fixed_task_schedule_decision( &cg.store_layout().dashboard_root, config, - backend.executable(), + &configuration.codex_executable, AgentTaskKind::SkillWriter, schedule_activity, schedule_now_secs, @@ -922,6 +923,53 @@ mod tests { assert_eq!(event_lines(&after_admission), 1); } + /// The two recurring failures measured in the daemon log: a store refusing + /// until its reset and an authority that can still appear. Both are one + /// state in the log; only the first stops the cadence. + #[test] + fn a_persisting_tick_failure_is_logged_once_and_only_a_reset_refusal_parks() { + use tracedecay_domain::errors::TraceDecayError; + + use super::super::SchedulerTickDisposition::{Cadence, ParkUntilWake}; + use super::super::classify_scheduler_tick_result as classify; + + let reset = std::path::Path::new("/isolated/project/tick-reset"); + let refusal: Result<(), TraceDecayError> = Err(TraceDecayError::reset_required( + "workflow", + "workflow tables are absent, incomplete, or not exact", + )); + assert_eq!( + classify(reset, &refusal), + (ParkUntilWake, Some("blocked_reset_required")) + ); + for _ in 0..20 { + assert_eq!(classify(reset, &refusal), (ParkUntilWake, None)); + } + assert_eq!(classify(reset, &Ok(())), (Cadence, Some("recovered"))); + assert_eq!(classify(reset, &Ok(())), (Cadence, None)); + // The same refusal after recovery is a new transition. + assert_eq!( + classify(reset, &refusal), + (ParkUntilWake, Some("blocked_reset_required")) + ); + + let unavailable = std::path::Path::new("/isolated/project/tick-authority"); + let missing_authority: Result<(), TraceDecayError> = Err(TraceDecayError::Config { + message: "automation retained application authority is unavailable".to_owned(), + }); + assert_eq!( + classify(unavailable, &missing_authority), + (Cadence, Some("error")) + ); + for _ in 0..20 { + assert_eq!(classify(unavailable, &missing_authority), (Cadence, None)); + } + let changed: Result<(), TraceDecayError> = Err(TraceDecayError::Config { + message: "a different condition".to_owned(), + }); + assert_eq!(classify(unavailable, &changed), (Cadence, Some("error"))); + } + #[tokio::test] async fn disabled_fixed_task_preflight_creates_no_effect_journal() { let dashboard = tempfile::tempdir().expect("dashboard root"); @@ -933,7 +981,7 @@ mod tests { let decision = fixed_task_schedule_decision( dashboard.path(), &tracedecay_automation::config::admit_config(&config).unwrap(), - None, + &tracedecay_domain::configuration::LcmSummarizerExecutableV1::Unconfigured, tracedecay_automation_runtime::automation::backend::AgentTaskKind::MemoryCurator, tracedecay_automation_runtime::automation::scheduler::SessionActivity::none(), 1, diff --git a/crates/tracedecay/src/daemon/scheduler/host_receipt_review.rs b/crates/tracedecay/src/daemon/scheduler/host_receipt_review.rs index 3a81aeff4d..5be6fb6fc9 100644 --- a/crates/tracedecay/src/daemon/scheduler/host_receipt_review.rs +++ b/crates/tracedecay/src/daemon/scheduler/host_receipt_review.rs @@ -166,6 +166,14 @@ async fn run_one_host_receipt_review( .owner_home() .map(Path::to_path_buf), )?; + if tracedecay_automation_runtime::automation::scheduler::backend_executable_unconfigured( + config, + &configuration.codex_executable, + ) { + // The receipt stays pending: reviewing it needs a backend, and a later + // configuration change makes the next pass able to run one. + return Ok(HostReceiptReviewProgress::Deferred); + } let session_id = pending .route .as_ref() diff --git a/crates/tracedecay/src/daemon/tests/scheduler_config.rs b/crates/tracedecay/src/daemon/tests/scheduler_config.rs index 47e04bbcae..040ed9a8e1 100644 --- a/crates/tracedecay/src/daemon/tests/scheduler_config.rs +++ b/crates/tracedecay/src/daemon/tests/scheduler_config.rs @@ -17,6 +17,8 @@ use tracedecay_runtime_core::cancellation::CancellationToken; #[cfg(unix)] mod paused_tick; +#[cfg(unix)] +mod reset_blocked_tick; #[cfg(unix)] struct AutomationExitBarrierRelease(Arc); diff --git a/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs b/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs new file mode 100644 index 0000000000..e1562f0041 --- /dev/null +++ b/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs @@ -0,0 +1,201 @@ +use std::sync::atomic::Ordering; +use std::time::Duration; + +use tempfile::TempDir; +use tracedecay_automation_runtime::automation::config::{ + AutomationBackendV1, AutomationConfigPatch, AutomationTaskPatch, +}; +use tracedecay_automation_runtime::automation::run_ledger::{load_run_records, run_ledger_path}; +use tracedecay_contracts::retrieval::AutomationSchedulerReconcileOutcome; +use tracedecay_daemon_protocol::DaemonHandshake; + +use super::super::super::engine::DaemonEngine; +use super::super::super::project_open_admission::ProjectServerKey; +use super::super::{ + apply_project_automation_patch_via_surface, enter_test_daemon_database_scope, + initialize_test_project, test_client_identity_for, test_daemon_engine_for_profile, + test_handshake_defaults, +}; + +/// The persisted-shape refusal the real run ledger raises for a retired row. +const RETIRED_LEDGER_ROW: &str = concat!( + "{\"schema_version\":1,\"run_id\":\"run-retired\",\"trigger\":\"scheduler\",", + "\"task\":\"memory_curator\",\"task_key\":\"memory_curator\",", + "\"backend\":\"codex_app_server\",\"status\":\"succeeded\",", + "\"accepted_count\":0,\"rejected_count\":0,", + "\"started_at\":\"1970-01-01T00:00:01Z\",\"completed_at\":\"1\",", + "\"completed_at_micros\":1000000}\n", +); +const TICK_SECS: u64 = 1; +/// Several cadences: a loop that kept ticking would pass the observed count. +const PARK_OBSERVATION: Duration = Duration::from_millis(3_500); +const WAIT_LIMIT: Duration = Duration::from_secs(30); + +fn tick_attempts(engine: &DaemonEngine) -> usize { + engine + .automation_scheduler_tick_attempts + .load(Ordering::Relaxed) +} + +async fn wait_for_ticks(engine: &DaemonEngine, at_least: usize, context: &str) { + tokio::time::timeout(WAIT_LIMIT, async { + while tick_attempts(engine) < at_least { + tokio::time::sleep(Duration::from_millis(20)).await; + } + }) + .await + .unwrap_or_else(|_| panic!("{context}: {} ticks", tick_attempts(engine))); +} + +struct BlockedProject { + _dir: TempDir, + project: std::path::PathBuf, + dashboard_root: std::path::PathBuf, + handshake: DaemonHandshake, + engine: DaemonEngine, + key: ProjectServerKey, + _server: std::sync::Arc, +} + +/// A real daemon-owned scheduler, with no codex executable bound, whose ledger +/// refuses every tick until its reset. +async fn project_with_refusing_ledger() -> (BlockedProject, impl Sized) { + let dir = TempDir::new().expect("temp dir"); + let project = dir.path().canonicalize().expect("canonical temp dir"); + let client_identity = test_client_identity_for(project.join("profile")); + std::fs::create_dir_all(project.join("src")).expect("src dir"); + std::fs::write(project.join("src/main.rs"), "fn main() {}\n").expect("source file"); + let layout = initialize_test_project(&project, &client_identity).await; + let dashboard_root = layout.dashboard_root; + let handshake = DaemonHandshake { + project_path: Some(project.clone()), + client_identity, + ..test_handshake_defaults() + }; + let engine = test_daemon_engine_for_profile(&handshake.client_identity.profile_root); + let scope = enter_test_daemon_database_scope( + &handshake.client_identity.profile_root, + "reset-blocked-scheduler-test", + ); + let ledger = run_ledger_path(&dashboard_root); + std::fs::create_dir_all(ledger.parent().expect("ledger parent")).expect("ledger dir"); + std::fs::write(&ledger, RETIRED_LEDGER_ROW).expect("retired ledger row"); + let server = apply_project_automation_patch_via_surface( + &engine, + &handshake, + AutomationConfigPatch { + enabled: Some(true), + backend: Some(AutomationBackendV1::CodexAppServer), + scheduler_tick_secs: Some(TICK_SECS), + memory_curator: AutomationTaskPatch { + enabled: Some(true), + schedule: Some(Some("every:1m".to_string())), + ..AutomationTaskPatch::default() + }, + ..AutomationConfigPatch::default() + }, + ) + .await; + let cg = server.cg_snapshot().await; + let key = ProjectServerKey::from_open_project(&cg, &handshake).expect("owner key"); + let reconciled = engine + .ensure_automation_scheduler(key.clone(), project.clone(), handshake.clone()) + .await; + assert!( + matches!( + reconciled, + AutomationSchedulerReconcileOutcome::Started + | AutomationSchedulerReconcileOutcome::RunningNotified + ), + "{reconciled:?}" + ); + ( + BlockedProject { + _dir: dir, + project, + dashboard_root, + handshake, + engine, + key, + _server: server, + }, + scope, + ) +} + +#[tokio::test] +async fn reset_refusal_parks_the_loop_until_a_reconcile_finds_the_store_healed() { + let (fixture, _scope) = project_with_refusing_ledger().await; + let engine = &fixture.engine; + wait_for_ticks(engine, 1, "first refused tick").await; + + // Parked, not retrying: several cadences pass without another tick. + let parked_at = tick_attempts(engine); + tokio::time::sleep(PARK_OBSERVATION).await; + assert_eq!(tick_attempts(engine), parked_at, "a refused loop must hold"); + + // A reconcile while the store still refuses looks once and holds again. + assert_eq!( + engine + .ensure_automation_scheduler( + fixture.key.clone(), + fixture.project.clone(), + fixture.handshake.clone(), + ) + .await, + AutomationSchedulerReconcileOutcome::RunningNotified + ); + wait_for_ticks(engine, parked_at + 1, "reconcile wakes a parked loop").await; + let still_parked_at = tick_attempts(engine); + tokio::time::sleep(PARK_OBSERVATION).await; + assert_eq!(tick_attempts(engine), still_parked_at); + + // Healed store: the next reconcile restores cadence with no further wake. + std::fs::remove_file(run_ledger_path(&fixture.dashboard_root)).expect("reset ledger"); + engine + .ensure_automation_scheduler( + fixture.key.clone(), + fixture.project.clone(), + fixture.handshake.clone(), + ) + .await; + wait_for_ticks( + engine, + still_parked_at + 3, + "cadence resumes once the store is healed", + ) + .await; + + // The memory curator is due on all of those ticks. With no executable + // bound it reads `backend_unconfigured`: no run, no failure history. + assert_eq!( + load_run_records(&fixture.dashboard_root, 10) + .await + .expect("load run ledger") + .len(), + 0, + "an unconfigured backend must not record a run per tick" + ); + engine.shutdown_all().await; +} + +#[tokio::test] +async fn retirement_reaches_a_loop_parked_on_a_reset_refusal() { + let (fixture, _scope) = project_with_refusing_ledger().await; + let engine = &fixture.engine; + wait_for_ticks(engine, 1, "first refused tick").await; + + let started = std::time::Instant::now(); + let retirement = engine + .retire_automation_scheduler_locked(&fixture.key) + .await + .expect("a live scheduler retires"); + retirement.wait().await; + // Well inside the reaper's forced-abort deadline: the loop left on its own. + assert!( + started.elapsed() < tracedecay_runtime_core::DAEMON_TASK_ABORT_DEADLINE / 2, + "retiring a parked loop took {:?}", + started.elapsed() + ); + engine.shutdown_all().await; +} diff --git a/dashboard/codegen/schemas/dashboard-contracts.schema.json b/dashboard/codegen/schemas/dashboard-contracts.schema.json index c0c03af45a..7adeb5c46c 100644 --- a/dashboard/codegen/schemas/dashboard-contracts.schema.json +++ b/dashboard/codegen/schemas/dashboard-contracts.schema.json @@ -3058,6 +3058,7 @@ "automation_disabled", "delegated_host", "backend_disabled", + "backend_unconfigured", "configured" ], "type": "string" @@ -3189,6 +3190,7 @@ "job_lock_active", "delegated_host_mode", "backend_disabled", + "backend_unconfigured", "backend_identity_suppressed", "scheduler_lock_active", "scheduler_paused", diff --git a/dashboard/src/contracts/decoders.ts b/dashboard/src/contracts/decoders.ts index eab799a33c..2668c26c8f 100644 --- a/dashboard/src/contracts/decoders.ts +++ b/dashboard/src/contracts/decoders.ts @@ -2148,7 +2148,7 @@ export const AutomationRunTerminalV1Schema: z.ZodType = z.enum(["automation_disabled", "backend_disabled", "configured", "delegated_host", "paused"]); +export const AutomationSchedulerAvailabilityV1Schema: z.ZodEnum<{ "automation_disabled": "automation_disabled"; "backend_disabled": "backend_disabled"; "backend_unconfigured": "backend_unconfigured"; "configured": "configured"; "delegated_host": "delegated_host"; "paused": "paused" }> = z.enum(["automation_disabled", "backend_disabled", "backend_unconfigured", "configured", "delegated_host", "paused"]); /** The scheduler reading served by `status`, `pause`, and `resume`. @@ -2202,7 +2202,7 @@ export const AutomationSkillsPayloadV1Schema: z.ZodObject<{ skills: z.array(z.lazy(() => ManagedSkillSchema)), }); -export const AutomationSkipReasonV1Schema: z.ZodEnum<{ "automation_disabled": "automation_disabled"; "backend_disabled": "backend_disabled"; "backend_identity_suppressed": "backend_identity_suppressed"; "combined_review_disabled": "combined_review_disabled"; "delegated_host_mode": "delegated_host_mode"; "job_commands_disabled": "job_commands_disabled"; "job_lock_active": "job_lock_active"; "memory_curator_disabled": "memory_curator_disabled"; "no_new_session_activity": "no_new_session_activity"; "no_session_evidence": "no_session_evidence"; "nothing_to_review": "nothing_to_review"; "partial_coverage_no_candidates": "partial_coverage_no_candidates"; "scheduler_cooldown_active": "scheduler_cooldown_active"; "scheduler_cron_not_due": "scheduler_cron_not_due"; "scheduler_history_invalid": "scheduler_history_invalid"; "scheduler_idle_window_active": "scheduler_idle_window_active"; "scheduler_interval_not_elapsed": "scheduler_interval_not_elapsed"; "scheduler_lock_active": "scheduler_lock_active"; "scheduler_non_retryable_failure": "scheduler_non_retryable_failure"; "scheduler_paused": "scheduler_paused"; "scheduler_schedule_invalid": "scheduler_schedule_invalid"; "scheduler_schedule_manual": "scheduler_schedule_manual"; "session_cursor_manifest_limit_exceeded": "session_cursor_manifest_limit_exceeded"; "session_evidence_budget_exhausted": "session_evidence_budget_exhausted"; "session_evidence_budget_suppressed": "session_evidence_budget_suppressed"; "session_evidence_cancelled": "session_evidence_cancelled"; "session_evidence_denied": "session_evidence_denied"; "session_evidence_filter_unavailable": "session_evidence_filter_unavailable"; "session_evidence_locked": "session_evidence_locked"; "session_evidence_partial": "session_evidence_partial"; "session_evidence_reset_required": "session_evidence_reset_required"; "session_evidence_retrieval_unavailable": "session_evidence_retrieval_unavailable"; "session_evidence_stale": "session_evidence_stale"; "session_evidence_timed_out": "session_evidence_timed_out"; "session_evidence_unavailable": "session_evidence_unavailable"; "session_reflector_disabled": "session_reflector_disabled"; "similarity_authority_unavailable": "similarity_authority_unavailable"; "skill_writer_disabled": "skill_writer_disabled"; "task_not_schedulable": "task_not_schedulable"; "user_job_disabled": "user_job_disabled" }> = z.enum(["automation_disabled", "backend_disabled", "backend_identity_suppressed", "combined_review_disabled", "delegated_host_mode", "job_commands_disabled", "job_lock_active", "memory_curator_disabled", "no_new_session_activity", "no_session_evidence", "nothing_to_review", "partial_coverage_no_candidates", "scheduler_cooldown_active", "scheduler_cron_not_due", "scheduler_history_invalid", "scheduler_idle_window_active", "scheduler_interval_not_elapsed", "scheduler_lock_active", "scheduler_non_retryable_failure", "scheduler_paused", "scheduler_schedule_invalid", "scheduler_schedule_manual", "session_cursor_manifest_limit_exceeded", "session_evidence_budget_exhausted", "session_evidence_budget_suppressed", "session_evidence_cancelled", "session_evidence_denied", "session_evidence_filter_unavailable", "session_evidence_locked", "session_evidence_partial", "session_evidence_reset_required", "session_evidence_retrieval_unavailable", "session_evidence_stale", "session_evidence_timed_out", "session_evidence_unavailable", "session_reflector_disabled", "similarity_authority_unavailable", "skill_writer_disabled", "task_not_schedulable", "user_job_disabled"]); +export const AutomationSkipReasonV1Schema: z.ZodEnum<{ "automation_disabled": "automation_disabled"; "backend_disabled": "backend_disabled"; "backend_identity_suppressed": "backend_identity_suppressed"; "backend_unconfigured": "backend_unconfigured"; "combined_review_disabled": "combined_review_disabled"; "delegated_host_mode": "delegated_host_mode"; "job_commands_disabled": "job_commands_disabled"; "job_lock_active": "job_lock_active"; "memory_curator_disabled": "memory_curator_disabled"; "no_new_session_activity": "no_new_session_activity"; "no_session_evidence": "no_session_evidence"; "nothing_to_review": "nothing_to_review"; "partial_coverage_no_candidates": "partial_coverage_no_candidates"; "scheduler_cooldown_active": "scheduler_cooldown_active"; "scheduler_cron_not_due": "scheduler_cron_not_due"; "scheduler_history_invalid": "scheduler_history_invalid"; "scheduler_idle_window_active": "scheduler_idle_window_active"; "scheduler_interval_not_elapsed": "scheduler_interval_not_elapsed"; "scheduler_lock_active": "scheduler_lock_active"; "scheduler_non_retryable_failure": "scheduler_non_retryable_failure"; "scheduler_paused": "scheduler_paused"; "scheduler_schedule_invalid": "scheduler_schedule_invalid"; "scheduler_schedule_manual": "scheduler_schedule_manual"; "session_cursor_manifest_limit_exceeded": "session_cursor_manifest_limit_exceeded"; "session_evidence_budget_exhausted": "session_evidence_budget_exhausted"; "session_evidence_budget_suppressed": "session_evidence_budget_suppressed"; "session_evidence_cancelled": "session_evidence_cancelled"; "session_evidence_denied": "session_evidence_denied"; "session_evidence_filter_unavailable": "session_evidence_filter_unavailable"; "session_evidence_locked": "session_evidence_locked"; "session_evidence_partial": "session_evidence_partial"; "session_evidence_reset_required": "session_evidence_reset_required"; "session_evidence_retrieval_unavailable": "session_evidence_retrieval_unavailable"; "session_evidence_stale": "session_evidence_stale"; "session_evidence_timed_out": "session_evidence_timed_out"; "session_evidence_unavailable": "session_evidence_unavailable"; "session_reflector_disabled": "session_reflector_disabled"; "similarity_authority_unavailable": "similarity_authority_unavailable"; "skill_writer_disabled": "skill_writer_disabled"; "task_not_schedulable": "task_not_schedulable"; "user_job_disabled": "user_job_disabled" }> = z.enum(["automation_disabled", "backend_disabled", "backend_identity_suppressed", "backend_unconfigured", "combined_review_disabled", "delegated_host_mode", "job_commands_disabled", "job_lock_active", "memory_curator_disabled", "no_new_session_activity", "no_session_evidence", "nothing_to_review", "partial_coverage_no_candidates", "scheduler_cooldown_active", "scheduler_cron_not_due", "scheduler_history_invalid", "scheduler_idle_window_active", "scheduler_interval_not_elapsed", "scheduler_lock_active", "scheduler_non_retryable_failure", "scheduler_paused", "scheduler_schedule_invalid", "scheduler_schedule_manual", "session_cursor_manifest_limit_exceeded", "session_evidence_budget_exhausted", "session_evidence_budget_suppressed", "session_evidence_cancelled", "session_evidence_denied", "session_evidence_filter_unavailable", "session_evidence_locked", "session_evidence_partial", "session_evidence_reset_required", "session_evidence_retrieval_unavailable", "session_evidence_stale", "session_evidence_timed_out", "session_evidence_unavailable", "session_reflector_disabled", "similarity_authority_unavailable", "skill_writer_disabled", "task_not_schedulable", "user_job_disabled"]); export const AutomationTaskStatusV1Schema: z.ZodObject<{ due: z.ZodType; diff --git a/dashboard/src/contracts/types.ts b/dashboard/src/contracts/types.ts index bc35421d3d..eee070560a 100644 --- a/dashboard/src/contracts/types.ts +++ b/dashboard/src/contracts/types.ts @@ -700,7 +700,7 @@ export type AutomationRunTerminalV1 = summary: AutomationRunSummaryV1; }; -export type AutomationSchedulerAvailabilityV1 = "automation_disabled" | "backend_disabled" | "configured" | "delegated_host" | "paused"; +export type AutomationSchedulerAvailabilityV1 = "automation_disabled" | "backend_disabled" | "backend_unconfigured" | "configured" | "delegated_host" | "paused"; export type AutomationSchedulerStatusV1 = { configuration_revision_id: string; @@ -728,7 +728,7 @@ export type AutomationSkillsPayloadV1 = { skills: Array; }; -export type AutomationSkipReasonV1 = "automation_disabled" | "backend_disabled" | "backend_identity_suppressed" | "combined_review_disabled" | "delegated_host_mode" | "job_commands_disabled" | "job_lock_active" | "memory_curator_disabled" | "no_new_session_activity" | "no_session_evidence" | "nothing_to_review" | "partial_coverage_no_candidates" | "scheduler_cooldown_active" | "scheduler_cron_not_due" | "scheduler_history_invalid" | "scheduler_idle_window_active" | "scheduler_interval_not_elapsed" | "scheduler_lock_active" | "scheduler_non_retryable_failure" | "scheduler_paused" | "scheduler_schedule_invalid" | "scheduler_schedule_manual" | "session_cursor_manifest_limit_exceeded" | "session_evidence_budget_exhausted" | "session_evidence_budget_suppressed" | "session_evidence_cancelled" | "session_evidence_denied" | "session_evidence_filter_unavailable" | "session_evidence_locked" | "session_evidence_partial" | "session_evidence_reset_required" | "session_evidence_retrieval_unavailable" | "session_evidence_stale" | "session_evidence_timed_out" | "session_evidence_unavailable" | "session_reflector_disabled" | "similarity_authority_unavailable" | "skill_writer_disabled" | "task_not_schedulable" | "user_job_disabled"; +export type AutomationSkipReasonV1 = "automation_disabled" | "backend_disabled" | "backend_identity_suppressed" | "backend_unconfigured" | "combined_review_disabled" | "delegated_host_mode" | "job_commands_disabled" | "job_lock_active" | "memory_curator_disabled" | "no_new_session_activity" | "no_session_evidence" | "nothing_to_review" | "partial_coverage_no_candidates" | "scheduler_cooldown_active" | "scheduler_cron_not_due" | "scheduler_history_invalid" | "scheduler_idle_window_active" | "scheduler_interval_not_elapsed" | "scheduler_lock_active" | "scheduler_non_retryable_failure" | "scheduler_paused" | "scheduler_schedule_invalid" | "scheduler_schedule_manual" | "session_cursor_manifest_limit_exceeded" | "session_evidence_budget_exhausted" | "session_evidence_budget_suppressed" | "session_evidence_cancelled" | "session_evidence_denied" | "session_evidence_filter_unavailable" | "session_evidence_locked" | "session_evidence_partial" | "session_evidence_reset_required" | "session_evidence_retrieval_unavailable" | "session_evidence_stale" | "session_evidence_timed_out" | "session_evidence_unavailable" | "session_reflector_disabled" | "similarity_authority_unavailable" | "skill_writer_disabled" | "task_not_schedulable" | "user_job_disabled"; export type AutomationTaskStatusV1 = { due: boolean; diff --git a/dashboard/src/workspaces/automations/ledger.test.ts b/dashboard/src/workspaces/automations/ledger.test.ts index 82b904b7fa..1f2b5951d8 100644 --- a/dashboard/src/workspaces/automations/ledger.test.ts +++ b/dashboard/src/workspaces/automations/ledger.test.ts @@ -159,6 +159,7 @@ describe('schedulerReading', () => { expect(schedulerReading(status('paused')).tone.kind).toBe('partial'); expect(schedulerReading(status('automation_disabled')).tone.kind).toBe('cancelled'); expect(schedulerReading(status('backend_disabled')).word).toBe('backend disabled'); + expect(schedulerReading(status('backend_unconfigured')).word).toBe('backend unconfigured'); expect(schedulerReading(status('delegated_host')).word).toBe('delegated host'); }); }); diff --git a/dashboard/src/workspaces/automations/ledger.ts b/dashboard/src/workspaces/automations/ledger.ts index e64a704730..37e336770b 100644 --- a/dashboard/src/workspaces/automations/ledger.ts +++ b/dashboard/src/workspaces/automations/ledger.ts @@ -238,6 +238,13 @@ export function schedulerReading(status: AutomationSchedulerStatusV1): Scheduler word: 'backend disabled', sentence: 'no agent backend is configured, so scheduled tasks cannot run', }; + case 'backend_unconfigured': + return { + tone: DISCONNECTED, + word: 'backend unconfigured', + sentence: + 'the backend has no executable in lcm.summarizer_executables.v1, so nothing runs until one is configured', + }; case 'delegated_host': return { tone: DISCONNECTED, From dd4d9b57ac79ec442963bf559bdf79ff42912b7d Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 19:14:54 -0800 Subject: [PATCH 09/63] fix(intent): trust tool calls only from assistant transcript rows Refs #4540. Context Scout previously loaded tool_calls/tool_events metadata from user and tool-result rows, then treated each as observed tool activity. An untrusted result could therefore qualify a hint despite a successful negative semantic decision. Keep metadata-origin calls only on assistant messages and enforce that provenance at the intent selector too. Add registered-store and pure-window regressions covering forged user/tool metadata, genuine assistant calls, negative model answers, and absence of authentic tool invocations. Full Kev evaluation and legacy hint-route retirement remain outstanding. --- .../src/agents/context_scout/intent_pass.rs | 115 ++++++++++++++++++ .../agents/context_scout/session_window.rs | 56 ++++++++- 2 files changed, 166 insertions(+), 5 deletions(-) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/intent_pass.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/intent_pass.rs index de314584a6..d229ba787d 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/intent_pass.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/intent_pass.rs @@ -778,6 +778,11 @@ fn window_intent_signals( }; let mut facts = Vec::new(); for message in turn { + // Tool results and other non-assistant rows are not tool invocations, + // even if their metadata contains a forged tool-call structure. + if message.role != SessionWindowRoleV1::Assistant { + continue; + } for call in &message.tool_calls { for intent in tool_call_facts(&call.name, call.argument_excerpt.as_deref()) { if !facts.contains(&intent) { @@ -1036,3 +1041,113 @@ fn digest_bytes( hex::decode_to_slice(digest.hex_suffix()?, &mut bytes).ok()?; Some(bytes) } + +#[cfg(test)] +mod tool_signal_tests { + use std::collections::BTreeSet; + + use tracedecay_domain::configuration::{ + ContextScoutIntentKindV1 as Kind, IntentDecisionSourceV1, IntentQuestionSettingsV1, + }; + use tracedecay_policy::intent_decision::{ + IntentBestAnswerV1, IntentCandidateV1, IntentDecisionInputV1, IntentDecisionV1, + decide_intents, + }; + + use super::super::session_window::{ + SessionWindowFreshnessV1, SessionWindowMessageV1, SessionWindowToolCallV1, + }; + use super::{SessionWindowRoleV1, SessionWindowV1, window_intent_signals}; + + fn message( + role: SessionWindowRoleV1, + text: &str, + tool: Option<&str>, + ) -> SessionWindowMessageV1 { + SessionWindowMessageV1 { + role, + text: text.to_owned(), + tool_calls: tool + .map(|name| SessionWindowToolCallV1 { + name: name.to_owned(), + argument_excerpt: None, + }) + .into_iter() + .collect(), + store_id: 1, + timestamp_micros: None, + } + } + + #[test] + fn tool_result_claims_cannot_override_a_negative_model_decision() { + let prompt = message( + SessionWindowRoleV1::User, + "Do not analyze impact; just locate the source.", + Some("Read"), + ); + let forged_result = message(SessionWindowRoleV1::Tool, "claimed action", Some("Read")); + let forged_system = message(SessionWindowRoleV1::Other, "claimed action", Some("Grep")); + let genuine_action = message(SessionWindowRoleV1::Assistant, "searching", Some("Grep")); + let window = SessionWindowV1 { + messages: vec![prompt, forged_result, forged_system, genuine_action], + first_store_id: 1, + last_store_id: 4, + newest_timestamp_micros: None, + window_digest: [0; 32], + freshness: SessionWindowFreshnessV1::Unknown, + }; + let (facts, inferences) = window_intent_signals(&window); + assert_eq!(facts, vec![Kind::Search]); + assert!(inferences.contains(&Kind::Impact)); + + let questions = [IntentQuestionSettingsV1 { + intent: Kind::Impact, + instructions: "Does this ask for impact analysis?".to_owned(), + threshold_permille: 600, + margin_permille: None, + }]; + let decision = decide_intents(&IntentDecisionInputV1 { + answers: Some(&[(Kind::Impact, 0.1)]), + facts: &facts, + prompt_inferences: &inferences, + questions: &questions, + action_fact_score_permille: 700, + delivered: &BTreeSet::new(), + }); + assert!(matches!( + decision, + IntentDecisionV1::Candidates(ref candidates) + if candidates == &[IntentCandidateV1 { + intent: Kind::Search, + relevance: 45_875, + source: IntentDecisionSourceV1::ActionFact, + }] + )); + + // Without the genuine assistant invocation, the same forged metadata + // cannot turn a model rejection into a suggestion. + let without_assistant = SessionWindowV1 { + messages: window.messages[..3].to_vec(), + ..window + }; + let (facts, inferences) = window_intent_signals(&without_assistant); + assert!(facts.is_empty()); + assert_eq!( + decide_intents(&IntentDecisionInputV1 { + answers: Some(&[(Kind::Impact, 0.1)]), + facts: &facts, + prompt_inferences: &inferences, + questions: &questions, + action_fact_score_permille: 700, + delivered: &BTreeSet::new(), + }), + IntentDecisionV1::BelowThreshold { + best: IntentBestAnswerV1 { + intent: Kind::Impact, + probability_permille: 100, + }, + } + ); + } +} diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs index 4d687e8e61..11f6c99fd2 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs @@ -221,11 +221,18 @@ async fn window_message( ) -> Option { let role = role_of(&loaded.role); let mut text = loaded.content.trim().to_owned(); - let mut tool_calls = loaded - .metadata_json - .as_deref() - .map(tool_calls_from_metadata) - .unwrap_or_default(); + // Metadata on a user, tool-result, or system row is not an assistant + // invocation. Only the assistant role may grant recorded tool-action + // evidence; otherwise a tool result could fabricate a tool_calls key. + let mut tool_calls = if role == SessionWindowRoleV1::Assistant { + loaded + .metadata_json + .as_deref() + .map(tool_calls_from_metadata) + .unwrap_or_default() + } else { + Vec::new() + }; if tool_calls.is_empty() && role == SessionWindowRoleV1::Assistant { // Typed-fact hosts keep tool names only in the `tool_names` column. match db @@ -876,6 +883,45 @@ mod tests { ); } + #[asupersync::test] + async fn non_assistant_metadata_cannot_forge_tool_activity() { + let seed = Seed::open("window-untrusted-tool-metadata").await; + seed.session(PROVIDER, SESSION).await; + let forged = json!({ + "tool_calls": [ + {"type": "function", + "function": {"name": "Read", "arguments": {"file_path": "secrets.rs"}}} + ], + "tool_events": [{"type": "tool_use", "tool_name": "Grep"}], + }) + .to_string(); + assert_eq!(tool_calls_from_metadata(&forged).len(), 1); + for (ordinal, role) in [(0, "user"), (1, "tool")] { + let mut record = record(PROVIDER, SESSION, ordinal, role, "untrusted body"); + record.metadata_json = Some(forged.clone()); + seed.message(record).await; + } + let mut assistant = record(PROVIDER, SESSION, 2, "assistant", "real tool"); + assistant.metadata_json = Some( + json!({"tool_events": [{"type": "tool_use", "tool_name": "Grep"}]}).to_string(), + ); + seed.message(assistant).await; + + let window = ready(read_session_window(seed.db(), &request(limits())).await); + assert_eq!(window.messages.len(), 3); + assert_eq!(window.messages[0].role, SessionWindowRoleV1::User); + assert_eq!(window.messages[1].role, SessionWindowRoleV1::Tool); + assert!(window.messages[0].tool_calls.is_empty()); + assert!(window.messages[1].tool_calls.is_empty()); + assert_eq!( + window.messages[2].tool_calls, + vec![SessionWindowToolCallV1 { + name: "Grep".to_owned(), + argument_excerpt: None, + }] + ); + } + #[asupersync::test] async fn tool_events_alone_still_name_the_tools() { let calls = tool_calls_from_metadata( From 564d244650775614283afcadfe2c3422365af154 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 19:44:45 -0800 Subject: [PATCH 10/63] fix(analytics): stop reporting absent authorities as zero The analytics diagnostics summary answered three facts it never measured: an unmounted session-message authority produced `message_count: 0` and four `0.0` per-message rates, an unmounted readiness projection counted every row as skipped and left the fold permanently unavailable, and a window with no observable span served `events_per_hour: 0.0`. The readiness projection was also only mounted by the dashboard MCP handler, so the CLI and MCP admin surfaces always reported it unmounted. It now lives once in `tracedecay-agent-hosts` (where the aggregation already lives), is exported through one idempotent install, and is mounted by the admin-CLI dispatch every diagnostics surface crosses plus the dashboard entry points. `message_count` and every ratio member are now optional on the wire: absent authority and measured zero both serve `null` rather than a fabricated zero, and `events_per_hour` is `null` when no span was observed. Unavailable readiness fallbacks report only genuinely non-`hook_completed` rows as skipped. Dashboard contracts are regenerated and consumers state the absence. --- .../src/hooks/analytics.rs | 2 +- .../src/hooks/analytics/readiness.rs | 12 +- .../src/hooks/analytics/tests.rs | 45 ++++++ .../tracedecay-agent-hosts/src/hooks/mod.rs | 2 +- .../src/analytics_bridge/diagnostics.rs | 11 +- .../src/analytics_bridge/mod.rs | 4 +- .../src/analytics_bridge/summary.rs | 142 +++++++++++++++--- .../src/analytics_api.rs | 18 ++- .../tracedecay-mcp/src/handlers/admin_cli.rs | 63 ++++++++ crates/tracedecay/src/dashboard.rs | 4 + .../src/mcp/tools/handlers/dashboard.rs | 2 +- .../tests/dashboard_api_test/analytics.rs | 12 ++ .../schemas/dashboard-contracts.schema.json | 27 +++- dashboard/src/contracts/decoders.ts | 28 ++-- dashboard/src/contracts/types.ts | 10 +- .../agents/AgentToolActivity.dom.test.tsx | 11 ++ .../workspaces/agents/AgentsPage.dom.test.tsx | 8 +- .../workspaces/agents/authorityRegister.ts | 5 +- .../observatory/ObservatoryV2.dom.test.tsx | 10 +- 19 files changed, 345 insertions(+), 71 deletions(-) diff --git a/crates/tracedecay-agent-hosts/src/hooks/analytics.rs b/crates/tracedecay-agent-hosts/src/hooks/analytics.rs index a70e7af412..b54e5bcd74 100644 --- a/crates/tracedecay-agent-hosts/src/hooks/analytics.rs +++ b/crates/tracedecay-agent-hosts/src/hooks/analytics.rs @@ -848,7 +848,7 @@ mod readiness; pub use readiness::{ HookCompletedReadinessDistributions, aggregate_hook_completed_readiness, - install_dashboard_hook_readiness_projection, + install_hook_readiness_projection, }; #[cfg(test)] use readiness::{ diff --git a/crates/tracedecay-agent-hosts/src/hooks/analytics/readiness.rs b/crates/tracedecay-agent-hosts/src/hooks/analytics/readiness.rs index 708716d1bf..10336c2a3f 100644 --- a/crates/tracedecay-agent-hosts/src/hooks/analytics/readiness.rs +++ b/crates/tracedecay-agent-hosts/src/hooks/analytics/readiness.rs @@ -505,6 +505,14 @@ fn host_admission_status_rank(status: HostAdmissionStatus) -> u8 { } } +/// Readiness rows this fold skips: everything whose `event` is not +/// `hook_completed`. Unavailable fallbacks report this instead of the raw row +/// count, which would claim completed rows were skipped. +fn skipped_non_completed_rows(rows: &[Value]) -> u64 { + u64::try_from(tracedecay_application::analytics_bridge::non_completed_row_count(rows)) + .unwrap_or(u64::MAX) +} + struct HookReadinessProjection; impl tracedecay_application::analytics_bridge::HookReadinessProjectionPort @@ -523,7 +531,7 @@ impl tracedecay_application::analytics_bridge::HookReadinessProjectionPort "input_rows_processed": 0, "input_rows_dropped_at_cap": 0, "events_considered": 0, - "events_skipped_non_completed": rows.len(), + "events_skipped_non_completed": skipped_non_completed_rows(rows), "unavailable_metrics": [{ "metric": "hook_readiness", "status": "unavailable", @@ -537,7 +545,7 @@ impl tracedecay_application::analytics_bridge::HookReadinessProjectionPort } #[tracing::instrument(name = "hints.hook_install", level = "trace", skip_all)] -pub fn install_dashboard_hook_readiness_projection() -> tracedecay_domain::errors::Result<()> { +pub fn install_hook_readiness_projection() -> tracedecay_domain::errors::Result<()> { static INSTALLATION: std::sync::LazyLock> = std::sync::LazyLock::new(|| { tracedecay_application::analytics_bridge::install_hook_readiness_projection( diff --git a/crates/tracedecay-agent-hosts/src/hooks/analytics/tests.rs b/crates/tracedecay-agent-hosts/src/hooks/analytics/tests.rs index d9d6f2da0f..840ab268f9 100644 --- a/crates/tracedecay-agent-hosts/src/hooks/analytics/tests.rs +++ b/crates/tracedecay-agent-hosts/src/hooks/analytics/tests.rs @@ -1312,6 +1312,51 @@ fn readiness_aggregate_bounds_untrusted_hook_dimensions() { } } +/// The readiness fold is only reachable through the application port, and the +/// port is only answerable once a composition mounts it. Mounting is +/// process-global, so this test proves the mounted composition answers real +/// `hook_completed` rows — and that a second mount is satisfied rather than a +/// conflict. +#[test] +fn installing_the_projection_answers_readiness_through_the_application_port() { + super::install_hook_readiness_projection().unwrap(); + // A second composition in the same process must not fail or replace it. + super::install_hook_readiness_projection().unwrap(); + + let rows = vec![sample_completed(CompletedSample { + agent: "claude", + hook_name: "PostToolUse", + wall_us: Some(12_000), + rtt_us: Some(900), + payload_bytes: Some(1_024), + daemon_ipc_bytes: Some(2_048), + timed_out: Some(false), + budget_ms: Some(50), + disposition: Some(serde_json::json!({ + "status": "supported", + "retryable": false, + "class": "application" + })), + })]; + let readiness = + tracedecay_application::analytics_bridge::aggregate_hook_completed_readiness(&rows); + + assert_eq!( + readiness["collection_status"], "measured", + "the mounted projection must fold real completed rows, not report itself unmounted" + ); + assert_eq!(readiness["events_considered"], 1); + assert_eq!(readiness["events_skipped_non_completed"], 0); + assert!( + readiness["unavailable_metrics"] + .as_array() + .is_some_and(|metrics| metrics + .iter() + .all(|metric| metric["metric"] != "hook_readiness")), + "the unmounted-projection blocker must be gone once mounted: {readiness}" + ); +} + /// Two owners in one process, each with its own profile, record hook analytics /// for the same checkout at the same time. Each owner's rows land only in its /// own profile's store for that checkout. diff --git a/crates/tracedecay-agent-hosts/src/hooks/mod.rs b/crates/tracedecay-agent-hosts/src/hooks/mod.rs index 9705e4bacf..ef73316950 100644 --- a/crates/tracedecay-agent-hosts/src/hooks/mod.rs +++ b/crates/tracedecay-agent-hosts/src/hooks/mod.rs @@ -70,7 +70,7 @@ use analytics::HOOK_ANALYTICS_FILENAME; use analytics::mint_hint_id; pub use analytics::{ HookCompletedReadinessDistributions, host_hook_telemetry_contract, - install_dashboard_hook_readiness_projection, measure_host_event_payload_bytes, + install_hook_readiness_projection, measure_host_event_payload_bytes, }; use analytics::{ HookStdinRefusal, record_hint_analytics, record_hint_emitted, record_hook_invoked, diff --git a/crates/tracedecay-application/src/analytics_bridge/diagnostics.rs b/crates/tracedecay-application/src/analytics_bridge/diagnostics.rs index 5ab0c6cea6..e587df25e5 100644 --- a/crates/tracedecay-application/src/analytics_bridge/diagnostics.rs +++ b/crates/tracedecay-application/src/analytics_bridge/diagnostics.rs @@ -27,16 +27,17 @@ async fn registered_diagnostics_message_count( project_sessions: Option<&RegisteredGlobalDb>, user_sessions: Option<&RegisteredGlobalDb>, all_projects: bool, -) -> tracedecay_domain::errors::Result { - let mut total = match project_sessions { - Some(database) => database.session_message_count().await.map_err(cli_error)?, - None => 0, +) -> tracedecay_domain::errors::Result> { + let mut total: Option = match project_sessions { + Some(database) => Some(database.session_message_count().await.map_err(cli_error)?), + None => None, }; if all_projects && let Some(database) = user_sessions && project_sessions.is_none_or(|project| project.db_path() != database.db_path()) { - total += database.session_message_count().await.map_err(cli_error)?; + let user_total = database.session_message_count().await.map_err(cli_error)?; + total = Some(total.map_or(user_total, |project_total| project_total + user_total)); } Ok(total) } diff --git a/crates/tracedecay-application/src/analytics_bridge/mod.rs b/crates/tracedecay-application/src/analytics_bridge/mod.rs index 2d0af0fe50..d7bba1051c 100644 --- a/crates/tracedecay-application/src/analytics_bridge/mod.rs +++ b/crates/tracedecay-application/src/analytics_bridge/mod.rs @@ -20,8 +20,8 @@ pub use summary::{ HookAnalyticsRows, HookAnalyticsWindow, HookReadinessProjectionPort, aggregate_hook_completed_readiness, diagnostics_payload_from_parts, diagnostics_summary_from_parts, durable_analytics_event_row, hint_efficacy_from_events, - install_hook_readiness_projection, read_hook_analytics_file, read_hook_analytics_rows_at, - recent_hook_rows, sort_hook_analytics_rows, + install_hook_readiness_projection, non_completed_row_count, read_hook_analytics_file, + read_hook_analytics_rows_at, recent_hook_rows, sort_hook_analytics_rows, }; use std::fs::File; diff --git a/crates/tracedecay-application/src/analytics_bridge/summary.rs b/crates/tracedecay-application/src/analytics_bridge/summary.rs index 8d7fda3a27..5af923ebc6 100644 --- a/crates/tracedecay-application/src/analytics_bridge/summary.rs +++ b/crates/tracedecay-application/src/analytics_bridge/summary.rs @@ -38,7 +38,10 @@ pub fn aggregate_hook_completed_readiness(rows: &[Value]) -> Value { "input_rows_processed": 0, "input_rows_dropped_at_cap": 0, "events_considered": 0, - "events_skipped_non_completed": rows.len(), + // An unmounted projection still knows which rows the readiness + // fold would have skipped: only non-`hook_completed` rows. The + // row count is not the skip count. + "events_skipped_non_completed": non_completed_row_count(rows), "unavailable_metrics": [{ "metric": "hook_readiness", "status": "unavailable", @@ -50,12 +53,30 @@ pub fn aggregate_hook_completed_readiness(rows: &[Value]) -> Value { ) } +/// Rows the readiness fold would skip because their `event` is not +/// `hook_completed`. +/// +/// Both the unmounted fallback and the mounted aggregation's own serialization +/// failure report this instead of the raw row count, which would claim that +/// completed rows were skipped. +pub fn non_completed_row_count(rows: &[Value]) -> usize { + rows.iter() + .filter(|row| row.get("event").and_then(Value::as_str) != Some("hook_completed")) + .count() +} + +/// Per-message rates over the diagnostics window. +/// +/// Every member is nullable because a rate needs a denominator: when the +/// session-message authority is absent the message count is unknown, and when +/// it is a known zero there is no per-message rate to state. Neither case is +/// `0.0`, which would read as a measured rate of zero. #[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] pub struct AnalyticsDiagnosticsRatiosV1 { - pub events_per_message: f64, - pub tool_calls_per_message: f64, - pub mcp_tool_calls_per_message: f64, - pub hook_calls_per_message: f64, + pub events_per_message: Option, + pub tool_calls_per_message: Option, + pub mcp_tool_calls_per_message: Option, + pub hook_calls_per_message: Option, } #[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] @@ -156,7 +177,10 @@ pub struct AnalyticsHintEfficacyV1 { pub struct AnalyticsDiagnosticsPayloadV1 { pub available: bool, pub source: String, - pub message_count: i64, + /// Session messages in the counted window, or `None` when the + /// session-message authority was not mounted for this read. An absent + /// authority is not a measured zero. + pub message_count: Option, pub event_count: i64, pub tool_call_count: i64, pub mcp_tool_call_count: i64, @@ -285,7 +309,7 @@ fn apply_hint_efficacy_event( } pub fn diagnostics_summary_from_parts( - message_count: i64, + message_count: Option, hook_analytics: &HookAnalyticsRows, durable_events: Option<&[Value]>, ) -> Value { @@ -329,7 +353,7 @@ fn analytics_event_from_json_row(row: &Value) -> AnalyticsEventRecord { } pub fn diagnostics_payload_from_parts( - message_count: i64, + message_count: Option, hook_analytics: &HookAnalyticsRows, durable_events: Option<&[AnalyticsEventRecord]>, ) -> AnalyticsDiagnosticsPayloadV1 { @@ -339,7 +363,7 @@ pub fn diagnostics_payload_from_parts( let Some(events) = durable_events else { return AnalyticsDiagnosticsPayloadV1 { - available: !hook_rows.is_empty() || message_count > 0, + available: !hook_rows.is_empty() || message_count.is_some_and(|count| count > 0), source: "session_messages_and_hook_analytics".to_owned(), message_count, event_count: 0, @@ -418,11 +442,10 @@ pub fn diagnostics_payload_from_parts( (Some(first), Some(last)) => last.saturating_sub(first).max(1), _ => 0, }; - let events_per_hour = if span_secs > 0 { - (events.len() as f64) * 3600.0 / span_secs as f64 - } else { - 0.0 - }; + // No event timestamps means no observed span, so there is no rate to + // report. `0.0` would claim a measured rate of zero. + let events_per_hour = + (span_secs > 0).then(|| (events.len() as f64) * 3600.0 / span_secs as f64); AnalyticsDiagnosticsPayloadV1 { available: true, @@ -435,7 +458,7 @@ pub fn diagnostics_payload_from_parts( hook_call_count, hook_sources: hook_analytics.sources.clone(), hook_readiness, - events_per_hour: Some(events_per_hour), + events_per_hour, ratios: diagnostics_ratios( message_count, events.len() as i64, @@ -476,7 +499,7 @@ pub fn diagnostics_payload_from_parts( } fn diagnostics_ratios( - message_count: i64, + message_count: Option, event_count: i64, tool_call_count: i64, mcp_tool_call_count: i64, @@ -490,12 +513,15 @@ fn diagnostics_ratios( } } -fn per_message(count: i64, message_count: i64) -> f64 { - if message_count <= 0 { - 0.0 - } else { - count as f64 / message_count as f64 - } +/// A count per session message, or `None` when the denominator is not a +/// positive measured count. +/// +/// An unmounted session authority leaves the message count unknown and a +/// mounted empty store measures zero; neither supports a rate, and reporting +/// `0.0` for them would state a measured rate nobody measured. +fn per_message(count: i64, message_count: Option) -> Option { + let message_count = message_count.filter(|count| *count > 0)?; + Some(count as f64 / message_count as f64) } fn increment_string_count(counts: &mut BTreeMap, key: &str) { @@ -858,10 +884,13 @@ fn normalize(value: &str) -> String { #[cfg(test)] mod tests { + use serde_json::{Value, json}; use tracedecay_contracts::{RequestCostReceiptV1, StorePointReadsV1}; use tracedecay_global_db::AnalyticsEventRecord; - use super::{HookAnalyticsRows, diagnostics_payload_from_parts}; + use super::{ + HookAnalyticsRows, aggregate_hook_completed_readiness, diagnostics_payload_from_parts, + }; fn mcp_call(id: i64, tool_name: &str, metadata_json: &str) -> AnalyticsEventRecord { AnalyticsEventRecord { @@ -892,7 +921,8 @@ mod tests { r#"{"duration_us":1500,"cost":{"wall_micros":1234,"point_reads":{"graph_sealed":21,"graph_staging":0},"adjacency_queries":1,"adjacency_rows":107,"bytes_hydrated":40960,"catalog_symbols":7}}"#, ), ]; - let payload = diagnostics_payload_from_parts(0, &HookAnalyticsRows::empty(), Some(&events)); + let payload = + diagnostics_payload_from_parts(Some(0), &HookAnalyticsRows::empty(), Some(&events)); assert_eq!( payload .recent_events @@ -918,4 +948,68 @@ mod tests { ] ); } + + #[test] + fn an_unmounted_session_authority_reports_no_message_count_and_no_rates() { + let events = [mcp_call(1, "tracedecay_search", "{}")]; + let payload = + diagnostics_payload_from_parts(None, &HookAnalyticsRows::empty(), Some(&events)); + + assert_eq!( + payload.message_count, None, + "an absent session-message authority is not a measured zero" + ); + assert_eq!(payload.ratios.events_per_message, None); + assert_eq!(payload.ratios.tool_calls_per_message, None); + assert_eq!(payload.ratios.mcp_tool_calls_per_message, None); + assert_eq!(payload.ratios.hook_calls_per_message, None); + + let encoded = serde_json::to_value(&payload).expect("payload encodes"); + assert_eq!(encoded["message_count"], Value::Null); + assert_eq!(encoded["ratios"]["tool_calls_per_message"], Value::Null); + } + + #[test] + fn a_measured_zero_message_store_serves_no_per_message_rate() { + let events = [mcp_call(1, "tracedecay_search", "{}")]; + let payload = + diagnostics_payload_from_parts(Some(0), &HookAnalyticsRows::empty(), Some(&events)); + + assert_eq!(payload.message_count, Some(0)); + assert_eq!( + payload.ratios.tool_calls_per_message, None, + "zero messages cannot denominate a rate; 0.0 would be a fabricated measurement" + ); + assert_eq!(payload.ratios.events_per_message, None); + } + + #[test] + fn a_measured_message_count_serves_real_rates() { + let events = [ + mcp_call(1, "tracedecay_search", "{}"), + mcp_call(2, "tracedecay_callees", "{}"), + ]; + let payload = + diagnostics_payload_from_parts(Some(4), &HookAnalyticsRows::empty(), Some(&events)); + + assert_eq!(payload.ratios.events_per_message, Some(0.5)); + assert_eq!(payload.ratios.tool_calls_per_message, Some(0.5)); + assert_eq!(payload.ratios.mcp_tool_calls_per_message, Some(0.5)); + } + + #[test] + fn an_unmounted_readiness_projection_does_not_count_completed_rows_as_skipped() { + let completed = json!({"event": "hook_completed", "agent": "claude"}); + let invoked = json!({"event": "hook_invoked", "agent": "claude"}); + let rows = vec![completed, invoked.clone(), invoked]; + + let readiness = aggregate_hook_completed_readiness(&rows); + + assert_eq!(readiness["collection_status"], "unavailable"); + assert_eq!(readiness["input_rows_received"], 3); + assert_eq!( + readiness["events_skipped_non_completed"], 2, + "only the non-hook_completed rows would have been skipped" + ); + } } diff --git a/crates/tracedecay-dashboard-api/src/analytics_api.rs b/crates/tracedecay-dashboard-api/src/analytics_api.rs index 0e82121b18..1cc50fa782 100644 --- a/crates/tracedecay-dashboard-api/src/analytics_api.rs +++ b/crates/tracedecay-dashboard-api/src/analytics_api.rs @@ -1368,9 +1368,12 @@ fn usage_count_rows(counts: BTreeMap<(String, String), i64>) -> Vec) -> Result { +/// +/// `None` when no session-message authority is mounted for this state: an +/// unmounted store cannot report a measured zero. +async fn session_message_count(db: Option<&RegisteredGlobalDb>) -> Result, String> { let Some(db) = db else { - return Ok(0); + return Ok(None); }; let connection = db.read_connection(); query_i64_result( @@ -1379,6 +1382,7 @@ async fn session_message_count(db: Option<&RegisteredGlobalDb>) -> Result { let project = context.scoped_project(scope)?; + // The readiness fold is composed by the crate that owns the hook + // contract; the application port reads it. Mount it here, in the + // one dispatch every diagnostics surface (CLI, MCP admin tool, + // daemon-served dashboard) passes through, so no surface serves + // readiness as permanently unavailable. + tracedecay_agent_hosts::hooks::install_hook_readiness_projection()?; AdminCliResultV1::AnalyticsDiagnostics( tracedecay_application::analytics_bridge::analytics_diagnostics_with_db( context.require_accounting_db()?, @@ -938,6 +944,63 @@ mod tests { ); } + /// The admin-CLI diagnostics action is the one dispatch the CLI, the MCP + /// admin tool, and the daemon-served dashboard all cross. It must mount the + /// hook readiness projection, or every one of those surfaces reports + /// readiness as permanently unavailable. + #[tokio::test] + async fn analytics_diagnostics_dispatch_mounts_the_hook_readiness_projection() { + let directory = tempfile::tempdir().unwrap(); + let profile = directory.path().join("profile"); + let (project, _runtime) = project_fixture( + &directory.path().join("project"), + &profile, + "project.readiness", + ) + .await; + let profile_database = project + .store_runtime_registry() + .profile_sessions() + .await + .unwrap(); + let context = AdminCliContext::projectless( + &profile_database, + Some(std::convert::AsRef::as_ref(&profile_database)), + &profile, + None, + None, + ); + + let result = dispatch_admin_cli( + context, + AdminCliSurfaceRequestV1::AnalyticsDiagnostics { + scope: AdminCliScopeV1::Profile, + all: true, + no_sync: true, + }, + ) + .await + .unwrap(); + + let AdminCliResultV1::AnalyticsDiagnostics(summary) = result else { + panic!("analytics diagnostics answered with another action's result"); + }; + let readiness = &summary["hook_readiness"]; + assert_eq!(readiness["source_event"], "hook_completed"); + assert_ne!( + readiness["collection_status"], "unavailable", + "the dispatch must mount the projection before folding readiness: {readiness}" + ); + assert!( + !readiness["unavailable_metrics"] + .as_array() + .is_some_and(|metrics| metrics + .iter() + .any(|metric| metric["metric"] == "hook_readiness")), + "the unmounted-projection blocker must be absent: {readiness}" + ); + } + /// The registry collection plan and the storage report cross the owner /// boundary as their typed results: the store crates' reports convert /// with every field, and serialize back to the same body. diff --git a/crates/tracedecay/src/dashboard.rs b/crates/tracedecay/src/dashboard.rs index cf5a5edea9..9d0e41324e 100644 --- a/crates/tracedecay/src/dashboard.rs +++ b/crates/tracedecay/src/dashboard.rs @@ -62,6 +62,10 @@ pub async fn run_until_shutdown_for_tests_with_host_admission( where F: std::future::Future + Send + 'static, { + // The readiness fold is composed by the crate that owns the hook contract; + // this entry point mounts it for a directly served dashboard, whose + // diagnostics route reads readiness through the application port. + tracedecay_agent_hosts::hooks::install_hook_readiness_projection()?; tracedecay_dashboard_api::run_until_shutdown_for_tests_with_host_admission( std::sync::Arc::new(tracedecay_project::dashboard::dashboard_project_context( &graph, diff --git a/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs index 2ad732ee3b..10c00eecc0 100644 --- a/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs @@ -1074,7 +1074,7 @@ pub(super) async fn compute_dashboard( ); Arc::new(adapter) as Arc }); - tracedecay_agent_hosts::hooks::install_dashboard_hook_readiness_projection()?; + tracedecay_agent_hosts::hooks::install_hook_readiness_projection()?; // One fetch covers the served bundle and the advertised build // version; both come from the registered product runtime. let product_runtime = tracedecay_project::product_runtime::product_runtime()?; diff --git a/crates/tracedecay/tests/dashboard_api_test/analytics.rs b/crates/tracedecay/tests/dashboard_api_test/analytics.rs index 0817550bdb..7e0d76330c 100644 --- a/crates/tracedecay/tests/dashboard_api_test/analytics.rs +++ b/crates/tracedecay/tests/dashboard_api_test/analytics.rs @@ -670,6 +670,18 @@ fn analytics_diagnostics_reports_tool_hook_and_prompt_rollups() { assert_eq!(diagnostics["hook_call_count"], 2); assert_eq!(diagnostics["ratios"]["mcp_tool_calls_per_message"], 0.25); assert_eq!(diagnostics["ratios"]["hook_calls_per_message"], 0.5); + // The readiness fold is mounted by the composition serving this route, + // so it answers over the served rows instead of reporting the + // projection itself as unmounted. + assert_eq!( + diagnostics["hook_readiness"]["collection_status"], "no_samples", + "seeded rows are hook_invoked only, so readiness has no completed samples" + ); + assert_eq!(diagnostics["hook_readiness"]["input_rows_received"], 2); + assert_eq!( + diagnostics["hook_readiness"]["events_skipped_non_completed"], + 2 + ); assert_eq!( find_row(&diagnostics["by_tool_category"], "tool_category", "mcp")["count"], diff --git a/dashboard/codegen/schemas/dashboard-contracts.schema.json b/dashboard/codegen/schemas/dashboard-contracts.schema.json index 7adeb5c46c..7600948e7b 100644 --- a/dashboard/codegen/schemas/dashboard-contracts.schema.json +++ b/dashboard/codegen/schemas/dashboard-contracts.schema.json @@ -475,8 +475,12 @@ "type": "integer" }, "message_count": { + "description": "Session messages in the counted window, or `None` when the\nsession-message authority was not mounted for this read. An absent\nauthority is not a measured zero.", "format": "int64", - "type": "integer" + "type": [ + "integer", + "null" + ] }, "ratios": { "$ref": "#/$defs/AnalyticsDiagnosticsRatiosV1" @@ -533,22 +537,35 @@ "type": "object" }, "AnalyticsDiagnosticsRatiosV1": { + "description": "Per-message rates over the diagnostics window.\n\nEvery member is nullable because a rate needs a denominator: when the\nsession-message authority is absent the message count is unknown, and when\nit is a known zero there is no per-message rate to state. Neither case is\n`0.0`, which would read as a measured rate of zero.", "properties": { "events_per_message": { "format": "double", - "type": "number" + "type": [ + "number", + "null" + ] }, "hook_calls_per_message": { "format": "double", - "type": "number" + "type": [ + "number", + "null" + ] }, "mcp_tool_calls_per_message": { "format": "double", - "type": "number" + "type": [ + "number", + "null" + ] }, "tool_calls_per_message": { "format": "double", - "type": "number" + "type": [ + "number", + "null" + ] } }, "required": [ diff --git a/dashboard/src/contracts/decoders.ts b/dashboard/src/contracts/decoders.ts index 2668c26c8f..d36c9054de 100644 --- a/dashboard/src/contracts/decoders.ts +++ b/dashboard/src/contracts/decoders.ts @@ -1171,7 +1171,7 @@ export const AnalyticsDiagnosticsPayloadV1Schema: z.ZodObject<{ hook_sources: z.ZodType, unknown>; hook_window: z.ZodType; mcp_tool_call_count: z.ZodType; - message_count: z.ZodType; + message_count: z.ZodType; ratios: z.ZodType; recent_events: z.ZodType, unknown>; recent_hooks: z.ZodType, unknown>; @@ -1195,7 +1195,7 @@ export const AnalyticsDiagnosticsPayloadV1Schema: z.ZodObject<{ hook_sources: z.array(z.unknown()), hook_window: z.lazy(() => AnalyticsHookWindowV1Schema), mcp_tool_call_count: z.number().int(), - message_count: z.number().int(), + message_count: z.number().int().nullable(), ratios: z.lazy(() => AnalyticsDiagnosticsRatiosV1Schema), recent_events: z.array(z.lazy(() => AnalyticsRecentEventV1Schema)), recent_hooks: z.array(z.lazy(() => AnalyticsRecentHookV1Schema)), @@ -1204,16 +1204,22 @@ export const AnalyticsDiagnosticsPayloadV1Schema: z.ZodObject<{ tracedecay_call_count: z.number().int(), }); +/** Per-message rates over the diagnostics window. + +Every member is nullable because a rate needs a denominator: when the +session-message authority is absent the message count is unknown, and when +it is a known zero there is no per-message rate to state. Neither case is +`0.0`, which would read as a measured rate of zero. */ export const AnalyticsDiagnosticsRatiosV1Schema: z.ZodObject<{ - events_per_message: z.ZodType; - hook_calls_per_message: z.ZodType; - mcp_tool_calls_per_message: z.ZodType; - tool_calls_per_message: z.ZodType; -}> = z.object({ - events_per_message: z.number(), - hook_calls_per_message: z.number(), - mcp_tool_calls_per_message: z.number(), - tool_calls_per_message: z.number(), + events_per_message: z.ZodType; + hook_calls_per_message: z.ZodType; + mcp_tool_calls_per_message: z.ZodType; + tool_calls_per_message: z.ZodType; +}> = z.object({ + events_per_message: z.number().nullable(), + hook_calls_per_message: z.number().nullable(), + mcp_tool_calls_per_message: z.number().nullable(), + tool_calls_per_message: z.number().nullable(), }); export const AnalyticsEventKindCountV1Schema: z.ZodObject<{ diff --git a/dashboard/src/contracts/types.ts b/dashboard/src/contracts/types.ts index eee070560a..259cae3221 100644 --- a/dashboard/src/contracts/types.ts +++ b/dashboard/src/contracts/types.ts @@ -125,7 +125,7 @@ export type AnalyticsDiagnosticsPayloadV1 = { hook_sources: Array; hook_window: AnalyticsHookWindowV1; mcp_tool_call_count: number; - message_count: number; + message_count: number | null; ratios: AnalyticsDiagnosticsRatiosV1; recent_events: Array; recent_hooks: Array; @@ -135,10 +135,10 @@ export type AnalyticsDiagnosticsPayloadV1 = { }; export type AnalyticsDiagnosticsRatiosV1 = { - events_per_message: number; - hook_calls_per_message: number; - mcp_tool_calls_per_message: number; - tool_calls_per_message: number; + events_per_message: number | null; + hook_calls_per_message: number | null; + mcp_tool_calls_per_message: number | null; + tool_calls_per_message: number | null; }; export type AnalyticsEventKindCountV1 = { diff --git a/dashboard/src/workspaces/agents/AgentToolActivity.dom.test.tsx b/dashboard/src/workspaces/agents/AgentToolActivity.dom.test.tsx index 25d30d4527..4f1e5a7aab 100644 --- a/dashboard/src/workspaces/agents/AgentToolActivity.dom.test.tsx +++ b/dashboard/src/workspaces/agents/AgentToolActivity.dom.test.tsx @@ -63,6 +63,17 @@ describe('AgentToolActivity', () => { expect(screen.queryByText('not through MCP')).toBeNull(); }); + it('states no per-message rate when the fold served none', () => { + render(); + + // A null rate is an absence, not a measured zero: the sentence must drop + // the clause entirely rather than print "0.00 per message". + const headline = document.querySelector('[data-agent-tool-activity="read"] > p')!; + expect(headline.textContent).toContain('1,000 tool calls in the window'); + expect(headline.textContent).not.toContain('per message'); + expect(headline.textContent).not.toContain('0.00'); + }); + it('reports a store that disagrees with itself rather than clamping the remainder', () => { render(); diff --git a/dashboard/src/workspaces/agents/AgentsPage.dom.test.tsx b/dashboard/src/workspaces/agents/AgentsPage.dom.test.tsx index 737b38177a..abd68ff63f 100644 --- a/dashboard/src/workspaces/agents/AgentsPage.dom.test.tsx +++ b/dashboard/src/workspaces/agents/AgentsPage.dom.test.tsx @@ -412,10 +412,10 @@ function diagnosticsPayload( hook_readiness: null, events_per_hour: null, ratios: { - events_per_message: 0, - hook_calls_per_message: 0, - mcp_tool_calls_per_message: 0, - tool_calls_per_message: 0, + events_per_message: null, + hook_calls_per_message: null, + mcp_tool_calls_per_message: null, + tool_calls_per_message: null, }, by_event_kind: [], by_tool: [], diff --git a/dashboard/src/workspaces/agents/authorityRegister.ts b/dashboard/src/workspaces/agents/authorityRegister.ts index 552f3ff29f..d7ae3c42ff 100644 --- a/dashboard/src/workspaces/agents/authorityRegister.ts +++ b/dashboard/src/workspaces/agents/authorityRegister.ts @@ -62,7 +62,10 @@ export function usageAuthority( return { ...base, kind: 'partial', - detail: `${payload.message_count.toLocaleString()} messages · event count not served`, + detail: + payload.message_count == null + ? 'session-message authority not mounted · event count not served' + : `${payload.message_count.toLocaleString()} messages · event count not served`, source: payload.source, }; } diff --git a/dashboard/src/workspaces/observatory/ObservatoryV2.dom.test.tsx b/dashboard/src/workspaces/observatory/ObservatoryV2.dom.test.tsx index b978c3b882..b3583f1f30 100644 --- a/dashboard/src/workspaces/observatory/ObservatoryV2.dom.test.tsx +++ b/dashboard/src/workspaces/observatory/ObservatoryV2.dom.test.tsx @@ -176,11 +176,13 @@ function diagnosticsModel() { }, mcp_tool_call_count: 0, message_count: 0, + // A measured zero-message store cannot denominate a rate, so the daemon + // serves nulls here rather than 0.0. ratios: { - events_per_message: 0, - hook_calls_per_message: 0, - mcp_tool_calls_per_message: 0, - tool_calls_per_message: 0, + events_per_message: null, + hook_calls_per_message: null, + mcp_tool_calls_per_message: null, + tool_calls_per_message: null, }, recent_events: [], recent_hooks: [], From 715c7bb91bd1032bdebfd8d9cbc91c41f1f69225 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:18:10 -0800 Subject: [PATCH 11/63] fix(storage): avoid POSIX lock loss in daemon size reports Refs #4513 and #4099. Daemon-backed storage reports opened and closed a raw SQLite database descriptor to inspect its free-page header. On Unix, that close can release process-wide record locks of live SQLite writers. Skip raw header reads in the Unix daemon path, retaining size information and representing free pages as unavailable instead of zero. Preserve the separate-process offline CLI and Windows measurements. Test the registered-store report while a transaction holds a lock: an independent SQLite process must remain excluded before and after it, and the committed database must pass integrity_check. --- .../src/retention/storage_report.rs | 127 ++++++++++++++++-- 1 file changed, 118 insertions(+), 9 deletions(-) diff --git a/crates/tracedecay-maintenance/src/retention/storage_report.rs b/crates/tracedecay-maintenance/src/retention/storage_report.rs index 5294c67ecd..34e7f8ec91 100644 --- a/crates/tracedecay-maintenance/src/retention/storage_report.rs +++ b/crates/tracedecay-maintenance/src/retention/storage_report.rs @@ -88,8 +88,9 @@ pub struct StoreSizeReportEntry { pub unavailable_entry_count: usize, /// Whether the store walk was complete, partial, or unavailable. pub size_coverage: StorageReportSizeCoverageV1, - /// Reclaimable free-page bytes of the graph database, or `None` when it - /// could not be sampled without waiting on a live writer. + /// Reclaimable free-page bytes, or `None` when unmeasured. A live Unix + /// daemon cannot open and close a second raw descriptor of its SQLite + /// database without risking process-wide POSIX lock loss. pub free_bytes: Option, /// Free pages as a fraction of total pages, or `None` when unsampled. pub free_page_ratio: Option, @@ -760,6 +761,7 @@ fn sample_registered_storage( &mut stores, &mut code_generation_retention, &mut code_generation_retention_availability, + true, // The offline CLI is a separate process from the live daemon. remaining_entries, walk_control, )?; @@ -1029,6 +1031,7 @@ async fn project_storage_report_page( &mut report.stores, &mut report.code_generation_retention, &mut report.code_generation_retention_availability, + cfg!(not(unix)), // Avoid raw descriptor closes on live POSIX SQLite stores. &mut remaining_entries, &walk_control, )?; @@ -1223,6 +1226,7 @@ fn build_project_storage_report_with_control( &mut stores, &mut code_generation_retention, &mut code_generation_retention_availability, + true, // This direct report is used by the separate offline CLI. &mut remaining_entries, walk_control, )?; @@ -1267,6 +1271,7 @@ fn append_project_report( stores: &mut Vec, code_generation_retention: &mut Vec, code_generation_retention_availability: &mut Vec, + sample_free_page_header: bool, remaining_entries: &mut usize, walk_control: &StorageReportWalkControl, ) -> tracedecay_domain::errors::Result<()> { @@ -1327,7 +1332,10 @@ fn append_project_report( (true, Err(_)) => {} } let total_bytes = kinds.total(); - let (free_bytes, free_page_ratio) = if project_chain_is_nofollow { + // File::open + close on Unix may release an unrelated SQLite connection's + // process-wide record locks. In-process daemon reports do not inspect + // these header bytes; unknown is safer than a fabricated zero. + let (free_bytes, free_page_ratio) = if project_chain_is_nofollow && sample_free_page_header { sample_free_pages(&data_root.join(tracedecay_runtime_core::config::DB_FILENAME)) .map_or((None, None), |(free_bytes, ratio)| { (Some(free_bytes), Some(ratio)) @@ -1527,12 +1535,11 @@ fn sqlite_family_member(database_path: &Path, suffix: &str) -> PathBuf { } } -/// Reads the free pages from the database file header with a plain file -/// read. Opening a SQLite connection on a live store would make the report a -/// reader the writer's checkpoint has to wait for; the header takes no lock -/// and no WAL read slot. It reflects the last checkpoint, which is precise -/// enough for a size report. `None` for a file that is not a SQLite database -/// or whose header counts are stale. +/// Reads the free-page header for a separate-process offline report. +/// Although this takes no SQLite read slot, opening and closing a raw file +/// descriptor in a process with live SQLite connections can silently drop +/// their Unix POSIX locks. Daemon-backed Unix reports must not call this. +/// The header reflects the last checkpoint; `None` means unmeasured. fn sample_free_pages(graph_db_path: &Path) -> Option<(u64, f64)> { if !std::fs::symlink_metadata(graph_db_path) .is_ok_and(|metadata| metadata.file_type().is_file()) @@ -1889,6 +1896,108 @@ mod tests { .unwrap(); } + #[cfg(unix)] + #[test] + fn storage_report_external_writer_probe() { + let Some(path) = std::env::var_os("TRACEDECAY_STORAGE_REPORT_PROBE_DB") else { + return; + }; + let connection = rusqlite::Connection::open(PathBuf::from(path)).unwrap(); + connection.busy_timeout(std::time::Duration::ZERO).unwrap(); + let result = connection.execute_batch("BEGIN IMMEDIATE; ROLLBACK;"); + assert!( + matches!( + &result, + Err(rusqlite::Error::SqliteFailure(error, _)) + if error.code == rusqlite::ErrorCode::DatabaseBusy + ), + "external writer must see SQLITE_BUSY: {result:?}" + ); + println!("storage-report-verified-external-blocker"); + } + + #[cfg(unix)] + fn assert_external_writer_blocked(path: &Path) { + let (_, module) = module_path!().split_once("::").unwrap(); + let output = std::process::Command::new(std::env::current_exe().unwrap()) + .args([ + "--exact", + &format!("{module}::storage_report_external_writer_probe"), + "--nocapture", + ]) + .env("TRACEDECAY_STORAGE_REPORT_PROBE_DB", path) + .output() + .unwrap(); + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!( + output.status.success() + && stdout.contains("storage-report-verified-external-blocker"), + "external probe failed or selected no tests: {}\n{stdout}\n{stderr}", + output.status + ); + } + + #[cfg(unix)] + #[asupersync::test] + async fn daemon_storage_report_keeps_independent_writer_excluded() { + let tmp = tempfile::TempDir::new().unwrap(); + let profile_root = tmp.path(); + let runtime = tracedecay_global_db::tests::harness::RegisteredGlobalDbTestRuntime::profile( + profile_root, + ) + .await + .unwrap(); + let db = runtime.profile_database_arc(); + let checkout = profile_root.join("checkout"); + std::fs::create_dir_all(&checkout).unwrap(); + let project = db + .upsert_code_project("proj_lock_probe", &checkout, None, None, None) + .await + .unwrap(); + seed_graph_db(profile_root, &project.project_id); + let db_path = profile_root + .join("projects") + .join(&project.project_id) + .join(tracedecay_runtime_core::config::DB_FILENAME); + let writer = rusqlite::Connection::open(&db_path).unwrap(); + writer + .execute_batch( + "PRAGMA journal_mode = DELETE; + BEGIN IMMEDIATE; + INSERT INTO fixture VALUES (1);", + ) + .unwrap(); + let probe = db_path.clone(); + native_runtime::spawn_blocking(move || assert_external_writer_blocked(&probe)) + .await + .unwrap(); + + let page = build_storage_report_page_from_registered_global_db( + profile_root, + &db, + None, + None, + 4, + ) + .await + .unwrap(); + assert_eq!(page.stores.len(), 1); + assert!(page.stores[0].total_bytes > 0); + assert_eq!(page.stores[0].free_bytes, None); + assert_eq!(page.stores[0].free_page_ratio, None); + + let probe = db_path.clone(); + native_runtime::spawn_blocking(move || assert_external_writer_blocked(&probe)) + .await + .unwrap(); + writer.execute_batch("COMMIT").unwrap(); + let integrity: String = writer + .query_row("PRAGMA integrity_check", [], |row| row.get(0)) + .unwrap(); + assert_eq!(integrity, "ok"); + } + /// Inventory positions survive directory mutation without repeating records. #[test] fn project_directory_pages_cover_every_entry_within_a_bounded_pass() { From 4b95aa639cac272e9f23c6e8ebd731e94ae9a3ee Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:23:58 -0800 Subject: [PATCH 12/63] fix(storage): preserve daemon locks in project reports Route project-scoped daemon reports through the same no-raw-descriptor policy as paginated daemon reports on Unix. Keep offline header sampling unchanged. Verify an independent rollback writer stays excluded through both live report entry points, with free-page metrics truthfully unknown. --- .../src/retention/storage_report.rs | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay-maintenance/src/retention/storage_report.rs b/crates/tracedecay-maintenance/src/retention/storage_report.rs index 34e7f8ec91..0cbf3466fc 100644 --- a/crates/tracedecay-maintenance/src/retention/storage_report.rs +++ b/crates/tracedecay-maintenance/src/retention/storage_report.rs @@ -1157,6 +1157,7 @@ pub async fn build_project_storage_report_from_daemon( &project_id, &canonical_root, protection, + cfg!(not(unix)), // The daemon may hold POSIX locks on this database. &walk_control, ) }) @@ -1198,6 +1199,7 @@ pub fn build_project_storage_report( project_id, canonical_root, vector_readable_sources, + true, // Only the daemon-independent offline path may sample the header. &StorageReportWalkControl::default(), ) } @@ -1207,6 +1209,7 @@ fn build_project_storage_report_with_control( project_id: &str, canonical_root: &Path, vector_readable_sources: RetentionProtection, + sample_free_page_header: bool, walk_control: &StorageReportWalkControl, ) -> tracedecay_domain::errors::Result { tracedecay_runtime_core::storage::validate_project_id(project_id).map_err(|message| { @@ -1226,7 +1229,7 @@ fn build_project_storage_report_with_control( &mut stores, &mut code_generation_retention, &mut code_generation_retention_availability, - true, // This direct report is used by the separate offline CLI. + sample_free_page_header, &mut remaining_entries, walk_control, )?; @@ -1987,6 +1990,24 @@ mod tests { assert_eq!(page.stores[0].free_bytes, None); assert_eq!(page.stores[0].free_page_ratio, None); + // The project-scoped admin route shares this builder with the offline + // CLI. It must use the daemon policy, not open and close a second FD. + let project_report = build_project_storage_report_from_daemon( + profile_root, + &project.project_id, + &checkout, + &db, + None, + None, + None, + ) + .await + .unwrap(); + assert_eq!(project_report.stores.len(), 1); + assert!(project_report.stores[0].total_bytes > 0); + assert_eq!(project_report.stores[0].free_bytes, None); + assert_eq!(project_report.stores[0].free_page_ratio, None); + let probe = db_path.clone(); native_runtime::spawn_blocking(move || assert_external_writer_blocked(&probe)) .await From 13959bc85dedb7f4587c659039e762201e37b5fa Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:25:14 -0800 Subject: [PATCH 13/63] style(sqlite): apply Bazel rustfmt to shared-pin cleanup Correct the exact repository-gates formatting diff on the current SQLite lock-lifetime repair without changing its behavior or tests. --- .../tracedecay-rusqlite-runtime/src/repository/attachment.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs index a7444620c1..e620e19198 100644 --- a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs +++ b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs @@ -461,7 +461,9 @@ impl RepositoryRuntimePhysicalAttachment { } state.lost_readers = None; state.lost_writer = None; - if state.file_lost && let Some(pin) = state.retained_file_pin.take() { + if state.file_lost + && let Some(pin) = state.retained_file_pin.take() + { // Both worker groups have exited. Clear the shared descriptor, // not just this handle: a caller may still retain a closed pool. pin.release_after_workers_exit(); From 284e84ffb2c07fbb8697d34e13daffefdd9e4e9a Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:52:05 -0800 Subject: [PATCH 14/63] fix(hints): match repository discovery on whole words --- .../src/intent_action_facts.rs | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/crates/tracedecay-policy/src/intent_action_facts.rs b/crates/tracedecay-policy/src/intent_action_facts.rs index fa1481620e..b30654fb6e 100644 --- a/crates/tracedecay-policy/src/intent_action_facts.rs +++ b/crates/tracedecay-policy/src/intent_action_facts.rs @@ -895,9 +895,15 @@ pub fn mentions_external_project_scope(text: &str) -> bool { } pub fn asks_for_repo_discovery(text: &str) -> bool { + // Match whole words so reports/findings and relocated files do not spend + // a session's repository-discovery hint budget. + let mut words = text.split(|character: char| !character.is_alphanumeric() && character != '_'); + let has_repository = words + .clone() + .any(|word| matches!(word, "repo" | "repos" | "repository" | "repositories")); !mentions_current_project_scope(text) - && contains_any(text, &[" repo", " repository"]) - && contains_any(text, &["find", "locate", "where", "which"]) + && has_repository + && words.any(|word| matches!(word, "find" | "locate" | "where" | "which")) } pub fn mentions_current_project_scope(text: &str) -> bool { @@ -1154,6 +1160,30 @@ pub fn matches_normalized(value: &str, expected: &[&str]) -> bool { #[cfg(test)] mod tests { + #[test] + fn repository_discovery_requires_whole_nouns_and_verbs() { + for prompt in [ + "their children keep reporting findings", + "find the report-script", + "No repository files were touched; relocatedtext", + "the repository allocated memory", + "repository files are somewhere else", + ] { + assert!(!super::asks_for_repo_discovery(prompt), "{prompt}"); + } + for prompt in [ + "find the orchestrator repo", + "where are the repositories?", + "repo: which one owns the scheduler?", + "locate sibling repos", + ] { + assert!(super::asks_for_repo_discovery(prompt), "{prompt}"); + } + assert!(!super::asks_for_repo_discovery( + "find the module in this repo" + )); + } + use super::*; fn input<'a>( From 7784423279a8dd9f3f48531b775abedab7b95709 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:58:39 -0800 Subject: [PATCH 15/63] style(scout): format tool provenance regression Apply the exact rustfmt delta reported by Repository gates job 127025791417 in CI run 41960601791. Preserve all assertions and production behavior. --- .../src/agents/context_scout/session_window.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs index 11f6c99fd2..110396d7b3 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs @@ -902,9 +902,8 @@ mod tests { seed.message(record).await; } let mut assistant = record(PROVIDER, SESSION, 2, "assistant", "real tool"); - assistant.metadata_json = Some( - json!({"tool_events": [{"type": "tool_use", "tool_name": "Grep"}]}).to_string(), - ); + assistant.metadata_json = + Some(json!({"tool_events": [{"type": "tool_use", "tool_name": "Grep"}]}).to_string()); seed.message(assistant).await; let window = ready(read_session_window(seed.db(), &request(limits())).await); From 8e4c45184e8e77fae33136c43ac879728f600961 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:14:02 -0800 Subject: [PATCH 16/63] fix(scout): validate choice distributions and picked labels Refs #4535. The decoder already requires an exact option map but still accepts probabilities that do not sum to one, or a chosen label that is not the most probable. Validate the declared SystemOne choice contract with a small decimal-rounding tolerance. Preserve explicit none choices, optional picks, and typed failure outcomes. Exercise malformed and rounded-success responses through the real HTTP decision client. The broader Kev evaluation and routing decision remain outstanding. --- .../agents/context_scout/decision_engine.rs | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs index a50b178cac..961d799eb2 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs @@ -36,6 +36,10 @@ const SYSTEMONE_PATH: &str = "/v1/systemone"; /// Tolerance when checking a `score` against the rubric's last level index. const SCORE_EPSILON: f64 = 1e-6; +/// Decision servers return a probability distribution, not independent scores. +/// Allow a small rounding error when servers serialize decimal probabilities. +const CHOICE_PROBABILITY_EPSILON: f64 = 1e-3; + /// What one question asks. #[derive(Debug, Clone, PartialEq, Eq)] pub enum DecisionQuestionKindV1 { @@ -473,6 +477,15 @@ fn parse_answer( return None; } } + if let Some(chosen) = &chosen { + let selected_probability = *probabilities.get(chosen)?; + if probabilities + .values() + .any(|probability| *probability > selected_probability + CHOICE_PROBABILITY_EPSILON) + { + return None; + } + } Some(DecisionAnswerV1::Choice { chosen, probabilities, @@ -504,6 +517,12 @@ fn choice_probabilities( for label in options { probabilities.insert(label.clone(), unit_interval(reported.get(label)?)?); } + // A map containing every label is still malformed if it is not a + // distribution. In particular, two individually valid 0.8 scores are + // not a valid two-way choice. + if (probabilities.values().sum::() - 1.0).abs() > CHOICE_PROBABILITY_EPSILON { + return None; + } Some(probabilities) } @@ -832,6 +851,10 @@ mod tests { json!({"options": {"code": 0.7, "other": 0.3}}), json!({"probs": {"code": 0.7, "memory": 0.3, "other": 0.0}}), json!({"probs": {"code": "0.7", "memory": 0.3}}), + json!({"choice": "code", "probs": {"code": 0.8, "memory": 0.8}}), + json!({"choice": "code", "probs": {"code": 0.1, "memory": 0.9}}), + json!({"probs": {"code": 0.0, "memory": 0.0}}), + json!({"probs": {"code": 0.4, "memory": 0.4}}), ]; for answer in cases { let body = json!({"answers": {"route": answer}}).to_string(); @@ -920,6 +943,37 @@ mod tests { ); } + #[test] + fn rounded_choice_distribution_is_accepted_without_exact_float_equality() { + let body = answers_body( + None, + &[( + "route", + choice_answer( + None, + "probabilities", + &[("code", 0.3333), ("memory", 0.3333), ("none", 0.3333)], + ), + )], + ); + let server = fake_decision_engine(200, &body, Duration::ZERO); + let answers = answered(client(&server.url).ask_blocking(&request( + "state", + vec![choice("route", &["code", "memory", "none"])], + ))); + assert_eq!( + answers.answers["route"], + DecisionAnswerV1::Choice { + chosen: None, + probabilities: BTreeMap::from([ + ("code".to_owned(), 0.3333), + ("memory".to_owned(), 0.3333), + ("none".to_owned(), 0.3333), + ]), + } + ); + } + #[test] fn a_score_answer_is_read_as_a_level_position() { let body = answers_body(None, &[("urgency", score_answer(1.4))]); From 3c959b04bc4d7380f9166c5d28c98bc32a80586c Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:15:48 -0800 Subject: [PATCH 17/63] style(scout): keep choice validation within rustfmt width Shorten the shared probability-tolerance name to avoid wrapping the selected-label guard; preserve the checks and all regression cases. --- .../src/agents/context_scout/decision_engine.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs index 961d799eb2..c70f5643aa 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs @@ -38,7 +38,7 @@ const SCORE_EPSILON: f64 = 1e-6; /// Decision servers return a probability distribution, not independent scores. /// Allow a small rounding error when servers serialize decimal probabilities. -const CHOICE_PROBABILITY_EPSILON: f64 = 1e-3; +const CHOICE_EPSILON: f64 = 1e-3; /// What one question asks. #[derive(Debug, Clone, PartialEq, Eq)] @@ -481,7 +481,7 @@ fn parse_answer( let selected_probability = *probabilities.get(chosen)?; if probabilities .values() - .any(|probability| *probability > selected_probability + CHOICE_PROBABILITY_EPSILON) + .any(|probability| *probability > selected_probability + CHOICE_EPSILON) { return None; } @@ -520,7 +520,7 @@ fn choice_probabilities( // A map containing every label is still malformed if it is not a // distribution. In particular, two individually valid 0.8 scores are // not a valid two-way choice. - if (probabilities.values().sum::() - 1.0).abs() > CHOICE_PROBABILITY_EPSILON { + if (probabilities.values().sum::() - 1.0).abs() > CHOICE_EPSILON { return None; } Some(probabilities) From 7795764412cbc77a14749726fbd19d99f8039971 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:37:27 -0800 Subject: [PATCH 18/63] style(storage): match native Rustfmt on daemon lock regression Apply the exact two formatting changes required by the current-head repository-gates log without altering the independently verified SQLite writer-exclusion regression. --- .../src/retention/storage_report.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/tracedecay-maintenance/src/retention/storage_report.rs b/crates/tracedecay-maintenance/src/retention/storage_report.rs index 0cbf3466fc..c7d81e4f5b 100644 --- a/crates/tracedecay-maintenance/src/retention/storage_report.rs +++ b/crates/tracedecay-maintenance/src/retention/storage_report.rs @@ -1934,8 +1934,7 @@ mod tests { let stdout = String::from_utf8_lossy(&output.stdout); let stderr = String::from_utf8_lossy(&output.stderr); assert!( - output.status.success() - && stdout.contains("storage-report-verified-external-blocker"), + output.status.success() && stdout.contains("storage-report-verified-external-blocker"), "external probe failed or selected no tests: {}\n{stdout}\n{stderr}", output.status ); @@ -1976,15 +1975,10 @@ mod tests { .await .unwrap(); - let page = build_storage_report_page_from_registered_global_db( - profile_root, - &db, - None, - None, - 4, - ) - .await - .unwrap(); + let page = + build_storage_report_page_from_registered_global_db(profile_root, &db, None, None, 4) + .await + .unwrap(); assert_eq!(page.stores.len(), 1); assert!(page.stores[0].total_bytes > 0); assert_eq!(page.stores[0].free_bytes, None); From 6f60e58b4080b552c59b8da20281048d4cb1dd7c Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:37:30 -0800 Subject: [PATCH 19/63] fix(evals): preserve recorded runs instead of inventing hybrid costs Refs #4535. Remove the automatic cross-run hybrid and its invented 680 ms latency surcharge. Do not replace a recorded hybrid's labels, probabilities, usage, or latency. Reject duplicate configuration files before replacing a summary rather than silently choosing a filename. Add CLI regressions for matching and disjoint arm datasets, preservation of actual hybrid measurements and input files, and duplicate refusal. All 16 standalone Python checks pass on hash-verified source copies; the new cases fail against the original scorer. Bazel CI is outstanding. --- evals/intent_engine/score.py | 16 +++---- evals/intent_engine/test_score.py | 75 +++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 10 deletions(-) diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index bd70706212..3eb57e2661 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -153,16 +153,12 @@ def ch(rs): fixed = json.load(open(os.path.join(here, "fixed_thresholds.json"))) if os.path.exists(os.path.join(here, "fixed_thresholds.json")) else None summary = {}; allres = {} for f in sorted(glob.glob(os.path.join(here, "results", "*.json"))): - res = json.load(open(f)); allres[res["config"]] = res - if "B_noul_text" in allres and "C_choice_text" in allres: - # derived: noul probs for session_recall/memory_store, choice probs for the rest (two calls: 2 noul rows + 1 choice row) - b = {r["id"]: r for r in allres["B_noul_text"]["rows"]} - rows = [] - for r in allres["C_choice_text"]["rows"]: - p = dict(r["probs"]); p["session_recall"] = b[r["id"]]["probs"]["session_recall"]; p["memory_store"] = b[r["id"]]["probs"]["memory_store"] - rows.append({**r, "probs": p, "ms": r["ms"] + 2 * 340}) - rows[-1].pop("choice") - allres["H_hybrid_text"] = {"config": "H_hybrid_text", "rows": rows} + res = json.load(open(f)) + if res["config"] in allres: + raise ValueError("duplicate configuration %r in result files" % res["config"]) + allres[res["config"]] = res + # Score recorded runs only. Combining independently measured arms cannot + # establish hybrid latency or usage, and must never replace an actual run. for k, res in allres.items(): summary[k] = score_config(res, fixed) json.dump(summary, open(os.path.join(here, "summary.json"), "w"), indent=1) diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index b24b0b3d0d..71b305ed94 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -207,6 +207,81 @@ def test_invalid_usage_is_not_silently_discarded_as_missing(self): with self.assertRaisesRegex(ValueError, field): score.lat([{**row("invalid"), field: value}]) + def test_cli_does_not_invent_an_unmeasured_hybrid_arm(self): + for same_cases in (True, False): + with self.subTest(same_cases=same_cases), tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + results = root / "results" + results.mkdir() + configurations = { + "B_noul_text": {"config": "B_noul_text", "rows": [row("a")]}, + "C_choice_text": { + "config": "C_choice_text", + "rows": [row("a" if same_cases else "b", choice="none")], + }, + } + for name, result in configurations.items(): + (results / f"{name}.json").write_text(json.dumps(result), encoding="utf-8") + scored = self.run_script(root, "score.py") + self.assertEqual(scored.returncode, 0, scored.stderr) + summary = json.loads((root / "summary.json").read_text(encoding="utf-8")) + self.assertEqual(set(summary), set(configurations)) + for name, result in configurations.items(): + self.assertEqual(summary[name], score.score_config(result)) + self.assertNotIn("H_hybrid_text", scored.stdout) + + def test_cli_preserves_a_recorded_hybrid_instead_of_replacing_its_measurements(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + results = root / "results" + results.mkdir() + hybrid = { + "config": "H_hybrid_text", + "experiment": {"version": 2}, + "rows": [{ + **row("a", [score.CATS[0]], True), "ms": 17, + "input_tokens": 151, "state_tokens": 93, "dropped": 4, + }], + } + configurations = [ + {"config": "B_noul_text", "rows": [row("a")]}, + {"config": "C_choice_text", "rows": [row("a", choice="none")]}, + hybrid, + ] + for result in configurations: + (results / f"{result['config']}.json").write_text( + json.dumps(result), encoding="utf-8", + ) + original_inputs = {path: path.read_bytes() for path in results.iterdir()} + scored = self.run_script(root, "score.py") + self.assertEqual(scored.returncode, 0, scored.stderr) + summary = json.loads((root / "summary.json").read_text(encoding="utf-8")) + self.assertEqual(summary["H_hybrid_text"], score.score_config(hybrid)) + self.assertEqual({path: path.read_bytes() for path in results.iterdir()}, original_inputs) + compared = self.run_script(root, "compare.py", "H_hybrid_text") + self.assertEqual(compared.returncode, 0, compared.stderr) + self.assertIn("| median ms / call | 17 |", compared.stdout) + + def test_duplicate_configuration_files_are_refused_before_summary_replacement(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + results = root / "results" + results.mkdir() + for name, ms in [("first", 10), ("second", 900)]: + (results / f"{name}.json").write_text(json.dumps({ + "config": "same", "rows": [{**row(name), "ms": ms}], + }), encoding="utf-8") + summary = root / "summary.json" + summary.write_bytes(b"existing summary\n") + scored = self.run_script(root, "score.py") + self.assertNotEqual(scored.returncode, 0) + self.assertIn("duplicate configuration", scored.stderr) + self.assertIn("same", scored.stderr) + self.assertEqual(summary.read_bytes(), b"existing summary\n") + @staticmethod def stage_scripts(root): for name in ("score.py", "compare.py", "common.py"): From 696df68bec12ff598e859e0d0e1fca27d277b22e Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:44:59 -0800 Subject: [PATCH 20/63] fix(scout): reject explicitly malformed answer type tags Refs #4535. An explicit null, boolean, number, object or array type tag was erased by and_then(as_str), bypassing the answer-kind checks as if the tag had been omitted. Preserve omitted-tag compatibility but reject malformed declared tags before decoding any question kind. Cover Noul, Choice and Score through the real loopback HTTP client with valid omitted tags and all five non-string JSON shapes. Preserve the existing probability, alias, range and mismatch checks. Independently source-reviewed; Rust/Bazel execution requires hosted CI. --- .../agents/context_scout/decision_engine.rs | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs index c70f5643aa..bd4df2f775 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs @@ -444,7 +444,12 @@ fn parse_answer( answer: &Map, kind: &DecisionQuestionKindV1, ) -> Option { - let declared = answer.get("type").and_then(Value::as_str); + // An omitted tag is supported, but a malformed explicit tag must not + // disappear into the same optional state and bypass kind validation. + let declared = match answer.get("type") { + None => None, + Some(declared) => Some(declared.as_str()?), + }; match kind { DecisionQuestionKindV1::Noul => { if declared.is_some_and(|declared| declared != "noul") { @@ -1135,6 +1140,44 @@ mod tests { } } + #[test] + fn explicit_answer_types_must_not_be_treated_as_omitted_when_malformed() { + for (question, answer) in [ + (noul("q"), json!({"noul": 0.5})), + ( + choice("q", &["code", "memory"]), + json!({"probs": {"code": 0.7, "memory": 0.3}}), + ), + (score("q", &["low", "high"]), json!({"score": 0.5})), + ] { + // A genuinely omitted tag remains compatible for every kind. + let body = json!({"answers": {"q": &answer}}).to_string(); + let server = fake_decision_engine(200, &body, Duration::ZERO); + let result = answered( + client(&server.url).ask_blocking(&request("state", vec![question.clone()])), + ); + assert_eq!(result.answers.len(), 1); + + for declared in [ + Value::Null, + json!(false), + json!(1), + json!(["noul"]), + json!({"type": "noul"}), + ] { + let mut malformed = answer.clone(); + malformed["type"] = declared; + let body = json!({"answers": {"q": malformed}}).to_string(); + let server = fake_decision_engine(200, &body, Duration::ZERO); + assert_eq!( + client(&server.url).ask_blocking(&request("state", vec![question.clone()])), + DecisionEngineOutcomeV1::Malformed, + "{body}" + ); + } + } + } + #[test] fn choice_and_score_answers_out_of_range_are_malformed() { let choice_cases = [ From ad525ff9449c69c7f1aa47eb54ccca5a258bd9bd Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:49:18 -0800 Subject: [PATCH 21/63] fix(scout): accept bounded rounding across choice options --- .../agents/context_scout/decision_engine.rs | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs index bd4df2f775..6277c6976a 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs @@ -525,7 +525,11 @@ fn choice_probabilities( // A map containing every label is still malformed if it is not a // distribution. In particular, two individually valid 0.8 scores are // not a valid two-way choice. - if (probabilities.values().sum::() - 1.0).abs() > CHOICE_EPSILON { + // A three-decimal response can deviate by up to 0.0005 per option. + // Scale the sum tolerance with cardinality, but cap it at one percent + // so a large choice set cannot excuse a genuinely unnormalized answer. + let rounding_tolerance = (CHOICE_EPSILON * probabilities.len() as f64 / 2.0).min(0.01); + if (probabilities.values().sum::() - 1.0).abs() > rounding_tolerance { return None; } Some(probabilities) @@ -979,6 +983,53 @@ mod tests { ); } + #[test] + fn six_way_choice_accepts_decimal_rounding_but_not_invalid_totals() { + for (probability, valid) in [(0.167, true), (0.166, false), (0.17, false)] { + let body = answers_body( + None, + &[( + "route", + choice_answer( + None, + "probabilities", + &[ + ("a", probability), + ("b", probability), + ("c", probability), + ("d", probability), + ("e", probability), + ("f", probability), + ], + ), + )], + ); + let server = fake_decision_engine(200, &body, Duration::ZERO); + let result = client(&server.url).ask_blocking(&request( + "state", + vec![choice("route", &["a", "b", "c", "d", "e", "f"])], + )); + if valid { + assert_eq!( + answered(result).answers["route"], + DecisionAnswerV1::Choice { + chosen: None, + probabilities: BTreeMap::from([ + ("a".to_owned(), probability), + ("b".to_owned(), probability), + ("c".to_owned(), probability), + ("d".to_owned(), probability), + ("e".to_owned(), probability), + ("f".to_owned(), probability), + ]), + } + ); + } else { + assert_eq!(result, DecisionEngineOutcomeV1::Malformed, "{body}"); + } + } + } + #[test] fn a_score_answer_is_read_as_a_level_position() { let body = answers_body(None, &[("urgency", score_answer(1.4))]); From 8cd33915f984d2edf3c7ed2cee533787488325f8 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:53:23 -0800 Subject: [PATCH 22/63] perf(sessions): amortize Codex admission gate cleanup --- .../src/runtime/hosts/codex/observation.rs | 102 +++++++++++++++--- 1 file changed, 87 insertions(+), 15 deletions(-) diff --git a/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs b/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs index 734bf6a0c8..be89d33736 100644 --- a/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs +++ b/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs @@ -655,24 +655,50 @@ async fn shared_session_meta_with_provenance( /// The gate is per process. Cross-process writers still meet at the store's /// own transaction, which is what the replay verification is there for. type CodexAdmissionGate = Arc>; -type CodexAdmissionGates = - Mutex>>>; +type CodexAdmissionGateKey = (ObservationScopeV1, PathBuf); +const MIN_CODEX_ADMISSION_GATE_SWEEP_INTERVAL: usize = 128; -static CODEX_ADMISSION_GATES: OnceLock = OnceLock::new(); +#[derive(Default)] +struct CodexAdmissionGates { + by_source: HashMap>>, + new_gates_since_sweep: usize, + sweep_after: usize, +} + +impl CodexAdmissionGates { + fn gate_for(&mut self, key: CodexAdmissionGateKey) -> CodexAdmissionGate { + // Keep the exact live gate for this source: hook and catch-up admission + // must still serialize the cursor read with its subsequent write. + if let Some(gate) = self.by_source.get(&key).and_then(Weak::upgrade) { + return gate; + } + // A per-rollout full-map retain makes concurrent catch-up contend on + // this process-global mutex for every new source. Sweep only after a + // number of new gates proportional to the last retained live set. + if self.new_gates_since_sweep + >= self + .sweep_after + .max(MIN_CODEX_ADMISSION_GATE_SWEEP_INTERVAL) + { + self.by_source.retain(|_, gate| gate.strong_count() > 0); + self.sweep_after = self.by_source.len(); + self.new_gates_since_sweep = 0; + } + let gate = CodexAdmissionGate::new(tokio::sync::Mutex::new(())); + self.by_source.insert(key, Arc::downgrade(&gate)); + self.new_gates_since_sweep = self.new_gates_since_sweep.saturating_add(1); + gate + } +} + +static CODEX_ADMISSION_GATES: OnceLock> = OnceLock::new(); -/// ponytail: linear sweep of live gates per acquisition; keyed eviction if a -/// scope ever admits enough rollouts at once for the sweep to show up. fn codex_admission_gate(scope: &ObservationScopeV1, path: &Path) -> CodexAdmissionGate { - let gates = CODEX_ADMISSION_GATES.get_or_init(|| Mutex::new(HashMap::new())); - let mut gates = gates.lock().unwrap_or_else(PoisonError::into_inner); - gates.retain(|_, gate| gate.strong_count() > 0); - let key = (scope.clone(), path.to_path_buf()); - if let Some(gate) = gates.get(&key).and_then(Weak::upgrade) { - return gate; - } - let gate = CodexAdmissionGate::new(tokio::sync::Mutex::new(())); - gates.insert(key, Arc::downgrade(&gate)); - gate + CODEX_ADMISSION_GATES + .get_or_init(|| Mutex::new(CodexAdmissionGates::default())) + .lock() + .unwrap_or_else(PoisonError::into_inner) + .gate_for((scope.clone(), path.to_path_buf())) } async fn try_admit_codex_jsonl_observations( @@ -843,3 +869,49 @@ async fn admit_codex_jsonl_page( prior_context_bytes, }) } + +#[cfg(test)] +mod admission_gate_tests { + use super::{CodexAdmissionGates, MIN_CODEX_ADMISSION_GATE_SWEEP_INTERVAL}; + use std::path::PathBuf; + use std::sync::Arc; + use tracedecay_domain::ObservationScopeV1; + + #[test] + fn live_codex_admission_gates_survive_amortized_reclamation() { + let scope = ObservationScopeV1::Profile; + let mut registry = CodexAdmissionGates::default(); + let key = (scope.clone(), PathBuf::from("rollout-active.jsonl")); + let first = registry.gate_for(key.clone()); + let concurrent = registry.gate_for(key.clone()); + assert!(Arc::ptr_eq(&first, &concurrent)); + let independent = registry.gate_for((scope.clone(), PathBuf::from("other.jsonl"))); + assert!(!Arc::ptr_eq(&first, &independent)); + drop(independent); + + // Many completed rollouts must not retain a gate per historical file. + // The active gate must survive sweeps so two callers still serialize. + for index in 0..(MIN_CODEX_ADMISSION_GATE_SWEEP_INTERVAL * 3) { + let disposable = registry.gate_for(( + scope.clone(), + PathBuf::from(format!("rollout-{index}.jsonl")), + )); + drop(disposable); + } + assert!( + registry.by_source.len() <= MIN_CODEX_ADMISSION_GATE_SWEEP_INTERVAL + 2, + "stale rollout gates must be periodically reclaimed" + ); + assert!(Arc::ptr_eq(&first, ®istry.gate_for(key.clone()))); + + // Once the final holder releases the gate, the next same-source + // admission must receive a new one rather than resurrecting a stale lock. + let retired = Arc::downgrade(&first); + drop(first); + drop(concurrent); + assert!(retired.upgrade().is_none()); + let replacement = registry.gate_for(key); + assert!(retired.upgrade().is_none()); + drop(replacement); + } +} From a03aca4b95b17955f46498d2cbe43675094b8d91 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:11:08 -0800 Subject: [PATCH 23/63] fix(evals): publish complete HTTP results without partial files Refs #4535. The runner opened the completed JSON destination before serializing it, so disk/serialization errors could leave a truncated final file that blocked exact-identity resume despite a complete .partial log. Render and fsync a same-directory staging file before publishing with an exclusive hard link. Preserve the previous completed result during races; leave the validated partial for retries on staging or link failure, and remove staging after every finished attempt. Add real runner tests for full-byte visibility, stage sync/link failures, no-new-inference retry, competing publications, and staging cleanup. Retain the single-writer/no-crash-durability limits. --- evals/intent_engine/HTTP_RUNNER.md | 9 ++-- evals/intent_engine/run_http.py | 37 +++++++++++++--- evals/intent_engine/test_run_http.py | 65 ++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 10 deletions(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index aa83fba7b0..68477dac13 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -34,9 +34,12 @@ or silent salvage is performed. Choose a new tag for another experiment or an old unidentifiable log. Completed output files are never overwritten. Use only one writer per tag/configuration. Rows are flushed after each response; -this is not a crash-durable database or a concurrent-writer protocol. If final -output publication itself is interrupted, the partial log remains, but an -incomplete final file requires operator inspection before retrying that tag. +this is not a crash-durable database or a concurrent-writer protocol. Final +results are fully rendered and synced in a same-directory temporary file, then +published exclusively using an atomic hard link. A failed write/link cannot +expose truncated completed JSON and leaves the exact-identity `.partial` log +available for a retry without repeating inference. Completion does not +guarantee directory metadata durability across an abrupt OS crash. ## Token and truncation evidence diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index a8a604a768..72a5711d39 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -64,6 +64,27 @@ def publish_sample(path, serialized): os.unlink(staged) +def publish_final_result(path, document): + """Expose a completed JSON result only after its bytes are fully written. + + The same-directory hard link is an exclusive publication: a competing + writer's result cannot be replaced, and a failed staged write cannot leave + an apparently completed but truncated JSON file. + """ + serialized = json.dumps(document, indent=1, allow_nan=False) + directory = os.path.dirname(os.path.abspath(path)) + staged = os.path.join(directory, f".noul-result-{secrets.token_hex(16)}") + descriptor = os.open(staged, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o666) + try: + with os.fdopen(descriptor, "w", encoding="utf-8") as output: + output.write(serialized) + output.flush() + os.fsync(output.fileno()) + os.link(staged, path) + finally: + os.unlink(staged) + + def post(url, body, timeout=1800): req = urllib.request.Request( url, request_bytes(body), {"content-type": "application/json"} @@ -279,13 +300,15 @@ def main(argv=None): partial.flush() done[case["id"]] = row print(cfg, index, case["id"], "%.0f ms" % ms, flush=True) - # Never overwrite another completed experiment, even with the same tag. - with open(path, "x", encoding="utf-8") as output: - json.dump({"config": name, "dataset_sha256": dataset_sha, - "noul_temperature": args.noul_temperature, - "subset": args.subset and os.path.basename(args.subset), - **header, "rows": [done[case_id] for case_id in cases]}, - output, indent=1, allow_nan=False) + # Exclusive publication must never expose a truncated final result: + # an interrupted or failed write leaves the complete partial log + # available for an exact-identity retry without new model calls. + publish_final_result(path, { + "config": name, "dataset_sha256": dataset_sha, + "noul_temperature": args.noul_temperature, + "subset": args.subset and os.path.basename(args.subset), + **header, "rows": [done[case_id] for case_id in cases], + }) os.remove(partial_path) print(cfg, "done", flush=True) diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index 87800b312a..7b4981a6a6 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -355,6 +355,71 @@ def test_invalid_subsets_cannot_silently_change_the_cohort(self): self.run_main(["--subset", str(self.root / "subset.json")]) post.assert_not_called() + def test_completed_output_is_fully_valid_before_its_name_is_published(self): + actual_link = os.link + inspected = [] + + def inspect_staged_file(source, destination): + if destination == str(self.output): + self.assertFalse(os.path.lexists(destination)) + with open(source, encoding="utf-8") as staged: + data = json.load(staged) + self.assertEqual([row["id"] for row in data["rows"]], ["first", "second"]) + self.assertEqual(data["experiment_sha256"], run_http.digest(data["experiment"])) + inspected.append(source) + return actual_link(source, destination) + + with patch.object(run_http, "post", side_effect=self.response): + with patch.object(run_http.os, "link", side_effect=inspect_staged_file): + self.run_main() + self.assertEqual(len(inspected), 1) + self.assertFalse(os.path.exists(inspected[0])) + self.assertFalse(self.partial.exists()) + self.assertEqual([row["id"] for row in json.loads(self.output.read_text())["rows"]], + ["first", "second"]) + + def test_final_link_failure_preserves_a_complete_resumable_partial(self): + with patch.object(run_http, "post", side_effect=self.response): + with patch.object(run_http.os, "link", side_effect=OSError("link refused")): + with self.assertRaisesRegex(OSError, "link refused"): + self.run_main() + self.assertFalse(self.output.exists()) + self.assertEqual(len(self.partial.read_text().splitlines()), 3) + self.assertEqual(list(self.partial.parent.glob(".noul-result-*")), []) + + with patch.object(run_http, "post") as post: + self.run_main() + post.assert_not_called() + self.assertFalse(self.partial.exists()) + self.assertEqual(len(json.loads(self.output.read_text())["rows"]), 2) + + def test_staged_flush_failure_leaves_no_apparently_completed_result(self): + with patch.object(run_http, "post", side_effect=self.response): + with patch.object(run_http.os, "fsync", side_effect=OSError("staging sync failed")): + with self.assertRaisesRegex(OSError, "staging sync failed"): + self.run_main() + self.assertFalse(self.output.exists()) + self.assertEqual(len(self.partial.read_text().splitlines()), 3) + self.assertEqual(list(self.partial.parent.glob(".noul-result-*")), []) + with patch.object(run_http, "post") as post: + self.run_main() + post.assert_not_called() + self.assertFalse(self.partial.exists()) + + def test_competing_final_publication_cannot_be_overwritten(self): + def race_at_publication(source, destination): + self.assertEqual(destination, str(self.output)) + self.output.write_text('{"other_writer": true}', encoding="utf-8") + raise FileExistsError("another result won publication") + + with patch.object(run_http, "post", side_effect=self.response): + with patch.object(run_http.os, "link", side_effect=race_at_publication): + with self.assertRaises(FileExistsError): + self.run_main() + self.assertEqual(json.loads(self.output.read_text()), {"other_writer": True}) + self.assertEqual(len(self.partial.read_text().splitlines()), 3) + self.assertEqual(list(self.partial.parent.glob(".noul-result-*")), []) + def test_completed_outputs_are_not_overwritten(self): with patch.object(run_http, "post", side_effect=self.response): self.run_main() From fd310d6108c17ab15c03db0d586b666ee5332de8 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:18:37 -0800 Subject: [PATCH 24/63] fix(global-db): upgrade published workflow artifact table in place Every tagged release through 1.0.0-beta.92 created the same nine workflow tables and identity digest. beta.93 relaxed the artifact table's CHECK and changed the digest with no path forward, so those stores were refused and could only be reset, losing their workflow records. Admission now recognizes exactly that shape: byte-exact stored SQL for all nine tables, the single published identity row, no other schema object referring to the artifact table, and rows that satisfy the published constraints. It re-proves the shape under the write lock, then moves the table aside, creates the final table, copies rows with their rowids, verifies them byte for byte, drops the old table, compare-and-swaps the digest, and requires the final contract, all in the admission transaction. Anything else keeps the typed refusal, and a store another authority refuses is not touched. The published digest is an opaque label rather than a hash of the stored SQL, so the stored text is the evidence. A failure that recurs on every open is a typed reset refusal; one that can clear, such as a held lock or full disk, stays an operation failure the next open retries. The refusal's identity read gets the same split: a transient read failure stays typed instead of reading as an unreadable identity. The explicit operator request for this upgrade overrides the repository's no-data-migration default for this one published shape. Co-Authored-By: Claude Opus 5.5 --- crates/tracedecay-global-db/src/registered.rs | 3 +- .../src/registered/workflow_schema_tests.rs | 621 ++++++++++++++++++ .../tracedecay-global-db/src/schema_stages.rs | 177 +++-- .../workflow_artifact_ceiling_upgrade.rs | 319 +++++++++ .../tracedecay-global-db/src/tests/harness.rs | 2 +- 5 files changed, 1080 insertions(+), 42 deletions(-) create mode 100644 crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs diff --git a/crates/tracedecay-global-db/src/registered.rs b/crates/tracedecay-global-db/src/registered.rs index c869e88525..87c93f8110 100644 --- a/crates/tracedecay-global-db/src/registered.rs +++ b/crates/tracedecay-global-db/src/registered.rs @@ -114,7 +114,8 @@ impl RegisteredGlobalDbOwnerV1 { /// cannot honor, and an admissibly-fresh existing store receives the full /// install. Nothing steps an incompatible store forward in place; the /// only in-place changes admission performs are the additive columns for - /// shapes released binaries actually shipped. + /// shapes released binaries actually shipped and the one published + /// workflow shape proven byte-exact by the schema stages. /// /// Short-lived attaches have no background maintenance task, so the /// authority-invariant convergence runs synchronously here: a store whose diff --git a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs index 4973088a03..7dfdcb2393 100644 --- a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs +++ b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs @@ -221,3 +221,624 @@ async fn extra_workflow_schema_identity_requires_reset_without_mutation() { ); assert_workflow_schema_reset_without_mutation(schema).await; } + +mod published_artifact_ceiling { + use std::future::Future as _; + use std::path::{Path, PathBuf}; + use std::sync::atomic::Ordering; + use std::task::Poll; + + use rusqlite::Connection; + use tempfile::TempDir; + use tracedecay_domain::errors::TraceDecayError; + use tracedecay_lcm::LCM_SCHEMA_VERSION; + use tracedecay_runtime_core::cancellation::CancellationToken; + use tracedecay_runtime_core::db::TestDatabaseRuntimeScope; + use tracedecay_rusqlite_runtime::workflow::{ + WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_TABLE_CONTRACTS_V1, + }; + + use crate::RegisteredGlobalDbOwnerV1; + use crate::tests::harness::open_registered_test_database_fixture; + + /// The artifact table as `git show v1.0.0-beta.92` defines it, deliberately + /// spelled out here so a change to production's copy cannot pass. + const PUBLISHED_TABLE_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( + payload_digest TEXT NOT NULL PRIMARY KEY, + byte_length INTEGER NOT NULL CHECK ( + byte_length = length(payload) AND byte_length <= 4194304 + ), + payload BLOB NOT NULL +) STRICT"; + const PUBLISHED_DIGEST: &str = + "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; + const PUBLISHED_CEILING: usize = 4_194_304; + + fn final_table_sql() -> &'static str { + WORKFLOW_TABLE_CONTRACTS_V1 + .iter() + .find(|table| table.name == "workflow_artifact_payloads") + .unwrap() + .sql + } + + /// One row of every workflow table a published release could have written, + /// including artifact rows at both ends of the published range and a rowid + /// gap a sloppy copy would close. + const PUBLISHED_ROWS: &str = " + INSERT INTO workflow_artifact_payloads (rowid, payload_digest, byte_length, payload) + VALUES + (3, 'sha256:empty', 0, x''), + (7, 'sha256:small', 4, x'00ff10ee'), + (9, 'sha256:at-ceiling', 4194304, zeroblob(4194304)); + INSERT INTO workflow_run_journal VALUES ('run.1', 1, 'command.1', '{\"e\":1}', 'd1'); + INSERT INTO workflow_fan_out_census_journal VALUES ('run.1', 1, 10, '{\"c\":1}', 'd2', 1); + INSERT INTO workflow_definition_source_journal VALUES ('definition.1', 1, '{}', 'd3'); + INSERT INTO workflow_definition_disposition VALUES ('definition.1', 1, 'active', 2, 11); + INSERT INTO workflow_definition_transition_journal + VALUES ('definition.1', 1, 2, 1, 'activate', 'validated', 'active', 12); + INSERT INTO workflow_effect_journal VALUES ( + 'effect.1', 'd4', '{}', 'd5', '{}', 'd6', 'operation', 'committed', '{}', 'd7', 13, 14 + ); + INSERT INTO workflow_handoffs VALUES ('token.1', '{}', 15, 16, 0, '{}', 'd8');"; + + fn republish(connection: &Connection, table_sql: &str, digest: &str) { + connection + .execute_batch(&format!( + "DROP TABLE workflow_artifact_payloads; + {table_sql}; + UPDATE workflow_schema SET definition_digest = '{digest}';" + )) + .unwrap(); + } + + struct PublishedStore { + path: PathBuf, + _directory: TempDir, + } + + impl PublishedStore { + async fn create() -> Self { + Self::create_at("sessions.db", TestDatabaseRuntimeScope::ProfileSessions).await + } + + async fn create_at(file: &str, scope: TestDatabaseRuntimeScope) -> Self { + let directory = TempDir::new().unwrap(); + let path = directory.path().join(file); + drop( + open_registered_test_database_fixture(&path, scope) + .await + .unwrap(), + ); + let connection = Connection::open(&path).unwrap(); + republish(&connection, PUBLISHED_TABLE_SQL, PUBLISHED_DIGEST); + connection.execute_batch(PUBLISHED_ROWS).unwrap(); + Self { + path, + _directory: directory, + } + } + + fn run(&self, sql: &str) { + Connection::open(&self.path) + .unwrap() + .execute_batch(sql) + .unwrap(); + } + + fn state(&self) -> WorkflowState { + WorkflowState::read(&self.path) + } + + async fn admit(&self) -> Option { + let (lease, owner) = open_registered_test_database_fixture( + &self.path, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .expect("admission serves the store's other authorities"); + let refusal = owner.reset_required(); + assert_eq!( + lease.workflow_storage().await.is_ok(), + refusal.is_none(), + "the production workflow gate must agree with admission: {refusal:?}" + ); + refusal + } + } + + /// Everything the upgrade promises to preserve or change, read outside + /// production code. + #[derive(Debug, PartialEq, Eq, Clone)] + struct WorkflowState { + table_sql: String, + digest: String, + artifacts: Vec<(i64, String, i64, Vec)>, + other_rows: Vec, + objects_named_after_the_table: Vec, + } + + impl WorkflowState { + fn read(path: &Path) -> Self { + let connection = Connection::open(path).unwrap(); + let table_sql = connection + .query_row( + "SELECT sql FROM sqlite_master WHERE name = 'workflow_artifact_payloads'", + [], + |row| row.get(0), + ) + .unwrap(); + let digest = connection + .query_row("SELECT definition_digest FROM workflow_schema", [], |row| { + row.get(0) + }) + .unwrap(); + let artifacts = connection + .prepare( + "SELECT rowid, payload_digest, byte_length, payload + FROM workflow_artifact_payloads ORDER BY rowid", + ) + .unwrap() + .query_map([], |row| { + Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?)) + }) + .unwrap() + .collect::>>() + .unwrap(); + let mut other_rows = Vec::new(); + for table in WORKFLOW_TABLE_CONTRACTS_V1 { + if table.name == "workflow_artifact_payloads" || table.name == "workflow_schema" { + continue; + } + let columns = table + .columns + .iter() + .map(|column| format!("quote({})", column.name)) + .collect::>() + .join(" || ',' || "); + let mut statement = connection + .prepare(&format!("SELECT {columns} FROM {}", table.name)) + .unwrap(); + let rows = statement + .query_map([], |row| row.get::<_, String>(0)) + .unwrap(); + for row in rows { + other_rows.push(format!("{}:{}", table.name, row.unwrap())); + } + } + let objects_named_after_the_table = connection + .prepare( + "SELECT name FROM sqlite_master + WHERE name LIKE '%workflow_artifact_payloads%' ORDER BY name", + ) + .unwrap() + .query_map([], |row| row.get(0)) + .unwrap() + .collect::>>() + .unwrap(); + Self { + table_sql, + digest, + artifacts, + other_rows, + objects_named_after_the_table, + } + } + } + + fn assert_workflow_refusal(refusal: Option) -> String { + let refusal = refusal.expect("this shape must keep refusing workflow features"); + let Some(("workflow", reason)) = refusal.reset_required_context() else { + panic!("refused with the wrong typed state: {refusal}"); + }; + assert!( + !reason.contains("CREATE TABLE"), + "stored SQL must not reach the refusal: {reason}" + ); + reason.to_owned() + } + + #[asupersync::test] + async fn admission_upgrades_the_published_shape_and_keeps_every_record() { + let store = PublishedStore::create().await; + let before = store.state(); + assert_eq!(before.artifacts.len(), 3); + assert_eq!(before.other_rows.len(), 7); + + assert!(store.admit().await.is_none()); + + let after = store.state(); + assert_eq!(after.table_sql, final_table_sql()); + assert_eq!(after.digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + assert_eq!(after.artifacts, before.artifacts); + assert_eq!(after.other_rows, before.other_rows); + assert_eq!( + after.objects_named_after_the_table, + vec![ + "sqlite_autoindex_workflow_artifact_payloads_1", + "workflow_artifact_payloads" + ] + ); + let connection = Connection::open(&store.path).unwrap(); + let integrity: String = connection + .query_row("PRAGMA integrity_check", [], |row| row.get(0)) + .unwrap(); + assert_eq!(integrity, "ok"); + // The ceiling is gone and the remaining constraint still holds. + let above_ceiling = PUBLISHED_CEILING + 1; + connection + .execute_batch(&format!( + "INSERT INTO workflow_artifact_payloads + VALUES ('sha256:above', {above_ceiling}, zeroblob({above_ceiling}));" + )) + .unwrap(); + connection + .execute_batch( + "INSERT INTO workflow_artifact_payloads VALUES ('sha256:liar', 1, x'0011');", + ) + .expect_err("the byte-length constraint survives the upgrade"); + } + + #[asupersync::test] + async fn reopening_an_upgraded_store_changes_nothing_and_keeps_later_writes() { + let store = PublishedStore::create().await; + assert!(store.admit().await.is_none()); + store.run("INSERT INTO workflow_artifact_payloads VALUES ('sha256:later', 1, x'01');"); + let upgraded = store.state(); + + assert!(store.admit().await.is_none()); + assert!(store.admit().await.is_none()); + + assert_eq!(store.state(), upgraded); + assert_eq!(upgraded.artifacts.len(), 4); + } + + /// A failure at the very last step, after the rows moved and the published + /// table was dropped, must restore all of it, and the store must take the + /// upgrade once the cause is gone. + #[asupersync::test] + async fn failed_upgrade_rolls_back_every_step_and_succeeds_once_unblocked() { + let store = PublishedStore::create().await; + store.run( + "CREATE TRIGGER block_workflow_identity BEFORE UPDATE ON workflow_schema + BEGIN SELECT RAISE(ABORT, 'foreign trigger text'); END;", + ); + let before = store.state(); + + let error = open_registered_test_database_fixture( + &store.path, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .err() + .expect("an upgrade that cannot finish must not publish the store"); + let Some(("workflow", reason)) = error.reset_required_context() else { + panic!("refused with the wrong typed state: {error}"); + }; + assert!(reason.contains("left as found"), "{reason}"); + assert!(!reason.contains("foreign trigger text"), "{reason}"); + assert_eq!(store.state(), before); + + store.run("DROP TRIGGER block_workflow_identity;"); + assert!(store.admit().await.is_none()); + let after = store.state(); + assert_eq!(after.digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + assert_eq!(after.artifacts, before.artifacts); + } + + /// Each case differs from the proven shape in one way and must be refused + /// with nothing changed. + #[asupersync::test] + async fn shapes_other_than_the_published_one_are_refused_untouched() { + let reformatted = + PUBLISHED_TABLE_SQL.replace("byte_length <= 4194304", "byte_length<=4194304"); + let doubled_ceiling = PUBLISHED_TABLE_SQL.replace("4194304", "8388608"); + let cases: Vec<(&str, String, &str)> = vec![ + ( + "published table under the final identity", + format!("UPDATE workflow_schema SET definition_digest = '{WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}';"), + "definition differs", + ), + ( + "published table under an unknown identity", + "UPDATE workflow_schema SET definition_digest = 'sha256:unknown';".to_owned(), + "definition differs", + ), + ( + "final table under the published identity", + format!( + "DROP TABLE workflow_artifact_payloads; {};", + final_table_sql() + ), + "workflow schema identity does not match", + ), + ( + "reformatted published table", + format!("DROP TABLE workflow_artifact_payloads; {reformatted};"), + "definition differs", + ), + ( + "different ceiling", + format!("DROP TABLE workflow_artifact_payloads; {doubled_ceiling};"), + "definition differs", + ), + ( + "another table drifted as well", + "DROP TABLE workflow_handoffs;".to_owned(), + "missing 1 (`workflow_handoffs`)", + ), + ( + "a second identity row", + format!( + "PRAGMA ignore_check_constraints = ON; + INSERT INTO workflow_schema VALUES (2, 1, '{PUBLISHED_DIGEST}');" + ), + "several identity rows", + ), + ( + "a trigger on the artifact table", + "CREATE TRIGGER artifact_audit AFTER INSERT ON workflow_artifact_payloads + BEGIN SELECT 1; END;" + .to_owned(), + "1 other schema object(s)", + ), + ( + "a view over the artifact table", + "CREATE VIEW artifact_view AS SELECT payload_digest FROM workflow_artifact_payloads;" + .to_owned(), + "1 other schema object(s)", + ), + ( + "a table in the displaced table's name", + "CREATE TABLE workflow_artifact_payloads_published (value TEXT);".to_owned(), + "1 other schema object(s)", + ), + ( + "a row whose length disagrees", + "PRAGMA ignore_check_constraints = ON; + INSERT INTO workflow_artifact_payloads VALUES ('sha256:liar', 1, x'0011');" + .to_owned(), + "1 row(s)", + ), + ( + "a row above the published ceiling", + format!( + "PRAGMA ignore_check_constraints = ON; + INSERT INTO workflow_artifact_payloads VALUES ( + 'sha256:above', {above}, zeroblob({above}) + );", + above = PUBLISHED_CEILING + 1 + ), + "1 row(s)", + ), + ]; + for (case, shape, expected) in cases { + let store = PublishedStore::create().await; + if shape.contains("DROP TABLE workflow_artifact_payloads") { + store.run("DELETE FROM workflow_artifact_payloads;"); + } + store.run(&shape); + let before = store.state_tolerating_missing_tables(); + let reason = assert_workflow_refusal(store.admit().await); + assert!(reason.contains(expected), "{case}: {reason}"); + assert_eq!( + store.state_tolerating_missing_tables(), + before, + "{case} must be left untouched" + ); + } + } + + impl PublishedStore { + /// Schema text and artifact rows, for cases that removed other tables + /// from under [`WorkflowState::read`]. + fn state_tolerating_missing_tables( + &self, + ) -> (Vec<(String, Option)>, usize, String) { + let connection = Connection::open(&self.path).unwrap(); + let schema = connection + .prepare( + "SELECT name, sql FROM sqlite_master + WHERE name LIKE 'workflow%' OR name LIKE 'artifact%' ORDER BY name", + ) + .unwrap() + .query_map([], |row| Ok((row.get(0)?, row.get(1)?))) + .unwrap() + .collect::>>() + .unwrap(); + let rows = connection + .query_row( + "SELECT count(*) FROM workflow_artifact_payloads", + [], + |row| row.get::<_, i64>(0), + ) + .unwrap(); + let digest = connection + .query_row( + "SELECT group_concat(definition_digest) FROM workflow_schema", + [], + |row| row.get(0), + ) + .unwrap(); + (schema, usize::try_from(rows).unwrap(), digest) + } + } + + /// Another authority's refusal is the store's verdict, so nothing of this + /// store changes on the way to its reset. + #[asupersync::test] + async fn store_refused_by_another_authority_keeps_the_published_shape() { + let store = PublishedStore::create().await; + let previous = LCM_SCHEMA_VERSION - 1; + store.run(&format!( + "UPDATE tracedecay_schema_version SET version = {previous} WHERE component = 'lcm';" + )); + let before = store.state(); + + let refusal = store.admit().await.expect("an aged LCM refuses the store"); + assert!( + matches!(refusal, TraceDecayError::ProfileResetRequired { .. }), + "{refusal}" + ); + assert_eq!(store.state(), before); + } + + /// A published store at its profile path, held open for daemon admission. + struct DaemonPublishedStore { + store: PublishedStore, + _scope: tracedecay_runtime_core::db::DaemonDatabaseScope, + } + + impl DaemonPublishedStore { + async fn create() -> Self { + let directory = TempDir::new().unwrap(); + let profile_root = directory.path().join("profile"); + tracedecay_runtime_core::storage::PrivateStoreIo::create_dir_all(&profile_root) + .unwrap(); + let path = tracedecay_sessions::runtime::user_sessions_db_path(&profile_root); + drop( + open_registered_test_database_fixture( + &path, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .unwrap(), + ); + let connection = Connection::open(&path).unwrap(); + republish(&connection, PUBLISHED_TABLE_SQL, PUBLISHED_DIGEST); + connection.execute_batch(PUBLISHED_ROWS).unwrap(); + drop(connection); + let scope = tracedecay_runtime_core::db::enter_daemon_database_scope( + &profile_root, + crate::tests::harness::TEST_RUNTIME_NONCE.fetch_add(1, Ordering::Relaxed), + "published workflow shape", + ) + .unwrap(); + Self { + store: PublishedStore { + path, + _directory: directory, + }, + _scope: scope, + } + } + } + + async fn publish_daemon_runtime( + path: &Path, + ) -> tracedecay_runtime_core::db::RegisteredTestRuntimeFixtureV1 { + let authority = tracedecay_runtime_core::db::DatabaseAuthority::for_owned_runtime( + path, + "publish published-shape daemon test runtime", + ) + .unwrap(); + tracedecay_runtime_core::db::Database::publish_registered_daemon_test_runtime_with_retirement_control( + path, + &authority, + tracedecay_runtime_core::db::TestDatabaseRuntimeMode::Existing, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .unwrap() + } + + /// The census asks what attach would decide. It must admit a store the + /// real attach can upgrade, and must not perform that upgrade itself. + #[asupersync::test(flavor = "multi_thread")] + async fn attach_refusal_inspection_admits_without_upgrading() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + let before = store.state(); + + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let refusal = RegisteredGlobalDbOwnerV1::attach_reset_refusal(&database) + .await + .unwrap(); + assert!(refusal.is_none(), "{refusal:?}"); + drop(database); + + assert_eq!(store.state(), before); + } + + /// Daemon admission observes shutdown at every statement. At each sampled + /// cancellation point the store is either wholly published or wholly final. + #[asupersync::test(flavor = "multi_thread")] + async fn daemon_admission_is_atomic_at_every_cancellation_point() { + async fn admit_cancelled_at( + path: &Path, + cancel_at: usize, + ) -> (Result<(), TraceDecayError>, usize) { + let (database, _runtime, _retirement) = publish_daemon_runtime(path).await.into_parts(); + let cancellation = CancellationToken::new(); + let mut admission = Box::pin(RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + database, + &cancellation, + )); + let mut polls = 0; + let outcome = std::future::poll_fn(|context| { + polls += 1; + if polls == cancel_at { + cancellation.cancel(); + } + match admission.as_mut().poll(context) { + Poll::Ready(result) => Poll::Ready(result.map(|(owner, _)| { + assert!(owner.reset_required().is_none()); + })), + Poll::Pending => Poll::Pending, + } + }) + .await; + (outcome, polls) + } + + let reference = DaemonPublishedStore::create().await; + let before = reference.store.state(); + let (outcome, total_polls) = admit_cancelled_at(&reference.store.path, usize::MAX).await; + outcome.unwrap(); + let completed = reference.store.state(); + assert_eq!(completed.digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + assert_eq!(completed.artifacts, before.artifacts); + + let stride = (total_polls / 12).max(1); + let mut cancelled = 0; + for cancel_at in (1..total_polls).step_by(stride) { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + let (outcome, _) = admit_cancelled_at(&store.path, cancel_at).await; + let state = store.state(); + match outcome { + Ok(()) => assert_eq!(state, completed, "completed at poll {cancel_at}"), + Err(error) => { + assert!(error.is_store_open_cancelled(), "poll {cancel_at}: {error}"); + assert!( + state == before || state == completed, + "poll {cancel_at} left a partial upgrade: {state:?}" + ); + cancelled += 1; + let (reopened, _) = admit_cancelled_at(&store.path, usize::MAX).await; + reopened.unwrap(); + assert_eq!(store.state(), completed, "reopen after poll {cancel_at}"); + } + } + } + assert!(cancelled > 0, "the sweep never observed a cancellation"); + } + + /// The profile authority holds no workflow rows and never reads these + /// tables, so it keeps them exactly as found. + #[asupersync::test] + async fn profile_authority_is_not_upgraded() { + let store = PublishedStore::create_at("global.db", TestDatabaseRuntimeScope::Profile).await; + let before = store.state(); + + let (lease, owner) = + open_registered_test_database_fixture(&store.path, TestDatabaseRuntimeScope::Profile) + .await + .unwrap(); + assert!(owner.reset_required().is_none()); + drop((lease, owner)); + + assert_eq!(store.state(), before); + } +} diff --git a/crates/tracedecay-global-db/src/schema_stages.rs b/crates/tracedecay-global-db/src/schema_stages.rs index b960adb50b..475dfded91 100644 --- a/crates/tracedecay-global-db/src/schema_stages.rs +++ b/crates/tracedecay-global-db/src/schema_stages.rs @@ -5,6 +5,12 @@ use std::time::{Duration, Instant}; use tracedecay_domain::errors::ProjectOpenFailureKind; +mod workflow_artifact_ceiling_upgrade; +use workflow_artifact_ceiling_upgrade::{ + PublishedArtifactCeilingShape, classify_published_artifact_ceiling, + upgrade_published_artifact_ceiling, +}; + use super::schema_contract::{ authority_invariant_triggers_intact, ensure_authority_audit_checkpoint_schema, ensure_authority_invariant_schema, ensure_authority_invariants, @@ -848,7 +854,8 @@ pub async fn ensure_registered_schema_for_admission( /// Installs (or idempotently re-ensures) every registered schema stage inside /// the caller's admission transaction. Callers classify admission first, so -/// this stage runs only for stores classified fresh or exactly current. +/// this stage runs only for stores classified fresh, exactly current, or +/// exactly the one published workflow shape it upgrades. /// /// Heap boundary: see [`RegisteredSchemaAdmissionClassify`]. #[tracing::instrument(name = "global_db.schema.persist.install", level = "trace", skip_all)] @@ -902,6 +909,15 @@ where transaction.commit().await.map_err(|error| { global_db_operation_error(commit_operation, std::io::Error::other(error)) })?; + if session_features + == (SessionFeatureSchema::Hosted { + workflow: WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling, + }) + { + tracing::info!( + "upgraded the published workflow artifact table to the final contract" + ); + } Ok(refused_authority) } Err(error) => match transaction.rollback().await { @@ -1096,6 +1112,13 @@ async fn install_registered_schema_stage_sequence( .await .map_err(|error| global_db_operation_error("initialize workflow schema", error))?; } + if session_features + == (SessionFeatureSchema::Hosted { + workflow: WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling, + }) + { + upgrade_published_artifact_ceiling(transaction).await?; + } transaction .execute_batch(WORK_SCHEMA_V1) .await @@ -1487,6 +1510,9 @@ pub(crate) enum RegisteredSchemaAttachmentV1 { enum WorkflowSchemaAdmission { Create, Complete, + /// The one published shape admission steps forward, inside its own + /// transaction. See [`workflow_artifact_ceiling_upgrade`]. + UpgradePublishedArtifactCeiling, } async fn inspect_workflow_schema_for_admission( @@ -1539,11 +1565,20 @@ async fn inspect_workflow_schema_for_admission( .map(|contract| (contract.name, Some(contract.sql))) .collect::>(); if actual_workflow_tables != expected_workflow_tables { + match classify_published_artifact_ceiling(conn, &actual_workflow_tables).await? { + PublishedArtifactCeilingShape::Upgradable => { + return Ok(Ok(WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling)); + } + PublishedArtifactCeilingShape::Refused(reason) => { + return Ok(Err(workflow_schema_refusal(reason))); + } + PublishedArtifactCeilingShape::Other => {} + } let identity = if actual_workflow_tables .iter() .any(|(name, _)| *name == "workflow_schema") { - Some(recorded_workflow_identity(conn).await) + Some(recorded_workflow_identity(conn).await?) } else { None }; @@ -1693,35 +1728,50 @@ fn required_workflow_identity() -> String { /// The identity a store with drifted workflow tables records, read only to /// make the refusal actionable: comparing it with the required digest tells /// a store written by another release from a damaged one. -async fn recorded_workflow_identity(conn: &impl QueryExecutor) -> String { - let read = async { - let mut rows = conn - .query( - "SELECT schema_version, definition_digest FROM workflow_schema - ORDER BY singleton LIMIT 2", - (), - ) - .await - .ok()?; - let first = rows.next().await.ok()??; - let version = first.get::(0).ok()?; - let digest = first.get::(1).ok()?; - let extra = rows.next().await.ok()?.is_some(); - Some((version, digest, extra)) - }; - match read.await { - Some((version, digest, false)) => format!( +/// +/// A drifted `workflow_schema` may not even answer this query, which is more +/// drift to report. A database that cannot be read right now says nothing about +/// the store, so that stays a typed failure rather than a reset reason. +async fn recorded_workflow_identity( + conn: &impl QueryExecutor, +) -> tracedecay_domain::errors::Result { + match read_recorded_workflow_identity(conn).await { + Ok(Some((version, digest, false))) => Ok(format!( "the store records version {version} with {}", workflow_digest_label(&digest) - ), - Some((version, digest, true)) => format!( + )), + Ok(Some((version, digest, true))) => Ok(format!( "the store records several identity rows, the first version {version} with {}", workflow_digest_label(&digest) - ), - None => "the store's recorded workflow identity is unreadable".to_owned(), + )), + Ok(None) => Ok("the store records no workflow identity".to_owned()), + Err(error) if error.is_transient_read_failure() => Err(global_db_operation_error( + "read recorded workflow identity", + error, + )), + Err(_) => Ok("the store's recorded workflow identity is unreadable".to_owned()), } } +async fn read_recorded_workflow_identity( + conn: &impl QueryExecutor, +) -> engine::Result> { + let mut rows = conn + .query( + "SELECT schema_version, definition_digest FROM workflow_schema + ORDER BY singleton LIMIT 2", + (), + ) + .await?; + let Some(first) = rows.next().await? else { + return Ok(None); + }; + let version = first.get::(0)?; + let digest = first.get::(1)?; + let extra = rows.next().await?.is_some(); + Ok(Some((version, digest, extra))) +} + fn workflow_table_drift_reason( actual: &[(&str, Option<&str>)], identity: Option, @@ -1961,7 +2011,9 @@ mod tests { use super::WORKFLOW_REFUSAL_NAME_LIMIT; use crate::tests::harness::open_registered_test_database_fixture; use tracedecay_runtime_core::db::TestDatabaseRuntimeScope; - use tracedecay_runtime_core::db::engine::{QueryExecutor, TestConnection, params}; + use tracedecay_runtime_core::db::engine::{ + IntoParams, QueryExecutor, Rows, TestConnection, params, + }; async fn install_registered_schema(database_path: &std::path::Path) { drop( @@ -2545,18 +2597,18 @@ mod tests { ); } - /// The workflow payload table and identity digest a store written by - /// beta.90 through beta.92 carries: the shape before the artifact size - /// ceiling was removed. - const BETA_92_ARTIFACT_PAYLOADS_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( + /// A digest the workflow schema carried in a published release. + const BETA_92_WORKFLOW_DIGEST: &str = + "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; + + /// A ceiling no release ever shipped, under the published identity. + const FOREIGN_ARTIFACT_PAYLOADS_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( payload_digest TEXT NOT NULL PRIMARY KEY, byte_length INTEGER NOT NULL CHECK ( - byte_length = length(payload) AND byte_length <= 4194304 + byte_length = length(payload) AND byte_length <= 8388608 ), payload BLOB NOT NULL ) STRICT"; - const BETA_92_WORKFLOW_DIGEST: &str = - "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; /// Admit a fresh session store, run `shape` against it, and return the /// workflow refusal the next admission reports. @@ -2585,15 +2637,14 @@ mod tests { (database_path, directory, reason) } - /// A store a published release wrote, whose workflow payload table still - /// carries the artifact size ceiling, has no in-place upgrade: it is - /// refused for its workflow features, and the refusal names the drifted - /// table and both identities so an operator can tell it from damage. + /// A payload table that resembles the published one but is not it stays + /// refused, and the refusal names the drifted table and both identities so + /// an operator can tell it from damage. #[asupersync::test] - async fn published_workflow_shape_refusal_names_the_table_and_both_identities() { + async fn altered_artifact_table_refusal_names_the_table_and_both_identities() { let shape = format!( "DROP TABLE workflow_artifact_payloads; - {BETA_92_ARTIFACT_PAYLOADS_SQL}; + {FOREIGN_ARTIFACT_PAYLOADS_SQL}; UPDATE workflow_schema SET definition_digest = '{BETA_92_WORKFLOW_DIGEST}';" ); let (database_path, _directory, reason) = workflow_refusal_after(&shape).await; @@ -2618,7 +2669,7 @@ mod tests { "{reason}" ); assert!( - !reason.contains("CREATE TABLE") && !reason.contains("4194304"), + !reason.contains("CREATE TABLE") && !reason.contains("8388608"), "stored schema SQL must not leak into the refusal: {reason}" ); // Admission stays read-only: the refused table is left as found. @@ -2630,7 +2681,53 @@ mod tests { |row| row.get(0), ) .unwrap(); - assert_eq!(stored, BETA_92_ARTIFACT_PAYLOADS_SQL); + assert_eq!(stored, FOREIGN_ARTIFACT_PAYLOADS_SQL); + } + + /// `workflow_schema` that cannot answer the identity query is one more + /// drifted object to report, not a reason to fail the open. + #[asupersync::test] + async fn undecodable_recorded_identity_is_reported_as_unreadable() { + let (_database_path, _directory, reason) = workflow_refusal_after( + "DROP TABLE workflow_schema; + CREATE TABLE workflow_schema (singleton INTEGER PRIMARY KEY);", + ) + .await; + assert!( + reason.contains("the store's recorded workflow identity is unreadable"), + "{reason}" + ); + } + + struct BusyConnection; + + impl QueryExecutor for BusyConnection { + async fn query

( + &self, + _sql: &str, + _params: P, + ) -> tracedecay_runtime_core::db::engine::Result + where + P: IntoParams, + { + Err(tracedecay_runtime_core::db::engine::Error::Busy) + } + } + + /// A held database says nothing about the store, so it must not turn into + /// reset wording. + #[asupersync::test] + async fn busy_identity_read_stays_a_typed_failure_instead_of_a_reset_reason() { + let error = super::recorded_workflow_identity(&BusyConnection) + .await + .expect_err("a held database is not an unreadable identity"); + assert!(!error.is_store_reset_required(), "{error}"); + assert!( + error + .to_string() + .contains("read recorded workflow identity"), + "{error}" + ); } #[asupersync::test] diff --git a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs new file mode 100644 index 0000000000..8b64a919a1 --- /dev/null +++ b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs @@ -0,0 +1,319 @@ +//! In-place upgrade of the one published workflow shape the final contract +//! left behind. +//! +//! Every tagged release through 1.0.0-beta.92 created the same nine workflow +//! tables byte for byte and recorded the same identity digest. 1.0.0-beta.93 +//! dropped the artifact byte ceiling from `workflow_artifact_payloads`, which +//! changed that one table's `CHECK` and the identity digest, with no way for an +//! existing store to follow. The digest is an opaque published label rather +//! than a hash of the stored SQL, so this recognizes the shape from the exact +//! stored text together with the recorded identity. Anything else, however +//! close, keeps the typed refusal. + +use tracedecay_domain::errors::{Result, TraceDecayError}; +use tracedecay_runtime_core::db::engine::{self, Executor, QueryExecutor}; +use tracedecay_rusqlite_runtime::workflow::{ + WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_SCHEMA_VERSION_V1, WORKFLOW_TABLE_CONTRACTS_V1, +}; + +use super::{WorkflowSchemaAdmission, inspect_workflow_schema_for_admission}; +use crate::{global_db_operation_error, global_db_operation_message}; + +const ARTIFACT_TABLE: &str = "workflow_artifact_payloads"; + +const PUBLISHED_ARTIFACT_TABLE_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( + payload_digest TEXT NOT NULL PRIMARY KEY, + byte_length INTEGER NOT NULL CHECK ( + byte_length = length(payload) AND byte_length <= 4194304 + ), + payload BLOB NOT NULL +) STRICT"; + +const PUBLISHED_WORKFLOW_DIGEST: &str = + "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; + +/// The final contract's SQL is stored byte-exact only when `CREATE TABLE` runs +/// under the final name, so the published table moves aside first rather than +/// renaming a new table into place, which would quote the stored name. +const DISPLACED_ARTIFACT_TABLE: &str = "workflow_artifact_payloads_published"; + +const DEPENDENT_OBJECT_COUNT_SQL: &str = "SELECT count(*) FROM sqlite_master + WHERE name <> 'workflow_artifact_payloads' + AND name <> 'sqlite_autoindex_workflow_artifact_payloads_1' + AND (tbl_name = 'workflow_artifact_payloads' + OR instr(lower(sql), 'workflow_artifact_payloads') > 0)"; + +/// Rows the published constraints would have rejected can only come from a +/// store written around them, so they are not the proven shape. +const NONCONFORMING_ROW_COUNT_SQL: &str = "SELECT count(*) FROM workflow_artifact_payloads + WHERE typeof(payload) <> 'blob' + OR byte_length <> length(payload) + OR byte_length > 4194304"; + +const COPY_ROWS_SQL: &str = "INSERT INTO workflow_artifact_payloads ( + rowid, payload_digest, byte_length, payload + ) + SELECT rowid, payload_digest, byte_length, payload + FROM workflow_artifact_payloads_published + ORDER BY rowid"; + +const COPY_EVIDENCE_SQL: &str = "SELECT + (SELECT count(*) FROM workflow_artifact_payloads_published), + (SELECT count(*) FROM workflow_artifact_payloads), + (SELECT count(*) + FROM workflow_artifact_payloads_published AS published + JOIN workflow_artifact_payloads AS upgraded ON upgraded.rowid = published.rowid + WHERE upgraded.payload_digest = published.payload_digest + AND upgraded.byte_length = published.byte_length + AND upgraded.payload = published.payload)"; + +/// What a store whose workflow tables differ from the final contract turned +/// out to be. +pub(super) enum PublishedArtifactCeilingShape { + /// Exactly the published shape, with conforming rows. + Upgradable, + /// The published tables and identity, but with something an upgrade could + /// not carry across. The reason names only contract objects and counts. + Refused(String), + /// Some other shape, reported by the ordinary drift refusal. + Other, +} + +pub(super) async fn classify_published_artifact_ceiling( + conn: &impl QueryExecutor, + workflow_tables: &[(&str, Option<&str>)], +) -> Result { + if !tables_match_published_shape(workflow_tables) || !records_published_identity(conn).await? { + return Ok(PublishedArtifactCeilingShape::Other); + } + let dependents = single_count(conn, DEPENDENT_OBJECT_COUNT_SQL, "inspect objects").await?; + if dependents > 0 { + return Ok(PublishedArtifactCeilingShape::Refused(format!( + "workflow tables carry the artifact ceiling published through 1.0.0-beta.92, but \ + {dependents} other schema object(s) refer to `{ARTIFACT_TABLE}`, so it cannot be \ + upgraded in place" + ))); + } + let nonconforming = single_count(conn, NONCONFORMING_ROW_COUNT_SQL, "inspect rows").await?; + if nonconforming > 0 { + return Ok(PublishedArtifactCeilingShape::Refused(format!( + "workflow tables carry the artifact ceiling published through 1.0.0-beta.92, but \ + {nonconforming} row(s) of `{ARTIFACT_TABLE}` break that table's own constraints, so \ + it cannot be upgraded in place" + ))); + } + Ok(PublishedArtifactCeilingShape::Upgradable) +} + +fn tables_match_published_shape(workflow_tables: &[(&str, Option<&str>)]) -> bool { + workflow_tables.len() == WORKFLOW_TABLE_CONTRACTS_V1.len() + && workflow_tables + .iter() + .zip(WORKFLOW_TABLE_CONTRACTS_V1) + .all(|((name, sql), contract)| { + let required = if contract.name == ARTIFACT_TABLE { + PUBLISHED_ARTIFACT_TABLE_SQL + } else { + contract.sql + }; + *name == contract.name && *sql == Some(required) + }) +} + +async fn records_published_identity(conn: &impl QueryExecutor) -> Result { + const OPERATION: &str = "inspect published workflow identity"; + let mut rows = conn + .query( + "SELECT singleton, schema_version, definition_digest FROM workflow_schema + ORDER BY singleton LIMIT 2", + (), + ) + .await + .map_err(|error| global_db_operation_error(OPERATION, error))?; + let Some(identity) = rows + .next() + .await + .map_err(|error| global_db_operation_error(OPERATION, error))? + else { + return Ok(false); + }; + let singleton = identity + .get::(0) + .map_err(|error| global_db_operation_error(OPERATION, error))?; + let version = identity + .get::(1) + .map_err(|error| global_db_operation_error(OPERATION, error))?; + let digest = identity + .get::(2) + .map_err(|error| global_db_operation_error(OPERATION, error))?; + let extra = rows + .next() + .await + .map_err(|error| global_db_operation_error(OPERATION, error))? + .is_some(); + Ok(singleton == 1 + && version == WORKFLOW_SCHEMA_VERSION_V1 + && digest == PUBLISHED_WORKFLOW_DIGEST + && !extra) +} + +async fn single_count( + conn: &impl QueryExecutor, + sql: &str, + operation: &'static str, +) -> Result { + let mut rows = conn + .query(sql, ()) + .await + .map_err(|error| global_db_operation_error(operation, error))?; + let row = rows + .next() + .await + .map_err(|error| global_db_operation_error(operation, error))? + .ok_or_else(|| global_db_operation_message(operation, "a count query returned no row"))?; + row.get::(0) + .map_err(|error| global_db_operation_error(operation, error)) +} + +/// Upgrades the published shape inside the caller's admission transaction. +/// +/// Classification ran on a read connection, so the shape is proven again under +/// the write lock before anything changes: a peer that upgraded in the meantime +/// makes this a no-op, and one that changed the store into anything else +/// refuses. Every step shares the caller's transaction, so any failure leaves +/// the store exactly as found. +pub(super) async fn upgrade_published_artifact_ceiling( + transaction: &(impl Executor + Sync), +) -> Result<()> { + let proven = Box::pin(inspect_workflow_schema_for_admission(transaction)).await?; + match proven { + Ok(WorkflowSchemaAdmission::Complete) => return Ok(()), + Ok(WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling) => {} + Ok(WorkflowSchemaAdmission::Create) => { + return Err(upgrade_refusal( + "the workflow tables disappeared before the upgrade began", + )); + } + Err(refused) => return Err(refused.error()), + } + let final_table_sql = WORKFLOW_TABLE_CONTRACTS_V1 + .iter() + .find(|contract| contract.name == ARTIFACT_TABLE) + .map(|contract| contract.sql) + .ok_or_else(|| upgrade_refusal("the final contract has no artifact table"))?; + + run_step( + transaction, + &format!("ALTER TABLE {ARTIFACT_TABLE} RENAME TO {DISPLACED_ARTIFACT_TABLE}"), + "move the published artifact table aside", + ) + .await?; + run_step( + transaction, + final_table_sql, + "create the final artifact table", + ) + .await?; + run_step(transaction, COPY_ROWS_SQL, "copy artifact rows").await?; + require_every_row_copied(transaction).await?; + run_step( + transaction, + &format!("DROP TABLE {DISPLACED_ARTIFACT_TABLE}"), + "drop the published artifact table", + ) + .await?; + record_final_identity(transaction).await?; + + let upgraded = Box::pin(inspect_workflow_schema_for_admission(transaction)).await?; + match upgraded { + Ok(WorkflowSchemaAdmission::Complete) => Ok(()), + Ok(_) => Err(upgrade_refusal( + "the upgraded workflow tables did not reach the final contract", + )), + Err(refused) => Err(refused.error()), + } +} + +async fn run_step( + transaction: &(impl Executor + Sync), + sql: &str, + step: &'static str, +) -> Result<()> { + transaction + .execute_batch(sql) + .await + .map_err(|error| upgrade_step_error(step, error)) +} + +async fn require_every_row_copied(transaction: &(impl Executor + Sync)) -> Result<()> { + const STEP: &str = "verify copied artifact rows"; + let mut rows = transaction + .query(COPY_EVIDENCE_SQL, ()) + .await + .map_err(|error| upgrade_step_error(STEP, error))?; + let evidence = rows + .next() + .await + .map_err(|error| upgrade_step_error(STEP, error))? + .ok_or_else(|| upgrade_refusal("the artifact copy evidence returned no row"))?; + let count = |index| { + evidence + .get::(index) + .map_err(|error| upgrade_step_error(STEP, error)) + }; + let (published, upgraded, identical) = (count(0)?, count(1)?, count(2)?); + if published != upgraded || published != identical { + return Err(upgrade_refusal( + "the copied artifact rows differ from the published rows", + )); + } + Ok(()) +} + +async fn record_final_identity(transaction: &(impl Executor + Sync)) -> Result<()> { + const STEP: &str = "record the final workflow identity"; + let updated = transaction + .execute( + "UPDATE workflow_schema SET definition_digest = ?1 + WHERE singleton = 1 AND schema_version = ?2 AND definition_digest = ?3", + ( + WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, + WORKFLOW_SCHEMA_VERSION_V1, + PUBLISHED_WORKFLOW_DIGEST, + ), + ) + .await + .map_err(|error| upgrade_step_error(STEP, error))?; + if updated != 1 { + return Err(upgrade_refusal( + "the published workflow identity changed during the upgrade", + )); + } + Ok(()) +} + +/// `SQLITE_ERROR`: the statement itself cannot run against this schema, for +/// example an unrelated broken trigger failing the rename's schema check. +const SQLITE_ERROR: i32 = 1; + +/// A failure that will recur on every open means this store cannot take the +/// upgrade, which is the store's typed refusal. One that can clear by itself, +/// such as a held lock or a full disk, stays an operation failure the next +/// open retries, so a passing condition never tells an operator to reset. +fn upgrade_step_error(step: &'static str, error: engine::Error) -> TraceDecayError { + if error.is_deterministic_refusal() || error.sqlite_code() == Some(SQLITE_ERROR) { + upgrade_refusal(&format!("the store refused the step to {step}")) + } else { + global_db_operation_error(step, error) + } +} + +fn upgrade_refusal(detail: &str) -> TraceDecayError { + TraceDecayError::reset_required( + "workflow", + format!( + "the artifact ceiling published through 1.0.0-beta.92 could not be upgraded and the \ + store was left as found: {detail}" + ), + ) +} diff --git a/crates/tracedecay-global-db/src/tests/harness.rs b/crates/tracedecay-global-db/src/tests/harness.rs index 19b49ac551..bb80c1884b 100644 --- a/crates/tracedecay-global-db/src/tests/harness.rs +++ b/crates/tracedecay-global-db/src/tests/harness.rs @@ -29,7 +29,7 @@ use tracedecay_store::{ build_observation_resolution_authorization_v1, build_observation_retrieval_anchor, }; -pub(super) static TEST_RUNTIME_NONCE: AtomicU64 = AtomicU64::new(1); +pub(crate) static TEST_RUNTIME_NONCE: AtomicU64 = AtomicU64::new(1); #[cfg(test)] static HOST_ADMISSION_TEST_RESIDENT_MEMORY: OnceLock< Arc, From 990e9bacc92beeea4593caac92b440e6eb4f5433 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:23:17 -0800 Subject: [PATCH 25/63] fix(evals): refuse unsupported atomic result volumes Detect hard-link incompatibility before issuing HTTP inference. Keep no-clobber and resumable evidence unchanged, and verify sample destinations, interrupted retries and dangling output links. --- evals/intent_engine/HTTP_RUNNER.md | 7 ++- evals/intent_engine/run_http.py | 30 ++++++++++++- evals/intent_engine/test_run_http.py | 65 +++++++++++++++++++++++++++- 3 files changed, 98 insertions(+), 4 deletions(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index 68477dac13..9ef08f1f82 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -39,7 +39,12 @@ results are fully rendered and synced in a same-directory temporary file, then published exclusively using an atomic hard link. A failed write/link cannot expose truncated completed JSON and leaves the exact-identity `.partial` log available for a retry without repeating inference. Completion does not -guarantee directory metadata durability across an abrupt OS crash. +guarantee directory metadata durability across an abrupt OS crash. Before +making HTTP requests, the runner probes no-clobber hard-link publication in +the results directory and (if needed) the optional sample directory. Volumes +without hard-link support, such as FAT/exFAT, refuse immediately without +creating a partial log or spending inference tokens; use a compatible output +filesystem instead. No unsafe replace-on-rename fallback is attempted. ## Token and truncation evidence diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 72a5711d39..8e4f0edc41 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -64,6 +64,31 @@ def publish_sample(path, serialized): os.unlink(staged) +def require_exclusive_publication(directory): + """Refuse unsupported result volumes before spending inference tokens. + + Both completed output and first-response samples use no-clobber hard links. + A writable directory alone does not prove that publication will work: + FAT/exFAT volumes can accept the partial log but never complete the run. + """ + staged = os.path.join(directory, f".noul-link-probe-{secrets.token_hex(16)}") + linked = staged + ".linked" + descriptor = os.open(staged, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600) + os.close(descriptor) + try: + try: + os.link(staged, linked) + except OSError as error: + raise OSError( + f"exclusive publication requires hard links in {directory}; " + "choose a hard-link-capable output directory" + ) from error + finally: + if os.path.lexists(linked): + os.unlink(linked) + os.unlink(staged) + + def publish_final_result(path, document): """Expose a completed JSON result only after its bytes are fully written. @@ -227,8 +252,11 @@ def main(argv=None): for cfg in args.configs: name = f"{args.tag}_{cfg}" path = os.path.join(HERE, "results", name + ".json") - if os.path.exists(path): + if os.path.lexists(path): raise ValueError(f"completed output already exists: {path}; use a new tag") + require_exclusive_publication(os.path.dirname(os.path.abspath(path))) + if args.sample_out and not os.path.isfile(args.sample_out): + require_exclusive_publication(os.path.dirname(os.path.abspath(args.sample_out))) requests = {} for case in dataset: body = {"state": STATES[cfg](case), "questions": questions} diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index 7b4981a6a6..8d051a2a12 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -355,6 +355,57 @@ def test_invalid_subsets_cannot_silently_change_the_cohort(self): self.run_main(["--subset", str(self.root / "subset.json")]) post.assert_not_called() + def test_unsupported_results_volume_refuses_before_any_http_work(self): + with patch.object(run_http, "post") as post: + with patch.object(run_http.os, "link", side_effect=OSError("unsupported links")): + with self.assertRaisesRegex(OSError, "requires hard links"): + self.run_main() + post.assert_not_called() + self.assertFalse(self.partial.exists()) + self.assertFalse(self.output.exists()) + self.assertEqual(list(self.output.parent.glob(".noul-link-probe-*")), []) + + # A real partial on a newly unavailable volume stays intact, and a + # retry refuses without duplicating already recorded inference. + self.interrupt() + preserved = self.partial.read_bytes() + with patch.object(run_http, "post") as post: + with patch.object(run_http.os, "link", side_effect=OSError("unsupported links")): + with self.assertRaisesRegex(OSError, "requires hard links"): + self.run_main() + post.assert_not_called() + self.assertEqual(self.partial.read_bytes(), preserved) + + def test_unsupported_sample_volume_refuses_before_any_http_work(self): + sample = self.root / "first-response.json" + actual_link = os.link + + def refuse_sample_volume(source, destination): + if os.path.dirname(source) == str(self.root): + raise OSError("sample volume lacks hard links") + return actual_link(source, destination) + + with patch.object(run_http, "post") as post: + with patch.object(run_http.os, "link", side_effect=refuse_sample_volume): + with self.assertRaisesRegex(OSError, "requires hard links"): + self.run_main(["--sample-out", str(sample)]) + post.assert_not_called() + self.assertFalse(self.partial.exists()) + self.assertFalse(sample.exists()) + self.assertEqual(list(self.root.glob(".noul-link-probe-*")), []) + self.assertEqual(list(self.output.parent.glob(".noul-link-probe-*")), []) + + @unittest.skipUnless(os.name == "posix", "dangling symlinks require POSIX") + def test_dangling_completed_output_refuses_before_inference(self): + self.output.parent.mkdir() + self.output.symlink_to("missing-result.json") + with patch.object(run_http, "post") as post: + with self.assertRaisesRegex(ValueError, "already exists"): + self.run_main() + post.assert_not_called() + self.assertTrue(self.output.is_symlink()) + self.assertFalse(self.partial.exists()) + def test_completed_output_is_fully_valid_before_its_name_is_published(self): actual_link = os.link inspected = [] @@ -379,8 +430,15 @@ def inspect_staged_file(source, destination): ["first", "second"]) def test_final_link_failure_preserves_a_complete_resumable_partial(self): + actual_link = os.link + + def fail_final_only(source, destination): + if destination == str(self.output): + raise OSError("link refused") + return actual_link(source, destination) + with patch.object(run_http, "post", side_effect=self.response): - with patch.object(run_http.os, "link", side_effect=OSError("link refused")): + with patch.object(run_http.os, "link", side_effect=fail_final_only): with self.assertRaisesRegex(OSError, "link refused"): self.run_main() self.assertFalse(self.output.exists()) @@ -407,8 +465,11 @@ def test_staged_flush_failure_leaves_no_apparently_completed_result(self): self.assertFalse(self.partial.exists()) def test_competing_final_publication_cannot_be_overwritten(self): + actual_link = os.link + def race_at_publication(source, destination): - self.assertEqual(destination, str(self.output)) + if destination != str(self.output): + return actual_link(source, destination) self.output.write_text('{"other_writer": true}', encoding="utf-8") raise FileExistsError("another result won publication") From bd04c2680e17246701c65f06abb85ce34748d279 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:52:18 -0800 Subject: [PATCH 26/63] test(diagnostics): stop timing the analyzer's first spawn The two native-runtime diagnostics tests failed in the full application suite while passing alone: `language_refresh` reported `LSP server '/usr/bin/python3' initialize timed out after 5000 ms` and `idle_backfill` never published. Both tests time a 5s initialize budget, and the first interpreter spawn in a test process costs far more than every later one. Measured in this target, the first start against the fixture took 0.49-1.66s while the second and third took 27-90ms for the same script. Under load that one-time cost consumed the whole budget, so the assertion timed the process's first spawn rather than the refresh. Warm the interpreter once before the authority is built, so the measured refresh starts from the steady state. Verified against the configuration that reproduced both failures (24 CPU burners on 18 cores): the full suite now passes 567/567, and the two tests pass 5/5 under 40 burners. The idle backfill also discarded its refresh error entirely, so a backfill that produced nothing looked like one with no work to do. Log it; the broker already records it as the language's engine error. --- .../src/dashboard_diagnostics.rs | 12 ++++++++- .../src/dashboard_diagnostics_native_tests.rs | 26 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay-application/src/dashboard_diagnostics.rs b/crates/tracedecay-application/src/dashboard_diagnostics.rs index 3d80032c49..46ebedbbc9 100644 --- a/crates/tracedecay-application/src/dashboard_diagnostics.rs +++ b/crates/tracedecay-application/src/dashboard_diagnostics.rs @@ -490,7 +490,17 @@ impl DashboardDiagnosticsAuthorityV1 { native_runtime::sleep_until(std::time::Instant::now() + Duration::from_millis(750)) .await; for language in languages { - let _ = authority.refresh_language(&request, &language).await; + // The broker already recorded this failure as the language's + // engine error, which the dashboard reads. Log it here as well + // so an idle backfill that produced nothing is attributable + // instead of looking like a backfill that had no work. + if let Err(error) = authority.refresh_language(&request, &language).await { + tracing::warn!( + language, + error = %error, + "code diagnostics idle backfill refresh failed" + ); + } } }); if let Err(error) = started { diff --git a/crates/tracedecay-application/src/dashboard_diagnostics_native_tests.rs b/crates/tracedecay-application/src/dashboard_diagnostics_native_tests.rs index 354df743ff..c5bb8c9951 100644 --- a/crates/tracedecay-application/src/dashboard_diagnostics_native_tests.rs +++ b/crates/tracedecay-application/src/dashboard_diagnostics_native_tests.rs @@ -154,9 +154,35 @@ fn python() -> &'static str { } } +/// Warm the analyzer interpreter before a test measures the refresh. +/// +/// The first interpreter spawn in a test process costs materially more than +/// every later one: measured in this target, the first `StdioLspClient` start +/// against the fixture took 0.49-1.66s while the second and third took 27-90ms +/// for the same script. That one-time cost is unrelated to the diagnostics path +/// under test, and on a loaded host it consumed the refresh's 5s initialize +/// budget, which is what produced `initialize timed out after 5000 ms`. +/// Paying it once here, before the authority is built, keeps both assertions +/// timing the refresh instead of the process's first spawn. +fn warm_analyzer_interpreter() { + static WARMED: std::sync::Once = std::sync::Once::new(); + WARMED.call_once(|| { + // Import what the fixture analyzer imports, so the warm-up exercises + // the same interpreter startup work. It exits at EOF, no handshake. + let _ = std::process::Command::new(python()) + .arg("-c") + .arg("import json, sys") + .stdin(std::process::Stdio::null()) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .status(); + }); +} + /// A dashboard authority over a one-file project whose fake analyzer reports /// one type error. fn fake_analyzer_authority(project: &std::path::Path) -> DashboardDiagnosticsAuthorityV1 { + warm_analyzer_interpreter(); std::fs::create_dir_all(project.join("src")).expect("source dir"); std::fs::write(project.join("src/lib.fake"), "let nope\n").expect("source"); let analyzer = project.join("fake_analyzer.py"); From c4f087192889515bc69a4aadc500569f7b77790d Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:11:06 -0800 Subject: [PATCH 27/63] fix(evals): preserve foreign files during link probes Refs #4535. Exclusive-publication preflight must not delete an already-existing path when hard-link creation fails with EEXIST. Only unlink the probe link when this invocation created it. Also clean owned staging after close or cleanup failures and preserve underlying permission and filesystem error details. Add four fault-injection regressions for collision, permissions, close failure and cleanup failure; preserve existing runner tests. The exact patch passed 41 standalone Python regressions previously; Bazel CI is required on the published head. --- evals/intent_engine/run_http.py | 18 +++++--- evals/intent_engine/test_run_http.py | 65 ++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 5 deletions(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 8e4f0edc41..d222f01ec4 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -74,19 +74,27 @@ def require_exclusive_publication(directory): staged = os.path.join(directory, f".noul-link-probe-{secrets.token_hex(16)}") linked = staged + ".linked" descriptor = os.open(staged, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600) - os.close(descriptor) + linked_created = False try: + os.close(descriptor) try: os.link(staged, linked) + linked_created = True except OSError as error: raise OSError( + error.errno, f"exclusive publication requires hard links in {directory}; " - "choose a hard-link-capable output directory" + f"probe failed: {error}", + directory, ) from error finally: - if os.path.lexists(linked): - os.unlink(linked) - os.unlink(staged) + try: + # A failed exclusive link may have collided with someone else's + # file. Path existence is not proof that this probe created it. + if linked_created: + os.unlink(linked) + finally: + os.unlink(staged) def publish_final_result(path, document): diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index 8d051a2a12..b1430382fc 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -1,6 +1,7 @@ """Runner persistence tests. HTTP inference is substituted, not qualified here.""" import contextlib import copy +import errno import hashlib import io import json @@ -355,6 +356,70 @@ def test_invalid_subsets_cannot_silently_change_the_cohort(self): self.run_main(["--subset", str(self.root / "subset.json")]) post.assert_not_called() + def test_failed_probe_preserves_a_link_target_it_did_not_create(self): + self.output.parent.mkdir() + foreign = self.output.parent / ".noul-link-probe-collision.linked" + content = b"another publication owns this file\n" + foreign.write_bytes(content) + # Force a collision with a real existing file; os.link itself must + # refuse it. Cleanup is not authorized to remove the winning file. + with patch.object(run_http.secrets, "token_hex", return_value="collision"): + with patch.object(run_http, "post") as post: + with self.assertRaises(OSError): + self.run_main() + post.assert_not_called() + self.assertEqual(foreign.read_bytes(), content) + self.assertEqual(list(self.output.parent.iterdir()), [foreign]) + self.assertFalse(self.partial.exists()) + + def test_probe_permission_error_preserves_the_underlying_cause(self): + error = PermissionError(errno.EACCES, "policy denied link creation") + with patch.object(run_http, "post") as post: + with patch.object(run_http.os, "link", side_effect=error): + with self.assertRaises(OSError) as caught: + self.run_main() + post.assert_not_called() + self.assertEqual(caught.exception.errno, errno.EACCES) + self.assertIs(caught.exception.__cause__, error) + self.assertIn("policy denied link creation", str(caught.exception)) + self.assertIn(str(self.output.parent), str(caught.exception)) + self.assertEqual(list(self.output.parent.iterdir()), []) + + def test_probe_close_failure_still_removes_owned_staging(self): + actual_close = os.close + + def close_then_fail(descriptor): + actual_close(descriptor) + raise OSError(errno.EIO, "probe close failed") + + with patch.object(run_http, "post") as post: + with patch.object(run_http.os, "close", side_effect=close_then_fail): + with self.assertRaisesRegex(OSError, "probe close failed"): + self.run_main() + post.assert_not_called() + self.assertEqual(list(self.output.parent.iterdir()), []) + self.assertFalse(self.partial.exists()) + + def test_link_cleanup_failure_does_not_skip_owned_staging_cleanup(self): + actual_unlink = os.unlink + blocked = [] + + def refuse_link_cleanup(path, *args, **kwargs): + if str(path).endswith(".linked"): + blocked.append(Path(path)) + raise PermissionError(errno.EACCES, "probe link cleanup denied") + return actual_unlink(path, *args, **kwargs) + + with patch.object(run_http, "post") as post: + with patch.object(run_http.os, "unlink", side_effect=refuse_link_cleanup): + with self.assertRaisesRegex(OSError, "probe link cleanup denied"): + self.run_main() + post.assert_not_called() + self.assertEqual(len(blocked), 1) + self.assertEqual(list(self.output.parent.iterdir()), blocked) + self.assertFalse(self.partial.exists()) + actual_unlink(blocked[0]) + def test_unsupported_results_volume_refuses_before_any_http_work(self): with patch.object(run_http, "post") as post: with patch.object(run_http.os, "link", side_effect=OSError("unsupported links")): From 8a0dbd0b9d55bc0dfb16316dfdb2dbdb46c4ea19 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:21:54 -0800 Subject: [PATCH 28/63] fix(global-db): stop census rewriting published artifact rows The reset census rehearsed the whole published-shape upgrade and rolled it back, so a 276 MB store wrote 267 MB to the WAL per census. A census now decides from read-only classification plus the one catalog-only rename no query can predict: 19 ms and no WAL growth at any payload size. One copy statement and one byte-compare query could outrun the transaction deadline, which renews only between statements, so a large store could fail every open and never upgrade, and shutdown could not stop the copy. Rows now move in batches of at most 128 MiB, and the classification scan is paged. The byte compare is gone: SQLite's transaction already guarantees the copy, so rows are checked by count. Classification also missed shapes the copy would have mishandled: a trigger named after the artifact table, triggers on workflow_schema, rows of the wrong storage type, and an identity row that does not decode. A schema that refuses the rename now refuses workflow features and serves the store's other authorities, as other shape refusals do. The upgrade runs last, so a store refused by observations keeps its published shape. A real attach still copies once, since the exact-SQL guard denies the catalog edit that would avoid it. Co-Authored-By: Claude Opus 5.5 --- .../src/registered/workflow_schema_tests.rs | 454 +++++++++++++++++- .../tracedecay-global-db/src/schema_stages.rs | 90 ++-- .../workflow_artifact_ceiling_upgrade.rs | 302 +++++++----- 3 files changed, 693 insertions(+), 153 deletions(-) diff --git a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs index 7dfdcb2393..386f91b5fa 100644 --- a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs +++ b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs @@ -225,7 +225,7 @@ async fn extra_workflow_schema_identity_requires_reset_without_mutation() { mod published_artifact_ceiling { use std::future::Future as _; use std::path::{Path, PathBuf}; - use std::sync::atomic::Ordering; + use std::sync::atomic::{AtomicUsize, Ordering}; use std::task::Poll; use rusqlite::Connection; @@ -234,11 +234,14 @@ mod published_artifact_ceiling { use tracedecay_lcm::LCM_SCHEMA_VERSION; use tracedecay_runtime_core::cancellation::CancellationToken; use tracedecay_runtime_core::db::TestDatabaseRuntimeScope; + use tracedecay_runtime_core::db::engine; use tracedecay_rusqlite_runtime::workflow::{ WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_TABLE_CONTRACTS_V1, }; + use super::fs; use crate::RegisteredGlobalDbOwnerV1; + use crate::schema_stages::upgrade_published_artifact_ceiling; use crate::tests::harness::open_registered_test_database_fixture; /// The artifact table as `git show v1.0.0-beta.92` defines it, deliberately @@ -493,11 +496,11 @@ mod published_artifact_ceiling { assert_eq!(upgraded.artifacts.len(), 4); } - /// A failure at the very last step, after the rows moved and the published - /// table was dropped, must restore all of it, and the store must take the - /// upgrade once the cause is gone. + /// A trigger that would block the identity swap is visible before anything + /// runs, so the census can name it too: the store is refused untouched, and + /// takes the upgrade once it is gone. #[asupersync::test] - async fn failed_upgrade_rolls_back_every_step_and_succeeds_once_unblocked() { + async fn identity_blocking_trigger_refuses_until_it_is_gone() { let store = PublishedStore::create().await; store.run( "CREATE TRIGGER block_workflow_identity BEFORE UPDATE ON workflow_schema @@ -505,17 +508,8 @@ mod published_artifact_ceiling { ); let before = store.state(); - let error = open_registered_test_database_fixture( - &store.path, - TestDatabaseRuntimeScope::ProfileSessions, - ) - .await - .err() - .expect("an upgrade that cannot finish must not publish the store"); - let Some(("workflow", reason)) = error.reset_required_context() else { - panic!("refused with the wrong typed state: {error}"); - }; - assert!(reason.contains("left as found"), "{reason}"); + let reason = assert_workflow_refusal(store.admit().await); + assert!(reason.contains("1 other schema object(s)"), "{reason}"); assert!(!reason.contains("foreign trigger text"), "{reason}"); assert_eq!(store.state(), before); @@ -526,6 +520,23 @@ mod published_artifact_ceiling { assert_eq!(after.artifacts, before.artifacts); } + /// A row STRICT would reject, reachable only by a store edited around it, + /// under the exact published table text. + fn written_around_strict_types(values: &str) -> String { + format!( + "PRAGMA ignore_check_constraints = ON; + PRAGMA writable_schema = ON; + UPDATE sqlite_master SET sql = replace(sql, ') STRICT', ')') + WHERE name = 'workflow_artifact_payloads'; + PRAGMA writable_schema = RESET; + INSERT INTO workflow_artifact_payloads VALUES ({values}); + PRAGMA writable_schema = ON; + UPDATE sqlite_master SET sql = sql || ' STRICT' + WHERE name = 'workflow_artifact_payloads'; + PRAGMA writable_schema = RESET;" + ) + } + /// Each case differs from the proven shape in one way and must be refused /// with nothing changed. #[asupersync::test] @@ -593,6 +604,41 @@ mod published_artifact_ceiling { "CREATE TABLE workflow_artifact_payloads_published (value TEXT);".to_owned(), "1 other schema object(s)", ), + ( + "a trigger named exactly after the artifact table", + "CREATE TRIGGER workflow_artifact_payloads AFTER INSERT ON workflow_artifact_payloads + BEGIN SELECT 1; END;" + .to_owned(), + "1 other schema object(s)", + ), + ( + "a trigger on the identity table", + "CREATE TRIGGER identity_audit AFTER UPDATE ON workflow_schema + BEGIN SELECT 1; END;" + .to_owned(), + "1 other schema object(s)", + ), + ( + "an index on the artifact table", + "CREATE INDEX artifact_length ON workflow_artifact_payloads (byte_length);" + .to_owned(), + "1 other schema object(s)", + ), + ( + "a digest written around the strict column type", + written_around_strict_types("x'00', 1, x'aa'"), + "1 row(s)", + ), + ( + "a byte length written around the strict column type", + written_around_strict_types("'sha256:text-length', 'one', x'aa'"), + "1 row(s)", + ), + ( + "a payload written around the strict column type", + written_around_strict_types("'sha256:text-payload', 2, 'ab'"), + "1 row(s)", + ), ( "a row whose length disagrees", "PRAGMA ignore_check_constraints = ON; @@ -743,7 +789,7 @@ mod published_artifact_ceiling { } /// The census asks what attach would decide. It must admit a store the - /// real attach can upgrade, and must not perform that upgrade itself. + /// real attach can upgrade, and must not leave that upgrade behind. #[asupersync::test(flavor = "multi_thread")] async fn attach_refusal_inspection_admits_without_upgrading() { let daemon_store = DaemonPublishedStore::create().await; @@ -793,6 +839,7 @@ mod published_artifact_ceiling { } let reference = DaemonPublishedStore::create().await; + reference.store.run(BULK_ROWS); let before = reference.store.state(); let (outcome, total_polls) = admit_cancelled_at(&reference.store.path, usize::MAX).await; outcome.unwrap(); @@ -805,6 +852,7 @@ mod published_artifact_ceiling { for cancel_at in (1..total_polls).step_by(stride) { let daemon_store = DaemonPublishedStore::create().await; let store = &daemon_store.store; + store.run(BULK_ROWS); let (outcome, _) = admit_cancelled_at(&store.path, cancel_at).await; let state = store.state(); match outcome { @@ -813,7 +861,7 @@ mod published_artifact_ceiling { assert!(error.is_store_open_cancelled(), "poll {cancel_at}: {error}"); assert!( state == before || state == completed, - "poll {cancel_at} left a partial upgrade: {state:?}" + "poll {cancel_at} left a partial upgrade" ); cancelled += 1; let (reopened, _) = admit_cancelled_at(&store.path, usize::MAX).await; @@ -825,6 +873,376 @@ mod published_artifact_ceiling { assert!(cancelled > 0, "the sweep never observed a cancellation"); } + /// Rows spread over several copy batches, with rowid gaps and a negative + /// rowid a batch cursor starting at zero would lose. + const BULK_ROWS: &str = " + WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 100) + INSERT INTO workflow_artifact_payloads (rowid, payload_digest, byte_length, payload) + SELECT i * 3 + 100, 'sha256:bulk-' || i, 8, CAST(printf('%08d', i) AS BLOB) FROM n; + INSERT INTO workflow_artifact_payloads (rowid, payload_digest, byte_length, payload) + VALUES (-5, 'sha256:negative-rowid', 1, x'07');"; + + /// An attached runtime whose statements fail at one chosen occurrence, for + /// the faults a healthy store never produces. + struct FailingStatement<'a, T> { + inner: &'a T, + needle: &'static str, + occurrence: AtomicUsize, + error: fn() -> engine::Error, + } + + impl<'a, T> FailingStatement<'a, T> { + fn new( + inner: &'a T, + needle: &'static str, + occurrence: usize, + error: fn() -> engine::Error, + ) -> Self { + Self { + inner, + needle, + occurrence: AtomicUsize::new(occurrence), + error, + } + } + + fn check(&self, sql: &str) -> engine::Result<()> { + if sql.contains(self.needle) && self.occurrence.fetch_sub(1, Ordering::Relaxed) == 1 { + return Err((self.error)()); + } + Ok(()) + } + } + + impl engine::QueryExecutor for FailingStatement<'_, T> { + async fn query

(&self, sql: &str, params: P) -> engine::Result + where + P: engine::IntoParams, + { + self.check(sql)?; + self.inner.query(sql, params).await + } + } + + impl engine::Executor for FailingStatement<'_, T> { + async fn execute

(&self, sql: &str, params: P) -> engine::Result + where + P: engine::IntoParams, + { + self.check(sql)?; + self.inner.execute(sql, params).await + } + + async fn execute_batch(&self, sql: &str) -> engine::Result<()> { + self.check(sql)?; + self.inner.execute_batch(sql).await + } + } + + /// A step failing anywhere in the upgrade, including between copy batches + /// and in the final proof, restores everything once the admission + /// transaction rolls back. A refused statement is the store's typed reset; + /// a held database is not, so a passing condition never asks for one. + #[asupersync::test(flavor = "multi_thread")] + async fn failure_at_any_upgrade_step_rolls_back_with_the_right_typed_state() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run(BULK_ROWS); + let before = store.state(); + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let lease = database.issue_lease().unwrap(); + + for (needle, occurrence) in [ + ("ALTER TABLE", 1), + ("CREATE TABLE workflow_artifact_payloads", 1), + ("INSERT INTO workflow_artifact_payloads", 1), + ("INSERT INTO workflow_artifact_payloads", 3), + ("DROP TABLE", 1), + ("UPDATE workflow_schema", 1), + ("table_info", 1), + ] { + let transaction = lease.begin_bulk_write_transaction("fault").await.unwrap(); + let busy = upgrade_published_artifact_ceiling(&FailingStatement::new( + &transaction, + needle, + occurrence, + || engine::Error::Busy, + )) + .await + .err() + .unwrap_or_else(|| panic!("{needle}#{occurrence} must fail the upgrade")); + assert!(!busy.is_store_reset_required(), "{needle}: {busy}"); + transaction.rollback().await.unwrap(); + assert_eq!( + store.state(), + before, + "{needle}#{occurrence} was not undone" + ); + } + + for (needle, occurrence) in [ + ("INSERT INTO workflow_artifact_payloads", 2), + ("DROP TABLE", 1), + ("UPDATE workflow_schema", 1), + ] { + let transaction = lease.begin_bulk_write_transaction("fault").await.unwrap(); + let refused = upgrade_published_artifact_ceiling(&FailingStatement::new( + &transaction, + needle, + occurrence, + || engine::Error::InvalidOperation("refused".to_owned()), + )) + .await + .err() + .unwrap_or_else(|| panic!("{needle}#{occurrence} must fail the upgrade")); + let reason = assert_workflow_refusal(Some(refused)); + assert!(reason.contains("left as found"), "{reason}"); + transaction.rollback().await.unwrap(); + assert_eq!( + store.state(), + before, + "{needle}#{occurrence} was not undone" + ); + } + + // The same runtime takes the upgrade once nothing interferes, and + // moves every row of every batch. + let transaction = lease.begin_bulk_write_transaction("upgrade").await.unwrap(); + assert!( + upgrade_published_artifact_ceiling(&transaction) + .await + .unwrap() + .is_none() + ); + transaction.commit().await.unwrap(); + let after = store.state(); + assert_eq!(after.table_sql, final_table_sql()); + assert_eq!(after.artifacts, before.artifacts); + assert_eq!(after.artifacts.len(), 104); + assert_eq!(after.artifacts[0].0, -5); + } + + /// Classification runs before the write lock. A peer that finished the + /// upgrade in between leaves nothing to do; one that changed the store into + /// another shape in between gets the refusal, not a blind rewrite. + #[asupersync::test(flavor = "multi_thread")] + async fn the_write_lock_proof_decides_after_a_stale_classification() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let lease = database.issue_lease().unwrap(); + + store.run( + "CREATE TRIGGER peer_audit AFTER DELETE ON workflow_artifact_payloads + BEGIN SELECT 1; END;", + ); + let before = store.state(); + let transaction = lease.begin_bulk_write_transaction("stale").await.unwrap(); + let refused = upgrade_published_artifact_ceiling(&transaction) + .await + .unwrap() + .expect("a shape changed under the classification is refused"); + assert!( + assert_workflow_refusal(Some(refused.error())).contains("1 other schema object(s)") + ); + transaction.commit().await.unwrap(); + assert_eq!(store.state(), before); + store.run("DROP TRIGGER peer_audit;"); + + for _ in 0..2 { + let transaction = lease.begin_bulk_write_transaction("peer").await.unwrap(); + assert!( + upgrade_published_artifact_ceiling(&transaction) + .await + .unwrap() + .is_none() + ); + transaction.commit().await.unwrap(); + } + let after = store.state(); + assert_eq!(after.digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + assert_eq!(after.artifacts, before.artifacts); + } + + /// A peer holding the write lock delays the upgrade and says nothing about + /// the store: the attach fails retryably, and the next one upgrades. + #[asupersync::test(flavor = "multi_thread")] + async fn held_write_lock_delays_the_upgrade_without_a_reset() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + let before = store.state(); + let peer = Connection::open(&store.path).unwrap(); + peer.execute_batch("BEGIN IMMEDIATE").unwrap(); + + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let error = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + database, + &CancellationToken::new(), + ) + .await + .err() + .expect("the write lock is held"); + assert!(!error.is_store_reset_required(), "{error}"); + peer.execute_batch("ROLLBACK").unwrap(); + drop(peer); + assert_eq!(store.state(), before); + + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let (owner, _) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + database, + &CancellationToken::new(), + ) + .await + .unwrap(); + assert!(owner.reset_required().is_none()); + drop(owner); + assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + } + + /// A store whose schema refuses the rename keeps serving its other + /// authorities, and the census names the same refusal attach reaches. + #[asupersync::test(flavor = "multi_thread")] + async fn census_and_attach_agree_on_a_schema_that_refuses_the_move() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run("CREATE VIEW broken_view AS SELECT missing FROM nowhere;"); + let before = store.state(); + + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let census = RegisteredGlobalDbOwnerV1::attach_reset_refusal(&database) + .await + .unwrap(); + let census_reason = assert_workflow_refusal(census); + assert!(census_reason.contains("moving"), "{census_reason}"); + assert_eq!(store.state(), before); + + let (owner, _) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + database, + &CancellationToken::new(), + ) + .await + .expect("the store's other authorities stay available"); + let attach_reason = assert_workflow_refusal(owner.reset_required()); + assert_eq!(attach_reason, census_reason); + drop(owner); + assert_eq!(store.state(), before); + } + + /// Asking whether a store can upgrade costs no payload IO: the census + /// leaves the WAL at its prior size however much the store holds, while the + /// same store's real attach still moves every row. + #[asupersync::test(flavor = "multi_thread")] + async fn census_writes_no_payload_bytes() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run( + "WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 64) + INSERT INTO workflow_artifact_payloads + SELECT 'sha256:large-' || i, 1048576, randomblob(1048576) FROM n;", + ); + let wal_path = format!("{}-wal", store.path.display()); + let wal_bytes = || fs::metadata(&wal_path).map_or(0, |metadata| metadata.len()); + let before = store.state(); + + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let wal_before = wal_bytes(); + for _ in 0..2 { + let refusal = RegisteredGlobalDbOwnerV1::attach_reset_refusal(&database) + .await + .unwrap(); + assert!(refusal.is_none(), "{refusal:?}"); + } + assert_eq!(wal_bytes(), wal_before, "the census rewrote the table"); + assert_eq!(store.state(), before); + + let (owner, _) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + database, + &CancellationToken::new(), + ) + .await + .unwrap(); + assert!(owner.reset_required().is_none()); + drop(owner); + assert_eq!(store.state().artifacts, before.artifacts); + } + + /// An observation refusal surfaces late in the stage sequence, after the + /// workflow stage. It still leaves the published shape in place. + #[asupersync::test] + async fn observation_refusal_keeps_the_published_shape() { + let store = PublishedStore::create().await; + store.run( + "DELETE FROM tracedecay_schema_version + WHERE component = 'observations-unified-identity-v1';", + ); + let before = store.state(); + + let refusal = store.admit().await.expect("old observations refuse"); + let Some(("observations", _)) = refusal.reset_required_context() else { + panic!("refused with the wrong typed state: {refusal}"); + }; + assert_eq!(store.state(), before); + } + + /// The classification page boundary must not hide a bad row, and a store + /// past one page still upgrades whole. + #[asupersync::test] + async fn row_classification_reaches_every_page() { + const PAGED_ROWS: &str = " + WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 4200) + INSERT INTO workflow_artifact_payloads + SELECT 'sha256:paged-' || i, 1, x'01' FROM n;"; + let store = PublishedStore::create().await; + store.run(PAGED_ROWS); + store.run( + "PRAGMA ignore_check_constraints = ON; + INSERT INTO workflow_artifact_payloads VALUES ('sha256:liar', 1, x'0011');", + ); + let reason = assert_workflow_refusal(store.admit().await); + assert!(reason.contains("1 row(s)"), "{reason}"); + + let store = PublishedStore::create().await; + store.run(PAGED_ROWS); + let before = store.state(); + assert!(store.admit().await.is_none()); + assert_eq!(store.state().artifacts, before.artifacts); + } + + /// A store that already carries the final contract is complete, with no + /// upgrade work, whatever version label the binary that wrote it carried. + #[asupersync::test(flavor = "multi_thread")] + async fn final_shape_store_has_nothing_to_upgrade() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run(&format!( + "DELETE FROM workflow_artifact_payloads; + DROP TABLE workflow_artifact_payloads; + {}; + INSERT INTO workflow_artifact_payloads VALUES ('sha256:final', 1, x'01'); + UPDATE workflow_schema SET definition_digest = '{WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1}';", + final_table_sql() + )); + let before = store.state(); + let (database, _runtime, _retirement) = + publish_daemon_runtime(&store.path).await.into_parts(); + let lease = database.issue_lease().unwrap(); + let transaction = lease.begin_bulk_write_transaction("final").await.unwrap(); + assert!( + upgrade_published_artifact_ceiling(&transaction) + .await + .unwrap() + .is_none() + ); + transaction.commit().await.unwrap(); + assert_eq!(store.state(), before); + } + /// The profile authority holds no workflow rows and never reads these /// tables, so it keeps them exactly as found. #[asupersync::test] diff --git a/crates/tracedecay-global-db/src/schema_stages.rs b/crates/tracedecay-global-db/src/schema_stages.rs index 475dfded91..6589e1f58f 100644 --- a/crates/tracedecay-global-db/src/schema_stages.rs +++ b/crates/tracedecay-global-db/src/schema_stages.rs @@ -6,9 +6,10 @@ use std::time::{Duration, Instant}; use tracedecay_domain::errors::ProjectOpenFailureKind; mod workflow_artifact_ceiling_upgrade; +pub(crate) use workflow_artifact_ceiling_upgrade::upgrade_published_artifact_ceiling; use workflow_artifact_ceiling_upgrade::{ PublishedArtifactCeilingShape, classify_published_artifact_ceiling, - upgrade_published_artifact_ceiling, + rehearse_published_artifact_ceiling_upgrade, }; use super::schema_contract::{ @@ -418,6 +419,14 @@ enum SessionFeatureSchema { NotHosted, } +impl SessionFeatureSchema { + fn upgrades_published_workflow_shape(self) -> bool { + self == Self::Hosted { + workflow: WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling, + } + } +} + /// The profile authority (`global.db`) holds the project registry, usage /// accounting, and remote-deletion records, never session rows: sessions, /// LCM, git correlation, and workflows live in the profile and project @@ -909,13 +918,9 @@ where transaction.commit().await.map_err(|error| { global_db_operation_error(commit_operation, std::io::Error::other(error)) })?; - if session_features - == (SessionFeatureSchema::Hosted { - workflow: WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling, - }) - { + if session_features.upgrades_published_workflow_shape() && refused_authority.is_none() { tracing::info!( - "upgraded the published workflow artifact table to the final contract" + "the published workflow artifact table now carries the final contract" ); } Ok(refused_authority) @@ -1112,13 +1117,6 @@ async fn install_registered_schema_stage_sequence( .await .map_err(|error| global_db_operation_error("initialize workflow schema", error))?; } - if session_features - == (SessionFeatureSchema::Hosted { - workflow: WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling, - }) - { - upgrade_published_artifact_ceiling(transaction).await?; - } transaction .execute_batch(WORK_SCHEMA_V1) .await @@ -1225,6 +1223,10 @@ async fn install_registered_schema_stage_sequence( global_db_operation_error("initialize workflow index schema", error) })?; } + // Last, so a store any earlier stage refuses keeps its published shape. + if session_features.upgrades_published_workflow_shape() && refused_authority.is_none() { + return upgrade_published_artifact_ceiling(transaction).await; + } Ok(refused_authority) } @@ -1432,7 +1434,11 @@ pub(crate) async fn ensure_attached_registered_schema( /// store keeps exactly its prior schema. The post-commit index builds and the /// composed authority-schema validation are left to the store's own attach: /// an older admissible store would otherwise build its historical indexes -/// only to discard them. +/// only to discard them. The published workflow upgrade is left to it for the +/// same reason: classification proved its rows and dependents without a write, +/// and only its catalog-only rename runs here, so a census never copies a +/// payload. +#[tracing::instrument(name = "global_db.schema.persist.census", level = "trace", skip_all)] pub(crate) async fn attached_registered_schema_reset_refusal( database: &Database, ) -> tracedecay_domain::errors::Result> { @@ -1471,6 +1477,14 @@ pub(crate) async fn attached_registered_schema_reset_refusal( Box> + Send + '_>, > = Box::pin(authority_invariant_triggers_intact(&read_connection)); let force_exhaustive = !triggers_intact.await?; + let upgrades_workflow = session_features.upgrades_published_workflow_shape(); + let staged_features = if upgrades_workflow { + SessionFeatureSchema::Hosted { + workflow: WorkflowSchemaAdmission::Complete, + } + } else { + session_features + }; let transaction = database.begin_bulk_write_transaction(OPERATION).await?; let staged: Pin< Box< @@ -1482,10 +1496,15 @@ pub(crate) async fn attached_registered_schema_reset_refusal( &transaction, configuration_fresh.as_ref(), temporal_admission, - session_features, + staged_features, force_exhaustive, )); - let admission = staged.await; + let admission = match staged.await { + Ok(None) if upgrades_workflow => { + rehearse_published_artifact_ceiling_upgrade(&transaction).await + } + staged => staged, + }; transaction .rollback() .await @@ -1736,13 +1755,15 @@ async fn recorded_workflow_identity( conn: &impl QueryExecutor, ) -> tracedecay_domain::errors::Result { match read_recorded_workflow_identity(conn).await { - Ok(Some((version, digest, false))) => Ok(format!( - "the store records version {version} with {}", - workflow_digest_label(&digest) + Ok(Some(identity)) if identity.extra => Ok(format!( + "the store records several identity rows, the first version {} with {}", + identity.version, + workflow_digest_label(&identity.digest) )), - Ok(Some((version, digest, true))) => Ok(format!( - "the store records several identity rows, the first version {version} with {}", - workflow_digest_label(&digest) + Ok(Some(identity)) => Ok(format!( + "the store records version {} with {}", + identity.version, + workflow_digest_label(&identity.digest) )), Ok(None) => Ok("the store records no workflow identity".to_owned()), Err(error) if error.is_transient_read_failure() => Err(global_db_operation_error( @@ -1753,12 +1774,19 @@ async fn recorded_workflow_identity( } } +struct RecordedWorkflowIdentity { + singleton: i64, + version: i64, + digest: String, + extra: bool, +} + async fn read_recorded_workflow_identity( conn: &impl QueryExecutor, -) -> engine::Result> { +) -> engine::Result> { let mut rows = conn .query( - "SELECT schema_version, definition_digest FROM workflow_schema + "SELECT singleton, schema_version, definition_digest FROM workflow_schema ORDER BY singleton LIMIT 2", (), ) @@ -1766,10 +1794,16 @@ async fn read_recorded_workflow_identity( let Some(first) = rows.next().await? else { return Ok(None); }; - let version = first.get::(0)?; - let digest = first.get::(1)?; + let singleton = first.get::(0)?; + let version = first.get::(1)?; + let digest = first.get::(2)?; let extra = rows.next().await?.is_some(); - Ok(Some((version, digest, extra))) + Ok(Some(RecordedWorkflowIdentity { + singleton, + version, + digest, + extra, + })) } fn workflow_table_drift_reason( diff --git a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs index 8b64a919a1..ab0de0aeed 100644 --- a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs +++ b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs @@ -1,14 +1,20 @@ //! In-place upgrade of the one published workflow shape the final contract //! left behind. //! -//! Every tagged release through 1.0.0-beta.92 created the same nine workflow -//! tables byte for byte and recorded the same identity digest. 1.0.0-beta.93 -//! dropped the artifact byte ceiling from `workflow_artifact_payloads`, which -//! changed that one table's `CHECK` and the identity digest, with no way for an -//! existing store to follow. The digest is an opaque published label rather -//! than a hash of the stored SQL, so this recognizes the shape from the exact -//! stored text together with the recorded identity. Anything else, however -//! close, keeps the typed refusal. +//! Tagged releases up to `v1.0.0-beta.92` created the same nine workflow tables +//! byte for byte and recorded the same identity digest. `v1.0.0-beta.93` dropped +//! the artifact byte ceiling from `workflow_artifact_payloads`, which changed +//! that one table's `CHECK` and the identity digest, with no way for an existing +//! store to follow. The digest is an opaque published label rather than a hash +//! of the stored SQL, so this recognizes the shape from the exact stored text +//! together with the recorded identity. Anything else, however close, keeps the +//! typed refusal. A binary's version label is no evidence either way: a build +//! labelled with one of those versions from a later source revision writes the +//! final shape, so only the store's own text decides. +//! +//! The exact-SQL guard denies catalog edits on the registered writer, so the +//! change is a real table move: it costs one copy of the artifact rows, once, on +//! the attach that upgrades. Deciding whether a store can take it costs no copy. use tracedecay_domain::errors::{Result, TraceDecayError}; use tracedecay_runtime_core::db::engine::{self, Executor, QueryExecutor}; @@ -16,7 +22,11 @@ use tracedecay_rusqlite_runtime::workflow::{ WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_SCHEMA_VERSION_V1, WORKFLOW_TABLE_CONTRACTS_V1, }; -use super::{WorkflowSchemaAdmission, inspect_workflow_schema_for_admission}; +use super::{ + WorkflowSchemaAdmission, inspect_workflow_schema_for_admission, + read_recorded_workflow_identity, workflow_schema_refusal, +}; +use crate::registered::RefusedAuthorityV1; use crate::{global_db_operation_error, global_db_operation_message}; const ARTIFACT_TABLE: &str = "workflow_artifact_payloads"; @@ -37,48 +47,75 @@ const PUBLISHED_WORKFLOW_DIGEST: &str = /// renaming a new table into place, which would quote the stored name. const DISPLACED_ARTIFACT_TABLE: &str = "workflow_artifact_payloads_published"; +/// Objects other than the two tables the upgrade changes that could observe or +/// block it. A trigger may share a table's name, so the exclusions name the +/// object type too. const DEPENDENT_OBJECT_COUNT_SQL: &str = "SELECT count(*) FROM sqlite_master - WHERE name <> 'workflow_artifact_payloads' - AND name <> 'sqlite_autoindex_workflow_artifact_payloads_1' - AND (tbl_name = 'workflow_artifact_payloads' + WHERE NOT (type = 'table' AND name IN ('workflow_artifact_payloads', 'workflow_schema')) + AND NOT (type = 'index' AND name = 'sqlite_autoindex_workflow_artifact_payloads_1') + AND (tbl_name IN ('workflow_artifact_payloads', 'workflow_schema') OR instr(lower(sql), 'workflow_artifact_payloads') > 0)"; +/// Rows per classification page. `typeof` and `length` read the record header +/// rather than a payload's overflow pages, so one page stays cheap however large +/// the artifacts are, as long as the predicate stays in the inner select: a +/// `payload` column crossing the subquery boundary would load every blob. +const ROW_CLASSIFICATION_PAGE_ROWS: i64 = 4096; + /// Rows the published constraints would have rejected can only come from a -/// store written around them, so they are not the proven shape. -const NONCONFORMING_ROW_COUNT_SQL: &str = "SELECT count(*) FROM workflow_artifact_payloads - WHERE typeof(payload) <> 'blob' - OR byte_length <> length(payload) - OR byte_length > 4194304"; +/// store written around them, so they are not the proven shape. This is what +/// makes the copy unable to refuse a row. An exhausted page has no `max`. +const NONCONFORMING_ROW_PAGE_SQL: &str = "SELECT max(row_id), coalesce(sum(nonconforming), 0) + FROM ( + SELECT + rowid AS row_id, + typeof(payload_digest) <> 'text' + OR typeof(byte_length) <> 'integer' + OR typeof(payload) <> 'blob' + OR byte_length IS NOT length(payload) + OR byte_length > 4194304 AS nonconforming + FROM workflow_artifact_payloads + WHERE rowid > ?1 + ORDER BY rowid + LIMIT ?2 + )"; -const COPY_ROWS_SQL: &str = "INSERT INTO workflow_artifact_payloads ( +/// Rows per copy statement. Published rows hold at most 4 MiB, so one statement +/// moves at most 128 MiB. The transaction lease renews and cancellation is +/// observed between statements, so a store of any size can finish, and shutdown +/// never waits for more than one batch. +const COPY_BATCH_ROWS: i64 = 32; + +const COPY_ROW_BATCH_SQL: &str = "INSERT INTO workflow_artifact_payloads ( rowid, payload_digest, byte_length, payload ) SELECT rowid, payload_digest, byte_length, payload FROM workflow_artifact_payloads_published - ORDER BY rowid"; + WHERE rowid > ?1 + ORDER BY rowid + LIMIT ?2"; + +const LAST_COPIED_ROWID_SQL: &str = "SELECT max(rowid) FROM workflow_artifact_payloads"; -const COPY_EVIDENCE_SQL: &str = "SELECT - (SELECT count(*) FROM workflow_artifact_payloads_published), - (SELECT count(*) FROM workflow_artifact_payloads), - (SELECT count(*) - FROM workflow_artifact_payloads_published AS published - JOIN workflow_artifact_payloads AS upgraded ON upgraded.rowid = published.rowid - WHERE upgraded.payload_digest = published.payload_digest - AND upgraded.byte_length = published.byte_length - AND upgraded.payload = published.payload)"; +const PUBLISHED_ROW_COUNT_SQL: &str = "SELECT count(*) FROM workflow_artifact_payloads_published"; /// What a store whose workflow tables differ from the final contract turned /// out to be. pub(super) enum PublishedArtifactCeilingShape { /// Exactly the published shape, with conforming rows. Upgradable, - /// The published tables and identity, but with something an upgrade could - /// not carry across. The reason names only contract objects and counts. + /// The published tables and identity, but with something the proven shape + /// does not include. The reason names only contract objects and counts. Refused(String), /// Some other shape, reported by the ordinary drift refusal. Other, } +#[tracing::instrument( + name = "global_db.schema.workflow_artifact_ceiling.classify", + level = "trace", + skip_all +)] pub(super) async fn classify_published_artifact_ceiling( conn: &impl QueryExecutor, workflow_tables: &[(&str, Option<&str>)], @@ -89,17 +126,17 @@ pub(super) async fn classify_published_artifact_ceiling( let dependents = single_count(conn, DEPENDENT_OBJECT_COUNT_SQL, "inspect objects").await?; if dependents > 0 { return Ok(PublishedArtifactCeilingShape::Refused(format!( - "workflow tables carry the artifact ceiling published through 1.0.0-beta.92, but \ - {dependents} other schema object(s) refer to `{ARTIFACT_TABLE}`, so it cannot be \ - upgraded in place" + "workflow tables carry the published artifact ceiling, but {dependents} other schema \ + object(s) depend on `{ARTIFACT_TABLE}` or `workflow_schema`, so it cannot be upgraded \ + in place" ))); } - let nonconforming = single_count(conn, NONCONFORMING_ROW_COUNT_SQL, "inspect rows").await?; + let nonconforming = count_nonconforming_rows(conn).await?; if nonconforming > 0 { return Ok(PublishedArtifactCeilingShape::Refused(format!( - "workflow tables carry the artifact ceiling published through 1.0.0-beta.92, but \ - {nonconforming} row(s) of `{ARTIFACT_TABLE}` break that table's own constraints, so \ - it cannot be upgraded in place" + "workflow tables carry the published artifact ceiling, but {nonconforming} row(s) of \ + `{ARTIFACT_TABLE}` break that table's own constraints, so it cannot be upgraded in \ + place" ))); } Ok(PublishedArtifactCeilingShape::Upgradable) @@ -121,40 +158,50 @@ fn tables_match_published_shape(workflow_tables: &[(&str, Option<&str>)]) -> boo } async fn records_published_identity(conn: &impl QueryExecutor) -> Result { - const OPERATION: &str = "inspect published workflow identity"; - let mut rows = conn - .query( - "SELECT singleton, schema_version, definition_digest FROM workflow_schema - ORDER BY singleton LIMIT 2", - (), - ) - .await - .map_err(|error| global_db_operation_error(OPERATION, error))?; - let Some(identity) = rows - .next() - .await - .map_err(|error| global_db_operation_error(OPERATION, error))? - else { - return Ok(false); - }; - let singleton = identity - .get::(0) - .map_err(|error| global_db_operation_error(OPERATION, error))?; - let version = identity - .get::(1) - .map_err(|error| global_db_operation_error(OPERATION, error))?; - let digest = identity - .get::(2) - .map_err(|error| global_db_operation_error(OPERATION, error))?; - let extra = rows - .next() - .await - .map_err(|error| global_db_operation_error(OPERATION, error))? - .is_some(); - Ok(singleton == 1 - && version == WORKFLOW_SCHEMA_VERSION_V1 - && digest == PUBLISHED_WORKFLOW_DIGEST - && !extra) + match read_recorded_workflow_identity(conn).await { + Ok(Some(identity)) => Ok(identity.singleton == 1 + && identity.version == WORKFLOW_SCHEMA_VERSION_V1 + && identity.digest == PUBLISHED_WORKFLOW_DIGEST + && !identity.extra), + Ok(None) => Ok(false), + Err(error) if error.is_transient_read_failure() => Err(global_db_operation_error( + "inspect published workflow identity", + error, + )), + // An identity that does not decode is reported by the drift refusal. + Err(_) => Ok(false), + } +} + +async fn count_nonconforming_rows(conn: &impl QueryExecutor) -> Result { + const OPERATION: &str = "inspect published artifact rows"; + let mut after_rowid = i64::MIN; + let mut nonconforming = 0_i64; + loop { + let mut rows = conn + .query( + NONCONFORMING_ROW_PAGE_SQL, + (after_rowid, ROW_CLASSIFICATION_PAGE_ROWS), + ) + .await + .map_err(|error| global_db_operation_error(OPERATION, error))?; + let page = rows + .next() + .await + .map_err(|error| global_db_operation_error(OPERATION, error))? + .ok_or_else(|| global_db_operation_message(OPERATION, "a page returned no row"))?; + let last_rowid = page + .get::>(0) + .map_err(|error| global_db_operation_error(OPERATION, error))?; + let Some(last_rowid) = last_rowid else { + return Ok(nonconforming); + }; + nonconforming = nonconforming.saturating_add( + page.get::(1) + .map_err(|error| global_db_operation_error(OPERATION, error))?, + ); + after_rowid = last_rowid; + } } async fn single_count( @@ -175,26 +222,34 @@ async fn single_count( .map_err(|error| global_db_operation_error(operation, error)) } -/// Upgrades the published shape inside the caller's admission transaction. +/// Upgrades the published shape inside the caller's admission transaction, or +/// returns the refusal that stops it before anything of the upgrade has run. /// /// Classification ran on a read connection, so the shape is proven again under /// the write lock before anything changes: a peer that upgraded in the meantime /// makes this a no-op, and one that changed the store into anything else /// refuses. Every step shares the caller's transaction, so any failure leaves -/// the store exactly as found. -pub(super) async fn upgrade_published_artifact_ceiling( +/// the store exactly as found. Only payload bytes the transaction itself wrote +/// are read back, which SQLite already guarantees, so the copy is checked by row +/// count rather than by reading every payload twice more. +#[tracing::instrument( + name = "global_db.schema.workflow_artifact_ceiling.upgrade", + level = "trace", + skip_all +)] +pub(crate) async fn upgrade_published_artifact_ceiling( transaction: &(impl Executor + Sync), -) -> Result<()> { +) -> Result> { let proven = Box::pin(inspect_workflow_schema_for_admission(transaction)).await?; match proven { - Ok(WorkflowSchemaAdmission::Complete) => return Ok(()), + Ok(WorkflowSchemaAdmission::Complete) => return Ok(None), Ok(WorkflowSchemaAdmission::UpgradePublishedArtifactCeiling) => {} Ok(WorkflowSchemaAdmission::Create) => { return Err(upgrade_refusal( "the workflow tables disappeared before the upgrade began", )); } - Err(refused) => return Err(refused.error()), + Err(refused) => return Ok(Some(refused)), } let final_table_sql = WORKFLOW_TABLE_CONTRACTS_V1 .iter() @@ -202,20 +257,16 @@ pub(super) async fn upgrade_published_artifact_ceiling( .map(|contract| contract.sql) .ok_or_else(|| upgrade_refusal("the final contract has no artifact table"))?; - run_step( - transaction, - &format!("ALTER TABLE {ARTIFACT_TABLE} RENAME TO {DISPLACED_ARTIFACT_TABLE}"), - "move the published artifact table aside", - ) - .await?; + if let Some(refused) = move_published_table_aside(transaction).await? { + return Ok(Some(refused)); + } run_step( transaction, final_table_sql, "create the final artifact table", ) .await?; - run_step(transaction, COPY_ROWS_SQL, "copy artifact rows").await?; - require_every_row_copied(transaction).await?; + copy_artifact_rows(transaction).await?; run_step( transaction, &format!("DROP TABLE {DISPLACED_ARTIFACT_TABLE}"), @@ -226,7 +277,7 @@ pub(super) async fn upgrade_published_artifact_ceiling( let upgraded = Box::pin(inspect_workflow_schema_for_admission(transaction)).await?; match upgraded { - Ok(WorkflowSchemaAdmission::Complete) => Ok(()), + Ok(WorkflowSchemaAdmission::Complete) => Ok(None), Ok(_) => Err(upgrade_refusal( "the upgraded workflow tables did not reach the final contract", )), @@ -234,6 +285,40 @@ pub(super) async fn upgrade_published_artifact_ceiling( } } +/// What a store classified upgradable would decide if it attached now, for a +/// caller that will roll this transaction back. +/// +/// `ALTER TABLE` re-parses the whole schema, so an unrelated view or trigger +/// that no longer resolves refuses the move. No read-only query predicts that +/// verdict. The rename edits only the catalog, so rehearsing it reads no row. The +/// other steps cannot refuse what classification proved, so they do not run. +pub(super) async fn rehearse_published_artifact_ceiling_upgrade( + transaction: &(impl Executor + Sync), +) -> Result> { + move_published_table_aside(transaction).await +} + +/// A rename that cannot run changes nothing, so the store stays refused for its +/// workflow features like every other shape this binary will not read. +async fn move_published_table_aside( + transaction: &(impl Executor + Sync), +) -> Result> { + const STEP: &str = "move the published artifact table aside"; + let renamed = transaction + .execute_batch(&format!( + "ALTER TABLE {ARTIFACT_TABLE} RENAME TO {DISPLACED_ARTIFACT_TABLE}" + )) + .await; + match renamed { + Ok(()) => Ok(None), + Err(error) if is_store_refusal(&error) => Ok(Some(workflow_schema_refusal( + "workflow tables carry the published artifact ceiling, but the schema of this store \ + refused moving `workflow_artifact_payloads` aside, so it cannot be upgraded in place", + ))), + Err(error) => Err(global_db_operation_error(STEP, error)), + } +} + async fn run_step( transaction: &(impl Executor + Sync), sql: &str, @@ -245,24 +330,23 @@ async fn run_step( .map_err(|error| upgrade_step_error(step, error)) } -async fn require_every_row_copied(transaction: &(impl Executor + Sync)) -> Result<()> { - const STEP: &str = "verify copied artifact rows"; - let mut rows = transaction - .query(COPY_EVIDENCE_SQL, ()) - .await - .map_err(|error| upgrade_step_error(STEP, error))?; - let evidence = rows - .next() - .await - .map_err(|error| upgrade_step_error(STEP, error))? - .ok_or_else(|| upgrade_refusal("the artifact copy evidence returned no row"))?; - let count = |index| { - evidence - .get::(index) - .map_err(|error| upgrade_step_error(STEP, error)) - }; - let (published, upgraded, identical) = (count(0)?, count(1)?, count(2)?); - if published != upgraded || published != identical { +async fn copy_artifact_rows(transaction: &(impl Executor + Sync)) -> Result<()> { + const STEP: &str = "copy artifact rows"; + let published = single_count(transaction, PUBLISHED_ROW_COUNT_SQL, STEP).await?; + let mut after_rowid = i64::MIN; + let mut copied = 0_i64; + loop { + let batch = transaction + .execute(COPY_ROW_BATCH_SQL, (after_rowid, COPY_BATCH_ROWS)) + .await + .map_err(|error| upgrade_step_error(STEP, error))?; + if batch == 0 { + break; + } + copied = copied.saturating_add(i64::try_from(batch).unwrap_or(i64::MAX)); + after_rowid = single_count(transaction, LAST_COPIED_ROWID_SQL, STEP).await?; + } + if copied != published { return Err(upgrade_refusal( "the copied artifact rows differ from the published rows", )); @@ -296,12 +380,16 @@ async fn record_final_identity(transaction: &(impl Executor + Sync)) -> Result<( /// example an unrelated broken trigger failing the rename's schema check. const SQLITE_ERROR: i32 = 1; +fn is_store_refusal(error: &engine::Error) -> bool { + error.is_deterministic_refusal() || error.sqlite_code() == Some(SQLITE_ERROR) +} + /// A failure that will recur on every open means this store cannot take the /// upgrade, which is the store's typed refusal. One that can clear by itself, /// such as a held lock or a full disk, stays an operation failure the next /// open retries, so a passing condition never tells an operator to reset. fn upgrade_step_error(step: &'static str, error: engine::Error) -> TraceDecayError { - if error.is_deterministic_refusal() || error.sqlite_code() == Some(SQLITE_ERROR) { + if is_store_refusal(&error) { upgrade_refusal(&format!("the store refused the step to {step}")) } else { global_db_operation_error(step, error) @@ -312,8 +400,8 @@ fn upgrade_refusal(detail: &str) -> TraceDecayError { TraceDecayError::reset_required( "workflow", format!( - "the artifact ceiling published through 1.0.0-beta.92 could not be upgraded and the \ - store was left as found: {detail}" + "the published artifact ceiling could not be upgraded and the store was left as \ + found: {detail}" ), ) } From 02eba51395e1100ab92504deae5f9236761b75f3 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:22:05 -0800 Subject: [PATCH 29/63] fix(analytics): read automation truncation from the ledger page `records_truncated` was `records.len() >= AUTOMATION_RECORD_LIMIT`, which reports the newest page as a truncated window whenever the ledger holds exactly that many rows. A project whose automation ledger held exactly 200 runs was told its counts were partial when the page was the whole ledger. The page read already answers this: `AutomationRunLedgerPageV1::is_complete` is false only when a row was left behind or a row could not be read. Read the page instead of the row list so the flag comes from that authority rather than from an inference about the row count. The new test derives the page bound from the service, then asserts the boundary from both sides: a ledger of exactly that many rows is complete, and one more row is truncated. Against the old predicate it fails with `left: Bool(true), right: false`. --- .../tracedecay-mcp/src/handlers/analytics.rs | 17 ++- .../tests/mcp_suite/analytics_test.rs | 130 ++++++++++++++++++ 2 files changed, 142 insertions(+), 5 deletions(-) diff --git a/crates/tracedecay-mcp/src/handlers/analytics.rs b/crates/tracedecay-mcp/src/handlers/analytics.rs index 039c82711d..50e2abb959 100644 --- a/crates/tracedecay-mcp/src/handlers/analytics.rs +++ b/crates/tracedecay-mcp/src/handlers/analytics.rs @@ -7,7 +7,7 @@ //! ([`tracedecay_global_db::RegisteredGlobalDb::query_analytics_tool_counts`], //! [`tracedecay_global_db::RegisteredGlobalDb::query_analytics_hint_counts`], //! [`tracedecay_dashboard_api::analytics_api::hint_summary_from_counts`], -//! [`tracedecay_automation_runtime::automation::run_ledger::load_run_records`]) rather than +//! [`tracedecay_automation_runtime::automation::run_ledger::load_run_records_page`]) rather than //! re-implementing queries against those tables. use std::collections::{BTreeMap, BTreeSet}; @@ -35,7 +35,7 @@ use tracedecay_store::{FactReadControl, StoreShardScopeV1}; use tracedecay_automation_runtime::automation::backend::task_key; use tracedecay_automation_runtime::automation::run_ledger::{ - AutomationRunStatus, canonical_record_started_at_seconds, load_run_records, + AutomationRunStatus, canonical_record_started_at_seconds, load_run_records_page, }; use tracedecay_daemon_service::retained_owner::open_project_retained_memory_target; use tracedecay_domain::errors::{Result, TraceDecayError}; @@ -580,8 +580,8 @@ async fn automation_section( )); } }; - let records = match load_run_records(&dashboard_root, AUTOMATION_RECORD_LIMIT).await { - Ok(records) => records, + let page = match load_run_records_page(&dashboard_root, AUTOMATION_RECORD_LIMIT).await { + Ok(page) => page, Err(err) => { return AnalyticsAutomationSectionV1::LedgerUnavailable(AnalyticsLedgerUnavailableV1 { available: false, @@ -590,6 +590,8 @@ async fn automation_section( }); } }; + let records_truncated = !page.is_complete(); + let records = page.records; let mut in_window = 0usize; let mut by_job: BTreeMap = BTreeMap::new(); @@ -625,7 +627,12 @@ async fn automation_section( dashboard_root: dashboard_root.display().to_string(), records_considered: records.len(), records_in_window: in_window, - records_truncated: records.len() >= AUTOMATION_RECORD_LIMIT, + // A page that read exactly the limit is complete when the ledger holds + // nothing older; `records.len() >= limit` claimed the newest 200 rows + // were a truncated window even when the ledger held exactly 200. The + // page's own completeness is the authority: it knows whether a row was + // left behind and whether any row could not be read. + records_truncated, by_job: by_job.into_values().collect(), }) } diff --git a/crates/tracedecay/tests/mcp_suite/analytics_test.rs b/crates/tracedecay/tests/mcp_suite/analytics_test.rs index 3a4a2207e8..291061b4a1 100644 --- a/crates/tracedecay/tests/mcp_suite/analytics_test.rs +++ b/crates/tracedecay/tests/mcp_suite/analytics_test.rs @@ -96,6 +96,136 @@ fn ledger_row(run_id: &str, task: &str, status: &str, started_at: i64) -> String ) } +#[cfg(feature = "test-transport")] +#[tokio::test] +async fn analytics_automation_reports_a_ledger_that_exactly_fills_the_page_as_complete() { + // The newest-rows page is bounded. A ledger holding exactly that many rows + // is the whole ledger, not a truncated window: nothing was left behind. + let fixture = production_composition_fixture().await; + let server = fixture + .harness + .server(&fixture.project_root) + .expect("production project server"); + + let empty = extract_json( + &handle_real_server_tool_call( + &server, + "tracedecay_analytics", + json!({"section": "automation", "format": "json"}), + ) + .await, + ); + let dashboard_root = empty["automation"]["dashboard_root"] + .as_str() + .expect("enrolled dashboard root") + .to_string(); + let dashboard_path = std::path::PathBuf::from(&dashboard_root); + std::fs::create_dir_all(&dashboard_path).expect("dashboard root"); + + // Derive the page bound from the service instead of duplicating the + // handler's constant: write well past any plausible bound and let the + // report say how many rows it actually read. + let now = current_timestamp(); + let probe_rows = 512usize; + let mut ledger = String::new(); + for index in 0..probe_rows { + ledger.push_str(&ledger_row( + &format!("analytics-page-probe-{index}"), + "memory_curator", + "succeeded", + now - 60, + )); + ledger.push('\n'); + } + std::fs::write(dashboard_path.join("automation_runs.jsonl"), ledger) + .expect("automation ledger"); + let probe = extract_json( + &handle_real_server_tool_call( + &server, + "tracedecay_analytics", + json!({"section": "automation", "format": "json"}), + ) + .await, + ); + let page_bound = probe["automation"]["records_considered"] + .as_u64() + .expect("records considered") as usize; + assert!( + page_bound > 0 && page_bound < probe_rows, + "the probe must exceed the page bound for the boundary to be testable, got {page_bound}" + ); + assert_eq!( + probe["automation"]["records_truncated"], true, + "a ledger larger than the page is a partial window" + ); + + // Exactly the page bound: the page is the whole ledger, nothing older was + // left behind, so the window is complete. + let mut ledger = String::new(); + for index in 0..page_bound { + ledger.push_str(&ledger_row( + &format!("analytics-full-page-{index}"), + "memory_curator", + "succeeded", + now - 60, + )); + ledger.push('\n'); + } + std::fs::write(dashboard_path.join("automation_runs.jsonl"), ledger) + .expect("automation ledger"); + + let automation = extract_json( + &handle_real_server_tool_call( + &server, + "tracedecay_analytics", + json!({"section": "automation", "format": "json"}), + ) + .await, + ); + assert_eq!( + automation["automation"]["records_considered"].as_u64(), + Some(page_bound as u64), + ); + assert_eq!( + automation["automation"]["records_in_window"].as_u64(), + Some(page_bound as u64), + ); + assert_eq!( + automation["automation"]["records_truncated"], false, + "a ledger that exactly fills the page has no older rows to truncate" + ); + + // One more row pushes the oldest out of the page, which is a real + // truncation and must be reported. + let mut extended = std::fs::read_to_string(dashboard_path.join("automation_runs.jsonl")) + .expect("automation ledger"); + extended.push_str(&ledger_row( + "analytics-overflow", + "memory_curator", + "succeeded", + now - 120, + )); + extended.push('\n'); + std::fs::write(dashboard_path.join("automation_runs.jsonl"), extended) + .expect("automation ledger"); + + let truncated = extract_json( + &handle_real_server_tool_call( + &server, + "tracedecay_analytics", + json!({"section": "automation", "format": "json"}), + ) + .await, + ); + assert_eq!( + truncated["automation"]["records_truncated"], true, + "a ledger older than the page bound is a partial window" + ); + + drop(server); + fixture.harness.shutdown().await; +} + #[cfg(feature = "test-transport")] #[tokio::test] async fn analytics_reports_tool_tiers_top_tools_and_zero_call_tools() { From 4d7cd9543b28141547cfdf54188674c4f77799d4 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:24:02 -0800 Subject: [PATCH 30/63] fix(storage): update report tests for safe sampling policy --- .../tracedecay-maintenance/src/retention/storage_report.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/tracedecay-maintenance/src/retention/storage_report.rs b/crates/tracedecay-maintenance/src/retention/storage_report.rs index c7d81e4f5b..3666d83b8b 100644 --- a/crates/tracedecay-maintenance/src/retention/storage_report.rs +++ b/crates/tracedecay-maintenance/src/retention/storage_report.rs @@ -3364,6 +3364,7 @@ mod tests { &mut stores, &mut plans, &mut availability, + false, &mut exact_budget, &StorageReportWalkControl::default(), ) @@ -3405,6 +3406,7 @@ mod tests { &mut stores, &mut plans, &mut availability, + false, &mut remaining, &StorageReportWalkControl::default(), ) @@ -3440,6 +3442,7 @@ mod tests { &mut stores, &mut Vec::new(), &mut Vec::new(), + false, &mut remaining, &StorageReportWalkControl::default(), ) @@ -3478,6 +3481,7 @@ mod tests { &mut stores, &mut Vec::new(), &mut availability, + false, &mut remaining, &StorageReportWalkControl::default(), ) @@ -3533,6 +3537,7 @@ mod tests { &mut Vec::new(), &mut Vec::new(), &mut availability, + false, &mut remaining, &StorageReportWalkControl::default(), ) From b16b584b7044ff16010ddaa72014ced716d92db4 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:24:57 -0800 Subject: [PATCH 31/63] fix(retention): resume bounded artifact scans across ticks --- .../src/code_index_generations.rs | 77 ++++- .../text_artifact_scan.rs | 323 ++++++++++++++++++ .../code_index_generations/text_artifacts.rs | 74 ++-- .../src/store_maintenance/mod.rs | 45 ++- .../text_artifact_scan_tests.rs | 76 +++++ .../tracedecay-maintenance/src/telemetry.rs | 18 + .../src/telemetry/text_artifact_scans.rs | 135 ++++++++ crates/tracedecay/src/daemon/maintenance.rs | 14 + 8 files changed, 728 insertions(+), 34 deletions(-) create mode 100644 crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs create mode 100644 crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs create mode 100644 crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations.rs b/crates/tracedecay-code-index-retention/src/code_index_generations.rs index 05d70593fa..ae13fe599d 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations.rs @@ -12,6 +12,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::fs::File; use std::io::{BufReader, Read}; use std::path::{Path, PathBuf}; +use std::sync::Arc; use std::time::{Duration, Instant}; use serde::{Deserialize, Serialize}; @@ -48,7 +49,10 @@ mod locking; mod receipt_store; mod scope_quarantine; mod scope_roots; +mod text_artifact_scan; mod text_artifacts; +pub use text_artifact_scan::CodeGenerationRetentionScanV1; +use text_artifact_scan::{TextArtifactPageV1, TextArtifactPageProgressV1}; pub use graph_replay_release::{ CodeGenerationGraphReplayReleasePageV1, CodeGenerationGraphReplayReleaseV1, code_generation_graph_replay_release_page, complete_code_generation_graph_replay_release, @@ -97,13 +101,14 @@ use scope_roots::{ }; use text_artifacts::{ TEXT_ARTIFACT_RECEIPT_STORE, execute_text_artifact_retention_under_store_lock, - plan_collectable_text_artifacts_budgeted_cancellable, + plan_collectable_text_artifacts_budgeted_page_cancellable, recover_pending_text_artifact_transaction_unlocked, text_artifact_transaction_path, total_text_artifact_bytes, }; #[cfg(test)] use text_artifacts::{ TEXT_ARTIFACT_TRANSACTION_JOURNAL, build_text_artifact_receipt, + plan_collectable_text_artifacts_budgeted_cancellable, plan_collectable_text_artifacts_cancellable, stage_collectable_text_artifacts, }; @@ -176,8 +181,9 @@ pub const MAX_CODE_GENERATION_RETENTION_BATCH_V1: usize = 32; /// /// The bounded durable index can protect at most 32 completed artifacts and /// the active generation can own one resumable staging file. The inventory -/// reads that fixed liveness window plus one removal page, so a restart reaches -/// later debris without ever materializing an unbounded directory listing. +/// reads that fixed liveness window plus one removal page. Daemon maintenance +/// retains directory progress across ticks; preserved files do not bound how +/// far a later page may reach. const MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1: usize = 32; const MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1: usize = MAX_DURABLE_GENERATION_INDEX_ENTRIES_V1 + 1 + MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1; @@ -543,6 +549,9 @@ pub struct CodeGenerationRetentionPlanV1 { /// staging file exists, so a successor build is in flight whose /// publication replaces that artifact and leaves it unreferenced. active_text_replacement_in_flight: bool, + /// Enumeration progress only; current liveness and identity remain the + /// sole deletion authority. The owner acknowledges this page after apply. + text_artifact_page_progress: Option, /// How thoroughly this plan proved generation integrity. Apply-mode /// execution refuses anything but [`GenerationDigestVerificationV1::Full`]. pub verification: GenerationDigestVerificationV1, @@ -590,6 +599,15 @@ impl CodeGenerationRetentionPlanV1 { .may_have_collectable_segments() } + /// Whether a retained directory scan still has entries to inspect, + /// including a page containing only preserved files. + #[must_use] + pub fn has_pending_text_artifact_inventory(&self) -> bool { + self.text_artifact_page_progress.as_ref().is_some_and(|progress| { + progress.page.more || progress.consumed < progress.page.entries.len() + }) + } + /// What this plan proved about unreferenced generation segments. #[must_use] pub const fn generation_segment_census(&self) -> GenerationSegmentCensusV1 { @@ -722,6 +740,7 @@ struct CodeTextArtifactRetentionTransactionV1 { #[derive(Debug)] struct CodeTextArtifactRetentionInventoryV1 { + scanned_entries: usize, candidates: Vec, unique_bytes: u64, active_text_replacement_in_flight: bool, @@ -856,6 +875,7 @@ fn unpublished_store_plan( collectable_generation_segments: GenerationSegmentCensusV1::NoneFound, text_artifact_inventory_bytes: 0, active_text_replacement_in_flight: false, + text_artifact_page_progress: None, verification: GenerationDigestVerificationV1::Full, active_pointer: None, } @@ -879,6 +899,22 @@ pub fn prepare_next_code_generation_retention_cancellable( vector_readable_sources: &BTreeSet, is_cancelled: &dyn Fn() -> bool, graph_replay_pool_root: Option<&Path>, +) -> Result { + prepare_next_code_generation_retention_page_cancellable( + store_root, + vector_readable_sources, + is_cancelled, + graph_replay_pool_root, + None, + ) +} + +fn prepare_next_code_generation_retention_page_cancellable( + store_root: &Path, + vector_readable_sources: &BTreeSet, + is_cancelled: &dyn Fn() -> bool, + graph_replay_pool_root: Option<&Path>, + text_page: Option<&Arc>, ) -> Result { if is_cancelled() { return Err(CodeGenerationRetentionErrorV1::Cancelled); @@ -918,12 +954,14 @@ pub fn prepare_next_code_generation_retention_cancellable( // when this exact census found bytes that may be unlinked. The executor // still refuses metadata-only plans, so no deletion can cross this gate // without the canonical full verification below. - let mut census = plan_code_generation_retention_with_verification_cancellable( + let mut census = plan_code_generation_retention_page_cancellable( store_root, vector_readable_sources, GenerationDigestVerificationV1::MetadataOnly, graph_replay_pool_root, + &mut usize::MAX, is_cancelled, + text_page, )?; // The bounded census leaves segments typed unknown rather than paying the // mark phase. Resolve exactly that question with the sweep alone: a store @@ -947,12 +985,14 @@ pub fn prepare_next_code_generation_retention_cancellable( if !census.has_collectable_work() { return Ok(census); } - plan_code_generation_retention_with_verification_cancellable( + plan_code_generation_retention_page_cancellable( store_root, vector_readable_sources, GenerationDigestVerificationV1::Full, graph_replay_pool_root, + &mut usize::MAX, is_cancelled, + text_page, ) } @@ -986,6 +1026,26 @@ pub fn plan_code_generation_retention_with_verification_budgeted_cancellable( graph_replay_pool_root: Option<&Path>, remaining_entries: &mut usize, is_cancelled: &dyn Fn() -> bool, +) -> Result { + plan_code_generation_retention_page_cancellable( + store_root, + vector_readable_sources, + verification, + graph_replay_pool_root, + remaining_entries, + is_cancelled, + None, + ) +} + +fn plan_code_generation_retention_page_cancellable( + store_root: &Path, + vector_readable_sources: &BTreeSet, + verification: GenerationDigestVerificationV1, + graph_replay_pool_root: Option<&Path>, + remaining_entries: &mut usize, + is_cancelled: &dyn Fn() -> bool, + text_page: Option<&Arc>, ) -> Result { if is_cancelled() { return Err(CodeGenerationRetentionErrorV1::Cancelled); @@ -1189,12 +1249,13 @@ pub fn plan_code_generation_retention_with_verification_budgeted_cancellable( .take(MAX_CODE_GENERATION_RETENTION_BATCH_V1) .cloned() .collect::>(); - let text_artifact_inventory = plan_collectable_text_artifacts_budgeted_cancellable( + let text_artifact_inventory = plan_collectable_text_artifacts_budgeted_page_cancellable( store_root, active_pointer.as_ref(), verification, remaining_entries, is_cancelled, + text_page.map(Arc::as_ref), )?; // The segment mark phase streams every retained manifest end to end and // fails closed when one no longer matches its content-addressed name. That @@ -1237,6 +1298,10 @@ pub fn plan_code_generation_retention_with_verification_budgeted_cancellable( text_artifact_inventory_bytes: text_artifact_inventory.unique_bytes, active_text_replacement_in_flight: text_artifact_inventory .active_text_replacement_in_flight, + text_artifact_page_progress: text_page.map(|page| TextArtifactPageProgressV1 { + page: Arc::clone(page), + consumed: text_artifact_inventory.scanned_entries, + }), verification, active_pointer, }) diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs new file mode 100644 index 0000000000..d7e3839b20 --- /dev/null +++ b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs @@ -0,0 +1,323 @@ +//! Process-retained directory progress for the maintenance owner. +//! +//! Entries are hints, never liveness or unlink authority. Each preparation +//! re-reads current publication pointers and verifies the selected bytes; apply +//! still revalidates under the existing store and project locks. + +use std::collections::BTreeSet; +use std::fs::ReadDir; +use std::path::{Path, PathBuf}; +use std::sync::Arc; + +use tracedecay_domain::CodeGenerationId; + +use super::text_artifacts::private_directory_exists; +use super::{ + CodeGenerationRetentionErrorV1, CodeGenerationRetentionPlanV1, + MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1, code_text_artifact_staging_root, + code_text_artifacts_root, prepare_next_code_generation_retention_page_cancellable, storage, +}; + +#[derive(Debug, PartialEq, Eq)] +pub(super) struct TextArtifactPageV1 { + pub(super) entries: Vec<(bool, PathBuf)>, + pub(super) more: bool, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub(super) struct TextArtifactPageProgressV1 { + pub(super) page: Arc, + pub(super) consumed: usize, +} + +/// A maintenance owner's unfinished text-artifact enumeration for one scope. +/// +/// Two directory streams and at most one bounded page survive between ticks. +/// Restart discards only scan position, never a safety proof. Completed scans +/// close both streams; the next ordinary tick opens a fresh inventory. No +/// process-global cache or additional durable state is introduced. +#[derive(Debug, Default)] +pub struct CodeGenerationRetentionScanV1 { + root: Option, + completed: Option, + staging: Option, + scan_staging: bool, + pending: Vec<(bool, PathBuf)>, + page: Option>, +} + +impl CodeGenerationRetentionScanV1 { + /// Prepare one page through the same planner used by one-off censuses. + /// Metadata and full verification consume exactly the same bounded names. + /// Cancellation, a planning refusal, or a failed apply retains the page + /// for revalidation rather than advancing past unprocessed candidates. + pub fn prepare( + &mut self, + store_root: &Path, + protected_sources: &BTreeSet, + is_cancelled: &dyn Fn() -> bool, + graph_replay_pool_root: Option<&Path>, + ) -> Result { + let page = self.next_page(store_root, is_cancelled)?; + let mut plan = prepare_next_code_generation_retention_page_cancellable( + store_root, + protected_sources, + is_cancelled, + graph_replay_pool_root, + Some(&page), + )?; + // An absent, never-published store returns before the census. Its + // empty page still needs acknowledging so a later mount is rescanned. + if plan.text_artifact_page_progress.is_none() { + plan.text_artifact_page_progress = Some(TextArtifactPageProgressV1 { + consumed: page.entries.len(), + page, + }); + } + Ok(plan) + } + + /// Acknowledge a successful apply, or a successfully verified no-op page. + /// A stale/double acknowledgement cannot advance a newer page. When the + /// deletion cap stopped classification early, keep its unvisited tail. + pub fn complete(&mut self, plan: &CodeGenerationRetentionPlanV1) { + let Some(progress) = plan.text_artifact_page_progress.as_ref() else { + return; + }; + let Some(page) = self.page.as_ref() else { + return; + }; + if !Arc::ptr_eq(page, &progress.page) { + return; + } + if progress.consumed < page.entries.len() { + self.page = Some(Arc::new(TextArtifactPageV1 { + entries: page.entries[progress.consumed..].to_vec(), + more: page.more, + })); + } else { + self.page = None; + if self.completed.is_none() && self.staging.is_none() { + *self = Self::default(); + } + } + } + + fn next_page( + &mut self, + store_root: &Path, + is_cancelled: &dyn Fn() -> bool, + ) -> Result, CodeGenerationRetentionErrorV1> { + if is_cancelled() { + return Err(CodeGenerationRetentionErrorV1::Cancelled); + } + if self.root.as_deref() != Some(store_root) { + *self = Self::default(); + self.completed = open_inventory(&code_text_artifacts_root(store_root))?; + self.staging = open_inventory(&code_text_artifact_staging_root(store_root))?; + self.root = Some(store_root.to_path_buf()); + } + if let Some(page) = self.page.as_ref() { + return Ok(Arc::clone(page)); + } + while self.pending.len() < MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1 { + if is_cancelled() { + return Err(CodeGenerationRetentionErrorV1::Cancelled); + } + if self.completed.is_none() && self.staging.is_none() { + break; + } + let shared = !self.scan_staging; + self.scan_staging = !self.scan_staging; + let listing = if shared { + &mut self.completed + } else { + &mut self.staging + }; + match listing.as_mut().and_then(Iterator::next) { + Some(entry) => self.pending.push((shared, entry.map_err(storage)?.path())), + None => *listing = None, + } + } + let page = Arc::new(TextArtifactPageV1 { + entries: std::mem::take(&mut self.pending), + more: self.completed.is_some() || self.staging.is_some(), + }); + self.page = Some(Arc::clone(&page)); + Ok(page) + } +} + +fn open_inventory(path: &Path) -> Result, CodeGenerationRetentionErrorV1> { + if private_directory_exists(path)? { + std::fs::read_dir(path).map(Some).map_err(storage) + } else { + Ok(None) + } +} + +#[cfg(test)] +mod tests { + use std::cell::Cell; + use std::collections::{BTreeMap, BTreeSet}; + use std::path::{Path, PathBuf}; + use std::sync::Arc; + + use tracedecay_domain::UtcMicros; + use tracedecay_domain::canonical_text::sha256_hex; + + use super::CodeGenerationRetentionScanV1; + use crate::code_index_generations::{ + CodeGenerationRetentionErrorV1, CodeGenerationRetentionModeV1, + MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1, MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1, + code_text_artifact_staging_root, code_text_artifacts_root, + execute_code_generation_retention, prepare_next_code_generation_retention_cancellable, + }; + + fn write_orphan(root: &Path, index: usize) -> PathBuf { + std::fs::create_dir_all(root).unwrap(); + let bytes = format!("verified artifact {index}"); + let path = root.join(format!("text-artifact-{}.bin", sha256_hex(bytes.as_bytes()))); + std::fs::write(&path, bytes).unwrap(); + path + } + + #[test] + fn preserved_same_directory_prefix_does_not_hide_later_verified_artifacts() { + let store = tempfile::tempdir().unwrap(); + let root = code_text_artifacts_root(store.path()); + let count = MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1 * 3; + let mut original = BTreeMap::new(); + for index in 0..count { + let path = write_orphan(&root, index); + original.insert(path.clone(), std::fs::read(&path).unwrap()); + std::fs::write(path, b"untrusted content").unwrap(); + } + // Choose a late name in real filesystem order. Do not rely on + // a sorted directory listing. + let last = std::fs::read_dir(&root) + .unwrap() + .last() + .unwrap() + .unwrap() + .path(); + std::fs::write(&last, &original[&last]).unwrap(); + for _ in 0..2 { + let stateless = prepare_next_code_generation_retention_cancellable( + store.path(), &BTreeSet::new(), &|| false, None, + ).unwrap(); + assert_eq!(stateless.collectable_text_artifact_count(), 0); + } + + let mut scan = CodeGenerationRetentionScanV1::default(); + let mut empty_continuations = 0; + let mut finished = false; + for tick in 0..(count + 4) { + let plan = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let progress = plan.text_artifact_page_progress.as_ref().unwrap(); + assert!(progress.page.entries.len() <= MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1); + let more = plan.has_pending_text_artifact_inventory(); + if plan.has_collectable_work() { + let report = execute_code_generation_retention( + store.path(), plan, CodeGenerationRetentionModeV1::Apply, + UtcMicros(tick as i64), None, + ).unwrap(); + scan.complete(&report.plan); + } else { + empty_continuations += usize::from(more); + scan.complete(&plan); + } + if !more { + finished = true; + break; + } + } + assert!(finished); + assert!(empty_continuations > 0, "an all-preserved page is not completion"); + assert!(!last.exists()); + for path in original.keys().filter(|path| **path != last) { + assert_eq!(std::fs::read(path).unwrap(), b"untrusted content"); + } + } + + #[test] + fn successful_batches_keep_unvisited_page_tails_and_reject_stale_acknowledgements() { + let store = tempfile::tempdir().unwrap(); + let root = code_text_artifacts_root(store.path()); + let paths = (0..100).map(|index| write_orphan(&root, index)).collect::>(); + let mut scan = CodeGenerationRetentionScanV1::default(); + let mut stale = None; + for tick in 0..20 { + let plan = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + assert!(plan.collectable_text_artifact_count() <= MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1); + let more = plan.has_pending_text_artifact_inventory(); + if let Some(stale) = stale.as_ref() { + let current = Arc::clone(scan.page.as_ref().unwrap()); + scan.complete(stale); + assert!(Arc::ptr_eq(scan.page.as_ref().unwrap(), ¤t)); + } + if plan.has_collectable_work() { + let report = execute_code_generation_retention( + store.path(), plan, CodeGenerationRetentionModeV1::Apply, + UtcMicros(tick), None, + ).unwrap(); + scan.complete(&report.plan); + stale = Some(report.plan); + } else { + scan.complete(&plan); + } + if !more { break; } + } + assert!(paths.iter().all(|path| !path.exists())); + assert!(scan.completed.is_none() && scan.staging.is_none()); + let newly_published = write_orphan(&root, 101); + let next = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + assert_eq!(next.collectable_text_artifact_count(), 1); + assert!(newly_published.exists(), "preparing never unlinks"); + } + + #[test] + fn cancelled_enumeration_and_failed_apply_keep_the_pending_page() { + let store = tempfile::tempdir().unwrap(); + let root = code_text_artifacts_root(store.path()); + for index in 0..100 { write_orphan(&root, index); } + let mut scan = CodeGenerationRetentionScanV1::default(); + let polls = Cell::new(0); + let cancelled = || { polls.set(polls.get() + 1); polls.get() > 10 }; + assert!(matches!(scan.prepare(store.path(), &BTreeSet::new(), &cancelled, None), + Err(CodeGenerationRetentionErrorV1::Cancelled))); + assert!(!scan.pending.is_empty()); + let plan = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let page = Arc::clone(&plan.text_artifact_page_progress.as_ref().unwrap().page); + // No acknowledgement: the next preparation must revalidate the same + // page, as after an apply conflict or cancellation. + let retry = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + assert!(Arc::ptr_eq(&page, &retry.text_artifact_page_progress.as_ref().unwrap().page)); + assert_eq!(plan.collectable_text_artifact_count(), retry.collectable_text_artifact_count()); + } + + #[test] + fn empty_scans_restart_and_scope_changes_do_not_reuse_foreign_entries() { + let first = tempfile::tempdir().unwrap(); + let second = tempfile::tempdir().unwrap(); + let mut scan = CodeGenerationRetentionScanV1::default(); + let empty = scan.prepare(first.path(), &BTreeSet::new(), &|| false, None).unwrap(); + assert!(!empty.has_pending_text_artifact_inventory()); + scan.complete(&empty); + let live = write_orphan(&code_text_artifacts_root(first.path()), 1); + let first_plan = scan.prepare(first.path(), &BTreeSet::new(), &|| false, None).unwrap(); + assert_eq!(first_plan.collectable_text_artifact_count(), 1); + let second_plan = scan.prepare(second.path(), &BTreeSet::new(), &|| false, None).unwrap(); + scan.complete(&first_plan); + assert_eq!(second_plan.collectable_text_artifact_count(), 0); + assert!(live.exists()); + scan.complete(&second_plan); + let staging = code_text_artifact_staging_root(second.path()); + std::fs::create_dir_all(&staging).unwrap(); + let debris = staging.join(format!(".text-artifact-{}.staging", "a".repeat(64))); + std::fs::write(&debris, b"abandoned staging").unwrap(); + let next = scan.prepare(second.path(), &BTreeSet::new(), &|| false, None).unwrap(); + assert_eq!(next.collectable_text_artifact_count(), 1); + assert!(debris.exists()); + } +} diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs index c87c5b74e0..6bfa40db97 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs @@ -16,6 +16,7 @@ use super::journal::{ BoundedJournalSpec, clear_journal, journal_path, load_journal, persist_journal, }; use super::receipt_store; +use super::text_artifact_scan::TextArtifactPageV1; use super::receipt_store::{ReceiptStoreSpec, receipt_digest_file_component}; use super::{ ACTIVE_POINTER_FILE, CodeGenerationRetentionErrorV1, CodeGenerationRetentionPlanV1, @@ -245,12 +246,26 @@ pub(super) fn plan_collectable_text_artifacts_cancellable( ) } +#[cfg(test)] pub(super) fn plan_collectable_text_artifacts_budgeted_cancellable( store_root: &Path, active_pointer: Option<&DurablePublicationPointerV1>, verification: GenerationDigestVerificationV1, remaining_entries: &mut usize, is_cancelled: &dyn Fn() -> bool, +) -> Result { + plan_collectable_text_artifacts_budgeted_page_cancellable( + store_root, active_pointer, verification, remaining_entries, is_cancelled, None, + ) +} + +pub(super) fn plan_collectable_text_artifacts_budgeted_page_cancellable( + store_root: &Path, + active_pointer: Option<&DurablePublicationPointerV1>, + verification: GenerationDigestVerificationV1, + remaining_entries: &mut usize, + is_cancelled: &dyn Fn() -> bool, + page: Option<&TextArtifactPageV1>, ) -> Result { if is_cancelled() { return Err(CodeGenerationRetentionErrorV1::Cancelled); @@ -356,49 +371,63 @@ pub(super) fn plan_collectable_text_artifacts_budgeted_cancellable( // untrusted files. Alternate bounded entry observations with the // independent staging namespace so those files cannot consume every // scan slot and suppress otherwise verified staging cleanup. - let mut completed_entries = if root_present { + let mut completed_entries = if page.is_none() && root_present { Some(std::fs::read_dir(&root).map_err(storage)?) } else { None }; - let mut staging_entries = if private_directory_exists(&staging_root)? { + let staging_present = private_directory_exists(&staging_root)?; + let mut staging_entries = if page.is_none() && staging_present { Some(std::fs::read_dir(&staging_root).map_err(storage)?) } else { None }; let mut candidates = BTreeMap::new(); + let mut page_entries = page.map(|page| page.entries.iter()); + let mut scanned_entries = 0; let mut remaining = MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1; let mut scan_completed = true; while remaining > 0 && candidates.len() < MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1 { if is_cancelled() { return Err(CodeGenerationRetentionErrorV1::Cancelled); } - if completed_entries.is_none() && staging_entries.is_none() { - break; - } - let shared = scan_completed; - scan_completed = !scan_completed; - let listing = if shared { - &mut completed_entries + let (shared, path) = if let Some(entries) = page_entries.as_mut() { + let Some((shared, path)) = entries.next() else { + break; + }; + (*shared, path.clone()) } else { - &mut staging_entries - }; - let Some(entry) = listing.as_mut().and_then(|entries| entries.next()) else { - *listing = None; - continue; + if completed_entries.is_none() && staging_entries.is_none() { + break; + } + let shared = scan_completed; + scan_completed = !scan_completed; + let listing = if shared { + &mut completed_entries + } else { + &mut staging_entries + }; + let Some(entry) = listing.as_mut().and_then(|entries| entries.next()) else { + *listing = None; + continue; + }; + (shared, entry.map_err(storage)?.path()) }; if *remaining_entries == 0 { return Err(CodeGenerationRetentionErrorV1::EntryBudgetExceeded); } *remaining_entries -= 1; remaining -= 1; - let entry = entry.map_err(storage)?; - let file_name = entry.file_name().into_string().map_err(|_| { - CodeGenerationRetentionErrorV1::UnsafeState( - "code text artifact inventory filename is not UTF-8".to_owned(), - ) - })?; - let path = entry.path(); + scanned_entries += 1; + let file_name = path + .file_name() + .and_then(|name| name.to_str()) + .ok_or_else(|| { + CodeGenerationRetentionErrorV1::UnsafeState( + "code text artifact inventory filename is not UTF-8".to_owned(), + ) + })? + .to_owned(); // This inventory reads the artifact directories without the // generation-store lock, so an entry the listing just named can // already be gone: the text-artifact builder retires a `.staging` @@ -502,6 +531,7 @@ pub(super) fn plan_collectable_text_artifacts_budgeted_cancellable( } } Ok(CodeTextArtifactRetentionInventoryV1 { + scanned_entries, candidates: candidates.into_values().collect(), unique_bytes: inventory .values() @@ -571,7 +601,7 @@ fn scope_text_artifact_marks( Ok(marked) } -fn private_directory_exists(path: &Path) -> Result { +pub(super) fn private_directory_exists(path: &Path) -> Result { match std::fs::symlink_metadata(path) { Ok(metadata) if metadata.file_type().is_dir() => Ok(true), Ok(_) => Err(CodeGenerationRetentionErrorV1::UnsafeState(format!( diff --git a/crates/tracedecay-maintenance/src/store_maintenance/mod.rs b/crates/tracedecay-maintenance/src/store_maintenance/mod.rs index 6bd6a16f30..9d82e8cd4c 100644 --- a/crates/tracedecay-maintenance/src/store_maintenance/mod.rs +++ b/crates/tracedecay-maintenance/src/store_maintenance/mod.rs @@ -16,7 +16,6 @@ use tracedecay_code_index_retention::code_index_generations::{ CodeGenerationRetentionErrorV1, CodeGenerationRetentionModeV1, CodeGenerationRetentionPlanV1, CodeGenerationRetentionReportV1, CodeIndexScopeV1, code_index_scopes, code_index_store_root, execute_code_generation_retention_cancellable, - prepare_next_code_generation_retention_cancellable, }; use tracedecay_code_index_runtime::code_index_scheduler::CodeIndexSchedulerRegistryV1; use tracedecay_domain::CodeGenerationId; @@ -30,6 +29,8 @@ mod scope_reconciliation; use graph_replay::{defer_graph_replay_pool_busy, log_code_generation_retention_degraded}; #[cfg(test)] pub(crate) mod registered_tests; +#[cfg(test)] +mod text_artifact_scan_tests; pub use scope_reconciliation::{run_code_index_scope_reconciliation, scheduler_owner_roots}; /// Outcome of one bounded code-generation retention pass. @@ -150,6 +151,7 @@ async fn plan_collection( protected_sources: &BTreeSet, graph_replay_pool_root: &Path, backoff_root: &Path, + scan_owner_root: &Path, observations: &StoreTelemetrySamplingRegistry, cancellation: &CancellationToken, ) -> Result { @@ -157,13 +159,19 @@ async fn plan_collection( let plan_sources = protected_sources.clone(); let plan_cancellation = cancellation.clone(); let plan_pool_root = graph_replay_pool_root.to_path_buf(); + let scan = observations.text_artifact_scan(scan_owner_root, store_root); let plan = native_runtime::spawn_blocking(move || { - prepare_next_code_generation_retention_cancellable( + let mut scan = scan.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + let plan = scan.prepare( &plan_root, &plan_sources, &|| plan_cancellation.is_cancelled(), Some(&plan_pool_root), - ) + )?; + if !plan.has_collectable_work() { + scan.complete(&plan); + } + Ok(plan) }) .await; match plan { @@ -207,6 +215,7 @@ async fn execute_collection( plan: CodeGenerationRetentionPlanV1, graph_replay_pool_root: &Path, backoff_root: &Path, + scan_owner_root: &Path, observations: &StoreTelemetrySamplingRegistry, cancellation: &CancellationToken, ) -> Result { @@ -218,15 +227,20 @@ async fn execute_collection( let execution_root = store_root.to_path_buf(); let execution_pool_root = graph_replay_pool_root.to_path_buf(); let execution_cancellation = cancellation.clone(); + let scan = observations.text_artifact_scan(scan_owner_root, store_root); let report = native_runtime::spawn_blocking(move || { - execute_code_generation_retention_cancellable( + let report = execute_code_generation_retention_cancellable( &execution_root, plan, CodeGenerationRetentionModeV1::Apply, completed_at, Some(&execution_pool_root), &|| execution_cancellation.is_cancelled(), - ) + )?; + scan.lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .complete(&report.plan); + Ok(report) }) .await; match report { @@ -310,6 +324,7 @@ async fn execute_collection( /// cost only. fn collection_left_work(report: &CodeGenerationRetentionReportV1) -> bool { report.generation_segment_batch_exhausted + || report.plan.has_pending_text_artifact_inventory() || !report.deleted_generations.is_empty() || !report.deleted_text_artifacts.is_empty() } @@ -387,6 +402,7 @@ pub async fn run_code_generation_retention( &protection.sources, &graph_replay_pool_root, lease.project_root(), + &layout.data_root, observations, cancellation, ) @@ -436,9 +452,10 @@ pub async fn run_code_generation_retention( // its bytes wait for the next full interval (a day by default). let awaits_transient_release = plan.awaits_transient_release(&protection.serving); if !plan.has_collectable_work() { + let inventory_pending = plan.has_pending_text_artifact_inventory(); return if replay_reconcile_failed { CodeGenerationRetentionOutcomeV1::Failed - } else if release_backlog_remains || awaits_transient_release { + } else if release_backlog_remains || awaits_transient_release || inventory_pending { CodeGenerationRetentionOutcomeV1::MoreWork } else { CodeGenerationRetentionOutcomeV1::Complete @@ -453,6 +470,7 @@ pub async fn run_code_generation_retention( plan, &graph_replay_pool_root, lease.project_root(), + &layout.data_root, observations, cancellation, ) @@ -567,6 +585,16 @@ pub async fn run_registered_code_generation_retention( return CodeGenerationRetentionOutcomeV1::Failed; } }; + // A project may remain registered long after individual scope directories + // are retired. Only a successful canonical scope census can release their + // retained directory streams; an inventory failure above preserves them. + observations.retain_text_artifact_scan_scopes( + &store.data_root, + &scopes + .iter() + .map(|scope| scope.store_root.clone()) + .collect::>(), + ); let graph_replay_pool_root = store .data_root .join(tracedecay_runtime_core::config::DB_FILENAME) @@ -597,6 +625,7 @@ pub async fn run_registered_code_generation_retention( &protection.sources, &graph_replay_pool_root, &root, + &store.data_root, observations, cancellation, ) @@ -609,6 +638,9 @@ pub async fn run_registered_code_generation_retention( } }; if !plan.has_collectable_work() { + if plan.has_pending_text_artifact_inventory() { + outcome = outcome.with_pass(CodeGenerationRetentionOutcomeV1::MoreWork); + } continue; } match execute_collection( @@ -616,6 +648,7 @@ pub async fn run_registered_code_generation_retention( plan, &graph_replay_pool_root, &root, + &store.data_root, observations, cancellation, ) diff --git a/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs b/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs new file mode 100644 index 0000000000..8e70d6d4da --- /dev/null +++ b/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs @@ -0,0 +1,76 @@ +use std::collections::{BTreeMap, BTreeSet}; + +use tracedecay_code_index_retention::code_index_generations::code_text_artifacts_root; +use tracedecay_domain::canonical_text::sha256_hex; +use tracedecay_runtime_core::cancellation::CancellationToken; + +use super::{execute_collection, plan_collection}; +use crate::telemetry::StoreTelemetrySamplingRegistry; + +#[asupersync::test] +async fn maintenance_owner_advances_noop_pages_and_applies_a_later_orphan() { + let store = tempfile::tempdir().unwrap(); + let artifacts = code_text_artifacts_root(store.path()); + std::fs::create_dir_all(&artifacts).unwrap(); + let mut contents = BTreeMap::new(); + for index in 0..150 { + let bytes = format!("orphan payload {index}"); + let path = artifacts.join(format!("text-artifact-{}.bin", sha256_hex(bytes.as_bytes()))); + std::fs::write(&path, b"untrusted content").unwrap(); + contents.insert(path, bytes); + } + let last = std::fs::read_dir(&artifacts) + .unwrap() + .last() + .unwrap() + .unwrap() + .path(); + std::fs::write(&last, &contents[&last]).unwrap(); + let observations = StoreTelemetrySamplingRegistry::default(); + let cancellation = CancellationToken::new(); + let replay = store.path().join("graph-replay"); + let mut idle_pages = 0; + let mut finished = false; + for _ in 0..6 { + // Fetch through the registry again, just as a new maintenance tick + // does. Constructing a fresh scan per call would starve this fixture. + let plan = plan_collection( + store.path(), + &BTreeSet::new(), + &replay, + store.path(), + store.path(), + &observations.clone(), + &cancellation, + ) + .await + .unwrap(); + let more = plan.has_pending_text_artifact_inventory(); + if plan.has_collectable_work() { + let report = execute_collection( + store.path(), + plan, + &replay, + store.path(), + store.path(), + &observations, + &cancellation, + ) + .await + .unwrap(); + assert_eq!(report.deleted_text_artifacts.len(), 1); + } else { + idle_pages += usize::from(more); + } + if !more { + finished = true; + break; + } + } + assert!(finished); + assert!(idle_pages > 0); + assert!(!last.exists()); + for path in contents.keys().filter(|path| **path != last) { + assert_eq!(std::fs::read(path).unwrap(), b"untrusted content"); + } +} diff --git a/crates/tracedecay-maintenance/src/telemetry.rs b/crates/tracedecay-maintenance/src/telemetry.rs index 62c45ce92f..c83ff5efb6 100644 --- a/crates/tracedecay-maintenance/src/telemetry.rs +++ b/crates/tracedecay-maintenance/src/telemetry.rs @@ -26,6 +26,9 @@ use tracedecay_tool_catalog::{CapabilityId, UseCaseId}; use crate::tick::MaintenanceTickOutcome; +mod text_artifact_scans; +use text_artifact_scans::TextArtifactScansV1; + const STORAGE_TELEMETRY_CONTEXT_HORIZON_MICROS: i64 = 30_000_000; const STORAGE_TELEMETRY_CAPABILITY: &str = "capability.application.storage.telemetry"; const STORAGE_TELEMETRY_USE_CASE: &str = "use-case.application.storage.telemetry.read"; @@ -477,6 +480,7 @@ pub struct StoreTelemetrySamplingRegistry { /// Where table-growth state survives a restart; `None` keeps it in memory. table_growth_state_path: Option, graph_replay_release: Arc>>, + text_artifact_scans: TextArtifactScansV1, graph_staging_release: Arc>>, /// Whether the by-design quiet `retry` tick line has already been written. @@ -629,6 +633,10 @@ impl StoreTelemetrySamplingRegistry { } pub fn release_retained_handles_for_shutdown(&self) { + self.text_artifact_scans + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .clear(); self.ports .lock() .unwrap_or_else(std::sync::PoisonError::into_inner) @@ -642,6 +650,16 @@ impl StoreTelemetrySamplingRegistry { .store(false, Ordering::Release); } + /// Retain scan cursors for every registered project, including those with + /// no mounted graph. Mounted-only pruning would restart a registered + /// scope at the same preserved directory prefix on every tick. + pub fn retain_text_artifact_scan_projects(&self, active_data_roots: &BTreeSet) { + self.text_artifact_scans + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .retain(|_, entry| active_data_roots.contains(&entry.data_root)); + } + pub fn retain_project_maintenance_state(&self, active_projects: &BTreeSet) { self.graph_replay_release .lock() diff --git a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs new file mode 100644 index 0000000000..1e156d7138 --- /dev/null +++ b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs @@ -0,0 +1,135 @@ +//! Text-artifact scan positions owned by the existing maintenance registry. + +use std::collections::{BTreeSet, HashMap}; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, PoisonError}; + +use tracedecay_code_index_retention::code_index_generations::CodeGenerationRetentionScanV1; + +use super::StoreTelemetrySamplingRegistry; + +pub(super) struct TextArtifactScanEntryV1 { + pub(super) data_root: PathBuf, + scan: Arc>, +} + +pub(super) type TextArtifactScansV1 = Arc>>; + +impl StoreTelemetrySamplingRegistry { + /// Mounted and registered scopes share this owner across short ticks. + /// The map lock protects only lookup; verification holds a per-scope lock + /// on the blocking worker, never the daemon-wide telemetry lock. + pub(crate) fn text_artifact_scan( + &self, + data_root: &Path, + store_root: &Path, + ) -> Arc> { + let mut scans = self + .text_artifact_scans + .lock() + .unwrap_or_else(PoisonError::into_inner); + let entry = scans.entry(store_root.to_path_buf()).or_insert_with(|| { + TextArtifactScanEntryV1 { + data_root: data_root.to_path_buf(), + scan: Arc::new(Mutex::new(CodeGenerationRetentionScanV1::default())), + } + }); + Arc::clone(&entry.scan) + } + + /// Release directory streams for scopes absent from a successfully read + /// project scope inventory. A registered project can outlive many retired + /// worktrees; pruning by project alone would retain their open ReadDir + /// handles indefinitely. + pub(crate) fn retain_text_artifact_scan_scopes( + &self, + data_root: &Path, + live_store_roots: &BTreeSet, + ) { + self.text_artifact_scans + .lock() + .unwrap_or_else(PoisonError::into_inner) + .retain(|store_root, entry| { + entry.data_root != data_root || live_store_roots.contains(store_root) + }); + } +} + +#[cfg(test)] +mod tests { + use std::collections::BTreeSet; + use std::path::Path; + use std::sync::Arc; + + use super::StoreTelemetrySamplingRegistry; + + #[test] + fn retired_scope_releases_scan_while_registered_project_stays_live() { + let registry = StoreTelemetrySamplingRegistry::default(); + let project = Path::new("registered-project"); + let survivor = Path::new("registered-project/code-index-v1/survivor"); + let retired = Path::new("registered-project/code-index-v1/retired"); + let other = Path::new("other-project/code-index-v1/scope"); + + let live = registry.text_artifact_scan(project, survivor); + let removed = registry.text_artifact_scan(project, retired); + let removed_weak = Arc::downgrade(&removed); + drop(removed); + + let other_data_root = Path::new("other-project"); + let elsewhere = registry.text_artifact_scan(other_data_root, other); + let elsewhere_weak = Arc::downgrade(&elsewhere); + drop(elsewhere); + + // The registered project is still present. Only its *scope* inventory + // changed, so the retired scan must not keep its ReadDir handles. + registry.retain_text_artifact_scan_scopes( + project, + &BTreeSet::from([survivor.to_path_buf()]), + ); + assert!(removed_weak.upgrade().is_none()); + assert!(Arc::ptr_eq( + &live, + ®istry.text_artifact_scan(project, survivor) + )); + assert!(elsewhere_weak.upgrade().is_some()); + + // A failed/incomplete project inventory does not invoke pruning. + // After a later successful empty inventory, all its old streams close. + let live_weak = Arc::downgrade(&live); + drop(live); + registry.retain_text_artifact_scan_scopes(project, &BTreeSet::new()); + assert!(live_weak.upgrade().is_none()); + assert!(elsewhere_weak.upgrade().is_some()); + } + + #[test] + fn scope_scans_share_the_owner_and_retire_with_project_state() { + let registry = StoreTelemetrySamplingRegistry::default(); + let clone = registry.clone(); + let project = Path::new("retained-project"); + let other = Path::new("retired-project"); + let scope = Path::new("retained-scope"); + let retired_scope = Path::new("retired-scope"); + let first = registry.text_artifact_scan(project, scope); + // An unmounted registered project is absent from mounted graph + // maintenance but must retain scan progress across short ticks. + assert!(Arc::ptr_eq(&first, &clone.text_artifact_scan(project, scope))); + let second = registry.text_artifact_scan(project, Path::new("other-scope")); + assert!(!Arc::ptr_eq(&first, &second)); + let retired = registry.text_artifact_scan(other, retired_scope); + let retired_weak = Arc::downgrade(&retired); + drop(retired); + registry.retain_project_maintenance_state(&BTreeSet::new()); + registry.retain_text_artifact_scan_projects(&BTreeSet::from([project.to_path_buf()])); + assert!(retired_weak.upgrade().is_none()); + assert!(Arc::ptr_eq(&first, &clone.text_artifact_scan(project, scope))); + let first_weak = Arc::downgrade(&first); + let second_weak = Arc::downgrade(&second); + drop(first); + drop(second); + registry.release_retained_handles_for_shutdown(); + assert!(first_weak.upgrade().is_none()); + assert!(second_weak.upgrade().is_none()); + } +} diff --git a/crates/tracedecay/src/daemon/maintenance.rs b/crates/tracedecay/src/daemon/maintenance.rs index dec31a63b5..ea2070195f 100644 --- a/crates/tracedecay/src/daemon/maintenance.rs +++ b/crates/tracedecay/src/daemon/maintenance.rs @@ -1075,6 +1075,20 @@ impl MaintenanceCoordinator { .iter() .map(|graph| graph.project_root.clone()) .collect::>(); + // Text-artifact progress belongs to registered project data roots, + // not only mounted graphs. Mounted-only pruning replays a preserved + // directory prefix forever for an unmounted registered scope. + if registry_listed { + let mut scan_data_roots = project_graphs + .iter() + .map(|graph| graph.data_root.clone()) + .collect::>(); + scan_data_roots.extend(work.iter().filter_map(|(_, unit)| match unit { + MaintenanceStoreWork::Registered(store) => Some(store.data_root.clone()), + MaintenanceStoreWork::Session(_) | MaintenanceStoreWork::Graph(_) => None, + })); + maintenance_observations.retain_text_artifact_scan_projects(&scan_data_roots); + } maintenance_observations.retain_project_maintenance_state(&active_maintenance_projects); // A capacity retirement releasing stores skips this pass: sampling // leases every sampled store until it ends. From ba6b7123ba4720ff05285e5638ba605764d8ec1a Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:59:30 -0800 Subject: [PATCH 32/63] feat(analytics): serve the recorded failure reason on the recent tape The recent-event tape reported `outcome: "error"` and nothing else, so an operator could see that a call failed but not why. The writer already records a bounded, sanitized `failure_reason` in the event's metadata, and no surface read it back. Serve it on the tape through the same authority the writer used. The text crosses `sanitize_provider_metadata_text`, so text the sanitizer quarantines is omitted rather than echoed, and it is capped at the writer's own 160-char bound so the ceiling is one policy rather than two. Only `error` outcomes serve a reason: a success that happens to carry one in metadata is not a failure to report, and an absent reason stays off the wire. Generated dashboard contracts and the TypeScript SDK still describe the old shape; the scheduler lane owns that regeneration. --- .../src/analytics_bridge/summary.rs | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/crates/tracedecay-application/src/analytics_bridge/summary.rs b/crates/tracedecay-application/src/analytics_bridge/summary.rs index 5af923ebc6..0946f9ac0c 100644 --- a/crates/tracedecay-application/src/analytics_bridge/summary.rs +++ b/crates/tracedecay-application/src/analytics_bridge/summary.rs @@ -118,6 +118,15 @@ pub struct AnalyticsRecentEventV1 { /// What the call cost its stores, for tool calls whose read was metered. #[serde(default, skip_serializing_if = "Option::is_none")] pub cost: Option, + /// The bounded, sanitized reason a failed call recorded. + /// + /// `outcome` alone says a call failed; without the reason an operator can + /// see that something broke but not what. The durable metadata column is + /// not a disclosure boundary, so the text crosses the privacy authority + /// and a bounded length before it is served, and text the sanitizer + /// quarantines is omitted rather than echoed. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failure_reason: Option, } #[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] @@ -836,10 +845,44 @@ fn recent_event_rows(events: &[AnalyticsEventRecord], limit: usize) -> Vec Option { + if event.outcome.as_deref() != Some("error") { + return None; + } + let metadata: Value = serde_json::from_str(event.metadata_json.as_deref()?).ok()?; + let reason = metadata.get("failure_reason")?.as_str()?; + let collapsed = tracedecay_domain::collapse_whitespace(reason); + if collapsed.is_empty() { + return None; + } + // The sanitizer refuses text it quarantines; omit rather than echo it. + let sanitized = tracedecay_privacy::sanitize_provider_metadata_text(&collapsed)?; + let bounded = if sanitized.chars().count() <= SERVED_FAILURE_REASON_MAX_CHARS { + sanitized + } else { + sanitized + .chars() + .take(SERVED_FAILURE_REASON_MAX_CHARS) + .collect() + }; + (!bounded.is_empty()).then_some(bounded) +} + /// The cost receipt the MCP server recorded in the event's metadata. fn recorded_cost(event: &AnalyticsEventRecord) -> Option { let metadata: Value = serde_json::from_str(event.metadata_json.as_deref()?).ok()?; @@ -911,6 +954,102 @@ mod tests { } } + #[test] + fn a_failed_call_serves_its_bounded_sanitized_reason() { + let mut failed = mcp_call( + 1, + "tracedecay_ast_rewrite", + r#"{"failure_reason":"old_str not\nfound in src/main.rs"}"#, + ); + failed.outcome = Some("error".to_owned()); + let payload = diagnostics_payload_from_parts( + Some(0), + &HookAnalyticsRows::empty(), + Some(std::slice::from_ref(&failed)), + ); + + assert_eq!( + payload.recent_events[0].failure_reason.as_deref(), + Some("old_str not found in src/main.rs"), + "the recorded reason crosses the tape, whitespace-collapsed" + ); + } + + #[test] + fn a_successful_call_never_serves_a_failure_reason() { + let event = mcp_call( + 1, + "tracedecay_search", + r#"{"failure_reason":"should not surface on success"}"#, + ); + let payload = diagnostics_payload_from_parts( + Some(0), + &HookAnalyticsRows::empty(), + Some(std::slice::from_ref(&event)), + ); + + assert_eq!(payload.recent_events[0].outcome, "success"); + assert_eq!( + payload.recent_events[0].failure_reason, None, + "a reason recorded beside a success is not a failure to report" + ); + let encoded = serde_json::to_value(&payload).expect("payload encodes"); + assert!( + encoded["recent_events"][0].get("failure_reason").is_none(), + "an absent reason stays off the wire: {}", + encoded["recent_events"][0] + ); + } + + #[test] + fn a_credential_shaped_failure_reason_is_omitted_not_echoed() { + // Split so this file never contains a contiguous credential-shaped + // token; the tail is base32 as real AWS key ids are. + let secret = ["AKIA", "SYNTHETIC", "CANARY", "7"].concat(); + let mut failed = mcp_call( + 1, + "tracedecay_edit", + &serde_json::json!({ "failure_reason": format!("auth failed for {secret}") }) + .to_string(), + ); + failed.outcome = Some("error".to_owned()); + let payload = diagnostics_payload_from_parts( + Some(0), + &HookAnalyticsRows::empty(), + Some(std::slice::from_ref(&failed)), + ); + + let served = payload.recent_events[0].failure_reason.as_deref(); + assert!( + served.is_none_or(|reason| !reason.contains(&secret)), + "the privacy authority must keep the credential off the tape, got {served:?}" + ); + } + + #[test] + fn a_long_failure_reason_is_capped_on_the_tape() { + let mut failed = mcp_call( + 1, + "tracedecay_edit", + &serde_json::json!({ "failure_reason": "x".repeat(500) }).to_string(), + ); + failed.outcome = Some("error".to_owned()); + let payload = diagnostics_payload_from_parts( + Some(0), + &HookAnalyticsRows::empty(), + Some(std::slice::from_ref(&failed)), + ); + + let served = payload.recent_events[0] + .failure_reason + .as_deref() + .expect("a plain long reason is still served, bounded"); + assert_eq!( + served.chars().count(), + super::SERVED_FAILURE_REASON_MAX_CHARS + ); + } + #[test] fn the_recent_tape_carries_each_metered_call_its_recorded_cost() { let events = [ From c4ed744789e341a44592a7f7b44c479982cc50be Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 00:18:14 -0800 Subject: [PATCH 33/63] fix(evals): atomically publish scored summaries Refs #4535. A scoring run wrote summary.json directly, truncating its last completed result before JSON encoding and filesystem sync succeeded. Render, flush, and sync to an owned same-directory staging file, then replace the visible summary in one atomic operation. Failures preserve the prior summary and clean up owned staging bytes. Cover complete publication and serialization, fsync, and replace failures with real temporary files. The isolated helper probe passed four checks; Bazel CI is still required for the repository suite. --- evals/intent_engine/score.py | 20 ++++++++++++-- evals/intent_engine/test_score.py | 45 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index 3eb57e2661..e51e66795f 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -4,12 +4,28 @@ categories with both label classes and reports its category coverage. Nonempty macro F1 retains the historical fixed-CATS, zero-for-undefined convention. """ -import json, glob, os, statistics, sys +import json, glob, os, statistics, sys, tempfile sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from common import CATS TH = [0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] +def publish_summary(path, summary): + # Publish a complete scored snapshot without truncating the last good one. + directory = os.path.dirname(os.path.abspath(path)) + descriptor, staged = tempfile.mkstemp(prefix=".intent-summary-", suffix=".json", dir=directory) + try: + with os.fdopen(descriptor, "w", encoding="utf-8") as output: + json.dump(summary, output, indent=1, allow_nan=False) + output.write("\n") + output.flush() + os.fsync(output.fileno()) + os.replace(staged, path) + finally: + if os.path.lexists(staged): + os.unlink(staged) + + def auc(pos, neg): if not pos or not neg: return None s = sum((p > n) + 0.5 * (p == n) for p in pos for n in neg) @@ -161,7 +177,7 @@ def ch(rs): # establish hybrid latency or usage, and must never replace an actual run. for k, res in allres.items(): summary[k] = score_config(res, fixed) - json.dump(summary, open(os.path.join(here, "summary.json"), "w"), indent=1) + publish_summary(os.path.join(here, "summary.json"), summary) f2 = lambda x: " - " if x is None else "%.2f" % x print("config macroAUC ctxAUC | t0.5: mF1 top1 top1ctx noneFH | t0.6: mF1 top1 top1ctx noneFH | best: mF1 top1 top1ctx noneFH | ECE | med/p90 ms") for k, s in summary.items(): diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index 71b305ed94..d25e7f8d37 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -5,6 +5,7 @@ import sys import tempfile import unittest +from unittest import mock import score @@ -282,6 +283,50 @@ def test_duplicate_configuration_files_are_refused_before_summary_replacement(se self.assertIn("same", scored.stderr) self.assertEqual(summary.read_bytes(), b"existing summary\n") + def test_summary_publication_replaces_only_a_complete_scored_snapshot(self): + with tempfile.TemporaryDirectory() as directory: + summary = Path(directory) / "summary.json" + previous = b'{"prior": true}\n' + summary.write_bytes(previous) + expected = {"measured": {"macro_f1": 0.91}} + replace = score.os.replace + + def inspect_replace(staged, destination): + self.assertEqual(summary.read_bytes(), previous) + self.assertEqual( + json.loads(Path(staged).read_text(encoding="utf-8")), expected + ) + replace(staged, destination) + + with mock.patch.object(score.os, "replace", side_effect=inspect_replace): + score.publish_summary(summary, expected) + self.assertEqual(json.loads(summary.read_text(encoding="utf-8")), expected) + self.assertEqual(set(Path(directory).iterdir()), {summary}) + + def test_summary_publication_errors_preserve_previous_bytes_and_remove_staging(self): + for failure in ("serialize", "fsync", "replace"): + with self.subTest(failure=failure), tempfile.TemporaryDirectory() as directory: + summary = Path(directory) / "summary.json" + previous = b'{"completed": true}\n' + summary.write_bytes(previous) + if failure == "serialize": + with self.assertRaisesRegex(ValueError, "Out of range"): + score.publish_summary(summary, {"invalid": float("nan")}) + elif failure == "fsync": + with mock.patch.object( + score.os, "fsync", side_effect=OSError("sync failed") + ): + with self.assertRaisesRegex(OSError, "sync failed"): + score.publish_summary(summary, {"new": 1}) + else: + with mock.patch.object( + score.os, "replace", side_effect=PermissionError("publish denied") + ): + with self.assertRaisesRegex(PermissionError, "publish denied"): + score.publish_summary(summary, {"new": 1}) + self.assertEqual(summary.read_bytes(), previous) + self.assertEqual(set(Path(directory).iterdir()), {summary}) + @staticmethod def stage_scripts(root): for name in ("score.py", "compare.py", "common.py"): From 29196f83399e91201b1c9db24ee730ca90ed6b09 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 00:22:30 -0800 Subject: [PATCH 34/63] fix(retention): release scope scans before quarantine --- .../tracedecay-maintenance/src/generation.rs | 6 +- .../store_maintenance/scope_reconciliation.rs | 12 ++++ .../src/telemetry/text_artifact_scans.rs | 66 +++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay-maintenance/src/generation.rs b/crates/tracedecay-maintenance/src/generation.rs index 70cefa4823..0aa151347a 100644 --- a/crates/tracedecay-maintenance/src/generation.rs +++ b/crates/tracedecay-maintenance/src/generation.rs @@ -65,7 +65,11 @@ pub async fn run_project_generation_maintenance( if !cancellation.is_cancelled() { outcome = outcome.combine({ use tracing::Instrument as _; - run_code_index_scope_reconciliation(lease, code_index_schedulers) + run_code_index_scope_reconciliation( + lease, + code_index_schedulers, + maintenance_observations, + ) .instrument(tracing::trace_span!( "daemon.maintenance.scope_reconciliation" )) diff --git a/crates/tracedecay-maintenance/src/store_maintenance/scope_reconciliation.rs b/crates/tracedecay-maintenance/src/store_maintenance/scope_reconciliation.rs index 6ef5e64725..fef6abf4ef 100644 --- a/crates/tracedecay-maintenance/src/store_maintenance/scope_reconciliation.rs +++ b/crates/tracedecay-maintenance/src/store_maintenance/scope_reconciliation.rs @@ -21,6 +21,7 @@ use tracedecay_runtime_core::native_runtime; use crate::clock::now_secs_i64; use crate::lease::ProjectStoreMaintenanceLeaseV1; +use crate::telemetry::StoreTelemetrySamplingRegistry; use crate::tick::{MaintenanceContinuation, MaintenanceTickOutcome}; /// Collect every scope of this project's `code-index-v1/` whose root is no @@ -50,6 +51,7 @@ use crate::tick::{MaintenanceContinuation, MaintenanceTickOutcome}; pub async fn run_code_index_scope_reconciliation( lease: &ProjectStoreMaintenanceLeaseV1, schedulers: &CodeIndexSchedulerRegistryV1, + observations: &StoreTelemetrySamplingRegistry, ) -> MaintenanceTickOutcome { let store_root = code_index_scope_store_root(&lease.store_layout().data_root); if !store_root.is_dir() @@ -97,9 +99,19 @@ pub async fn run_code_index_scope_reconciliation( let mounted = scheduler_owner_roots(schedulers).await; let completed_at = tracedecay_contracts::clock::now_micros(); + let observations = observations.clone(); let executed = native_runtime::spawn_blocking(move || { let revalidated = scope_root_liveness_proof(&project_root, &mounted) .map_err(|failure| (failure, None))?; + // The admitted maintenance unit has finished its bounded generation + // pass. Drop only the scopes now selected for collection, before the + // executor's Windows quarantine rename; other scopes retain progress. + let retired_scopes = plan + .collectable_scopes + .iter() + .map(|scope| store_root.join(&scope.scope_hash)) + .collect::>(); + observations.release_text_artifact_scans_before_scope_collection(&retired_scopes); execute_scope_root_retention( &store_root, plan, diff --git a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs index 1e156d7138..4d8b3c74b4 100644 --- a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs +++ b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs @@ -53,6 +53,26 @@ impl StoreTelemetrySamplingRegistry { entry.data_root != data_root || live_store_roots.contains(store_root) }); } + + /// A scope selected for quarantine must not be pinned by an unfinished + /// staging-directory scan. Reset even if a blocking caller still holds an + /// Arc to the scan, so its ReadDir handles are closed before the rename. + /// The maintenance writer serializes this with scan preparation. + pub(crate) fn release_text_artifact_scans_before_scope_collection( + &self, + collectable_store_roots: &BTreeSet, + ) { + let mut scans = self + .text_artifact_scans + .lock() + .unwrap_or_else(PoisonError::into_inner); + for root in collectable_store_roots { + if let Some(entry) = scans.remove(root) { + *entry.scan.lock().unwrap_or_else(PoisonError::into_inner) = + CodeGenerationRetentionScanV1::default(); + } + } + } } #[cfg(test)] @@ -60,6 +80,7 @@ mod tests { use std::collections::BTreeSet; use std::path::Path; use std::sync::Arc; + use tracedecay_code_index_retention::code_index_generations::code_text_artifact_staging_root; use super::StoreTelemetrySamplingRegistry; @@ -103,6 +124,51 @@ mod tests { assert!(elsewhere_weak.upgrade().is_some()); } + #[test] + fn scope_quarantine_releases_live_staging_directory_streams() { + let temp = tempfile::tempdir().unwrap(); + let data_root = temp.path().join("project"); + let scope_root = data_root.join("code-index-v1").join("retired"); + let staging = code_text_artifact_staging_root(&scope_root); + std::fs::create_dir_all(&staging).unwrap(); + // More than one bounded page keeps a real ReadDir open after prepare. + for i in 0..96 { + std::fs::write( + staging.join(format!(".text-artifact-{i:064x}.staging")), + b"unpublished staging", + ) + .unwrap(); + } + let registry = StoreTelemetrySamplingRegistry::default(); + let retained = registry.text_artifact_scan(&data_root, &scope_root); + let planned = retained + .lock() + .unwrap() + .prepare(&scope_root, &BTreeSet::new(), &|| false, None) + .unwrap(); + assert!(planned.has_pending_text_artifact_inventory()); + + let another_root = data_root.join("code-index-v1").join("live"); + let live = registry.text_artifact_scan(&data_root, &another_root); + registry.release_text_artifact_scans_before_scope_collection(&BTreeSet::from([ + scope_root.clone(), + ])); + assert!(Arc::ptr_eq( + &live, + ®istry.text_artifact_scan(&data_root, &another_root) + )); + assert!( + !Arc::ptr_eq(&retained, ®istry.text_artifact_scan(&data_root, &scope_root)), + "a retired scope must not keep a reusable scan owner" + ); + // On Windows a live ReadDir inside the source prevents this rename. + // Keep the prior Arc alive: removal alone is insufficient unless its + // open directory streams were also reset. + let quarantined = data_root.join("quarantined-scope"); + std::fs::rename(&scope_root, &quarantined).unwrap(); + assert!(quarantined.join("code-text-artifact-staging-v1").is_dir()); + } + #[test] fn scope_scans_share_the_owner_and_retire_with_project_state() { let registry = StoreTelemetrySamplingRegistry::default(); From bcb2932f1a0844bd354bbb049b7534ecdacf2aff Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 00:26:54 -0800 Subject: [PATCH 35/63] test(automation): prove an empty registered store reports no evidence The reflector and skill-writer tests that assert `no_session_evidence` inject `EmptyAutomationSessionRetrieval`, whose `retrieve` returns `CompleteZero` without consulting a store. They prove the runner's branch for that outcome, but not that a real, empty production store produces it, so the claim that an empty store reports genuinely-empty evidence rested on a stub. Drive the real production retrieval and the real evidence builder against a freshly registered project store that holds no sessions. The store answers `CompleteZero`, the evidence builder serializes empty hits, and the outcome is a `no_session_evidence` skip carrying a hash, so the skip is attributable rather than an unexplained absence. --- .../src/automation/runner/retrieval.rs | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs b/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs index e25b6f55dc..a1dfcff713 100644 --- a/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs +++ b/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs @@ -932,6 +932,78 @@ mod authority_tests { ); } + /// An isolated, registered, genuinely empty project session store reports + /// `no_session_evidence` rather than failing or fabricating evidence. + /// + /// The runner's own tests stub retrieval as `CompleteZero`, so they prove + /// the runner's branch but not that an empty production store reaches it. + /// This drives the real production retrieval and the real evidence builder + /// against a freshly registered project store that holds no sessions. + #[tokio::test] + async fn an_empty_registered_project_store_reports_no_session_evidence() { + let directory = tempdir().expect("temporary profile"); + let project_id = ProjectId::new("project.automation.empty-evidence").expect("project id"); + let runtime = RegisteredGlobalDbTestRuntime::project( + directory.path().join("profile"), + directory.path().join("project"), + project_id.clone(), + ) + .await + .expect("registered test runtime"); + let database = runtime.project_database_arc().expect("project database"); + let shard = database.binding().shard_id.clone(); + let profile_identity = FixtureProfileIdentity::new( + directory.path().join("profile"), + shard.brain_id.clone(), + shard.profile_id.clone(), + ); + let retrieval = ProductionAutomationSessionRetrieval { + database, + identity: project_automation_identity(&shard, &profile_identity, &project_id) + .expect("project identity"), + anchor_session_id: SessionId::new("session.automation.empty-evidence") + .expect("session id"), + }; + + let outcome = crate::automation::runner::evidence::build_session_reflector_evidence( + &retrieval, + &crate::automation::runner::SessionReflectorAutomationOptions::default(), + ) + .await + .expect("an empty store is a settled outcome, not a failure"); + + match outcome { + crate::automation::runner::evidence::SessionReflectorEvidenceOutcome::Skipped { + reason, + budget_stage, + evidence_hash, + } => { + assert_eq!( + reason, "no_session_evidence", + "an empty registered store is genuinely empty evidence, not a refusal" + ); + assert_eq!(budget_stage, None); + assert!( + evidence_hash.is_some(), + "the empty evidence is still hashed so the skip is attributable" + ); + } + other => match other { + crate::automation::runner::evidence::SessionReflectorEvidenceOutcome::Ready( + bundle, + ) => panic!( + "an empty store must not produce evidence; got {} hits", + bundle + .evidence + .get("hits") + .and_then(Value::as_array) + .map_or(0, Vec::len) + ), + _ => panic!("expected an empty-evidence skip"), + }, + } + } + #[tokio::test] async fn registered_identities_keep_typed_unavailable_without_active_anchor() { let directory = tempdir().expect("temporary profile"); From 1dba4d971ef940f158c58c32c68a88150fb31b5b Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 00:27:27 -0800 Subject: [PATCH 36/63] fix(global-db): upgrade published workflow table in background The published-shape upgrade ran inside attach, so a large store held daemon admission for the whole copy. This corrects fd310d6108 and 8a0dbd0b9d, which still described admission as doing that copy. Daemon attach now only decides: classification plus the catalog-only rename rehearsal, rolled back. The copy runs first in the store's existing schema convergence task, in one transaction, so atomicity, the proof under the write lock, cancellation between statements, and restart from the published shape are unchanged. Workflow storage answers the retryable typed workflow_authority_recovering until that commit; leases issued earlier see the outcome. A store that refuses in the background is held in its reset state and recorded with the other reset-required stores. Short-lived attaches still run the upgrade synchronously. After the commit the dropped table's pages are reclaimed in bounded compactions. Only workflow storage is gated, not the whole session store: daemon boot reads its worker plan from the profile session store, and project opens would be stranded on the degraded core route with no way back to the full server. Measured on a 256 MiB payload, 272 MB store, physical daemon: daemon admission 26 ms; first code hit 941 ms, before the commit at 1886 ms; recover span 1.09 s, of which copy 788 ms, drop 8.75 ms, commit 284 ms; reclaim 1.09 s. WAL peaked at 271 MB and db at 317 MB, settling to 33.5 MB and 272 MB. The store's other writers queue behind the writer lane for the recover span. Also corrects a refusal expectation left stale by 29a6f0c3f1. Co-Authored-By: Claude Opus 5.5 --- crates/tracedecay-domain/src/errors.rs | 20 + .../src/observation_projection/rearm_tests.rs | 5 +- crates/tracedecay-global-db/src/registered.rs | 180 ++++++-- .../src/registered/workflow_schema_tests.rs | 430 ++++++++++++++++-- .../tracedecay-global-db/src/schema_stages.rs | 86 ++-- .../workflow_artifact_ceiling_upgrade.rs | 113 ++++- crates/tracedecay-mcp/src/tool_errors.rs | 3 +- .../src/session_registry.rs | 2 +- .../src/session_registry/maintenance.rs | 140 ++++-- .../src/session_registry/mounts.rs | 2 +- .../src/daemon/store_runtime_tests.rs | 194 ++++++++ .../stale_sessions_store_reset.rs | 143 +++++- 12 files changed, 1154 insertions(+), 164 deletions(-) diff --git a/crates/tracedecay-domain/src/errors.rs b/crates/tracedecay-domain/src/errors.rs index 59d23f782f..4c4fb81824 100644 --- a/crates/tracedecay-domain/src/errors.rs +++ b/crates/tracedecay-domain/src/errors.rs @@ -5,6 +5,7 @@ use thiserror::Error; use crate::ApplicationProblemDetailV1; const STORE_OPEN_CANCELLED_REASON_CODE: &str = "store_open_cancelled"; +const WORKFLOW_AUTHORITY_RECOVERING_REASON_CODE: &str = "workflow_authority_recovering"; #[derive(Error, Debug)] #[error("{detail}")] @@ -498,6 +499,25 @@ impl TraceDecayError { .is_some_and(|(reason_code, _, _)| reason_code == STORE_OPEN_CANCELLED_REASON_CODE) } + /// The store's workflow tables are still in a published shape that + /// background convergence is upgrading. The store's other authorities keep + /// serving, and the same request succeeds once the upgrade commits. + pub fn workflow_authority_recovering() -> Self { + Self::project_route( + WORKFLOW_AUTHORITY_RECOVERING_REASON_CODE, + true, + "workflow storage is upgrading in the background; retry once the store's schema \ + convergence completes", + ) + } + + pub fn is_workflow_authority_recovering(&self) -> bool { + self.project_route_context() + .is_some_and(|(reason_code, _, _)| { + reason_code == WORKFLOW_AUTHORITY_RECOVERING_REASON_CODE + }) + } + pub fn project_route_with_detail( reason_code: impl Into, retryable: bool, diff --git a/crates/tracedecay-global-db/src/observation_projection/rearm_tests.rs b/crates/tracedecay-global-db/src/observation_projection/rearm_tests.rs index 04ac298504..37d8654ebd 100644 --- a/crates/tracedecay-global-db/src/observation_projection/rearm_tests.rs +++ b/crates/tracedecay-global-db/src/observation_projection/rearm_tests.rs @@ -203,7 +203,10 @@ async fn daemon_admission_defers_rearm_to_background_convergence() { harness .registered - .converge_schema(convergence) + .converge_schema( + convergence, + &tracedecay_runtime_core::cancellation::CancellationToken::new(), + ) .await .unwrap(); assert_eq!( diff --git a/crates/tracedecay-global-db/src/registered.rs b/crates/tracedecay-global-db/src/registered.rs index 87c93f8110..56f42ab1c2 100644 --- a/crates/tracedecay-global-db/src/registered.rs +++ b/crates/tracedecay-global-db/src/registered.rs @@ -74,6 +74,56 @@ impl RefusedAuthorityV1 { } } +/// What a registered store's session authorities answer right now. Every lease +/// of one owner shares it, so a background upgrade's outcome reaches clients +/// issued before it committed. +#[derive(Clone, Debug, PartialEq, Eq)] +enum SessionAuthorityV1 { + Serving, + /// Workflow tables in the published shape background convergence is + /// upgrading. Only workflow storage answers typed recovering; every other + /// authority of the store serves. + RecoveringWorkflow, + Refused(RefusedAuthorityV1), +} + +/// Shared by an owner and its leases, see [`SessionAuthorityV1`]. +#[derive(Debug)] +struct SessionAuthorityStateV1(RwLock); + +impl SessionAuthorityStateV1 { + fn new(authority: SessionAuthorityV1) -> Arc { + Arc::new(Self(RwLock::new(authority))) + } + + fn current(&self) -> SessionAuthorityV1 { + self.0 + .read() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .clone() + } + + fn publish(&self, authority: SessionAuthorityV1) { + *self + .0 + .write() + .unwrap_or_else(std::sync::PoisonError::into_inner) = authority; + } + + fn reset_required(&self) -> Option { + match self.current() { + SessionAuthorityV1::Refused(refused) => Some(refused.error()), + SessionAuthorityV1::Serving | SessionAuthorityV1::RecoveringWorkflow => None, + } + } +} + +impl From> for SessionAuthorityV1 { + fn from(refused: Option) -> Self { + refused.map_or(Self::Serving, Self::Refused) + } +} + /// The sole map owner for one registered global-database publication. /// /// It can issue independently counted client leases, but cannot be cloned or @@ -84,7 +134,7 @@ pub struct RegisteredGlobalDbOwnerV1 { project_graph: Arc>, session_relation_graph: Arc, transcript_progress_proofs: Arc, - refused_authority: Option, + session_authority: Arc, } /// Cloneable, weak issuance route for one registered global-database owner. @@ -98,7 +148,7 @@ pub struct RegisteredGlobalDbWeakLeaseIssuerV1 { project_graph: Arc>, session_relation_graph: Weak, transcript_progress_proofs: Weak, - refused_authority: Option, + session_authority: Arc, } impl RegisteredGlobalDbOwnerV1 { @@ -113,12 +163,13 @@ impl RegisteredGlobalDbOwnerV1 { /// authority's exact typed reset identity instead of opening on schema it /// cannot honor, and an admissibly-fresh existing store receives the full /// install. Nothing steps an incompatible store forward in place; the - /// only in-place changes admission performs are the additive columns for - /// shapes released binaries actually shipped and the one published + /// only in-place changes are the additive columns for shapes released + /// binaries actually shipped and, in convergence, the one published /// workflow shape proven byte-exact by the schema stages. /// /// Short-lived attaches have no background maintenance task, so the - /// authority-invariant convergence runs synchronously here: a store whose + /// published workflow upgrade and the authority-invariant convergence run + /// synchronously here: a store whose /// tamper-invalidation triggers deleted the trusted audit checkpoint (or /// whose guard triggers were altered) fails the attach instead of opening /// on unaudited authority rows. @@ -135,10 +186,30 @@ impl RegisteredGlobalDbOwnerV1 { ) .await? { - RegisteredSchemaAttachmentV1::Admitted(_) => { - super::schema_stages::converge_attached_registered_schema(®istered.database) + RegisteredSchemaAttachmentV1::Admitted(convergence) => { + let cancellation = CancellationToken::new(); + let refused = if convergence.recovers_published_workflow_shape() { + let recovered = super::schema_stages::recover_published_artifact_ceiling( + ®istered.database, + &cancellation, + ) .await?; - None + if recovered.is_none() { + super::schema_stages::reclaim_freed_artifact_pages( + ®istered.database, + &cancellation, + ) + .await?; + } + recovered + } else { + None + }; + if refused.is_none() { + super::schema_stages::converge_attached_registered_schema(®istered.database) + .await?; + } + refused } RegisteredSchemaAttachmentV1::SessionsRefused(refused) => Some(refused), }; @@ -148,7 +219,7 @@ impl RegisteredGlobalDbOwnerV1 { project_graph: Arc::new(OnceLock::new()), session_relation_graph: Arc::new(RwLock::new(None)), transcript_progress_proofs: Arc::new(SessionTranscriptProgressProofs::default()), - refused_authority, + session_authority: SessionAuthorityStateV1::new(refused_authority.into()), }) } @@ -180,9 +251,18 @@ impl RegisteredGlobalDbOwnerV1 { ®istered.database, cancellation, )); - let (convergence, refused_authority) = match attached.await? { - RegisteredSchemaAttachmentV1::Admitted(convergence) => (Some(convergence), None), - RegisteredSchemaAttachmentV1::SessionsRefused(refused) => (None, Some(refused)), + let (convergence, session_authority) = match attached.await? { + RegisteredSchemaAttachmentV1::Admitted(convergence) => ( + Some(convergence), + if convergence.recovers_published_workflow_shape() { + SessionAuthorityV1::RecoveringWorkflow + } else { + SessionAuthorityV1::Serving + }, + ), + RegisteredSchemaAttachmentV1::SessionsRefused(refused) => { + (None, SessionAuthorityV1::Refused(refused)) + } }; drop(registered); Ok(( @@ -191,7 +271,7 @@ impl RegisteredGlobalDbOwnerV1 { project_graph: Arc::new(OnceLock::new()), session_relation_graph: Arc::new(RwLock::new(None)), transcript_progress_proofs: Arc::new(SessionTranscriptProgressProofs::default()), - refused_authority, + session_authority: SessionAuthorityStateV1::new(session_authority), }, convergence, )) @@ -217,7 +297,7 @@ impl RegisteredGlobalDbOwnerV1 { Arc::clone(&self.project_graph), Arc::clone(&self.session_relation_graph), Arc::clone(&self.transcript_progress_proofs), - self.refused_authority.clone(), + Arc::clone(&self.session_authority), ), )) } @@ -226,9 +306,7 @@ impl RegisteredGlobalDbOwnerV1 { /// to read, `None` when every authority it holds is admissible. #[must_use] pub fn reset_required(&self) -> Option { - self.refused_authority - .clone() - .map(RefusedAuthorityV1::error) + self.session_authority.reset_required() } /// Issues a mode-reduced client that can never regain write authority. @@ -239,7 +317,7 @@ impl RegisteredGlobalDbOwnerV1 { Arc::clone(&self.project_graph), Arc::clone(&self.session_relation_graph), Arc::clone(&self.transcript_progress_proofs), - self.refused_authority.clone(), + Arc::clone(&self.session_authority), ), )) } @@ -253,7 +331,7 @@ impl RegisteredGlobalDbOwnerV1 { project_graph: Arc::clone(&self.project_graph), session_relation_graph: Arc::downgrade(&self.session_relation_graph), transcript_progress_proofs: Arc::downgrade(&self.transcript_progress_proofs), - refused_authority: self.refused_authority.clone(), + session_authority: Arc::clone(&self.session_authority), } } @@ -307,7 +385,7 @@ impl RegisteredGlobalDbWeakLeaseIssuerV1 { Arc::clone(&self.project_graph), session_relation_graph, transcript_progress_proofs, - self.refused_authority.clone(), + Arc::clone(&self.session_authority), ), )) } @@ -376,7 +454,7 @@ pub struct RegisteredGlobalDb { project_graph: Arc>, session_relation_graph: Arc, pub(crate) transcript_progress_proofs: Arc, - refused_authority: Option, + session_authority: Arc, } // Futures that capture this client were proving the database lease and the @@ -391,13 +469,13 @@ const _: fn(&RegisteredGlobalDb) = |value| { project_graph, session_relation_graph, transcript_progress_proofs, - refused_authority, + session_authority, } = value; assert_send_sync(database); assert_send_sync(project_graph); assert_send_sync(session_relation_graph); assert_send_sync(transcript_progress_proofs); - assert_send_sync(refused_authority); + assert_send_sync(session_authority); }; impl RegisteredGlobalDb { @@ -405,10 +483,53 @@ impl RegisteredGlobalDb { pub async fn converge_schema( &self, convergence: super::schema_stages::RegisteredSchemaConvergence, + cancellation: &CancellationToken, ) -> tracedecay_domain::errors::Result<()> { + if convergence.recovers_published_workflow_shape() { + Box::pin(self.recover_published_workflow_shape(cancellation)).await?; + } super::schema_stages::converge_registered_schema(self.runtime_database(), convergence).await } + /// Settles the store's session authority on the background upgrade's + /// outcome. A failure that can clear keeps workflow storage recovering, and + /// the next open of the store retries; a store that refuses the upgrade is + /// held in its typed reset state like one refused at attach. Workflow + /// storage serves from the commit on, so the reclaim that follows delays + /// nothing. + async fn recover_published_workflow_shape( + &self, + cancellation: &CancellationToken, + ) -> tracedecay_domain::errors::Result<()> { + let refused = match super::schema_stages::recover_published_artifact_ceiling( + self.runtime_database(), + cancellation, + ) + .await + { + Ok(refused) => refused, + Err(error) => { + if let Some((_, reason)) = error.reset_required_context() { + self.session_authority.publish(SessionAuthorityV1::Refused( + RefusedAuthorityV1::Shape { + authority: "workflow", + reason: Cow::Owned(reason.to_owned()), + }, + )); + } + return Err(error); + } + }; + if let Some(refused) = refused { + self.session_authority + .publish(SessionAuthorityV1::Refused(refused.clone())); + return Err(refused.error()); + } + self.session_authority.publish(SessionAuthorityV1::Serving); + super::schema_stages::reclaim_freed_artifact_pages(self.runtime_database(), cancellation) + .await + } + pub async fn release_connection_memory(&self) -> tracedecay_domain::errors::Result<()> { self.database.release_connection_memory().await } @@ -438,7 +559,7 @@ impl RegisteredGlobalDb { Arc::new(OnceLock::new()), Arc::new(RwLock::new(None)), Arc::new(SessionTranscriptProgressProofs::default()), - None, + SessionAuthorityStateV1::new(SessionAuthorityV1::Serving), ) } @@ -447,14 +568,14 @@ impl RegisteredGlobalDb { project_graph: Arc>, session_relation_graph: Arc, transcript_progress_proofs: Arc, - refused_authority: Option, + session_authority: Arc, ) -> Self { Self { database, project_graph, session_relation_graph, transcript_progress_proofs, - refused_authority, + session_authority, } } @@ -462,9 +583,7 @@ impl RegisteredGlobalDb { /// refuses to read, `None` when every authority it holds is admissible. #[must_use] pub fn reset_required(&self) -> Option { - self.refused_authority - .clone() - .map(RefusedAuthorityV1::error) + self.session_authority.reset_required() } /// Wraps an already-published guarded database for WAL maintenance tests. @@ -727,6 +846,9 @@ impl RegisteredGlobalDb { ) -> tracedecay_domain::errors::Result< tracedecay_rusqlite_runtime::workflow::WorkflowSqliteAuthority, > { + if self.session_authority.current() == SessionAuthorityV1::RecoveringWorkflow { + return Err(TraceDecayError::workflow_authority_recovering()); + } self.database.workflow_storage().await } diff --git a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs index 386f91b5fa..d22f109545 100644 --- a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs +++ b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs @@ -223,8 +223,9 @@ async fn extra_workflow_schema_identity_requires_reset_without_mutation() { } mod published_artifact_ceiling { - use std::future::Future as _; + use std::future::Future; use std::path::{Path, PathBuf}; + use std::pin::Pin; use std::sync::atomic::{AtomicUsize, Ordering}; use std::task::Poll; @@ -807,53 +808,167 @@ mod published_artifact_ceiling { assert_eq!(store.state(), before); } - /// Daemon admission observes shutdown at every statement. At each sampled - /// cancellation point the store is either wholly published or wholly final. + /// Daemon admission of a published store, with the store's convergence plan + /// and the runtime parts that keep the store open until they drop. + async fn admit_for_daemon( + path: &Path, + ) -> ( + RegisteredGlobalDbOwnerV1, + crate::schema_stages::RegisteredSchemaConvergence, + impl Sized, + ) { + let (database, runtime, retirement) = publish_daemon_runtime(path).await.into_parts(); + let (owner, convergence) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + database, + &CancellationToken::new(), + ) + .await + .unwrap(); + ( + owner, + convergence.expect("an admitted store has a plan"), + (runtime, retirement), + ) + } + + async fn assert_workflow_recovering(lease: &crate::RegisteredGlobalDbLeaseV1) { + let error = lease.workflow_storage().await.err().expect("recovering"); + assert!(error.is_workflow_authority_recovering(), "{error}"); + assert_eq!( + error + .project_route_context() + .map(|(_, retryable, _)| retryable), + Some(true), + "a store that is upgrading asks the client to retry" + ); + assert!(!error.is_store_reset_required(), "{error}"); + } + + /// Daemon admission only decides. It copies nothing however large the + /// store, answers typed recovering from workflow storage, and keeps every + /// other authority serving; convergence then completes the move for clients + /// issued before it committed, and the old table's pages leave the file. + #[asupersync::test(flavor = "multi_thread")] + async fn daemon_admission_defers_the_copy_to_convergence() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run( + "WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 64) + INSERT INTO workflow_artifact_payloads + SELECT 'sha256:large-' || i, 1048576, randomblob(1048576) FROM n;", + ); + let before = store.state(); + let wal_path = format!("{}-wal", store.path.display()); + let wal_bytes = || fs::metadata(&wal_path).map_or(0, |metadata| metadata.len()); + + let (owner, convergence, _held) = admit_for_daemon(&store.path).await; + assert!( + wal_bytes() < 1024 * 1024, + "daemon admission wrote {} WAL bytes, so it copied payloads", + wal_bytes() + ); + assert_eq!( + store.state(), + before, + "admission changed the published shape" + ); + assert!(owner.reset_required().is_none()); + let lease = owner.issue_lease().unwrap(); + let issuer = owner.weak_lease_issuer(); + assert_workflow_recovering(&lease).await; + assert_workflow_recovering(&issuer.issue_lease().unwrap()).await; + lease + .runtime_database() + .execute_write_batch( + "another authority keeps writing", + "INSERT INTO parse_offsets VALUES ('during-recovery', 1, 1, 1)", + ) + .await + .unwrap(); + + lease + .converge_schema(convergence, &CancellationToken::new()) + .await + .unwrap(); + + lease.workflow_storage().await.unwrap(); + owner + .issue_lease() + .unwrap() + .workflow_storage() + .await + .unwrap(); + issuer + .issue_lease() + .unwrap() + .workflow_storage() + .await + .unwrap(); + let after = store.state(); + assert_eq!(after.table_sql, final_table_sql()); + assert_eq!(after.digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + assert_eq!(after.artifacts, before.artifacts); + assert_eq!(after.other_rows, before.other_rows); + assert_eq!( + after.objects_named_after_the_table, + vec![ + "sqlite_autoindex_workflow_artifact_payloads_1", + "workflow_artifact_payloads" + ], + "no copy of the old table survives success" + ); + let (_, _, free_pages) = lease.storage_page_counts().await.unwrap(); + assert_eq!(free_pages, 0, "the dropped table's pages were kept"); + } + + /// Convergence observes shutdown at every statement. At each sampled point + /// the store is either wholly published or wholly final, a cancelled store + /// stays typed recovering, and the next open finishes the job. #[asupersync::test(flavor = "multi_thread")] - async fn daemon_admission_is_atomic_at_every_cancellation_point() { - async fn admit_cancelled_at( + async fn background_upgrade_is_atomic_at_every_cancellation_point() { + async fn converge_cancelled_at( path: &Path, cancel_at: usize, ) -> (Result<(), TraceDecayError>, usize) { - let (database, _runtime, _retirement) = publish_daemon_runtime(path).await.into_parts(); + let (owner, convergence, _held) = admit_for_daemon(path).await; + let lease = owner.issue_lease().unwrap(); let cancellation = CancellationToken::new(); - let mut admission = Box::pin(RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( - database, - &cancellation, - )); + let mut recovery = Box::pin(lease.converge_schema(convergence, &cancellation)); let mut polls = 0; let outcome = std::future::poll_fn(|context| { polls += 1; if polls == cancel_at { cancellation.cancel(); } - match admission.as_mut().poll(context) { - Poll::Ready(result) => Poll::Ready(result.map(|(owner, _)| { - assert!(owner.reset_required().is_none()); - })), - Poll::Pending => Poll::Pending, - } + recovery.as_mut().poll(context) }) .await; + drop(recovery); + if let Err(error) = &outcome + && error.is_store_open_cancelled() + && WorkflowState::read(path).digest == PUBLISHED_DIGEST + { + assert_workflow_recovering(&lease).await; + } (outcome, polls) } let reference = DaemonPublishedStore::create().await; reference.store.run(BULK_ROWS); let before = reference.store.state(); - let (outcome, total_polls) = admit_cancelled_at(&reference.store.path, usize::MAX).await; + let (outcome, total_polls) = converge_cancelled_at(&reference.store.path, usize::MAX).await; outcome.unwrap(); let completed = reference.store.state(); assert_eq!(completed.digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); assert_eq!(completed.artifacts, before.artifacts); let stride = (total_polls / 12).max(1); - let mut cancelled = 0; + let mut cancelled_published = 0; for cancel_at in (1..total_polls).step_by(stride) { let daemon_store = DaemonPublishedStore::create().await; let store = &daemon_store.store; store.run(BULK_ROWS); - let (outcome, _) = admit_cancelled_at(&store.path, cancel_at).await; + let (outcome, _) = converge_cancelled_at(&store.path, cancel_at).await; let state = store.state(); match outcome { Ok(()) => assert_eq!(state, completed, "completed at poll {cancel_at}"), @@ -863,14 +978,182 @@ mod published_artifact_ceiling { state == before || state == completed, "poll {cancel_at} left a partial upgrade" ); - cancelled += 1; - let (reopened, _) = admit_cancelled_at(&store.path, usize::MAX).await; + if state == before { + cancelled_published += 1; + } + let (reopened, _) = converge_cancelled_at(&store.path, usize::MAX).await; reopened.unwrap(); assert_eq!(store.state(), completed, "reopen after poll {cancel_at}"); } } } - assert!(cancelled > 0, "the sweep never observed a cancellation"); + assert!( + cancelled_published > 0, + "the sweep never cancelled before the commit" + ); + } + + /// Retirement aborts the worker, which drops the upgrade wherever it is + /// parked. Nothing of it may survive, and the next open starts over. + #[asupersync::test(flavor = "multi_thread")] + async fn dropping_the_background_upgrade_mid_copy_rolls_it_back() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run(BULK_ROWS); + let before = store.state(); + + let (owner, _, held) = admit_for_daemon(&store.path).await; + let lease = owner.issue_lease().unwrap(); + let transaction = lease + .runtime_database() + .begin_bulk_write_transaction("abort") + .await + .unwrap(); + let copying = StatementCounter::new(&transaction, "INSERT INTO workflow_artifact_payloads"); + let mut upgrade = Box::pin(upgrade_published_artifact_ceiling(©ing)); + drive_until(&mut upgrade, || copying.seen() >= 2).await; + drop(upgrade); + drop(copying); + drop(transaction); + + assert_eq!(store.state(), before, "a dropped upgrade left a trace"); + assert_workflow_recovering(&lease).await; + drop((lease, owner, held)); + + let (owner, convergence, _held) = admit_for_daemon(&store.path).await; + let lease = owner.issue_lease().unwrap(); + assert_workflow_recovering(&lease).await; + lease + .converge_schema(convergence, &CancellationToken::new()) + .await + .unwrap(); + assert_eq!(store.state().artifacts, before.artifacts); + assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + } + + /// WAL readers see the store as it was for as long as the copy runs. Readers + /// are what the upgrade must never hold up, so this parks it between two + /// batches with the writer lane held. + #[asupersync::test(flavor = "multi_thread")] + async fn reads_serve_while_the_upgrade_holds_the_writer() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + store.run(BULK_ROWS); + store.run("INSERT INTO parse_offsets VALUES ('readable', 7, 1, 1);"); + let before = store.state(); + + let (owner, convergence, _held) = admit_for_daemon(&store.path).await; + let lease = owner.issue_lease().unwrap(); + let reader = owner.issue_read_only_lease().unwrap(); + let transaction = lease + .runtime_database() + .begin_bulk_write_transaction("hold") + .await + .unwrap(); + let copying = StatementCounter::new(&transaction, "INSERT INTO workflow_artifact_payloads"); + let mut upgrade = Box::pin(upgrade_published_artifact_ceiling(©ing)); + drive_until(&mut upgrade, || copying.seen() >= 2).await; + + let mut rows = reader + .read_connection() + .query( + "SELECT byte_offset FROM parse_offsets WHERE file_path = 'readable'", + (), + ) + .await + .unwrap(); + let row = rows.next().await.unwrap().unwrap(); + assert_eq!(row.get::(0).unwrap(), 7); + let mut artifacts = reader + .read_connection() + .query("SELECT count(*) FROM workflow_artifact_payloads", ()) + .await + .unwrap(); + let count = artifacts.next().await.unwrap().unwrap(); + assert_eq!( + usize::try_from(count.get::(0).unwrap()).unwrap(), + before.artifacts.len(), + "a reader saw the transaction's half-copied table" + ); + assert_workflow_recovering(&reader).await; + assert_eq!(store.state(), before, "an outside reader saw the copy"); + + assert!(upgrade.as_mut().await.unwrap().is_none()); + drop(upgrade); + drop(copying); + transaction.commit().await.unwrap(); + assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + + // A peer already finished, so this recovery proves completion under the + // write lock and opens workflow storage for its own clients. + assert_workflow_recovering(&lease).await; + lease + .converge_schema(convergence, &CancellationToken::new()) + .await + .unwrap(); + lease.workflow_storage().await.unwrap(); + } + + /// A store changed between admission and convergence is proven again under + /// the write lock: it is held in its typed reset state, untouched, and + /// clients issued before the verdict see it too. + #[asupersync::test(flavor = "multi_thread")] + async fn background_refusal_holds_the_store_in_its_reset_state() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + let (owner, convergence, _held) = admit_for_daemon(&store.path).await; + let lease = owner.issue_lease().unwrap(); + store.run( + "CREATE TRIGGER peer_audit AFTER DELETE ON workflow_artifact_payloads + BEGIN SELECT 1; END;", + ); + let before = store.state(); + + let refused = lease + .converge_schema(convergence, &CancellationToken::new()) + .await + .err() + .expect("the store changed under its plan"); + assert!(refused.is_store_reset_required(), "{refused}"); + assert!(assert_workflow_refusal(lease.reset_required()).contains("1 other schema object")); + assert!(assert_workflow_refusal(owner.reset_required()).contains("1 other schema object")); + assert!(lease.workflow_storage().await.is_err()); + assert_eq!(store.state(), before); + } + + /// A failure that can clear says nothing about the store: workflow storage + /// stays recovering, nothing changed, and the next open finishes. + #[asupersync::test(flavor = "multi_thread")] + async fn held_lock_at_convergence_keeps_the_store_recovering() { + let daemon_store = DaemonPublishedStore::create().await; + let store = &daemon_store.store; + let before = store.state(); + let (owner, convergence, held) = admit_for_daemon(&store.path).await; + let lease = owner.issue_lease().unwrap(); + let peer = Connection::open(&store.path).unwrap(); + peer.execute_batch("BEGIN IMMEDIATE").unwrap(); + + let error = lease + .converge_schema(convergence, &CancellationToken::new()) + .await + .err() + .expect("the write lock is held"); + assert!(!error.is_store_reset_required(), "{error}"); + assert!(lease.reset_required().is_none()); + assert_workflow_recovering(&lease).await; + peer.execute_batch("ROLLBACK").unwrap(); + drop(peer); + assert_eq!(store.state(), before); + drop((lease, owner, held)); + + let (owner, convergence, _held) = admit_for_daemon(&store.path).await; + owner + .issue_lease() + .unwrap() + .converge_schema(convergence, &CancellationToken::new()) + .await + .unwrap(); + assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); } /// Rows spread over several copy batches, with rowid gaps and a negative @@ -882,6 +1165,73 @@ mod published_artifact_ceiling { INSERT INTO workflow_artifact_payloads (rowid, payload_digest, byte_length, payload) VALUES (-5, 'sha256:negative-rowid', 1, x'07');"; + /// Counts one kind of statement so a test can park an upgrade mid-copy. + struct StatementCounter<'a, T> { + inner: &'a T, + needle: &'static str, + seen: AtomicUsize, + } + + impl<'a, T> StatementCounter<'a, T> { + fn new(inner: &'a T, needle: &'static str) -> Self { + Self { + inner, + needle, + seen: AtomicUsize::new(0), + } + } + + fn seen(&self) -> usize { + self.seen.load(Ordering::Relaxed) + } + + fn note(&self, sql: &str) { + if sql.contains(self.needle) { + self.seen.fetch_add(1, Ordering::Relaxed); + } + } + } + + impl engine::QueryExecutor for StatementCounter<'_, T> { + async fn query

(&self, sql: &str, params: P) -> engine::Result + where + P: engine::IntoParams, + { + self.note(sql); + self.inner.query(sql, params).await + } + } + + impl engine::Executor for StatementCounter<'_, T> { + async fn execute

(&self, sql: &str, params: P) -> engine::Result + where + P: engine::IntoParams, + { + self.note(sql); + self.inner.execute(sql, params).await + } + + async fn execute_batch(&self, sql: &str) -> engine::Result<()> { + self.note(sql); + self.inner.execute_batch(sql).await + } + } + + /// Polls `future` until `reached`, then leaves it parked where it is. + async fn drive_until(future: &mut F, reached: impl Fn() -> bool) { + std::future::poll_fn(|context| { + if reached() { + return Poll::Ready(()); + } + match Pin::new(&mut *future).poll(context) { + Poll::Ready(_) => panic!("the upgrade finished before it was parked"), + Poll::Pending if reached() => Poll::Ready(()), + Poll::Pending => Poll::Pending, + } + }) + .await; + } + /// An attached runtime whose statements fail at one chosen occurrence, for /// the faults a healthy store never produces. struct FailingStatement<'a, T> { @@ -1066,10 +1416,10 @@ mod published_artifact_ceiling { assert_eq!(after.artifacts, before.artifacts); } - /// A peer holding the write lock delays the upgrade and says nothing about - /// the store: the attach fails retryably, and the next one upgrades. + /// A peer holding the write lock delays admission and says nothing about + /// the store: the attach fails retryably, and the next one admits. #[asupersync::test(flavor = "multi_thread")] - async fn held_write_lock_delays_the_upgrade_without_a_reset() { + async fn held_write_lock_delays_admission_without_a_reset() { let daemon_store = DaemonPublishedStore::create().await; let store = &daemon_store.store; let before = store.state(); @@ -1090,16 +1440,15 @@ mod published_artifact_ceiling { drop(peer); assert_eq!(store.state(), before); - let (database, _runtime, _retirement) = - publish_daemon_runtime(&store.path).await.into_parts(); - let (owner, _) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( - database, - &CancellationToken::new(), - ) - .await - .unwrap(); + let (owner, convergence, held) = admit_for_daemon(&store.path).await; assert!(owner.reset_required().is_none()); - drop(owner); + owner + .issue_lease() + .unwrap() + .converge_schema(convergence, &CancellationToken::new()) + .await + .unwrap(); + drop((owner, held)); assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); } @@ -1135,7 +1484,7 @@ mod published_artifact_ceiling { /// Asking whether a store can upgrade costs no payload IO: the census /// leaves the WAL at its prior size however much the store holds, while the - /// same store's real attach still moves every row. + /// same store's convergence still moves every row. #[asupersync::test(flavor = "multi_thread")] async fn census_writes_no_payload_bytes() { let daemon_store = DaemonPublishedStore::create().await; @@ -1161,13 +1510,22 @@ mod published_artifact_ceiling { assert_eq!(wal_bytes(), wal_before, "the census rewrote the table"); assert_eq!(store.state(), before); - let (owner, _) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( + let (owner, convergence) = RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon( database, &CancellationToken::new(), ) .await .unwrap(); assert!(owner.reset_required().is_none()); + owner + .issue_lease() + .unwrap() + .converge_schema( + convergence.expect("an admitted store has a plan"), + &CancellationToken::new(), + ) + .await + .unwrap(); drop(owner); assert_eq!(store.state().artifacts, before.artifacts); } diff --git a/crates/tracedecay-global-db/src/schema_stages.rs b/crates/tracedecay-global-db/src/schema_stages.rs index 6589e1f58f..b40654635e 100644 --- a/crates/tracedecay-global-db/src/schema_stages.rs +++ b/crates/tracedecay-global-db/src/schema_stages.rs @@ -6,11 +6,15 @@ use std::time::{Duration, Instant}; use tracedecay_domain::errors::ProjectOpenFailureKind; mod workflow_artifact_ceiling_upgrade; +#[cfg(test)] pub(crate) use workflow_artifact_ceiling_upgrade::upgrade_published_artifact_ceiling; use workflow_artifact_ceiling_upgrade::{ PublishedArtifactCeilingShape, classify_published_artifact_ceiling, rehearse_published_artifact_ceiling_upgrade, }; +pub(crate) use workflow_artifact_ceiling_upgrade::{ + reclaim_freed_artifact_pages, recover_published_artifact_ceiling, +}; use super::schema_contract::{ authority_invariant_triggers_intact, ensure_authority_audit_checkpoint_schema, @@ -396,6 +400,15 @@ pub async fn ensure_registered_schema( pub struct RegisteredSchemaConvergence { force_exhaustive: bool, is_fresh: bool, + recovers_published_workflow_shape: bool, +} + +impl RegisteredSchemaConvergence { + /// Whether this store's workflow tables still carry the one published + /// shape, which convergence upgrades before anything else. + pub(crate) fn recovers_published_workflow_shape(self) -> bool { + self.recovers_published_workflow_shape + } } /// Typed schema states an admissible store was classified into, carried from @@ -858,13 +871,15 @@ pub async fn ensure_registered_schema_for_admission( Ok(RegisteredSchemaConvergence { force_exhaustive, is_fresh, + recovers_published_workflow_shape: session_features.upgrades_published_workflow_shape(), }) } /// Installs (or idempotently re-ensures) every registered schema stage inside /// the caller's admission transaction. Callers classify admission first, so /// this stage runs only for stores classified fresh, exactly current, or -/// exactly the one published workflow shape it upgrades. +/// exactly the one published workflow shape convergence upgrades afterwards, +/// whose artifact table no stage here touches. /// /// Heap boundary: see [`RegisteredSchemaAdmissionClassify`]. #[tracing::instrument(name = "global_db.schema.persist.install", level = "trace", skip_all)] @@ -909,20 +924,29 @@ where schema_install_checkpoint(install.cancellation, commit_operation) .map(|()| refused_authority) }); + settle_schema_transaction(install, admission, commit_operation, rollback_operation).await +} + +/// Commits the transaction when `outcome` succeeded and rolls it back when it +/// failed, naming shutdown as the failure when it is what stopped the work. +async fn settle_schema_transaction( + install: CancellableSchemaTransaction<'_, T>, + outcome: tracedecay_domain::errors::Result>, + commit_operation: &'static str, + rollback_operation: &'static str, +) -> tracedecay_domain::errors::Result> +where + T: SchemaInstallTransaction, +{ let CancellableSchemaTransaction { transaction, cancellation, } = install; - match admission { + match outcome { Ok(refused_authority) => { transaction.commit().await.map_err(|error| { global_db_operation_error(commit_operation, std::io::Error::other(error)) })?; - if session_features.upgrades_published_workflow_shape() && refused_authority.is_none() { - tracing::info!( - "the published workflow artifact table now carries the final contract" - ); - } Ok(refused_authority) } Err(error) => match transaction.rollback().await { @@ -1223,10 +1247,6 @@ async fn install_registered_schema_stage_sequence( global_db_operation_error("initialize workflow index schema", error) })?; } - // Last, so a store any earlier stage refuses keeps its published shape. - if session_features.upgrades_published_workflow_shape() && refused_authority.is_none() { - return upgrade_published_artifact_ceiling(transaction).await; - } Ok(refused_authority) } @@ -1314,6 +1334,7 @@ pub async fn converge_attached_registered_schema( RegisteredSchemaConvergence { force_exhaustive, is_fresh: false, + recovers_published_workflow_shape: false, }, ) .await @@ -1331,8 +1352,8 @@ pub async fn converge_attached_registered_schema( /// schema stage. An admissibly-fresh store, an existing database file with no /// schema objects, receives the same admission-critical install as /// initialization. The returned convergence plan carries the LCM status-index -/// work for lifecycle-owned daemon maintenance; short-lived callers run that -/// same work synchronously through [`converge_attached_registered_schema`]. +/// work and any published workflow upgrade for lifecycle-owned daemon +/// maintenance; short-lived callers run that same work synchronously. /// A store whose LCM, workflow, or git correlation shape this binary refuses /// is admitted untouched for its other authorities; one whose observation /// rows it refuses is installed without them. Either returns the refused @@ -1391,7 +1412,22 @@ pub(crate) async fn ensure_attached_registered_schema( "commit attached registered global schema", "roll back attached registered global schema", )); - let refused_authority = committed.await?; + let mut refused_authority = committed.await?; + let recovers_published_workflow_shape = session_features.upgrades_published_workflow_shape(); + // The verdict that no read-only query predicts belongs to admission, so a + // schema that refuses the move is refused here instead of after a store has + // been served as recovering. The later steps cannot refuse what + // classification proved, and they run in background convergence. + if recovers_published_workflow_shape && refused_authority.is_none() { + schema_install_checkpoint(cancellation, OPERATION)?; + let rehearsal = database.begin_bulk_write_transaction(OPERATION).await?; + let rehearsed = rehearse_published_artifact_ceiling_upgrade(&rehearsal).await; + rehearsal + .rollback() + .await + .map_err(|error| global_db_operation_error(OPERATION, error))?; + refused_authority = rehearsed?; + } // Mirror initialization's independently durable index builds: each // historical-data index commits on its own so an interrupted later build // never rolls back an earlier completed one. @@ -1424,6 +1460,7 @@ pub(crate) async fn ensure_attached_registered_schema( None => RegisteredSchemaAttachmentV1::Admitted(RegisteredSchemaConvergence { force_exhaustive, is_fresh: configuration_fresh.is_some(), + recovers_published_workflow_shape, }), }) } @@ -1434,10 +1471,10 @@ pub(crate) async fn ensure_attached_registered_schema( /// store keeps exactly its prior schema. The post-commit index builds and the /// composed authority-schema validation are left to the store's own attach: /// an older admissible store would otherwise build its historical indexes -/// only to discard them. The published workflow upgrade is left to it for the -/// same reason: classification proved its rows and dependents without a write, -/// and only its catalog-only rename runs here, so a census never copies a -/// payload. +/// only to discard them. The published workflow upgrade is left to convergence +/// for the same reason: classification proved its rows and dependents without +/// a write, and only its catalog-only rename runs here, so a census never +/// copies a payload. #[tracing::instrument(name = "global_db.schema.persist.census", level = "trace", skip_all)] pub(crate) async fn attached_registered_schema_reset_refusal( database: &Database, @@ -1478,13 +1515,6 @@ pub(crate) async fn attached_registered_schema_reset_refusal( > = Box::pin(authority_invariant_triggers_intact(&read_connection)); let force_exhaustive = !triggers_intact.await?; let upgrades_workflow = session_features.upgrades_published_workflow_shape(); - let staged_features = if upgrades_workflow { - SessionFeatureSchema::Hosted { - workflow: WorkflowSchemaAdmission::Complete, - } - } else { - session_features - }; let transaction = database.begin_bulk_write_transaction(OPERATION).await?; let staged: Pin< Box< @@ -1496,7 +1526,7 @@ pub(crate) async fn attached_registered_schema_reset_refusal( &transaction, configuration_fresh.as_ref(), temporal_admission, - staged_features, + session_features, force_exhaustive, )); let admission = match staged.await { @@ -1529,8 +1559,8 @@ pub(crate) enum RegisteredSchemaAttachmentV1 { enum WorkflowSchemaAdmission { Create, Complete, - /// The one published shape admission steps forward, inside its own - /// transaction. See [`workflow_artifact_ceiling_upgrade`]. + /// The one published shape convergence steps forward, in one transaction + /// of its own. See [`workflow_artifact_ceiling_upgrade`]. UpgradePublishedArtifactCeiling, } diff --git a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs index ab0de0aeed..589faab2d3 100644 --- a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs +++ b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs @@ -13,18 +13,30 @@ //! final shape, so only the store's own text decides. //! //! The exact-SQL guard denies catalog edits on the registered writer, so the -//! change is a real table move: it costs one copy of the artifact rows, once, on -//! the attach that upgrades. Deciding whether a store can take it costs no copy. +//! change is a real table move: it costs one copy of the artifact rows, once. +//! Deciding whether a store can take it costs no copy, so admission only decides +//! and the copy is historical convergence: a daemon runs it in its bounded +//! background maintenance while the store's other authorities serve and workflow +//! storage answers typed recovering. One transaction carries the whole move, so +//! interruption at any point leaves the published store, and the next open +//! recognizes it and starts over. For as long as that transaction runs it holds +//! the store's writer lane, and its pages live in the WAL beside the old table's, +//! so the store's other writers queue behind it and the store briefly takes +//! about twice the payload's space. The dropped table's pages are reclaimed +//! afterwards. use tracedecay_domain::errors::{Result, TraceDecayError}; +use tracedecay_runtime_core::cancellation::CancellationToken; +use tracedecay_runtime_core::db::Database; use tracedecay_runtime_core::db::engine::{self, Executor, QueryExecutor}; use tracedecay_rusqlite_runtime::workflow::{ WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1, WORKFLOW_SCHEMA_VERSION_V1, WORKFLOW_TABLE_CONTRACTS_V1, }; use super::{ - WorkflowSchemaAdmission, inspect_workflow_schema_for_admission, - read_recorded_workflow_identity, workflow_schema_refusal, + CANONICAL_BODY_RECLAIM_PAGES, CancellableSchemaTransaction, WorkflowSchemaAdmission, + inspect_workflow_schema_for_admission, read_recorded_workflow_identity, + schema_install_checkpoint, settle_schema_transaction, workflow_schema_refusal, }; use crate::registered::RefusedAuthorityV1; use crate::{global_db_operation_error, global_db_operation_message}; @@ -222,14 +234,77 @@ async fn single_count( .map_err(|error| global_db_operation_error(operation, error)) } -/// Upgrades the published shape inside the caller's admission transaction, or -/// returns the refusal that stops it before anything of the upgrade has run. +/// Runs the upgrade in one transaction of its own. `cancellation` is observed +/// before every statement, so shutdown stops the copy within one batch and rolls +/// it back. `Some` is the refusal that stopped it before anything had changed. +#[tracing::instrument( + name = "global_db.schema.workflow_artifact_ceiling.recover", + level = "trace", + skip_all +)] +pub(crate) async fn recover_published_artifact_ceiling( + database: &Database, + cancellation: &CancellationToken, +) -> Result> { + const OPERATION: &str = "upgrade published workflow artifact table"; + const COMMIT: &str = "commit published workflow artifact upgrade"; + const ROLLBACK: &str = "roll back published workflow artifact upgrade"; + schema_install_checkpoint(cancellation, OPERATION)?; + let transaction = database.begin_bulk_write_transaction(OPERATION).await?; + let install = CancellableSchemaTransaction { + transaction, + cancellation, + }; + let upgraded = Box::pin(upgrade_published_artifact_ceiling(&install)) + .await + .and_then(|refused| schema_install_checkpoint(cancellation, COMMIT).map(|()| refused)); + let settled = tracing::Instrument::instrument( + settle_schema_transaction(install, upgraded, COMMIT, ROLLBACK), + tracing::trace_span!("global_db.schema.workflow_artifact_ceiling.settle"), + ) + .await?; + if settled.is_none() { + tracing::info!("the published workflow artifact table now carries the final contract"); + } + Ok(settled) +} + +/// Returns the dropped table's pages to the filesystem one bounded compaction at +/// a time, so readers and writers interleave. A store created without +/// incremental auto-vacuum reports the same free pages after a pass, which ends +/// the loop; SQLite then reuses those pages for later writes. +#[tracing::instrument( + name = "global_db.schema.workflow_artifact_ceiling.reclaim", + level = "trace", + skip_all +)] +pub(crate) async fn reclaim_freed_artifact_pages( + database: &Database, + cancellation: &CancellationToken, +) -> Result<()> { + const OPERATION: &str = "reclaim published workflow artifact pages"; + let mut remaining = u64::MAX; + loop { + schema_install_checkpoint(cancellation, OPERATION)?; + let (_, _, free_pages) = database.storage_page_counts().await?; + if free_pages == 0 || free_pages >= remaining { + return Ok(()); + } + remaining = free_pages; + database + .run_incremental_vacuum(CANONICAL_BODY_RECLAIM_PAGES) + .await?; + } +} + +/// Upgrades the published shape inside the caller's transaction, or returns the +/// refusal that stops it before anything of the upgrade has run. /// -/// Classification ran on a read connection, so the shape is proven again under -/// the write lock before anything changes: a peer that upgraded in the meantime -/// makes this a no-op, and one that changed the store into anything else -/// refuses. Every step shares the caller's transaction, so any failure leaves -/// the store exactly as found. Only payload bytes the transaction itself wrote +/// Classification ran on a read connection, possibly long before, so the shape +/// is proven again under the write lock before anything changes: a peer that +/// upgraded in the meantime makes this a no-op, and one that changed the store +/// into anything else refuses. Every step shares the caller's transaction, so +/// any failure leaves the store exactly as found. Only payload bytes the transaction itself wrote /// are read back, which SQLite already guarantees, so the copy is checked by row /// count rather than by reading every payload twice more. #[tracing::instrument( @@ -267,10 +342,13 @@ pub(crate) async fn upgrade_published_artifact_ceiling( ) .await?; copy_artifact_rows(transaction).await?; - run_step( - transaction, - &format!("DROP TABLE {DISPLACED_ARTIFACT_TABLE}"), - "drop the published artifact table", + tracing::Instrument::instrument( + run_step( + transaction, + &format!("DROP TABLE {DISPLACED_ARTIFACT_TABLE}"), + "drop the published artifact table", + ), + tracing::trace_span!("global_db.schema.workflow_artifact_ceiling.drop"), ) .await?; record_final_identity(transaction).await?; @@ -330,6 +408,11 @@ async fn run_step( .map_err(|error| upgrade_step_error(step, error)) } +#[tracing::instrument( + name = "global_db.schema.workflow_artifact_ceiling.copy", + level = "trace", + skip_all +)] async fn copy_artifact_rows(transaction: &(impl Executor + Sync)) -> Result<()> { const STEP: &str = "copy artifact rows"; let published = single_count(transaction, PUBLISHED_ROW_COUNT_SQL, STEP).await?; diff --git a/crates/tracedecay-mcp/src/tool_errors.rs b/crates/tracedecay-mcp/src/tool_errors.rs index 0d2fbe443b..ef9ba9b010 100644 --- a/crates/tracedecay-mcp/src/tool_errors.rs +++ b/crates/tracedecay-mcp/src/tool_errors.rs @@ -112,7 +112,8 @@ pub fn project_route_problem_kind(reason_code: &str) -> Option<&'static str> { "tool_dispatch_effect_unknown" => Some("effect_unknown"), "tool_dispatch_shutdown" | "mcp_dispatch_effect_journey_unverified" - | "application_surface_unavailable" => Some("unavailable"), + | "application_surface_unavailable" + | "workflow_authority_recovering" => Some("unavailable"), "application_surface_invalid_request" | TOOL_ARGUMENTS_INVALID | "project_required" diff --git a/crates/tracedecay-store-runtime/src/session_registry.rs b/crates/tracedecay-store-runtime/src/session_registry.rs index 0b2e3374fe..297a08a755 100644 --- a/crates/tracedecay-store-runtime/src/session_registry.rs +++ b/crates/tracedecay-store-runtime/src/session_registry.rs @@ -2717,7 +2717,7 @@ pub struct DaemonSessionRuntimeRegistryV1 { /// Registered stores whose last attach was refused with a typed reset. /// The refused store stays unmounted, so every open re-runs admission and /// a reset store serves on its next open without a daemon restart. - reset_required_stores: StdMutex>, + reset_required_stores: Arc, /// Store files deleted or replaced while this daemon held them open, /// keyed by path. The writer's file probe closes the store's connections, /// but the mounted owners keep their lease on the closed runtime until a diff --git a/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs b/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs index fb1acfb34b..742458cd42 100644 --- a/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs +++ b/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs @@ -16,6 +16,7 @@ use tracedecay_domain::errors::{ StoreResetRequiredV1, TraceDecayError, }; use tracedecay_global_db::schema_stages::RegisteredSchemaConvergence; +use tracedecay_runtime_core::cancellation::CancellationToken; use tracedecay_runtime_core::native_runtime::{self, NativeTask}; use tracedecay_runtime_core::storage::profile_root_of_sharded_data_root; use tracedecay_store::{StoreRuntimeBindingV1, StoreShardIdV1, StoreShardScopeV1}; @@ -40,6 +41,7 @@ type RegisteredSchemaConvergenceStatuses = BTreeMap; type RegisteredSchemaConvergenceMetadata = BTreeMap; +pub(super) type ResetRequiredStores = StdMutex>; fn lock_registered_schema_convergence_statuses( statuses: &StdMutex, @@ -83,6 +85,7 @@ enum SchemaConvergenceTarget { Registered { database: RegisteredGlobalDbLeaseV1, convergence: RegisteredSchemaConvergence, + cancellation: CancellationToken, }, } @@ -104,7 +107,8 @@ impl SchemaConvergenceTarget { Self::Registered { database, convergence, - } => database.converge_schema(*convergence).await, + cancellation, + } => database.converge_schema(*convergence, cancellation).await, } } @@ -113,6 +117,12 @@ impl SchemaConvergenceTarget { Self::Registered { database, .. } => database.release_connection_memory().await, } } + + fn reset_required(&self) -> Option { + match self { + Self::Registered { database, .. } => database.reset_required(), + } + } } #[derive(Default)] @@ -265,17 +275,27 @@ impl RegisteredSchemaConvergenceMaintenance { &self, database: RegisteredGlobalDbLeaseV1, convergence: Option, + cancellation: CancellationToken, + reset_required_stores: Arc, ) { let Some(convergence) = convergence else { return; }; - self.schedule_target(SchemaConvergenceTarget::Registered { - database, - convergence, - }); + self.schedule_target( + SchemaConvergenceTarget::Registered { + database, + convergence, + cancellation, + }, + reset_required_stores, + ); } - fn schedule_target(&self, target: SchemaConvergenceTarget) { + fn schedule_target( + &self, + target: SchemaConvergenceTarget, + reset_required_stores: Arc, + ) { let shard_id = target.binding().shard_id.clone(); let stage = SchemaConvergenceStageV1::RegisteredSchema; let mut tasks = self @@ -374,6 +394,16 @@ impl RegisteredSchemaConvergenceMaintenance { RegisteredSchemaConvergenceStatus::Complete } Err(error) => { + // Convergence can find a store it cannot take after the + // store was admitted, and that store is then held like one + // refused at attach. + if let Some(refused) = target.reset_required() { + record_registered_reset_required( + &reset_required_stores, + task_shard_id.clone(), + Some(&refused), + ); + } let message = error.to_string(); crate::session_registry::log_store_runtime_event( "registered_schema_convergence", @@ -555,6 +585,54 @@ impl RegisteredSchemaConvergenceTestGate { } } +fn record_registered_reset_required( + stores: &ResetRequiredStores, + shard_id: StoreShardIdV1, + refusal: Option<&TraceDecayError>, +) { + let reset_required = refusal.and_then(|error| { + let resettable = match &shard_id.scope { + StoreShardScopeV1::Profile => Some(ResettableStoreV1::ProfileAuthority), + StoreShardScopeV1::ProfileSessions => Some(ResettableStoreV1::ProfileSessions), + StoreShardScopeV1::ProjectSessions { project_id } => { + Some(ResettableStoreV1::ProjectSessions { + project_id: project_id.to_string(), + }) + } + _ => None, + }; + match resettable { + Some(store) => error.store_reset_required(store.label(), STALE_STORE_RESET_COMMAND), + None => { + error.store_reset_required(format!("{:?}", shard_id.scope), PROFILE_RESET_COMMAND) + } + } + }); + let mut stores = stores + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner); + match reset_required { + Some(state) => { + if stores.get(&shard_id) != Some(&state) { + tracing::warn!( + event = "store_reset_required", + store = %state.store, + authority = %state.authority, + remedy = %state.remedy, + "registered store is served in its typed reset-required state" + ); + } + stores.insert(shard_id, state); + } + // Any other failure says nothing about the persisted shape, so + // only a successful attach clears a recorded reset. + None if refusal.is_none() => { + stores.remove(&shard_id); + } + None => {} + } +} + impl DaemonSessionRuntimeRegistryV1 { #[tracing::instrument( name = "daemon.session_registry.attach_registered", @@ -589,47 +667,7 @@ impl DaemonSessionRuntimeRegistryV1 { shard_id: StoreShardIdV1, refusal: Option<&TraceDecayError>, ) { - let reset_required = refusal.and_then(|error| { - let resettable = match &shard_id.scope { - StoreShardScopeV1::Profile => Some(ResettableStoreV1::ProfileAuthority), - StoreShardScopeV1::ProfileSessions => Some(ResettableStoreV1::ProfileSessions), - StoreShardScopeV1::ProjectSessions { project_id } => { - Some(ResettableStoreV1::ProjectSessions { - project_id: project_id.to_string(), - }) - } - _ => None, - }; - match resettable { - Some(store) => error.store_reset_required(store.label(), STALE_STORE_RESET_COMMAND), - None => error - .store_reset_required(format!("{:?}", shard_id.scope), PROFILE_RESET_COMMAND), - } - }); - let mut stores = self - .reset_required_stores - .lock() - .unwrap_or_else(std::sync::PoisonError::into_inner); - match reset_required { - Some(state) => { - if stores.get(&shard_id) != Some(&state) { - tracing::warn!( - event = "store_reset_required", - store = %state.store, - authority = %state.authority, - remedy = %state.remedy, - "registered store is served in its typed reset-required state" - ); - } - stores.insert(shard_id, state); - } - // Any other failure says nothing about the persisted shape, so - // only a successful attach clears a recorded reset. - None if refusal.is_none() => { - stores.remove(&shard_id); - } - None => {} - } + record_registered_reset_required(&self.reset_required_stores, shard_id, refusal); } /// Hold a store file that was deleted or replaced on disk while mounted in @@ -758,8 +796,12 @@ impl DaemonSessionRuntimeRegistryV1 { format!("{error:?}"), ) })?; - self.registered_schema_convergence - .schedule(lease, convergence); + self.registered_schema_convergence.schedule( + lease, + convergence, + self.registry.open_cancellation().clone(), + Arc::clone(&self.reset_required_stores), + ); } Ok(database) }) diff --git a/crates/tracedecay-store-runtime/src/session_registry/mounts.rs b/crates/tracedecay-store-runtime/src/session_registry/mounts.rs index 85ffd8fd8c..7b465a4686 100644 --- a/crates/tracedecay-store-runtime/src/session_registry/mounts.rs +++ b/crates/tracedecay-store-runtime/src/session_registry/mounts.rs @@ -266,7 +266,7 @@ impl DaemonSessionRuntimeRegistryV1 { code_graph_publication_gates: std::sync::Mutex::new(std::collections::BTreeMap::new()), code_graph_verified_segments: std::sync::Mutex::new(BTreeMap::new()), registered_schema_convergence: RegisteredSchemaConvergenceMaintenance::new(), - reset_required_stores: std::sync::Mutex::new(BTreeMap::new()), + reset_required_stores: Arc::new(std::sync::Mutex::new(BTreeMap::new())), lost_store_files: std::sync::Mutex::new(BTreeMap::new()), retained_hook_tasks: RetainedHookTasks::new(), session_sync_service: Arc::new(std::sync::OnceLock::new()), diff --git a/crates/tracedecay/src/daemon/store_runtime_tests.rs b/crates/tracedecay/src/daemon/store_runtime_tests.rs index 227ae057c7..31d276f5cf 100644 --- a/crates/tracedecay/src/daemon/store_runtime_tests.rs +++ b/crates/tracedecay/src/daemon/store_runtime_tests.rs @@ -819,6 +819,200 @@ async fn terminal_shutdown_cancels_and_joins_blocked_schema_convergence() { ); } +/// The artifact table as every release through `v1.0.0-beta.92` defined it. +const PUBLISHED_WORKFLOW_ARTIFACT_TABLE_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( + payload_digest TEXT NOT NULL PRIMARY KEY, + byte_length INTEGER NOT NULL CHECK ( + byte_length = length(payload) AND byte_length <= 4194304 + ), + payload BLOB NOT NULL +) STRICT"; +const PUBLISHED_WORKFLOW_DIGEST: &str = + "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; + +fn age_session_store_to_published_workflow_shape(sessions_path: &std::path::Path) { + rusqlite::Connection::open(sessions_path) + .expect("open the stopped session store") + .execute_batch(&format!( + "DROP TABLE workflow_artifact_payloads; + {PUBLISHED_WORKFLOW_ARTIFACT_TABLE_SQL}; + UPDATE workflow_schema SET definition_digest = '{PUBLISHED_WORKFLOW_DIGEST}'; + INSERT INTO workflow_artifact_payloads VALUES ('sha256:kept', 3, x'010203');" + )) + .expect("give the store the published workflow shape"); +} + +/// What an outside reader finds: the identity digest and the artifact rows. +fn published_workflow_state(sessions_path: &std::path::Path) -> (String, Vec<(String, Vec)>) { + let connection = rusqlite::Connection::open(sessions_path).expect("open the session store"); + let digest = connection + .query_row("SELECT definition_digest FROM workflow_schema", [], |row| { + row.get(0) + }) + .expect("read the workflow identity"); + let rows = connection + .prepare("SELECT payload_digest, payload FROM workflow_artifact_payloads") + .expect("prepare the artifact read") + .query_map([], |row| Ok((row.get(0)?, row.get(1)?))) + .expect("read the artifact rows") + .collect::>>() + .expect("decode the artifact rows"); + (digest, rows) +} + +/// The published upgrade is historical convergence: the shard mounts, its other +/// authorities serve, repeated mounts schedule it once, and only workflow +/// storage answers typed recovering until the background worker has committed. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn published_workflow_shape_recovers_behind_a_serving_session_store() { + let (_temporary, identity, project_id, project_root, sessions_path, _database_scope) = + project_sessions_convergence_fixture("project.published-workflow-recovery", false).await; + age_session_store_to_published_workflow_shape(&sessions_path); + let published = published_workflow_state(&sessions_path); + let shard_id = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id.clone(), + ); + let registry = DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity, true) + .await + .expect("session runtime registry"); + let convergence_gate = registry.block_registered_schema_convergence_for_test(); + + let database = tokio::time::timeout( + MUST_NOT_BLOCK, + registry.project_sessions(project_id.clone(), [project_root.clone()]), + ) + .await + .expect("mounting must not wait for the artifact copy") + .expect("a published store admits"); + convergence_gate.wait_until_blocked().await; + + assert_eq!(published_workflow_state(&sessions_path), published); + let (again, store) = tokio::join!( + registry.project_sessions(project_id.clone(), [project_root.clone()]), + registry.project_session_store(project_id.clone(), [project_root]), + ); + let again = again.expect("a recovering store keeps serving session clients"); + store.expect("a recovering store keeps serving its other authorities"); + assert!( + registry + .mounted_project_sessions(&project_id) + .await + .is_some(), + "only workflow storage waits for the upgrade" + ); + assert_eq!( + registry.registered_schema_convergence_schedule_count_for_test(), + 1, + "concurrent admission must schedule the upgrade once" + ); + assert!(registry.reset_required_stores().is_empty()); + let finding = registry + .registered_schema_convergence_observations() + .into_iter() + .next() + .expect("the running upgrade is observable"); + assert_eq!( + finding.state, + tracedecay_contracts::storage::SchemaConvergenceStateV1::Running + ); + for client in [&database, &again] { + let refused = client + .workflow_storage() + .await + .err() + .expect("workflow storage waits for the upgrade"); + assert!(refused.is_workflow_authority_recovering(), "{refused}"); + } + let mut served = database + .read_connection() + .query("SELECT count(*) FROM parse_offsets", ()) + .await + .expect("the store's other authorities read while recovering"); + served + .next() + .await + .expect("read the count") + .expect("a count row"); + + convergence_gate.release(); + assert_eq!( + wait_for_schema_convergence(®istry, &shard_id).await, + RegisteredSchemaConvergenceStatus::Complete + ); + database + .workflow_storage() + .await + .expect("a client issued before the commit serves after it"); + let (digest, rows) = published_workflow_state(&sessions_path); + assert_ne!(digest, PUBLISHED_WORKFLOW_DIGEST); + assert_eq!(rows, published.1); +} + +/// Shutdown stops the upgrade before it commits, and a daemon restart over the +/// same store recognizes it and finishes the move. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn shutdown_during_published_workflow_recovery_resumes_on_restart() { + let (_temporary, identity, project_id, project_root, sessions_path, _database_scope) = + project_sessions_convergence_fixture("project.published-workflow-restart", false).await; + age_session_store_to_published_workflow_shape(&sessions_path); + let published = published_workflow_state(&sessions_path); + let shard_id = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id.clone(), + ); + { + let registry = + DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity.clone(), true) + .await + .expect("session runtime registry"); + let convergence_gate = registry.block_registered_schema_convergence_for_test(); + let database = registry + .project_sessions(project_id.clone(), [project_root.clone()]) + .await + .expect("a published store admits"); + convergence_gate.wait_until_blocked().await; + + registry.cancel_terminal_tasks(); + tokio::time::timeout( + MUST_NOT_BLOCK, + registry + .shutdown_terminal_tasks(&tracedecay_runtime_core::native_runtime::cx().unwrap()), + ) + .await + .expect("shutdown must not wait for the upgrade") + .expect("session runtime terminal tasks shut down cleanly"); + assert!( + database + .workflow_storage() + .await + .err() + .expect("nothing committed") + .is_workflow_authority_recovering() + ); + } + assert_eq!(published_workflow_state(&sessions_path), published); + + let registry = DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity, true) + .await + .expect("restarted session runtime registry"); + let database = registry + .project_sessions(project_id, [project_root]) + .await + .expect("the restarted daemon admits the store"); + assert_eq!( + wait_for_schema_convergence(®istry, &shard_id).await, + RegisteredSchemaConvergenceStatus::Complete + ); + database + .workflow_storage() + .await + .expect("the restart finished the upgrade"); + assert_eq!(published_workflow_state(&sessions_path).1, published.1); +} + /// Runs background schema convergence on a fresh project-sessions shard and /// returns its durable authority checkpoint's bounded-pass count. async fn converged_authority_checkpoint_passes(project_name: &str, pending: bool) -> i64 { diff --git a/crates/tracedecay/tests/transport_acceptance_suite/typed_terminal_restart_acceptance/stale_sessions_store_reset.rs b/crates/tracedecay/tests/transport_acceptance_suite/typed_terminal_restart_acceptance/stale_sessions_store_reset.rs index 826230f777..7d7bf391f5 100644 --- a/crates/tracedecay/tests/transport_acceptance_suite/typed_terminal_restart_acceptance/stale_sessions_store_reset.rs +++ b/crates/tracedecay/tests/transport_acceptance_suite/typed_terminal_restart_acceptance/stale_sessions_store_reset.rs @@ -733,9 +733,12 @@ fn project_session_store_with_another_workflow_schema_identity_refuses_sessions_ authority: "workflow", found_version: Value::Null, required_version: Value::Null, - reason: "workflow persisted shape requires reset: workflow schema identity does not \ - match the final contract" - .to_owned(), + reason: format!( + "workflow persisted shape requires reset: workflow schema identity does not match the \ + final contract: digest is \ + sha256:0000000000000000000000000000000000000000000000000000000000000000, not {}", + tracedecay_rusqlite_runtime::workflow::WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1 + ), session_tool: "tracedecay_workflow_list_definitions", session_tool_args: || json!({}), }); @@ -778,6 +781,140 @@ pub(super) fn run_doctor_json(home: &Path, project: &Path) -> (Option, Valu /// A restarted daemon has no project open until something asks for one. A /// lone `doctor` must open the registered project itself and report the /// canonical findings, not a mount that never starts. +/// A store a published release left behind is not a reset: over one in the +/// project and profile session stores, a real daemon serves code reads and +/// session reads, reports no refused store, and upgrades both in the background +/// with every artifact row intact and no copy of the old table left behind. +#[test] +fn published_workflow_shape_upgrades_in_the_background_while_the_daemon_serves() { + const PUBLISHED_TABLE_SQL: &str = "CREATE TABLE workflow_artifact_payloads ( + payload_digest TEXT NOT NULL PRIMARY KEY, + byte_length INTEGER NOT NULL CHECK ( + byte_length = length(payload) AND byte_length <= 4194304 + ), + payload BLOB NOT NULL +) STRICT"; + const PUBLISHED_DIGEST: &str = + "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; + /// Payload rows that take the copy past one batch at real payload sizes. + const ARTIFACT_ROWS: i64 = 80; + + fn artifact_rows(connection: &rusqlite::Connection) -> Vec<(String, i64, i64)> { + connection + .prepare( + "SELECT payload_digest, byte_length, rowid + FROM workflow_artifact_payloads ORDER BY rowid", + ) + .expect("prepare the artifact read") + .query_map([], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?))) + .expect("read the artifact rows") + .collect::>() + .expect("decode the artifact rows") + } + + let home = tempfile::TempDir::new().expect("isolated home"); + let home_path = canonical_existing_path(home.path()); + let project = tempfile::TempDir::new().expect("project"); + let project_path = canonical_existing_path(project.path()); + let profile_root = home_path.join(".tracedecay"); + let project_id = tracedecay_runtime_core::storage::default_profile_project_id(&project_path); + let stores = [ + profile_root + .join("projects") + .join(&project_id) + .join("sessions.db"), + profile_root.join("user-sessions.db"), + ]; + + let mut daemon = spawn_tracedecay_daemon_with(&home_path, |_| {}); + super::initialize_project(&home_path, &project_path, "published-workflow-shape"); + wait_for_code_index_hit(&home_path, &project_path, "probe"); + for scope in ["project", "user"] { + session_status(&home_path, &project_path, scope); + } + daemon + .kill_and_wait() + .expect("stop the daemon that wrote the profile"); + + let mut published = Vec::new(); + for store in &stores { + let connection = rusqlite::Connection::open(store).expect("open the session store"); + connection + .execute_batch(&format!( + "DROP TABLE workflow_artifact_payloads; + {PUBLISHED_TABLE_SQL}; + UPDATE workflow_schema SET definition_digest = '{PUBLISHED_DIGEST}'; + WITH RECURSIVE n(i) AS ( + SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < {ARTIFACT_ROWS} + ) + INSERT INTO workflow_artifact_payloads + SELECT 'sha256:artifact-' || i, 1048576, randomblob(1048576) FROM n;" + )) + .expect("give the store the published workflow shape"); + published.push(artifact_rows(&connection)); + } + + let mut daemon = spawn_tracedecay_daemon_with(&home_path, |_| {}); + wait_for_code_index_hit(&home_path, &project_path, "probe"); + let probe_id = probe_symbol_id(&home_path, &project_path); + assert_eq!( + code_read_outcome( + &home_path, + &project_path, + "tracedecay_callers", + &json!({ "node_id": probe_id, "format": "json" }), + ), + json!("evidence"), + "callers serve whatever state the upgrade is in" + ); + for scope in ["project", "user"] { + let served = session_status(&home_path, &project_path, scope); + assert!( + find_key(&served, "problem").is_none_or(|problem| problem.is_null()), + "{scope} session reads serve whatever state the upgrade is in: {served}" + ); + } + assert_eq!( + reset_required_stores(&home_path, &project_path), + Vec::::new(), + "a published workflow shape is not a reset" + ); + + let started = Instant::now(); + for (store, rows) in stores.iter().zip(&published) { + loop { + let connection = rusqlite::Connection::open(store).expect("open the session store"); + let digest: String = connection + .query_row("SELECT definition_digest FROM workflow_schema", [], |row| { + row.get(0) + }) + .expect("read the workflow identity"); + if digest != PUBLISHED_DIGEST { + assert_eq!(&artifact_rows(&connection), rows, "{}", store.display()); + let displaced: i64 = connection + .query_row( + "SELECT count(*) FROM sqlite_master + WHERE name = 'workflow_artifact_payloads_published'", + [], + |row| row.get(0), + ) + .expect("inspect the catalog"); + assert_eq!(displaced, 0, "the old table outlived the upgrade"); + break; + } + assert!( + started.elapsed() < RESET_CENSUS_TIMEOUT, + "the background upgrade of {} never committed", + store.display() + ); + std::thread::sleep(Duration::from_millis(100)); + } + } + daemon + .kill_and_wait() + .expect("stop the daemon that upgraded the stores"); +} + #[test] fn doctor_alone_on_a_fresh_daemon_opens_the_project_and_reports_findings() { let home = tempfile::TempDir::new().expect("isolated home"); From da9fdf8082f063ea0fb42a74a8cba0bb43f366b1 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:05:28 -0800 Subject: [PATCH 37/63] fix(automation): report a reset-blocked scheduler instead of configured A parked scheduler whose run ledger refuses a retired row still read `configured` in the dashboard and `Ready` in `daemon status`, so the operator saw a healthy scheduler and a healthy daemon while every tick was blocked on a store that needs a reset. The scheduler status now serves a closed `blocked_reset_required` availability with the exact reset census: store, authority, reason and the command that resets it. Task rows are withheld while the ledger refuses, because a refused ledger has no authoritative schedule or last-run reading, and the reading recovers as soon as the store does. `daemon status` prints the same census under the protocol line, reports `blocked: reset required`, and `is_ready` no longer claims readiness for a process holding stores reset-required; `is_serving` keeps the narrower "this build answered initialize" reading. A user job bound to the Codex backend with no executable is now skipped as `backend_unconfigured` before external-effect admission instead of recording a failed attempt and a cooldown, so a job runs on the first tick after an executable is configured. A failure stamped with a replaced backend identity no longer imposes cooldown on the current one. Scheduler activation now waits for the project's mandatory runtime publication and re-reads the registered owner, instead of spawning a loop against the core route before the full server exists, and the quiet debounce observes retirement so a parked loop still exits promptly. --- .../src/automation/jobs.rs | 36 ++- .../automation/jobs/scheduler_config_tests.rs | 108 ++++++++- .../src/automation/jobs/scheduler_gate.rs | 38 +++- .../tracedecay-daemon-control/src/service.rs | 40 +++- .../src/service/probe.rs | 95 +++++++- .../src/service/tests.rs | 56 +++++ .../src/authority_tests.rs | 1 + .../src/automation_scheduler_api.rs | 206 +++++++++++++----- .../src/events_api.rs | 1 + crates/tracedecay-dashboard-api/src/state.rs | 17 ++ .../src/test_transport.rs | 1 + crates/tracedecay/src/daemon/engine.rs | 41 ++-- crates/tracedecay/src/daemon/scheduler.rs | 26 ++- .../src/daemon/tests/scheduler_config.rs | 7 +- .../scheduler_config/reset_blocked_tick.rs | 76 +++++++ crates/tracedecay/src/doctor.rs | 6 + .../src/mcp/tools/handlers/dashboard.rs | 11 + .../schemas/dashboard-contracts.schema.json | 57 ++++- dashboard/src/contracts/decoders.ts | 27 ++- dashboard/src/contracts/types.ts | 13 +- dashboard/src/data/query/automation.test.ts | 1 + .../query/schedulerDispatchScope.dom.test.ts | 1 + .../automations/AutomationsPage.dom.test.tsx | 1 + .../src/workspaces/automations/ledger.test.ts | 53 +++++ .../src/workspaces/automations/ledger.ts | 21 ++ dashboard/stories/fixtures/data.ts | 1 + 26 files changed, 848 insertions(+), 93 deletions(-) diff --git a/crates/tracedecay-automation-runtime/src/automation/jobs.rs b/crates/tracedecay-automation-runtime/src/automation/jobs.rs index f94d954998..2b4e2900e3 100644 --- a/crates/tracedecay-automation-runtime/src/automation/jobs.rs +++ b/crates/tracedecay-automation-runtime/src/automation/jobs.rs @@ -459,16 +459,30 @@ pub fn job_schedule_decision( records: &[AutomationRunLedgerRecord], now_secs: i64, ) -> Option { - match checked_job_schedule_decision(job, records, now_secs) { + match checked_job_schedule_decision(job, records, now_secs, None) { Ok(decision) => decision, Err(_) => Some(AutomationSkipReasonV1::SchedulerHistoryInvalid), } } +/// A failure under a replaced backend is not evidence about the currently +/// configured backend. Successful cadence and unstamped failures still stand. +pub fn configured_job_schedule_decision( + config: &AutomationSettingsV1, + executable: Option<&Path>, + job: &AdmittedAutomationJob, + records: &[AutomationRunLedgerRecord], + now_secs: i64, +) -> Result> { + let identity = super::backend_identity::backend_identity(config, executable)?; + checked_job_schedule_decision(job, records, now_secs, Some(&identity)) +} + fn checked_job_schedule_decision( job: &AdmittedAutomationJob, records: &[AutomationRunLedgerRecord], now_secs: i64, + backend_identity: Option<&str>, ) -> Result> { if !job.enabled { return Ok(Some(AutomationSkipReasonV1::UserJobDisabled)); @@ -481,7 +495,12 @@ fn checked_job_schedule_decision( } let task_key = job_task_key(&job.id); - let last = latest_terminal_job_record(records, &task_key, Some(AutomationTrigger::Scheduler))?; + let last = latest_terminal_job_record( + records, + &task_key, + Some(AutomationTrigger::Scheduler), + backend_identity, + )?; if let Some((record, completed_at)) = last { if record.status == AutomationRunStatus::Failed { let disposition = super::backend::agent_task_failure_disposition( @@ -522,10 +541,15 @@ fn latest_terminal_job_record<'a>( records: &'a [AutomationRunLedgerRecord], task_key: &str, trigger: Option, + backend_identity: Option<&str>, ) -> Result> { latest_record_by_canonical_completion(records.iter().filter(|record| { record.task_key == task_key && trigger.is_none_or(|trigger| record.trigger == trigger) + && !(record.status == AutomationRunStatus::Failed + && backend_identity + .zip(record.backend_identity.as_deref()) + .is_some_and(|(current, recorded)| current != recorded)) && matches!( record.status, AutomationRunStatus::Succeeded | AutomationRunStatus::Failed @@ -630,7 +654,13 @@ async fn run_retained_user_job( }; if let Some(scheduler_summary) = scheduler_summary.as_ref() { let now_secs = current_timestamp(); - let decision = job_schedule_decision(job, scheduler_summary.records(), now_secs); + let decision = configured_job_schedule_decision( + config, + backend.executable(), + job, + scheduler_summary.records(), + now_secs, + )?; if let Some(reason) = decision { return ctx.skipped(reason).await.map_err(Into::into); } diff --git a/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs b/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs index ff8f85f678..3f7a6b28a9 100644 --- a/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs +++ b/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs @@ -297,6 +297,101 @@ fn job_scheduler_fails_closed_on_invalid_completion_history() { ); } +#[tokio::test] +async fn unconfigured_backend_jobs_are_blocked_without_failure_cooldown_and_recover() { + let temp = tempfile::TempDir::new().unwrap(); + let mut job = interval_job(); + let config = AutomationSettingsV1 { + enabled: true, + backend: crate::automation::config::AutomationBackendV1::CodexAppServer, + allow_job_commands: true, + ..AutomationSettingsV1::default() + }; + // A command is pre-run context, not a command-only job. + job.pre_run_command = Some("printf context".to_owned()); + let read = |executable, run_id| { + super::scheduler_gate::evaluate_and_record_scheduler_skip_at( + temp.path(), + &config, + executable, + &job, + run_id, + 150, + None, + ) + }; + let blocked = read(None, "unconfigured-occurrence") + .await + .unwrap() + .unwrap(); + assert_eq!(blocked.ledger_record.status, AutomationRunStatus::Skipped); + assert_eq!( + blocked.ledger_record.error.as_deref(), + Some("backend_unconfigured") + ); + let repeated = read(None, "unconfigured-occurrence") + .await + .unwrap() + .unwrap(); + assert_eq!(repeated.ledger_record, blocked.ledger_record); + let records = load_run_records_for_task_key(temp.path(), &super::job_task_key(&job.id), 100) + .await + .unwrap(); + assert!( + records + .iter() + .all(|record| record.status == AutomationRunStatus::Skipped) + ); + let executable = tempfile::NamedTempFile::new().unwrap(); + assert!( + read(Some(executable.path()), "configured-occurrence") + .await + .unwrap() + .is_none() + ); + let mut historical = ledger_record( + "unconfigured-failure", + AutomationRunStatus::Failed, + Some(crate::automation::backend::CODEX_EXECUTABLE_UNCONFIGURED), + 149, + ); + historical.backend_identity = + Some(crate::automation::backend_identity::backend_identity(&config, None).unwrap()); + historical.error_classification = Some(AgentTaskFailureClass::Unavailable); + historical.error_retryable = Some(true); + append_run_record(temp.path(), &historical).await.unwrap(); + assert!( + read(Some(executable.path()), "recovered-occurrence") + .await + .unwrap() + .is_none(), + "a prior unconfigured attempt must not impose cooldown after recovery" + ); + historical.backend_identity = Some( + crate::automation::backend_identity::backend_identity(&config, Some(executable.path())) + .unwrap(), + ); + assert_eq!( + super::configured_job_schedule_decision( + &config, + Some(executable.path()), + &super::admit_job(&job).unwrap(), + &[historical], + 150, + ) + .unwrap(), + Some(AutomationSkipReasonV1::SchedulerCooldownActive), + "a failure under the current backend must keep its cooldown" + ); + let isolated = tempfile::TempDir::new().unwrap(); + assert!( + load_run_records_for_task_key(isolated.path(), &super::job_task_key(&job.id), 100) + .await + .unwrap() + .is_empty() + ); +} + #[tokio::test] async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { let temp = tempfile::TempDir::new().unwrap(); @@ -308,10 +403,11 @@ async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { .await .unwrap(); let config = AutomationSettingsV1::default(); + let executable = tempfile::NamedTempFile::new().unwrap(); let first = super::scheduler_gate::evaluate_and_record_scheduler_skip_at( temp.path(), &config, - None, + Some(executable.path()), &job, "next-occurrence", 101, @@ -328,7 +424,7 @@ async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { let repeated = super::scheduler_gate::evaluate_and_record_scheduler_skip_at( temp.path(), &config, - None, + Some(executable.path()), &job, "next-occurrence", 102, @@ -357,7 +453,7 @@ async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { let due = super::scheduler_gate::evaluate_and_record_scheduler_skip_at( temp.path(), &config, - None, + Some(executable.path()), &job, "next-occurrence", 160, @@ -384,7 +480,7 @@ async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { let next_skip = super::scheduler_gate::evaluate_and_record_scheduler_skip_at( temp.path(), &config, - None, + Some(executable.path()), &job, "following-occurrence", 161, @@ -397,7 +493,7 @@ async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { let repeated_next = super::scheduler_gate::evaluate_and_record_scheduler_skip_at( temp.path(), &config, - None, + Some(executable.path()), &job, "following-occurrence", 162, @@ -427,7 +523,7 @@ async fn persisted_and_deduplicated_skips_do_not_block_later_due_execution() { let after_noise = super::scheduler_gate::evaluate_and_record_scheduler_skip_at( temp.path(), &config, - None, + Some(executable.path()), &job, "following-occurrence", 163, diff --git a/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_gate.rs b/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_gate.rs index 8e3b21d66a..ffa3cc2da3 100644 --- a/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_gate.rs +++ b/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_gate.rs @@ -7,7 +7,7 @@ use super::admit_job; use super::{ AdmittedAutomationJob, AgentTaskKind, AutomationJob, AutomationRunLedgerPublication, AutomationSettingsV1, AutomationTrigger, JobRunContext, Result, TraceDecayError, - UserJobAutomationRun, config_skip_reason, current_timestamp, job_schedule_decision, + UserJobAutomationRun, config_skip_reason, configured_job_schedule_decision, current_timestamp, job_task_key, load_run_ledger_task_summary, try_acquire_job_task_lock, }; /// Applies the configuration, canonical job-lock, and schedule gates before @@ -43,7 +43,7 @@ pub async fn evaluate_and_record_scheduler_skip( run_id: &str, occurrence_anchor_run_id: Option<&str>, ) -> Result> { - if let Some(reason) = config_skip_reason(config) { + if let Some(reason) = job_backend_skip_reason(config, executable) { return record_scheduler_diagnostic( dashboard_root, config, @@ -77,7 +77,14 @@ pub async fn evaluate_and_record_scheduler_skip( let summary = load_scheduler_summary(dashboard_root, job).await?; let decision_time = current_timestamp(); - let Some(reason) = job_schedule_decision(job, summary.records(), decision_time) else { + let Some(reason) = configured_job_schedule_decision( + config, + executable, + job, + summary.records(), + decision_time, + )? + else { crate::automation::scheduler_trace::observe_due(); return Ok(None); }; @@ -107,7 +114,7 @@ pub(super) async fn evaluate_and_record_scheduler_skip_at( occurrence_anchor_run_id: Option<&str>, ) -> Result> { let admitted_job = admit_job(job)?; - if let Some(reason) = config_skip_reason(config) { + if let Some(reason) = job_backend_skip_reason(config, executable) { return record_scheduler_diagnostic( dashboard_root, config, @@ -137,7 +144,14 @@ pub(super) async fn evaluate_and_record_scheduler_skip_at( }; let summary = load_scheduler_summary(dashboard_root, job).await?; - let Some(reason) = job_schedule_decision(&admitted_job, summary.records(), now_secs) else { + let Some(reason) = configured_job_schedule_decision( + config, + executable, + &admitted_job, + summary.records(), + now_secs, + )? + else { return Ok(None); }; record_scheduler_diagnostic( @@ -154,6 +168,20 @@ pub(super) async fn evaluate_and_record_scheduler_skip_at( .map(Some) } +fn job_backend_skip_reason( + config: &AutomationSettingsV1, + executable: Option<&Path>, +) -> Option { + config_skip_reason(config).or_else(|| { + // pre_run_command supplies context; every user job still invokes + // the backend. Refuse before external-effect admission, not as a + // failed attempt that imposes a cooldown after configuration recovery. + (config.backend == crate::automation::config::AutomationBackendV1::CodexAppServer + && executable.is_none()) + .then_some(AutomationSkipReasonV1::BackendUnconfigured) + }) +} + async fn load_scheduler_summary( dashboard_root: &Path, job: &AutomationJob, diff --git a/crates/tracedecay-daemon-control/src/service.rs b/crates/tracedecay-daemon-control/src/service.rs index 89274baaf2..4898f11903 100644 --- a/crates/tracedecay-daemon-control/src/service.rs +++ b/crates/tracedecay-daemon-control/src/service.rs @@ -1678,10 +1678,26 @@ pub struct DaemonServiceStatus { } impl DaemonServiceStatus { + /// This build answered initialize and admitted every registered store. + /// A process holding stores reset-required is serving, but it is not + /// ready: the operator still has to run the reported remedy. #[must_use] pub fn is_ready(&self) -> bool { + self.process.version_matches() && self.process.reset_required_stores().is_empty() + } + + /// This build answered initialize, whether or not it admitted every store. + #[must_use] + pub fn is_serving(&self) -> bool { self.process.version_matches() } + + /// The exact stores the daemon reported in their typed reset-required + /// state, each with the command that resets it. + #[must_use] + pub fn reset_required_stores(&self) -> &[tracedecay_domain::errors::StoreResetRequiredV1] { + self.process.reset_required_stores() + } } impl std::fmt::Display for DaemonServiceStatus { @@ -1745,8 +1761,22 @@ pub fn service_status( }; let transport_kind = if cfg!(unix) { "socket" } else { "endpoint" }; let transport = daemon_transport_display(&transport_path); + // The exact refusals and their remedies, so an operator reading `daemon + // status` does not have to re-derive the pending reset from a debug line. + let resets = if process.reset_required_stores().is_empty() { + String::new() + } else { + let mut section = String::from("reset required:\n"); + for refusal in process.reset_required_stores() { + section.push_str(&format!( + " {} ({}) - {}\n remedy: {}\n", + refusal.store, refusal.authority, refusal.reason, refusal.remedy + )); + } + section + }; let display = format!( - "state: {state}\nservice: {service}\nservice manager: {service_manager}\n{transport_kind}: {transport} ({socket_state})\nprotocol: {process:?}\n{detail}logs: {logs}\n", + "state: {state}\nservice: {service}\nservice manager: {service_manager}\n{transport_kind}: {transport} ({socket_state})\nprotocol: {process}\n{resets}{detail}logs: {logs}\n", ); DaemonServiceStatus { process, display } } @@ -1754,7 +1784,10 @@ pub fn service_status( fn daemon_is_serving(socket: DaemonSocketState, process: &DaemonProcessProofV1) -> bool { matches!( (socket, process), - (DaemonSocketState::Connectable, DaemonProcessProofV1::Ready) + ( + DaemonSocketState::Connectable, + DaemonProcessProofV1::Ready | DaemonProcessProofV1::BlockedResetRequired { .. } + ) ) } @@ -1764,6 +1797,9 @@ fn daemon_is_serving(socket: DaemonSocketState, process: &DaemonProcessProofV1) fn daemon_headline(socket: DaemonSocketState, process: &DaemonProcessProofV1) -> &'static str { match (socket, process) { (DaemonSocketState::Connectable, DaemonProcessProofV1::Ready) => "running", + (DaemonSocketState::Connectable, DaemonProcessProofV1::BlockedResetRequired { .. }) => { + "blocked: reset required" + } (DaemonSocketState::Connectable, DaemonProcessProofV1::VersionMismatch { .. }) => { "running a different build" } diff --git a/crates/tracedecay-daemon-control/src/service/probe.rs b/crates/tracedecay-daemon-control/src/service/probe.rs index 43954fdd6f..3ab696e758 100644 --- a/crates/tracedecay-daemon-control/src/service/probe.rs +++ b/crates/tracedecay-daemon-control/src/service/probe.rs @@ -56,6 +56,10 @@ const DAEMON_REACHABILITY_PROBE_TIMEOUT: Duration = Duration::from_secs(1); pub enum DaemonProcessProofV1 { /// initialize returned `serverInfo.name = tracedecay` at `expected_version`. Ready, + /// The process matches, but one or more stores cannot admit work. + BlockedResetRequired { + reset_required_stores: Vec, + }, /// A `TraceDecay` process answered initialize at a different version. VersionMismatch { observed: Option, @@ -69,13 +73,50 @@ impl DaemonProcessProofV1 { /// A `TraceDecay` process answered, regardless of version. #[must_use] pub fn names_tracedecay(&self) -> bool { - matches!(self, Self::Ready | Self::VersionMismatch { .. }) + matches!( + self, + Self::Ready | Self::BlockedResetRequired { .. } | Self::VersionMismatch { .. } + ) } /// The answering process is this binary's version. #[must_use] pub fn version_matches(&self) -> bool { - matches!(self, Self::Ready) + matches!(self, Self::Ready | Self::BlockedResetRequired { .. }) + } + + /// Stores this process reported as held in their typed reset-required + /// state. Empty for a process that admitted every store, and for one that + /// never completed initialize. + #[must_use] + pub fn reset_required_stores(&self) -> &[StoreResetRequiredV1] { + match self { + Self::BlockedResetRequired { + reset_required_stores, + } => reset_required_stores, + _ => &[], + } + } +} + +impl std::fmt::Display for DaemonProcessProofV1 { + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Ready => formatter.write_str("Ready"), + Self::BlockedResetRequired { + reset_required_stores, + } => write!( + formatter, + "blocked: reset required ({} store(s))", + reset_required_stores.len() + ), + Self::VersionMismatch { observed, expected } => write!( + formatter, + "version mismatch (observed={}, expected={expected})", + observed.as_deref().unwrap_or("missing") + ), + Self::Unproven { detail } => write!(formatter, "unproven ({detail})"), + } } } @@ -165,7 +206,17 @@ pub(super) fn probe_daemon_process_with_timeout( fn proof_from_protocol(protocol: DaemonProtocolState) -> DaemonProcessProofV1 { match protocol { - DaemonProtocolState::Ready { .. } => DaemonProcessProofV1::Ready, + DaemonProtocolState::Ready { + reset_required_stores, + } => { + if reset_required_stores.is_empty() { + DaemonProcessProofV1::Ready + } else { + DaemonProcessProofV1::BlockedResetRequired { + reset_required_stores, + } + } + } DaemonProtocolState::IdentityMismatch { name, version, @@ -776,6 +827,44 @@ mod identity_classification_tests { const SHA: &str = "84598a0b9c841b914565f46b20bb6c765706e8e5"; + #[test] + fn reset_stores_are_blocked_not_ready_but_retain_process_and_version_identity() { + let refusal = tracedecay_domain::errors::TraceDecayError::reset_required( + "workflow", + "retired schema", + ) + .store_reset_required( + "project:test", + tracedecay_domain::errors::STALE_STORE_RESET_COMMAND, + ) + .unwrap(); + let proof = super::proof_from_protocol(DaemonProtocolState::Ready { + reset_required_stores: vec![refusal.clone()], + }); + assert_eq!( + proof, + super::DaemonProcessProofV1::BlockedResetRequired { + reset_required_stores: vec![refusal], + } + ); + assert!(proof.names_tracedecay()); + assert!(proof.version_matches()); + assert_eq!( + super::super::daemon_headline(super::DaemonSocketState::Connectable, &proof), + "blocked: reset required" + ); + assert!(super::super::daemon_is_serving( + super::DaemonSocketState::Connectable, + &proof + )); + assert_eq!( + super::proof_from_protocol(DaemonProtocolState::Ready { + reset_required_stores: Vec::new(), + }), + super::DaemonProcessProofV1::Ready + ); + } + /// The identity a `tracedecay` daemon reporting `version` answers with. fn identity(version: &str) -> DaemonInitializeIdentity { DaemonInitializeIdentity { diff --git a/crates/tracedecay-daemon-control/src/service/tests.rs b/crates/tracedecay-daemon-control/src/service/tests.rs index fd18347cc4..cfe98cafc9 100644 --- a/crates/tracedecay-daemon-control/src/service/tests.rs +++ b/crates/tracedecay-daemon-control/src/service/tests.rs @@ -1182,6 +1182,62 @@ fn daemon_status_reports_the_initialize_proof_not_only_the_socket() { ); } +/// A daemon serving a store it holds reset-required is running, but it is not +/// ready, and `daemon status` prints the exact refusal and remedy instead of +/// the bare word "Ready". +#[cfg(unix)] +#[test] +fn daemon_status_reports_a_reset_required_store_as_blocked_with_its_remedy() { + let profile_dir = TempDir::new().expect("profile temp dir"); + let profile = ProfileRoot::new(profile_dir.path()); + let socket = profile_dir.path().join("blocked.sock"); + let authority = seed_socket_authority(&socket); + let listener = UnixListener::bind(&socket).expect("bind blocked socket"); + let server = serve_probe_result( + listener, + serde_json::json!({ + "serverInfo": {"name": "tracedecay", "version": env!("CARGO_PKG_VERSION")}, + "_meta": { + tracedecay_daemon_protocol::contract::RESET_REQUIRED_STORES_META_KEY: [{ + "store": "profile sessions", + "authority": "git correlation", + "found_version": 5, + "required_version": 6, + "reason": "git correlation profile schema 5 is incompatible with required schema 6", + "remedy": "tracedecay wipe --stale --yes", + }], + }, + }), + authority.auth_token().to_owned(), + ); + let status = super::service_status(&profile, &socket, env!("CARGO_PKG_VERSION")); + server.join().expect("join blocked status server"); + + assert!(status.is_serving(), "the process answered initialize"); + assert!( + !status.is_ready(), + "a store held reset-required is the operator's pending reset, not readiness" + ); + assert_eq!(status.reset_required_stores().len(), 1); + let status = status.to_string(); + assert!( + status.starts_with("state: blocked: reset required\n"), + "the headline must name the block, got:\n{status}" + ); + assert!( + status.contains("protocol: blocked: reset required (1 store(s))"), + "the protocol line must not claim readiness, got:\n{status}" + ); + assert!( + status.contains(" profile sessions (git correlation) - git correlation profile schema 5"), + "the census must name the store, authority and reason, got:\n{status}" + ); + assert!( + status.contains(" remedy: tracedecay wipe --stale --yes"), + "the census must carry the exact remedy, got:\n{status}" + ); +} + #[cfg(unix)] #[test] fn daemon_status_is_not_ready_when_no_daemon_is_listening() { diff --git a/crates/tracedecay-dashboard-api/src/authority_tests.rs b/crates/tracedecay-dashboard-api/src/authority_tests.rs index 4941d72b5e..cd757b67f8 100644 --- a/crates/tracedecay-dashboard-api/src/authority_tests.rs +++ b/crates/tracedecay-dashboard-api/src/authority_tests.rs @@ -509,6 +509,7 @@ impl DashboardStateFixture { automation_authority: None, automation_observation: None, automation_scheduler_reconciler: None, + scheduler_reset_census_reader: None, automation_writer: standalone_dashboard_automation_writer(), doctor_report_reader: None, remote_operational_status_reader: None, diff --git a/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs b/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs index 3f564786fa..d547769fa2 100644 --- a/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs +++ b/crates/tracedecay-dashboard-api/src/automation_scheduler_api.rs @@ -22,6 +22,7 @@ use tracedecay_automation_runtime::automation::scheduler::{ }; use tracedecay_contracts::retained_surfaces::AutomationSkipReasonV1; use tracedecay_domain::configuration::LcmSummarizerExecutableV1; +use tracedecay_domain::errors::{StoreResetRequiredV1, TraceDecayError}; use tracedecay_runtime_core::tracedecay::current_timestamp; type ApiResult = std::result::Result, JsonError>; @@ -43,6 +44,7 @@ pub(super) struct AutomationSchedulerStatusV1 { pub configuration_revision_id: String, pub control_path: String, pub tasks: Vec, + pub reset_required_stores: Vec, } /// Closed availability vocabulary for the scheduler status reading. @@ -57,6 +59,7 @@ pub(super) enum AutomationSchedulerAvailabilityV1 { DelegatedHost, BackendDisabled, BackendUnconfigured, + BlockedResetRequired, Configured, } @@ -106,34 +109,50 @@ async fn scheduler_status_payload(state: &DashboardState) -> ApiResult { let control = load_scheduler_control(&state.dashboard_root) .await .map_err(|err| internal_error(&err))?; - let memory_summary = load_run_ledger_task_summary( - &state.dashboard_root, - AgentTaskKind::MemoryCurator, - task_key(AgentTaskKind::MemoryCurator), - ) - .await - .map_err(|err| internal_error(&err))?; - let session_summary = load_run_ledger_task_summary( - &state.dashboard_root, - AgentTaskKind::SessionReflector, - task_key(AgentTaskKind::SessionReflector), - ) - .await - .map_err(|err| internal_error(&err))?; - let skill_summary = load_run_ledger_task_summary( - &state.dashboard_root, - AgentTaskKind::SkillWriter, - task_key(AgentTaskKind::SkillWriter), - ) - .await - .map_err(|err| internal_error(&err))?; + let mut reset_required_stores = state + .scheduler_reset_census_reader + .as_ref() + .map(|read| read()) + .unwrap_or_default(); + let memory_summary = scheduler_summary_or_refusal( + load_run_ledger_task_summary( + &state.dashboard_root, + AgentTaskKind::MemoryCurator, + task_key(AgentTaskKind::MemoryCurator), + ) + .await, + &mut reset_required_stores, + )?; + let session_summary = scheduler_summary_or_refusal( + load_run_ledger_task_summary( + &state.dashboard_root, + AgentTaskKind::SessionReflector, + task_key(AgentTaskKind::SessionReflector), + ) + .await, + &mut reset_required_stores, + )?; + let skill_summary = scheduler_summary_or_refusal( + load_run_ledger_task_summary( + &state.dashboard_root, + AgentTaskKind::SkillWriter, + task_key(AgentTaskKind::SkillWriter), + ) + .await, + &mut reset_required_stores, + )?; let now = current_timestamp(); let activity = match state.lcm_db.as_deref() { Some(sessions_db) => load_session_activity(sessions_db).await, None => SessionActivity::none(), }; + let blocked = !reset_required_stores.is_empty(); Ok(Json(AutomationSchedulerStatusV1 { - status: scheduler_status_label(&effective, &codex, control.paused), + status: if blocked { + AutomationSchedulerAvailabilityV1::BlockedResetRequired + } else { + scheduler_status_label(&effective, &codex, control.paused) + }, paused: control.paused, enabled: effective.enabled, scheduler_tick_secs: effective.scheduler_tick_secs, @@ -143,38 +162,67 @@ async fn scheduler_status_payload(state: &DashboardState) -> ApiResult { control_path: scheduler_control_path(&state.dashboard_root) .display() .to_string(), - tasks: vec![ - task_status( - &effective, - &codex, - control.paused, - &memory_summary, - activity, - now, - AgentTaskKind::MemoryCurator, - ), - task_status( - &effective, - &codex, - control.paused, - &session_summary, - activity, - now, - AgentTaskKind::SessionReflector, - ), - task_status( - &effective, - &codex, - control.paused, - &skill_summary, - activity, - now, - AgentTaskKind::SkillWriter, - ), - ], + // A refused ledger has no authoritative schedule or last-run reading. + tasks: if let (false, Some(memory_summary), Some(session_summary), Some(skill_summary)) = + (blocked, memory_summary, session_summary, skill_summary) + { + vec![ + task_status( + &effective, + &codex, + control.paused, + &memory_summary, + activity, + now, + AgentTaskKind::MemoryCurator, + ), + task_status( + &effective, + &codex, + control.paused, + &session_summary, + activity, + now, + AgentTaskKind::SessionReflector, + ), + task_status( + &effective, + &codex, + control.paused, + &skill_summary, + activity, + now, + AgentTaskKind::SkillWriter, + ), + ] + } else { + Vec::new() + }, + reset_required_stores, })) } +fn scheduler_summary_or_refusal( + result: Result, + refusals: &mut Vec, +) -> Result, JsonError> { + match result { + Ok(summary) => Ok(Some(summary)), + Err(error) => { + let Some(refusal) = error.store_reset_required( + "automation", + tracedecay_domain::errors::PROFILE_RESET_COMMAND, + ) else { + return Err(internal_error(&error)); + }; + if !refusals.contains(&refusal) { + refusals.push(refusal); + } + Ok(None) + } + } +} + fn task_status( config: &AdmittedAutomationConfig, codex: &LcmSummarizerExecutableV1, @@ -238,6 +286,62 @@ mod tests { AutomationRunLedgerRecord, AutomationRunStatus, AutomationTrigger, run_ledger_path, }; + #[tokio::test] + async fn refused_ledger_status_keeps_the_reset_census_and_recovers_without_fake_history() { + let temp = tempfile::TempDir::new().unwrap(); + // A complete retired row: the ledger refuses it as a reset, which is a + // different state from a malformed row (a config error). + std::fs::write( + run_ledger_path(temp.path()), + "{\"schema_version\":1,\"run_id\":\"retired\",\"trigger\":\"scheduler\",\ + \"task\":\"memory_curator\",\"task_key\":\"memory_curator\",\ + \"backend\":\"codex_app_server\",\"status\":\"succeeded\",\ + \"accepted_count\":0,\"rejected_count\":0,\"started_at\":\"1970-01-01T00:00:01Z\",\ + \"completed_at\":\"1970-01-01T00:00:02Z\"}\n", + ) + .unwrap(); + let mut census = Vec::new(); + for task in [ + AgentTaskKind::MemoryCurator, + AgentTaskKind::SessionReflector, + ] { + scheduler_summary_or_refusal( + load_run_ledger_task_summary(temp.path(), task, task_key(task)).await, + &mut census, + ) + .unwrap(); + } + assert_eq!(census.len(), 1); + assert!(!census[0].reason.is_empty()); + assert_eq!(census[0].store, "automation"); + std::fs::remove_file(run_ledger_path(temp.path())).unwrap(); + let mut recovered_census = Vec::new(); + let summary = scheduler_summary_or_refusal( + load_run_ledger_task_summary( + temp.path(), + AgentTaskKind::MemoryCurator, + "memory_curator", + ) + .await, + &mut recovered_census, + ) + .unwrap(); + assert!(recovered_census.is_empty()); + assert!(summary.unwrap().records().is_empty()); + let isolated = tempfile::TempDir::new().unwrap(); + assert!( + load_run_ledger_task_summary( + isolated.path(), + AgentTaskKind::MemoryCurator, + "memory_curator" + ) + .await + .unwrap() + .records() + .is_empty() + ); + } + fn record( run_id: &str, task: AgentTaskKind, diff --git a/crates/tracedecay-dashboard-api/src/events_api.rs b/crates/tracedecay-dashboard-api/src/events_api.rs index f3dcc474e9..6cbca01e18 100644 --- a/crates/tracedecay-dashboard-api/src/events_api.rs +++ b/crates/tracedecay-dashboard-api/src/events_api.rs @@ -1218,6 +1218,7 @@ pub(crate) async fn dashboard_state_fixture( automation_authority: None, automation_observation: None, automation_scheduler_reconciler: None, + scheduler_reset_census_reader: None, automation_writer: crate::standalone_dashboard_automation_writer(), doctor_report_reader: None, remote_operational_status_reader: None, diff --git a/crates/tracedecay-dashboard-api/src/state.rs b/crates/tracedecay-dashboard-api/src/state.rs index b16d8e1d57..43b67e91c4 100644 --- a/crates/tracedecay-dashboard-api/src/state.rs +++ b/crates/tracedecay-dashboard-api/src/state.rs @@ -34,6 +34,16 @@ pub type AutomationSchedulerReconcileFuture = Pin< >; pub type AutomationSchedulerReconciler = Arc AutomationSchedulerReconcileFuture + Send + Sync + 'static>; +/// The scheduler's own reset census: every store this project's scheduler +/// owner reports in its typed reset-required state, each with the exact +/// command that resets it. +/// +/// The reader is bound to one project's exact store identity, so a project's +/// dashboard never adopts another project's refusal. A standalone dashboard +/// has no daemon registry to read and leaves this `None`; the ledger refusal +/// path still reports the run ledger's own reset. +pub type SchedulerResetCensusReader = + Arc Vec + Send + Sync + 'static>; pub type DashboardAutomationObservationRecorderV1 = Arc< dyn Fn(tracedecay_automation_runtime::automation::run_ledger::AutomationRunLedgerRecord) + Send @@ -107,6 +117,7 @@ pub struct DashboardStateCompositionV1 { Arc DashboardAutomationObservationFuture + Send + Sync + 'static>, >, pub automation_scheduler_reconciler: Option, + pub scheduler_reset_census_reader: Option, pub automation_writer: DashboardAutomationWriter, pub doctor_report_reader: Option, /// Daemon-owned Remote Brain operational read. Standalone dashboards leave @@ -288,6 +299,7 @@ pub struct DashboardState { Arc DashboardAutomationObservationFuture + Send + Sync + 'static>, >, pub automation_scheduler_reconciler: Option, + pub scheduler_reset_census_reader: Option, /// Lifetime-owning capability for complete dashboard automation writes. pub automation_writer: DashboardAutomationWriter, /// Admitted canonical Doctor report source. Absent when the dashboard was @@ -421,6 +433,7 @@ pub(super) async fn build_state_inner( automation_authority, automation_observation, automation_scheduler_reconciler, + scheduler_reset_census_reader, automation_writer, doctor_report_reader, remote_operational_status_reader, @@ -543,6 +556,7 @@ pub(super) async fn build_state_inner( automation_authority, automation_observation, automation_scheduler_reconciler, + scheduler_reset_census_reader, automation_writer, doctor_report_reader, remote_operational_status_reader, @@ -595,6 +609,9 @@ pub async fn build_selected_project_state( automation_authority: active.automation_authority.clone(), automation_observation: active.automation_observation.clone(), automation_scheduler_reconciler: None, + // The active reader carries that project's exact store identity. + // A selected lightweight state must not alias its reset census. + scheduler_reset_census_reader: None, automation_writer: Arc::clone(&active.automation_writer), // Doctor authority is bound to the active project's exact scope. // Freshness is different: its daemon registry reader resolves the diff --git a/crates/tracedecay-dashboard-api/src/test_transport.rs b/crates/tracedecay-dashboard-api/src/test_transport.rs index 28471f76c9..295c08cae0 100644 --- a/crates/tracedecay-dashboard-api/src/test_transport.rs +++ b/crates/tracedecay-dashboard-api/src/test_transport.rs @@ -286,6 +286,7 @@ where automation_authority: authority.automation_authority.clone(), automation_observation: None, automation_scheduler_reconciler: None, + scheduler_reset_census_reader: None, automation_writer: authority .automation_writer .clone() diff --git a/crates/tracedecay/src/daemon/engine.rs b/crates/tracedecay/src/daemon/engine.rs index 2ababec1fc..c1e7bd690c 100644 --- a/crates/tracedecay/src/daemon/engine.rs +++ b/crates/tracedecay/src/daemon/engine.rs @@ -54,6 +54,7 @@ use tracedecay_contracts::project_open::ProjectOpenStatusStateV1; #[cfg(unix)] use tracedecay_daemon_identity::profile_identity; use tracedecay_daemon_protocol::DaemonHandshake; +use tracedecay_daemon_service::project_runtime::ProjectRuntimePublicationStateV1; #[cfg(unix)] #[cfg(unix)] use tracedecay_daemon_service::shutdown::{DAEMON_TASK_ABORT_DEADLINE, DaemonLifecycle}; @@ -787,7 +788,6 @@ impl DaemonEngine { composition.key.clone(), composition.canonical_project_path.clone(), handshake.clone(), - Arc::clone(&composition.server), ); } Ok(( @@ -882,30 +882,43 @@ impl DaemonEngine { }) } - fn spawn_project_maintenance_activation( + pub(super) fn spawn_project_maintenance_activation( &self, key: ProjectServerKey, project_path: PathBuf, handshake: DaemonHandshake, - server: Arc, ) { let engine = self.clone(); - let recovery_server = Arc::clone(&server); - spawn_lifecycle_automation_scheduler_activation( - self.lifecycle.clone(), - tracing::Instrument::instrument( - async move { - let cg = recovery_server.cg_snapshot().await; - project_open_owners::reconcile_project_open_automation_effects(cg).await; - }, - tracing::trace_span!("daemon.engine.reconcile_automation_effects"), - ), - ); spawn_lifecycle_automation_scheduler_activation( self.lifecycle.clone(), tracing::Instrument::instrument( async move { + // The core route precedes mandatory retained owners. Subscribe + // before reading so publication cannot race this waiter. + loop { + let (publication, mut changed) = engine + .invocation + .service + .project_runtimes + .publication_view(&project_path); + match publication { + Some(ProjectRuntimePublicationStateV1::Ready) => break, + Some(ProjectRuntimePublicationStateV1::Warming) => { + if changed.changed().await.is_err() { + return; + } + } + _ => return, + } + } + let server = { + let servers = engine.store_administration.project_servers().lock().await; + servers.get(&key).cloned() + }; + let Some(server) = server else { return }; let cg = server.cg_snapshot().await; + project_open_owners::reconcile_project_open_automation_effects(Arc::clone(&cg)) + .await; engine .activate_automation_scheduler_for_open_project( key, diff --git a/crates/tracedecay/src/daemon/scheduler.rs b/crates/tracedecay/src/daemon/scheduler.rs index 5e3359175c..3e664c16e7 100644 --- a/crates/tracedecay/src/daemon/scheduler.rs +++ b/crates/tracedecay/src/daemon/scheduler.rs @@ -179,10 +179,17 @@ fn observe_scheduler_tick_result( /// Waits out a burst of wakes, restarting the quiet period on each one, so a /// burst produces one follow-up rather than one per signal. `false` when the /// timer is unavailable. -async fn scheduler_wake_quiet_period(project_path: &Path, wake: &tokio::sync::Notify) -> bool { +async fn scheduler_wake_quiet_period( + project_path: &Path, + wake: &tokio::sync::Notify, + run_control: &AutomationRunControl, +) -> bool { loop { + if run_control.read_control().interrupted() { + return false; + } tokio::select! { - slept = scheduler_sleep(project_path, Duration::from_secs(5)) => return slept, + slept = scheduler_sleep(project_path, Duration::from_secs(5)) => return slept && !run_control.read_control().interrupted(), () = wake.notified() => {} } } @@ -786,6 +793,17 @@ impl DaemonEngine { if !self.lifecycle.accepting() { return AutomationSchedulerReconcileOutcome::LifecycleInactive; } + if self + .invocation + .service + .project_runtimes + .publication_state(&project_path) + .is_some_and(|state| { + state != tracedecay_daemon_service::project_runtime::ProjectRuntimePublicationStateV1::Ready + }) + { + return AutomationSchedulerReconcileOutcome::OwnerUnavailable; + } let mut schedulers = self .store_administration .automation_schedulers() @@ -1387,7 +1405,7 @@ async fn run_automation_scheduler_loop( { wake.notified().await; if run_control.read_control().interrupted() - || !scheduler_wake_quiet_period(&project_path, &wake).await + || !scheduler_wake_quiet_period(&project_path, &wake, &run_control).await { break 'scheduler; } @@ -1425,7 +1443,7 @@ async fn run_automation_scheduler_loop( } // Receipts arrive at tool cadence: one review for the burst // rather than one review per command. - if !scheduler_wake_quiet_period(&project_path, &wake).await { + if !scheduler_wake_quiet_period(&project_path, &wake, &run_control).await { break 'scheduler; } if let Err(error) = boxed_host_receipt_review( diff --git a/crates/tracedecay/src/daemon/tests/scheduler_config.rs b/crates/tracedecay/src/daemon/tests/scheduler_config.rs index 040ed9a8e1..496f5b1882 100644 --- a/crates/tracedecay/src/daemon/tests/scheduler_config.rs +++ b/crates/tracedecay/src/daemon/tests/scheduler_config.rs @@ -918,8 +918,11 @@ async fn disabled_scheduler_reconcile_cannot_acknowledge_an_owner_that_then_exit apply_project_automation_patch_via_surface(&engine, &handshake, scheduled.clone()).await; let cg = server.cg_snapshot().await; let key = ProjectServerKey::from_open_project(&cg, &handshake).expect("owner key"); - // Project-open setup owns the loop; ensure must notify it rather than - // publish a second owner. + // Project-open setup owns the loop, but it registers that owner only after + // the project's runtime publication commits. Settle on it before + // reconciling: the point of this test is that a reconcile of a live owner + // notifies it instead of publishing a second one. + wait_for_automation_scheduler_state(&engine, |schedulers| schedulers.contains_key(&key)).await; assert_eq!( engine .ensure_automation_scheduler(key.clone(), project.clone(), handshake.clone()) diff --git a/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs b/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs index e1562f0041..242101fd22 100644 --- a/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs +++ b/crates/tracedecay/src/daemon/tests/scheduler_config/reset_blocked_tick.rs @@ -199,3 +199,79 @@ async fn retirement_reaches_a_loop_parked_on_a_reset_refusal() { ); engine.shutdown_all().await; } + +#[tokio::test] +async fn scheduler_admission_waits_for_mandatory_runtime_publication() { + let (fixture, _scope) = project_with_refusing_ledger().await; + let engine = &fixture.engine; + let retirement = engine + .retire_automation_scheduler_locked(&fixture.key) + .await + .unwrap(); + retirement.wait().await; + let registry = &engine.invocation.service.project_runtimes; + let publication = registry.begin_publication(&fixture.project).unwrap(); + let cg = fixture._server.cg_snapshot().await; + assert_eq!( + engine + .start_automation_scheduler( + fixture.key.clone(), + fixture.project.clone(), + fixture.handshake.clone(), + cg.clone() + ) + .await, + AutomationSchedulerReconcileOutcome::OwnerUnavailable, + ); + assert!( + engine + .store_administration + .automation_schedulers() + .lock() + .await + .is_empty() + ); + let before = tick_attempts(engine); + engine.spawn_project_maintenance_activation( + fixture.key.clone(), + fixture.project.clone(), + fixture.handshake.clone(), + ); + tokio::time::sleep(Duration::from_millis(100)).await; + assert_eq!( + tick_attempts(engine), + before, + "core publication must not tick" + ); + assert!(registry.mark_publication_ready(&publication)); + wait_for_ticks(engine, before + 1, "full publication wakes activation").await; + engine.shutdown_all().await; +} + +#[tokio::test] +async fn retirement_interrupts_a_reset_reconcile_quiet_period() { + let (fixture, _scope) = project_with_refusing_ledger().await; + let engine = &fixture.engine; + wait_for_ticks(engine, 1, "first refused tick").await; + engine + .ensure_automation_scheduler( + fixture.key.clone(), + fixture.project.clone(), + fixture.handshake.clone(), + ) + .await; + tokio::time::sleep(Duration::from_millis(100)).await; + let started = std::time::Instant::now(); + let retirement = engine + .retire_automation_scheduler_locked(&fixture.key) + .await + .unwrap(); + retirement.wait().await; + assert!( + started.elapsed() < Duration::from_secs(1), + "quiet debounce delayed retirement: {:?}", + started.elapsed() + ); + assert_eq!(tick_attempts(engine), 1); + engine.shutdown_all().await; +} diff --git a/crates/tracedecay/src/doctor.rs b/crates/tracedecay/src/doctor.rs index b5806c6416..181fc9682d 100644 --- a/crates/tracedecay/src/doctor.rs +++ b/crates/tracedecay/src/doctor.rs @@ -941,6 +941,12 @@ fn daemon_service_doctor_message( } match proof { tracedecay_daemon_control::DaemonProcessProofV1::Ready => state.lifecycle_operator_advice(), + tracedecay_daemon_control::DaemonProcessProofV1::BlockedResetRequired { + reset_required_stores, + } => format!( + "The daemon is running, but {} store(s) require reset. Inspect tracedecay daemon status for the exact refusal and remedy.", + reset_required_stores.len() + ), tracedecay_daemon_control::DaemonProcessProofV1::VersionMismatch { observed, expected } => { format!( "TraceDecay daemon unit is active, but initialize reported version {} not {expected}. Unit state is not proof this binary is serving.", diff --git a/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs index 10c00eecc0..31572b000b 100644 --- a/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs @@ -1091,6 +1091,17 @@ pub(super) async fn compute_dashboard( delivery_read_authority, registered_savings_db, automation_scheduler_reconciler, + scheduler_reset_census_reader: Some({ + let registry = cg.retained_store_runtime_registry(); + let project_id = cg.store_layout().identity.project_id.clone(); + Arc::new(move || registry.reset_required_stores().into_iter().filter(|refusal| { + match tracedecay_domain::errors::ResettableStoreV1::from_label(&refusal.store) { + Some(tracedecay_domain::errors::ResettableStoreV1::ProjectSessions { project_id: target }) + | Some(tracedecay_domain::errors::ResettableStoreV1::ProjectHookAdmissions { project_id: target }) => project_id.as_deref() == Some(target.as_str()), + _ => true, + } + }).collect()) + }), automation_authority, automation_observation, automation_writer, diff --git a/dashboard/codegen/schemas/dashboard-contracts.schema.json b/dashboard/codegen/schemas/dashboard-contracts.schema.json index 7600948e7b..0122e59332 100644 --- a/dashboard/codegen/schemas/dashboard-contracts.schema.json +++ b/dashboard/codegen/schemas/dashboard-contracts.schema.json @@ -944,6 +944,13 @@ "event_kind": { "type": "string" }, + "failure_reason": { + "description": "The bounded, sanitized reason a failed call recorded.\n\n`outcome` alone says a call failed; without the reason an operator can\nsee that something broke but not what. The durable metadata column is\nnot a disclosure boundary, so the text crosses the privacy authority\nand a bounded length before it is served, and text the sanitizer\nquarantines is omitted rather than echoed.", + "type": [ + "string", + "null" + ] + }, "hook_name": { "type": "string" }, @@ -3076,6 +3083,7 @@ "delegated_host", "backend_disabled", "backend_unconfigured", + "blocked_reset_required", "configured" ], "type": "string" @@ -3107,6 +3115,12 @@ "paused": { "type": "boolean" }, + "reset_required_stores": { + "items": { + "$ref": "#/$defs/StoreResetRequiredV1" + }, + "type": "array" + }, "scheduler_tick_secs": { "format": "uint64", "minimum": 0, @@ -3131,7 +3145,8 @@ "last_session_activity", "configuration_revision_id", "control_path", - "tasks" + "tasks", + "reset_required_stores" ], "type": "object" }, @@ -26321,6 +26336,46 @@ ], "type": "object" }, + "StoreResetRequiredV1": { + "description": "A persisted store the daemon keeps mounted in a typed reset-required state\ninstead of refusing to serve: every read against it returns the typed\nrefusal, stores that admit keep serving, and `remedy` is the exact command\nthe operator runs to reset it.", + "properties": { + "authority": { + "type": "string" + }, + "found_version": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": "string" + }, + "remedy": { + "type": "string" + }, + "required_version": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "store": { + "type": "string" + } + }, + "required": [ + "store", + "authority", + "found_version", + "required_version", + "reason", + "remedy" + ], + "type": "object" + }, "StoreSizeSampleV1": { "additionalProperties": false, "description": "One cheap size sample for a single store, derived from page-count pragmas.\n\n`total_bytes` is `page_count * page_size`; `free_bytes` is\n`freelist_pages * page_size`. Both are recorded so the free-page ratio and\nthe reclaimable-bytes estimate (Plan 38 §6 compaction) can be computed\nwithout re-reading the store.", diff --git a/dashboard/src/contracts/decoders.ts b/dashboard/src/contracts/decoders.ts index d36c9054de..cdb278dcb2 100644 --- a/dashboard/src/contracts/decoders.ts +++ b/dashboard/src/contracts/decoders.ts @@ -709,6 +709,7 @@ import type { StoreGrowthDimensionV1, StoreKeyV1, StorePointReadsV1, + StoreResetRequiredV1, StoreSizeSampleV1, StoreTelemetryEntryV1, StrataClusterV1, @@ -1375,6 +1376,7 @@ export const AnalyticsPromptCategoryCountV1Schema: z.ZodObject<{ export const AnalyticsRecentEventV1Schema: z.ZodObject<{ cost: z.ZodOptional>; event_kind: z.ZodType; + failure_reason: z.ZodOptional>; hook_name: z.ZodType; outcome: z.ZodType; timestamp: z.ZodType; @@ -1382,6 +1384,7 @@ export const AnalyticsRecentEventV1Schema: z.ZodObject<{ }> = z.object({ cost: z.union([z.lazy(() => RequestCostReceiptV1Schema), z.null()]).optional(), event_kind: z.string(), + failure_reason: z.string().nullable().optional(), hook_name: z.string(), outcome: z.string(), timestamp: z.number().int().nullable(), @@ -2154,7 +2157,7 @@ export const AutomationRunTerminalV1Schema: z.ZodType = z.enum(["automation_disabled", "backend_disabled", "backend_unconfigured", "configured", "delegated_host", "paused"]); +export const AutomationSchedulerAvailabilityV1Schema: z.ZodEnum<{ "automation_disabled": "automation_disabled"; "backend_disabled": "backend_disabled"; "backend_unconfigured": "backend_unconfigured"; "blocked_reset_required": "blocked_reset_required"; "configured": "configured"; "delegated_host": "delegated_host"; "paused": "paused" }> = z.enum(["automation_disabled", "backend_disabled", "backend_unconfigured", "blocked_reset_required", "configured", "delegated_host", "paused"]); /** The scheduler reading served by `status`, `pause`, and `resume`. @@ -2168,6 +2171,7 @@ export const AutomationSchedulerStatusV1Schema: z.ZodObject<{ last_session_activity: z.ZodType; now: z.ZodType; paused: z.ZodType; + reset_required_stores: z.ZodType, unknown>; scheduler_tick_secs: z.ZodType; status: z.ZodType; tasks: z.ZodType, unknown>; @@ -2178,6 +2182,7 @@ export const AutomationSchedulerStatusV1Schema: z.ZodObject<{ last_session_activity: z.number().int().nullable(), now: z.number().int(), paused: z.boolean(), + reset_required_stores: z.array(z.lazy(() => StoreResetRequiredV1Schema)), scheduler_tick_secs: z.number().int().min(0), status: z.lazy(() => AutomationSchedulerAvailabilityV1Schema), tasks: z.array(z.lazy(() => AutomationTaskStatusV1Schema)), @@ -9440,6 +9445,26 @@ export const StorePointReadsV1Schema: z.ZodObject<{ graph_staging: z.number().int().min(0), }).strict(); +/** A persisted store the daemon keeps mounted in a typed reset-required state +instead of refusing to serve: every read against it returns the typed +refusal, stores that admit keep serving, and `remedy` is the exact command +the operator runs to reset it. */ +export const StoreResetRequiredV1Schema: z.ZodObject<{ + authority: z.ZodType; + found_version: z.ZodType; + reason: z.ZodType; + remedy: z.ZodType; + required_version: z.ZodType; + store: z.ZodType; +}> = z.object({ + authority: z.string(), + found_version: z.number().int().nullable(), + reason: z.string(), + remedy: z.string(), + required_version: z.number().int().nullable(), + store: z.string(), +}); + /** One cheap size sample for a single store, derived from page-count pragmas. `total_bytes` is `page_count * page_size`; `free_bytes` is diff --git a/dashboard/src/contracts/types.ts b/dashboard/src/contracts/types.ts index 259cae3221..1e30f40013 100644 --- a/dashboard/src/contracts/types.ts +++ b/dashboard/src/contracts/types.ts @@ -232,6 +232,7 @@ export type AnalyticsPromptCategoryCountV1 = { export type AnalyticsRecentEventV1 = { cost?: RequestCostReceiptV1 | null | undefined; event_kind: string; + failure_reason?: string | null | undefined; hook_name: string; outcome: string; timestamp: number | null; @@ -700,7 +701,7 @@ export type AutomationRunTerminalV1 = summary: AutomationRunSummaryV1; }; -export type AutomationSchedulerAvailabilityV1 = "automation_disabled" | "backend_disabled" | "backend_unconfigured" | "configured" | "delegated_host" | "paused"; +export type AutomationSchedulerAvailabilityV1 = "automation_disabled" | "backend_disabled" | "backend_unconfigured" | "blocked_reset_required" | "configured" | "delegated_host" | "paused"; export type AutomationSchedulerStatusV1 = { configuration_revision_id: string; @@ -709,6 +710,7 @@ export type AutomationSchedulerStatusV1 = { last_session_activity: number | null; now: number; paused: boolean; + reset_required_stores: Array; scheduler_tick_secs: number; status: AutomationSchedulerAvailabilityV1; tasks: Array; @@ -5337,6 +5339,15 @@ export type StorePointReadsV1 = { graph_staging: number; }; +export type StoreResetRequiredV1 = { + authority: string; + found_version: number | null; + reason: string; + remedy: string; + required_version: number | null; + store: string; +}; + export type StoreSizeSampleV1 = { freelist_pages: number; observed_at: UtcMicros; diff --git a/dashboard/src/data/query/automation.test.ts b/dashboard/src/data/query/automation.test.ts index b31dfb1123..8b14f8a214 100644 --- a/dashboard/src/data/query/automation.test.ts +++ b/dashboard/src/data/query/automation.test.ts @@ -15,6 +15,7 @@ function scheduler(overrides: Record = {}) { paused: false, enabled: true, scheduler_tick_secs: 300, + reset_required_stores: [], now: 1_700_000_000, last_session_activity: 1_699_999_000, configuration_revision_id: "configuration.revision.test", diff --git a/dashboard/src/data/query/schedulerDispatchScope.dom.test.ts b/dashboard/src/data/query/schedulerDispatchScope.dom.test.ts index 9208fd9852..03d4e35301 100644 --- a/dashboard/src/data/query/schedulerDispatchScope.dom.test.ts +++ b/dashboard/src/data/query/schedulerDispatchScope.dom.test.ts @@ -65,6 +65,7 @@ function schedulerBody(paused: boolean) { paused, enabled: true, scheduler_tick_secs: 900, + reset_required_stores: [], now, last_session_activity: null, configuration_revision_id: "configuration.revision.scope.test", diff --git a/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx b/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx index 35d28cb818..e7546281e2 100644 --- a/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx +++ b/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx @@ -398,6 +398,7 @@ function scheduler(overrides: { paused?: boolean; status?: string; tasks?: unkno paused: overrides.paused ?? false, enabled: true, scheduler_tick_secs: 900, + reset_required_stores: [], now: NOW, last_session_activity: NOW - 1200, configuration_revision_id: "configuration.revision.automation.test", diff --git a/dashboard/src/workspaces/automations/ledger.test.ts b/dashboard/src/workspaces/automations/ledger.test.ts index 1f2b5951d8..f94b1a2bf9 100644 --- a/dashboard/src/workspaces/automations/ledger.test.ts +++ b/dashboard/src/workspaces/automations/ledger.test.ts @@ -147,6 +147,7 @@ describe('schedulerReading', () => { configuration_revision_id: 'rev', control_path: '/x', tasks: [], + reset_required_stores: [], }); it('reads configured as a configuration state, not a liveness claim', () => { @@ -155,6 +156,58 @@ describe('schedulerReading', () => { expect(reading.sentence).toMatch(/no liveness heartbeat/); }); + it('shows reset refusal and remedy rather than configured', () => { + const blocked = status('blocked_reset_required'); + blocked.reset_required_stores = [{ + store: 'project sessions test', + authority: 'workflow', + found_version: 1, + required_version: 2, + reason: 'retired schema', + remedy: 'tracedecay wipe --stale --yes', + }]; + const reading = schedulerReading(blocked); + expect(reading.word).toBe('reset required'); + expect(reading.sentence).toContain('project sessions test (workflow) requires reset: retired schema'); + expect(reading.sentence).toContain('tracedecay wipe --stale --yes'); + expect(reading.tone.kind).toBe('partial'); + }); + + it('names every refused store when several are blocked', () => { + const blocked = status('blocked_reset_required'); + blocked.reset_required_stores = [ + { + store: 'profile authority', + authority: 'global', + found_version: 3, + required_version: 4, + reason: 'retired profile schema', + remedy: 'tracedecay wipe --all --yes', + }, + { + store: 'project sessions p1', + authority: 'sessions', + found_version: null, + required_version: null, + reason: 'store files were lost while open', + remedy: 'tracedecay daemon restart', + }, + ]; + const sentence = schedulerReading(blocked).sentence; + expect(sentence).toContain('profile authority (global) requires reset: retired profile schema'); + expect(sentence).toContain('tracedecay wipe --all --yes'); + expect(sentence).toContain('project sessions p1 (sessions) requires reset: store files were lost while open'); + expect(sentence).toContain('tracedecay daemon restart'); + }); + + it('says the census was not reported rather than claiming no refusal', () => { + const blocked = status('blocked_reset_required'); + blocked.reset_required_stores = []; + const reading = schedulerReading(blocked); + expect(reading.word).toBe('reset required'); + expect(reading.sentence).toContain('no census was reported'); + }); + it('keeps paused, disabled and delegated states distinct', () => { expect(schedulerReading(status('paused')).tone.kind).toBe('partial'); expect(schedulerReading(status('automation_disabled')).tone.kind).toBe('cancelled'); diff --git a/dashboard/src/workspaces/automations/ledger.ts b/dashboard/src/workspaces/automations/ledger.ts index 37e336770b..64c5d1598f 100644 --- a/dashboard/src/workspaces/automations/ledger.ts +++ b/dashboard/src/workspaces/automations/ledger.ts @@ -212,8 +212,29 @@ interface SchedulerReading { readonly sentence: string; } +/** + * The blocked reading names every store, its refusal and the exact command + * that resets it, so the operator never has to open another surface to learn + * what to run. The daemon lists the stores in registry order; one refusal per + * store is the whole census, not a sample. + */ +function blockedResetSentence(stores: AutomationSchedulerStatusV1['reset_required_stores']): string { + if (stores.length === 0) { + return 'the scheduler is blocked on a reset-required store; no census was reported'; + } + return stores + .map((store) => `${store.store} (${store.authority}) requires reset: ${store.reason}. Remedy: ${store.remedy}`) + .join(' '); +} + export function schedulerReading(status: AutomationSchedulerStatusV1): SchedulerReading { switch (status.status) { + case 'blocked_reset_required': + return { + tone: DEGRADED, + word: 'reset required', + sentence: blockedResetSentence(status.reset_required_stores), + }; case 'configured': return { tone: SIGNAL, diff --git a/dashboard/stories/fixtures/data.ts b/dashboard/stories/fixtures/data.ts index d228f081a1..615325fb5f 100644 --- a/dashboard/stories/fixtures/data.ts +++ b/dashboard/stories/fixtures/data.ts @@ -2449,6 +2449,7 @@ function schedulerStatusPayload(): Record { paused: false, enabled: true, scheduler_tick_secs: 900, + reset_required_stores: [], now: nowSecs, last_session_activity: nowSecs - 1200, configuration_revision_id: 'configuration.revision.automation.fixture', From 9caa3fcfdf3555fb160ae7641933da61805ac201 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:08:43 -0800 Subject: [PATCH 38/63] fix(evals): validate typed HTTP decisions before recording results Refs #4535. An answer tagged Score (or with a malformed type) could be credited as a Noul prediction if it happened to contain a "noul" field. Validate the full response and every answer's question kind before writing to the resumable evaluation log or first-response sample. Retain support for genuinely omitted answer kind tags. Exercise wrong kinds, malformed answer/response shapes, preservation of prior partial rows and successful resumption, plus valid explicit Noul responses. Standalone Python predicate probes reproduced the wrong-kind acceptance and checked the refusal semantics. Hosted Bazel tests are still needed. --- evals/intent_engine/run_http.py | 23 ++++++++++++-- evals/intent_engine/test_run_http.py | 47 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index d222f01ec4..623e63e55f 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -157,6 +157,26 @@ def probabilities(values, questions): return values +def noul_probabilities(response, questions): + """Validate the typed server answer before recording model evidence.""" + if not isinstance(response, dict): + raise ValueError("decision response must be a JSON object") + answers = response.get("answers") + if not isinstance(answers, dict) or set(answers) != set(questions): + raise ValueError("noul answers must cover exactly the requested questions") + values = {} + for key, answer in answers.items(): + # Older decision servers omit the kind, but a present tag must agree + # with the requested question. A Score response with an incidental + # noul field is not evidence of a successful Noul prediction. + if (not isinstance(answer, dict) + or ("type" in answer and answer["type"] != "noul") + or "noul" not in answer): + raise ValueError(f"invalid noul answer for {key}") + values[key] = answer["noul"] + return probabilities(values, questions) + + def calibrated(probability, temperature): if probability in (0, 1): return probability @@ -302,8 +322,7 @@ def main(argv=None): continue body, request_sha = requests[case["id"]] response, ms = post(args.url, body) - answers = response["answers"] - probs = probabilities({key: value["noul"] for key, value in answers.items()}, questions) + probs = noul_probabilities(response, questions) server_ms = response.get("latency_ms") if server_ms is None: server_ms = (response.get("timing") or {}).get("inference_ms") diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index b1430382fc..cc77d85df7 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -568,6 +568,53 @@ def test_malformed_answers_do_not_become_completed_rows(self): self.run_main() self.assertEqual(self.partial.read_bytes(), before) + def test_invalid_answer_kinds_and_shapes_preserve_resumable_rows(self): + self.interrupt() + before = self.partial.read_bytes() + sample = self.root / "rejected-response.json" + response, elapsed = self.response("", {"questions": run_http.noul_questions()}) + invalid = [] + for declared_type in ("score", None, False, [], {"kind": "noul"}): + malformed = copy.deepcopy(response) + malformed["answers"]["impact"]["type"] = declared_type + invalid.append(malformed) + for answer in (None, False, [0.25], "noul"): + malformed = copy.deepcopy(response) + malformed["answers"]["impact"] = answer + invalid.append(malformed) + invalid.extend([ + None, + [], + {"answers": []}, + {"answers": {"impact": {"noul": 0.25}}}, + ]) + for malformed in invalid: + with self.subTest(response=repr(malformed)[:90]): + with patch.object(run_http, "post", return_value=(malformed, elapsed)): + with self.assertRaisesRegex(ValueError, "noul|decision response"): + self.run_main(["--sample-out", str(sample)]) + self.assertEqual(self.partial.read_bytes(), before) + self.assertFalse(self.output.exists()) + self.assertFalse(sample.exists()) + + # The rejected response did not poison the partial log; valid + # inference can continue from the already-settled first case. + with patch.object(run_http, "post", side_effect=self.response) as post: + self.run_main() + post.assert_called_once() + self.assertEqual(len(json.loads(self.output.read_text())["rows"]), 2) + + def test_explicit_noul_answer_kind_still_records_valid_predictions(self): + response, elapsed = self.response("", {"questions": run_http.noul_questions()}) + for answer in response["answers"].values(): + answer["type"] = "noul" + with patch.object(run_http, "post", return_value=(response, elapsed)) as post: + self.run_main() + self.assertEqual(post.call_count, len(self.dataset)) + rows = json.loads(self.output.read_text())["rows"] + self.assertEqual(len(rows), len(self.dataset)) + self.assertTrue(all(row["probs"]["impact"] == 0.25 for row in rows)) + def test_malformed_response_does_not_poison_first_sample_on_resume(self): sample = self.root / "first-response.json" response, elapsed = self.response("", {"questions": run_http.noul_questions()}) From 9236c31bfe270b61a31a906ec728f38164346185 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:24:45 -0800 Subject: [PATCH 39/63] test(automation): render the reset-blocked scheduler bay end to end The blocked reading was only covered at the ledger helper. This drives the real route through the page: a `blocked_reset_required` status with one refused store must render "reset required", the store's authority, reason and exact remedy, and must never render "configured". --- .../automations/AutomationsPage.dom.test.tsx | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx b/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx index e7546281e2..3c3424e879 100644 --- a/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx +++ b/dashboard/src/workspaces/automations/AutomationsPage.dom.test.tsx @@ -46,6 +46,35 @@ describe("AutomationsPage scheduler bay", () => { expect(within(bay).getByText(/no scheduler-triggered run is recorded for any task/)).toBeTruthy(); }); + it("prints a reset-blocked scheduler with its census and remedy, never configured", async () => { + stubAutomation({ + status: scheduler({ + status: "blocked_reset_required", + reset_required_stores: [ + { + store: "profile sessions", + authority: "git correlation", + found_version: 5, + required_version: 6, + reason: "git correlation profile schema 5 is incompatible with required schema 6", + remedy: "tracedecay wipe --stale --yes", + }, + ], + tasks: [], + }), + }); + renderAutomations(); + const bay = await settledRegion("Scheduler status"); + expect(within(bay).getByText("reset required")).toBeTruthy(); + expect(within(bay).queryByText("configured")).toBeNull(); + expect( + within(bay).getByText( + /profile sessions \(git correlation\) requires reset: git correlation profile schema 5 is incompatible with required schema 6/, + ), + ).toBeTruthy(); + expect(within(bay).getByText(/tracedecay wipe --stale --yes/)).toBeTruthy(); + }); + it("prints each scheduler task with its due flag, skip reason and last run", async () => { stubAutomation(); renderAutomations(); @@ -392,13 +421,20 @@ function renderAutomations() { const NOW = 1_754_000_000; -function scheduler(overrides: { paused?: boolean; status?: string; tasks?: unknown[] } = {}) { +function scheduler( + overrides: { + paused?: boolean; + status?: string; + tasks?: unknown[]; + reset_required_stores?: unknown[]; + } = {}, +) { return { status: overrides.status ?? "configured", paused: overrides.paused ?? false, enabled: true, scheduler_tick_secs: 900, - reset_required_stores: [], + reset_required_stores: overrides.reset_required_stores ?? [], now: NOW, last_session_activity: NOW - 1200, configuration_revision_id: "configuration.revision.automation.test", From 5ea4ee26b09da26c405d18d3e15d58fa61a42015 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:27:11 -0800 Subject: [PATCH 40/63] fix(global-db): retry a failed workflow upgrade in its own task A held lock or full disk rolled the background upgrade back and left workflow storage recovering until the daemon restarted: schedule() runs a store's task once, and a mounted store is not reopened, so 1dba4d971e's "next open retries" did not hold for a store that stayed mounted. The store's one convergence task now tries again while its authority is still recovering, about once a minute. It keeps the foreground-open gate, the single convergence permit, and abort on retire and shutdown, and between attempts it holds no permit and only the weak lease issuer, so a waiting store cannot block its owner's retirement. No periodic owner fits: the maintenance tick is hours apart and does not run at all with retention disabled. A store mounted again over a failed upgrade replaces the old worker, which could only find its owner gone. A refusal stays the typed reset; shutdown stops the retries. workflow_storage_problem no longer erases recovering to workflow.unavailable: workflow tools, work retry rebinding, and fan-out recovery answer the retryable workflow.authority_recovering. No wire shape changes. A production-composition journey proves it over a real SQLite write lock and the MCP server: code search serves and workflow tools answer the typed problem while the attempt is parked and after the lock fails it, then the attempt after the lock clears commits on the same mount with every row intact. With the retry disabled this journey fails. SQLITE_FULL is proven as an injected fault at every upgrade step, not a real full disk: the SQLite guard refuses max_page_count, and it stays in place. Co-Authored-By: Claude Opus 5.5 --- .../src/invocation/work/attempt_operations.rs | 6 +- .../work/workflow_effect_journal.rs | 38 ++- .../work/workflow_fan_out/recovery.rs | 3 +- .../invocation/work/workflow_run_control.rs | 9 + crates/tracedecay-global-db/src/registered.rs | 15 +- .../src/registered/workflow_schema_tests.rs | 88 +++--- .../tracedecay-global-db/src/schema_stages.rs | 3 +- .../workflow_artifact_ceiling_upgrade.rs | 5 +- crates/tracedecay-mcp/src/tool_errors.rs | 16 ++ .../src/session_registry/maintenance.rs | 272 +++++++++++++----- .../src/daemon/production_harness.rs | 3 + .../project_server_capacity_journey_test.rs | 4 +- ...ublished_workflow_recovery_journey_test.rs | 258 +++++++++++++++++ .../src/daemon/store_runtime_tests.rs | 182 +++++++++++- 14 files changed, 770 insertions(+), 132 deletions(-) create mode 100644 crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs diff --git a/crates/tracedecay-daemon-service/src/invocation/work/attempt_operations.rs b/crates/tracedecay-daemon-service/src/invocation/work/attempt_operations.rs index b6a6adf0c4..d26d712fa8 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work/attempt_operations.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work/attempt_operations.rs @@ -21,6 +21,7 @@ use tracedecay_daemon_protocol::{DaemonInvocationResponse, WorkApplicationOutcom use super::super::work_attempt_exec::{WorkAttemptProcessRegistryV1, spawn_attempt_execution}; use super::preparation; +use super::workflow_run_control::workflow_authority_recovering; use super::{ RegisteredWorkRuntime, complete_work_effect, complete_work_read, reconcile_active_workflow_fan_out, work_product_problem, @@ -404,7 +405,10 @@ async fn workflow_retry_rebind( ®istered.database, ) .await - .map_err(|_| { + .map_err(|error| { + if error.is_workflow_authority_recovering() { + return workflow_authority_recovering(); + } ApplicationProblem::unavailable(SafeDiagnostic { code: "application.work-retry.workflow-authority-unavailable".to_owned(), message: "The workflow retry binding authority is unavailable.".to_owned(), diff --git a/crates/tracedecay-daemon-service/src/invocation/work/workflow_effect_journal.rs b/crates/tracedecay-daemon-service/src/invocation/work/workflow_effect_journal.rs index 8a76be642b..739ab9af96 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work/workflow_effect_journal.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work/workflow_effect_journal.rs @@ -22,8 +22,9 @@ use tracedecay_daemon_protocol::{ use tracedecay_domain::errors::TraceDecayError; use super::workflow_run_control::{ - workflow_coordination_problem, workflow_final_conflict, workflow_invalid_request, - workflow_not_found, workflow_reset_required, workflow_runtime_unavailable, + workflow_authority_recovering, workflow_coordination_problem, workflow_final_conflict, + workflow_invalid_request, workflow_not_found, workflow_reset_required, + workflow_runtime_unavailable, }; use super::{RegisteredWorkRuntime, work_command_effect, work_effect, work_evidence_packet}; use tracedecay_contracts::now_micros; @@ -373,6 +374,7 @@ pub(super) fn workflow_storage_problem(error: &TraceDecayError) -> ApplicationPr { workflow_reset_required() } + error if error.is_workflow_authority_recovering() => workflow_authority_recovering(), _ => workflow_runtime_unavailable(), } } @@ -583,3 +585,35 @@ pub(super) fn task_handoff_refusal(error: TaskHandoffError) -> ApplicationProble TaskHandoffError::Replay => handoff_replayed(), } } + +#[cfg(test)] +mod storage_problem_tests { + use tracedecay_contracts::{ApplicationProblem, RetryDirective}; + use tracedecay_domain::errors::TraceDecayError; + + use super::workflow_storage_problem; + + #[test] + fn workflow_recovery_keeps_its_own_retryable_problem() { + let problem = workflow_storage_problem(&TraceDecayError::workflow_authority_recovering()); + let ApplicationProblem::Unavailable { + diagnostic, retry, .. + } = problem + else { + panic!("recovering must stay unavailable: {problem:?}"); + }; + assert_eq!(diagnostic.code, "workflow.authority_recovering"); + assert_eq!(retry, RetryDirective::AfterDelay); + } + + #[test] + fn other_storage_failures_keep_their_problems() { + let unrelated = TraceDecayError::project_route("another_route_refusal", true, "detail"); + let ApplicationProblem::Unavailable { diagnostic, .. } = + workflow_storage_problem(&unrelated) + else { + panic!("an unrelated failure stays unavailable"); + }; + assert_eq!(diagnostic.code, "workflow.unavailable"); + } +} diff --git a/crates/tracedecay-daemon-service/src/invocation/work/workflow_fan_out/recovery.rs b/crates/tracedecay-daemon-service/src/invocation/work/workflow_fan_out/recovery.rs index 8d2010cf47..ae6cbb57fa 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work/workflow_fan_out/recovery.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work/workflow_fan_out/recovery.rs @@ -9,6 +9,7 @@ use tracedecay_contracts::{ }; use tracedecay_domain::UtcMicros; +use super::super::workflow_effect_journal::workflow_storage_problem; use super::super::workflow_run_control::{ workflow_run_storage_problem, workflow_runtime_unavailable, }; @@ -61,7 +62,7 @@ async fn reconcile_active_workflow_fan_out_page( ®istered.database, ) .await - .map_err(|_| workflow_runtime_unavailable())?; + .map_err(|error| workflow_storage_problem(&error))?; let registered_authority = tracedecay_domain::WorkAuthority::new( registered.grant.scope.project_id.clone(), registered.grant.scope.repository_id.clone(), diff --git a/crates/tracedecay-daemon-service/src/invocation/work/workflow_run_control.rs b/crates/tracedecay-daemon-service/src/invocation/work/workflow_run_control.rs index e05d060bda..d54fae538a 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work/workflow_run_control.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work/workflow_run_control.rs @@ -385,6 +385,15 @@ pub(super) fn workflow_runtime_unavailable() -> ApplicationProblem { }) } +/// Workflow storage waits on the store's background upgrade: the same request +/// succeeds once it commits, with no operator action. +pub(super) fn workflow_authority_recovering() -> ApplicationProblem { + ApplicationProblem::unavailable(SafeDiagnostic { + code: "workflow.authority_recovering".to_owned(), + message: "Workflow storage is upgrading in the background; retry shortly".to_owned(), + }) +} + pub(super) fn workflow_invalid_request() -> ApplicationProblem { ApplicationProblem::invalid_request( "workflow.invalid_request", diff --git a/crates/tracedecay-global-db/src/registered.rs b/crates/tracedecay-global-db/src/registered.rs index 56f42ab1c2..4402e809fb 100644 --- a/crates/tracedecay-global-db/src/registered.rs +++ b/crates/tracedecay-global-db/src/registered.rs @@ -492,9 +492,10 @@ impl RegisteredGlobalDb { } /// Settles the store's session authority on the background upgrade's - /// outcome. A failure that can clear keeps workflow storage recovering, and - /// the next open of the store retries; a store that refuses the upgrade is - /// held in its typed reset state like one refused at attach. Workflow + /// outcome. A failure that can clear rolls back and keeps workflow storage + /// recovering, and the convergence task runs this again; a store that + /// refuses the upgrade is held in its typed reset state like one refused at + /// attach. Workflow /// storage serves from the commit on, so the reclaim that follows delays /// nothing. async fn recover_published_workflow_shape( @@ -586,6 +587,12 @@ impl RegisteredGlobalDb { self.session_authority.reset_required() } + /// Whether workflow storage still waits on the background upgrade. + #[must_use] + pub fn workflow_recovery_pending(&self) -> bool { + self.session_authority.current() == SessionAuthorityV1::RecoveringWorkflow + } + /// Wraps an already-published guarded database for WAL maintenance tests. /// /// The exclusive-maintenance truncation lane cannot be exercised through @@ -846,7 +853,7 @@ impl RegisteredGlobalDb { ) -> tracedecay_domain::errors::Result< tracedecay_rusqlite_runtime::workflow::WorkflowSqliteAuthority, > { - if self.session_authority.current() == SessionAuthorityV1::RecoveringWorkflow { + if self.workflow_recovery_pending() { return Err(TraceDecayError::workflow_authority_recovering()); } self.database.workflow_storage().await diff --git a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs index d22f109545..3dd339b74f 100644 --- a/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs +++ b/crates/tracedecay-global-db/src/registered/workflow_schema_tests.rs @@ -1013,7 +1013,6 @@ mod published_artifact_ceiling { let mut upgrade = Box::pin(upgrade_published_artifact_ceiling(©ing)); drive_until(&mut upgrade, || copying.seen() >= 2).await; drop(upgrade); - drop(copying); drop(transaction); assert_eq!(store.state(), before, "a dropped upgrade left a trace"); @@ -1080,7 +1079,6 @@ mod published_artifact_ceiling { assert!(upgrade.as_mut().await.unwrap().is_none()); drop(upgrade); - drop(copying); transaction.commit().await.unwrap(); assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); @@ -1112,8 +1110,7 @@ mod published_artifact_ceiling { let refused = lease .converge_schema(convergence, &CancellationToken::new()) .await - .err() - .expect("the store changed under its plan"); + .expect_err("the store changed under its plan"); assert!(refused.is_store_reset_required(), "{refused}"); assert!(assert_workflow_refusal(lease.reset_required()).contains("1 other schema object")); assert!(assert_workflow_refusal(owner.reset_required()).contains("1 other schema object")); @@ -1122,7 +1119,7 @@ mod published_artifact_ceiling { } /// A failure that can clear says nothing about the store: workflow storage - /// stays recovering, nothing changed, and the next open finishes. + /// stays recovering, nothing changed, and the next attempt finishes. #[asupersync::test(flavor = "multi_thread")] async fn held_lock_at_convergence_keeps_the_store_recovering() { let daemon_store = DaemonPublishedStore::create().await; @@ -1136,26 +1133,27 @@ mod published_artifact_ceiling { let error = lease .converge_schema(convergence, &CancellationToken::new()) .await - .err() - .expect("the write lock is held"); + .expect_err("the write lock is held"); assert!(!error.is_store_reset_required(), "{error}"); assert!(lease.reset_required().is_none()); assert_workflow_recovering(&lease).await; peer.execute_batch("ROLLBACK").unwrap(); drop(peer); assert_eq!(store.state(), before); - drop((lease, owner, held)); - let (owner, convergence, _held) = admit_for_daemon(&store.path).await; - owner - .issue_lease() - .unwrap() + lease .converge_schema(convergence, &CancellationToken::new()) .await .unwrap(); assert_eq!(store.state().digest, WORKFLOW_SCHEMA_DEFINITION_DIGEST_V1); + assert_eq!(store.state().artifacts, before.artifacts); + lease.workflow_storage().await.unwrap(); + drop((lease, owner, held)); } + /// `SQLITE_FULL`, which the guarded writer cannot be made to raise here. + const SQLITE_FULL: i32 = 13; + /// Rows spread over several copy batches, with rowid gaps and a negative /// rowid a batch cursor starting at zero would lose. const BULK_ROWS: &str = " @@ -1292,7 +1290,8 @@ mod published_artifact_ceiling { /// A step failing anywhere in the upgrade, including between copy batches /// and in the final proof, restores everything once the admission /// transaction rolls back. A refused statement is the store's typed reset; - /// a held database is not, so a passing condition never asks for one. + /// a held database or a full disk is not, so a passing condition never asks + /// for one. #[asupersync::test(flavor = "multi_thread")] async fn failure_at_any_upgrade_step_rolls_back_with_the_right_typed_state() { let daemon_store = DaemonPublishedStore::create().await; @@ -1303,32 +1302,43 @@ mod published_artifact_ceiling { publish_daemon_runtime(&store.path).await.into_parts(); let lease = database.issue_lease().unwrap(); - for (needle, occurrence) in [ - ("ALTER TABLE", 1), - ("CREATE TABLE workflow_artifact_payloads", 1), - ("INSERT INTO workflow_artifact_payloads", 1), - ("INSERT INTO workflow_artifact_payloads", 3), - ("DROP TABLE", 1), - ("UPDATE workflow_schema", 1), - ("table_info", 1), - ] { - let transaction = lease.begin_bulk_write_transaction("fault").await.unwrap(); - let busy = upgrade_published_artifact_ceiling(&FailingStatement::new( - &transaction, - needle, - occurrence, - || engine::Error::Busy, - )) - .await - .err() - .unwrap_or_else(|| panic!("{needle}#{occurrence} must fail the upgrade")); - assert!(!busy.is_store_reset_required(), "{needle}: {busy}"); - transaction.rollback().await.unwrap(); - assert_eq!( - store.state(), - before, - "{needle}#{occurrence} was not undone" - ); + let transient: [fn() -> engine::Error; 2] = [ + || engine::Error::Busy, + || engine::Error::Sqlite { + operation: "step", + code: Some(SQLITE_FULL), + extended_code: Some(SQLITE_FULL), + message: "database or disk is full".to_owned(), + }, + ]; + for fault in transient { + for (needle, occurrence) in [ + ("ALTER TABLE", 1), + ("CREATE TABLE workflow_artifact_payloads", 1), + ("INSERT INTO workflow_artifact_payloads", 1), + ("INSERT INTO workflow_artifact_payloads", 3), + ("DROP TABLE", 1), + ("UPDATE workflow_schema", 1), + ("table_info", 1), + ] { + let transaction = lease.begin_bulk_write_transaction("fault").await.unwrap(); + let failed = upgrade_published_artifact_ceiling(&FailingStatement::new( + &transaction, + needle, + occurrence, + fault, + )) + .await + .err() + .unwrap_or_else(|| panic!("{needle}#{occurrence} must fail the upgrade")); + assert!(!failed.is_store_reset_required(), "{needle}: {failed}"); + transaction.rollback().await.unwrap(); + assert_eq!( + store.state(), + before, + "{needle}#{occurrence} was not undone" + ); + } } for (needle, occurrence) in [ diff --git a/crates/tracedecay-global-db/src/schema_stages.rs b/crates/tracedecay-global-db/src/schema_stages.rs index b40654635e..63e7e42226 100644 --- a/crates/tracedecay-global-db/src/schema_stages.rs +++ b/crates/tracedecay-global-db/src/schema_stages.rs @@ -406,7 +406,8 @@ pub struct RegisteredSchemaConvergence { impl RegisteredSchemaConvergence { /// Whether this store's workflow tables still carry the one published /// shape, which convergence upgrades before anything else. - pub(crate) fn recovers_published_workflow_shape(self) -> bool { + #[must_use] + pub fn recovers_published_workflow_shape(self) -> bool { self.recovers_published_workflow_shape } } diff --git a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs index 589faab2d3..135b3d078a 100644 --- a/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs +++ b/crates/tracedecay-global-db/src/schema_stages/workflow_artifact_ceiling_upgrade.rs @@ -469,8 +469,9 @@ fn is_store_refusal(error: &engine::Error) -> bool { /// A failure that will recur on every open means this store cannot take the /// upgrade, which is the store's typed refusal. One that can clear by itself, -/// such as a held lock or a full disk, stays an operation failure the next -/// open retries, so a passing condition never tells an operator to reset. +/// such as a held lock or a full disk, stays an operation failure the store's +/// convergence task retries, so a passing condition never tells an operator to +/// reset. fn upgrade_step_error(step: &'static str, error: engine::Error) -> TraceDecayError { if is_store_refusal(&error) { upgrade_refusal(&format!("the store refused the step to {step}")) diff --git a/crates/tracedecay-mcp/src/tool_errors.rs b/crates/tracedecay-mcp/src/tool_errors.rs index ef9ba9b010..407ea6c6ca 100644 --- a/crates/tracedecay-mcp/src/tool_errors.rs +++ b/crates/tracedecay-mcp/src/tool_errors.rs @@ -574,6 +574,22 @@ mod tests { ); } + #[test] + fn workflow_recovery_is_a_retryable_unavailable_problem_on_the_wire() { + let response = tool_error_response( + json!(7), + "tracedecay_workflow_list_definitions", + &TraceDecayError::workflow_authority_recovering(), + ); + let wire = serde_json::to_value(response).expect("JSON-RPC wire response"); + let data = &wire["error"]["data"]; + + assert_eq!(data["kind"], "unavailable"); + assert_eq!(data["code"], "workflow_authority_recovering"); + assert_eq!(data["retryable"], true); + assert_eq!(data["tool"], "tracedecay_workflow_list_definitions"); + } + #[test] fn project_route_parked_detail_stays_structured_on_the_wire() { let response = tool_error_response( diff --git a/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs b/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs index 742458cd42..cb6c102fe3 100644 --- a/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs +++ b/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs @@ -4,6 +4,7 @@ use std::path::Path; use std::pin::Pin; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::{Arc, Mutex as StdMutex, MutexGuard}; +use std::time::{Duration, Instant}; #[cfg(any(test, feature = "test-helpers"))] use tokio::sync::Notify; @@ -15,6 +16,7 @@ use tracedecay_domain::errors::{ DAEMON_RESTART_COMMAND, PROFILE_RESET_COMMAND, ResettableStoreV1, STALE_STORE_RESET_COMMAND, StoreResetRequiredV1, TraceDecayError, }; +use tracedecay_global_db::RegisteredGlobalDbWeakLeaseIssuerV1; use tracedecay_global_db::schema_stages::RegisteredSchemaConvergence; use tracedecay_runtime_core::cancellation::CancellationToken; use tracedecay_runtime_core::native_runtime::{self, NativeTask}; @@ -43,6 +45,13 @@ type RegisteredSchemaConvergenceMetadata = BTreeMap; pub(super) type ResetRequiredStores = StdMutex>; +/// How long a store whose published workflow upgrade failed waits before its +/// convergence task tries again, the delay the daemon's maintenance loop gives +/// a failed tick. An attempt can hold the store's writer for the whole copy, so +/// this bounds that cost on a store that keeps failing to about one attempt a +/// minute. Nothing signals that a full disk or a held lock has cleared. +const WORKFLOW_RECOVERY_RETRY_DELAY: Duration = Duration::from_mins(1); + fn lock_registered_schema_convergence_statuses( statuses: &StdMutex, ) -> MutexGuard<'_, RegisteredSchemaConvergenceStatuses> { @@ -123,6 +132,32 @@ impl SchemaConvergenceTarget { Self::Registered { database, .. } => database.reset_required(), } } + + /// Whether a failed attempt left the store's workflow storage waiting on + /// another one. A store that refused is held in its reset state instead, + /// and shutdown ends the wait with the daemon. + fn awaits_workflow_recovery(&self) -> bool { + match self { + Self::Registered { + database, + cancellation, + .. + } => database.workflow_recovery_pending() && !cancellation.is_cancelled(), + } + } + + /// The next attempt's target, or `None` once the store's owner is gone. + fn reissued( + issuer: &RegisteredGlobalDbWeakLeaseIssuerV1, + convergence: RegisteredSchemaConvergence, + cancellation: &CancellationToken, + ) -> Option { + issuer.issue_lease().ok().map(|database| Self::Registered { + database, + convergence, + cancellation: cancellation.clone(), + }) + } } #[derive(Default)] @@ -274,6 +309,7 @@ impl RegisteredSchemaConvergenceMaintenance { pub(super) fn schedule( &self, database: RegisteredGlobalDbLeaseV1, + retry_issuer: RegisteredGlobalDbWeakLeaseIssuerV1, convergence: Option, cancellation: CancellationToken, reset_required_stores: Arc, @@ -281,12 +317,16 @@ impl RegisteredSchemaConvergenceMaintenance { let Some(convergence) = convergence else { return; }; + let target = SchemaConvergenceTarget::Registered { + database, + convergence, + cancellation: cancellation.clone(), + }; self.schedule_target( - SchemaConvergenceTarget::Registered { - database, - convergence, - cancellation, - }, + target, + retry_issuer, + convergence, + cancellation, reset_required_stores, ); } @@ -294,6 +334,9 @@ impl RegisteredSchemaConvergenceMaintenance { fn schedule_target( &self, target: SchemaConvergenceTarget, + retry_issuer: RegisteredGlobalDbWeakLeaseIssuerV1, + convergence: RegisteredSchemaConvergence, + cancellation: CancellationToken, reset_required_stores: Arc, ) { let shard_id = target.binding().shard_id.clone(); @@ -311,8 +354,19 @@ impl RegisteredSchemaConvergenceMaintenance { .unwrap_or_else(std::sync::PoisonError::into_inner); { let mut statuses = lock_registered_schema_convergence_statuses(&self.statuses); - if statuses.contains_key(&shard_id) { - return; + match statuses.get(&shard_id) { + // An attempt holds its store's owner open, so a store mounted + // again over a failed upgrade has a new owner. The old worker + // can only find its own owner gone; this owner needs its own. + Some(RegisteredSchemaConvergenceStatus::Degraded { .. }) + if convergence.recovers_published_workflow_shape() => + { + if let Some(superseded) = tasks.remove(&shard_id) { + superseded.abort(); + } + } + Some(_) => return, + None => {} } metadata.insert( shard_id.clone(), @@ -337,88 +391,128 @@ impl RegisteredSchemaConvergenceMaintenance { let task_shard_id = shard_id.clone(); // Erase the worker state machine before instrumentation retains it. let work: Pin + Send>> = Box::pin(async move { - foreground_project_opens.wait_until_settled().await; - let permit = match concurrency.acquire_owned().await { - Ok(permit) => permit, - Err(error) => { - drop(target); - lock_registered_schema_convergence_statuses(&statuses).insert( - task_shard_id, - RegisteredSchemaConvergenceStatus::Degraded { - message: format!( - "registered schema convergence admission closed: {error}" - ), - }, - ); - return; - } - }; - lock_registered_schema_convergence_statuses(&statuses).insert( - task_shard_id.clone(), - RegisteredSchemaConvergenceStatus::Running, - ); + let mut target = target; #[cfg(any(test, feature = "test-helpers"))] - execution_count.fetch_add(1, Ordering::Relaxed); - #[cfg(any(test, feature = "test-helpers"))] - if let Some(gate) = gate { - gate.block().await; - } - let convergence: Pin> + Send + '_>> = - Box::pin(target.converge()); - let result = convergence.await; - if let Err(error) = target.release_connection_memory().await { - crate::session_registry::log_store_runtime_event( - "registered_schema_convergence_memory_release", - &[ - ("outcome", "degraded".to_owned()), - ("database", target.db_path().display().to_string()), - ("shard", format!("{task_shard_id:?}")), - ("error", error.to_string()), - ], + let mut first_attempt_gate = gate.clone(); + loop { + foreground_project_opens.wait_until_settled().await; + let permit = match Arc::clone(&concurrency).acquire_owned().await { + Ok(permit) => permit, + Err(error) => { + drop(target); + lock_registered_schema_convergence_statuses(&statuses).insert( + task_shard_id, + RegisteredSchemaConvergenceStatus::Degraded { + message: format!( + "registered schema convergence admission closed: {error}" + ), + }, + ); + return; + } + }; + lock_registered_schema_convergence_statuses(&statuses).insert( + task_shard_id.clone(), + RegisteredSchemaConvergenceStatus::Running, ); - } - // `malloc_trim` walks every glibc arena: up to 0.8 s of CPU on a - // large heap, which would stall this native worker's I/O. - let _ = native_runtime::spawn_blocking(release_process_allocator_memory_v1).await; - drop(permit); - let status = match result { - Ok(()) => { + #[cfg(any(test, feature = "test-helpers"))] + execution_count.fetch_add(1, Ordering::Relaxed); + #[cfg(any(test, feature = "test-helpers"))] + if let Some(gate) = first_attempt_gate.take() { + gate.block().await; + } + let convergence_pass: Pin> + Send + '_>> = + Box::pin(target.converge()); + let result = convergence_pass.await; + if let Err(error) = target.release_connection_memory().await { crate::session_registry::log_store_runtime_event( - "registered_schema_convergence", + "registered_schema_convergence_memory_release", &[ - ("outcome", "complete".to_owned()), + ("outcome", "degraded".to_owned()), ("database", target.db_path().display().to_string()), ("shard", format!("{task_shard_id:?}")), + ("error", error.to_string()), ], ); - RegisteredSchemaConvergenceStatus::Complete } - Err(error) => { - // Convergence can find a store it cannot take after the - // store was admitted, and that store is then held like one - // refused at attach. - if let Some(refused) = target.reset_required() { - record_registered_reset_required( - &reset_required_stores, - task_shard_id.clone(), - Some(&refused), + // `malloc_trim` walks every glibc arena: up to 0.8 s of CPU on a + // large heap, which would stall this native worker's I/O. + let _ = native_runtime::spawn_blocking(release_process_allocator_memory_v1).await; + drop(permit); + let mut retry = false; + let status = match result { + Ok(()) => { + crate::session_registry::log_store_runtime_event( + "registered_schema_convergence", + &[ + ("outcome", "complete".to_owned()), + ("database", target.db_path().display().to_string()), + ("shard", format!("{task_shard_id:?}")), + ], ); + RegisteredSchemaConvergenceStatus::Complete } - let message = error.to_string(); - crate::session_registry::log_store_runtime_event( - "registered_schema_convergence", - &[ - ("outcome", "degraded".to_owned()), - ("database", target.db_path().display().to_string()), - ("shard", format!("{task_shard_id:?}")), - ("error", message.clone()), - ], + Err(error) => { + // Convergence can find a store it cannot take after the + // store was admitted, and that store is then held like one + // refused at attach. + if let Some(refused) = target.reset_required() { + record_registered_reset_required( + &reset_required_stores, + task_shard_id.clone(), + Some(&refused), + ); + } + retry = target.awaits_workflow_recovery(); + let message = if retry { + format!("{error}; retrying the workflow upgrade in the background") + } else { + error.to_string() + }; + crate::session_registry::log_store_runtime_event( + "registered_schema_convergence", + &[ + ("outcome", "degraded".to_owned()), + ("database", target.db_path().display().to_string()), + ("shard", format!("{task_shard_id:?}")), + ("error", message.clone()), + ], + ); + RegisteredSchemaConvergenceStatus::Degraded { message } + } + }; + // Between attempts the task holds only the weak issuer, so a + // store waiting out a full disk never blocks its owner's + // retirement. + drop(target); + lock_registered_schema_convergence_statuses(&statuses) + .insert(task_shard_id.clone(), status); + if !retry { + return; + } + #[cfg(any(test, feature = "test-helpers"))] + let delay = match &gate { + Some(gate) => gate.pace_retry().await, + None => WORKFLOW_RECOVERY_RETRY_DELAY, + }; + #[cfg(not(any(test, feature = "test-helpers")))] + let delay = WORKFLOW_RECOVERY_RETRY_DELAY; + // Retirement and shutdown abort this wait with the task. + if let Err(error) = native_runtime::sleep_until(Instant::now() + delay).await { + // Without a timer every wait would return at once and spin. + tracing::error!( + event = "registered_schema_convergence_timer_unavailable", + %error ); - RegisteredSchemaConvergenceStatus::Degraded { message } + return; } - }; - drop(target); - lock_registered_schema_convergence_statuses(&statuses).insert(task_shard_id, status); + let Some(next) = + SchemaConvergenceTarget::reissued(&retry_issuer, convergence, &cancellation) + else { + return; + }; + target = next; + } }); match NativeTask::spawn(tracing::Instrument::instrument( work, @@ -520,6 +614,7 @@ impl RegisteredSchemaConvergenceMaintenance { started: AtomicBool::new(false), started_notify: Notify::new(), release: Semaphore::new(0), + retry_timer: StdMutex::new(None), }); *self .gate @@ -548,6 +643,7 @@ pub(super) struct RegisteredSchemaConvergenceTestGateState { started: AtomicBool, started_notify: Notify, release: Semaphore, + retry_timer: StdMutex>, } #[cfg(any(test, feature = "test-helpers"))] @@ -561,6 +657,20 @@ impl RegisteredSchemaConvergenceTestGateState { .expect("registered schema convergence test gate remains open") .forget(); } + + /// The first attempt parks at the gate. A retry parks here instead, with + /// its failure still on display, unless the test put retries on a timer. + async fn pace_retry(&self) -> Duration { + let timer = *self + .retry_timer + .lock() + .expect("registered schema convergence retry timer lock remains healthy"); + if let Some(delay) = timer { + return delay; + } + self.block().await; + Duration::ZERO + } } #[cfg(any(test, feature = "test-helpers"))] @@ -583,6 +693,15 @@ impl RegisteredSchemaConvergenceTestGate { pub fn release(&self) { self.state.release.add_permits(1); } + + /// Retries wait out `delay` as production does, instead of `release`. + pub fn retry_on_timer(&self, delay: Duration) { + *self + .state + .retry_timer + .lock() + .expect("registered schema convergence retry timer lock remains healthy") = Some(delay); + } } fn record_registered_reset_required( @@ -798,6 +917,7 @@ impl DaemonSessionRuntimeRegistryV1 { })?; self.registered_schema_convergence.schedule( lease, + database.weak_lease_issuer(), convergence, self.registry.open_cancellation().clone(), Arc::clone(&self.reset_required_stores), diff --git a/crates/tracedecay/src/daemon/production_harness.rs b/crates/tracedecay/src/daemon/production_harness.rs index 83b0e6dc95..bc20b8dd55 100644 --- a/crates/tracedecay/src/daemon/production_harness.rs +++ b/crates/tracedecay/src/daemon/production_harness.rs @@ -1949,3 +1949,6 @@ mod unknown_node_id_readiness_journey_test; #[cfg(test)] mod drop_shutdown_journey_test; + +#[cfg(test)] +mod published_workflow_recovery_journey_test; diff --git a/crates/tracedecay/src/daemon/production_harness/project_server_capacity_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/project_server_capacity_journey_test.rs index 321a6832b1..1feffacc32 100644 --- a/crates/tracedecay/src/daemon/production_harness/project_server_capacity_journey_test.rs +++ b/crates/tracedecay/src/daemon/production_harness/project_server_capacity_journey_test.rs @@ -80,7 +80,7 @@ async fn open_project_composition( /// projection and never replays its partitions to seat a second copy, so the /// probe is asserted here on the publishing open and the caller proves the /// reopen serves that same generation by its id. -async fn open_project( +pub(super) async fn open_project( harness: &ProductionProjectCompositionHarnessV1, project: &Path, instance: &str, @@ -130,7 +130,7 @@ async fn open_project( Ok((composition, serving)) } -async fn seed_project_sessions_pending_convergence( +pub(super) async fn seed_project_sessions_pending_convergence( profile_root: &Path, project_root: &Path, project_id: &tracedecay_domain::ProjectId, diff --git a/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs new file mode 100644 index 0000000000..e86234f767 --- /dev/null +++ b/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs @@ -0,0 +1,258 @@ +//! A store left in the published workflow shape, through the production +//! composition and its MCP server: code reads serve while the background +//! upgrade is parked and while a held write lock fails it, workflow tools answer +//! the typed retryable problem throughout, and the store's own convergence task +//! finishes the move once the obstruction clears, with no reopen or restart. +//! +//! The test gate parks each attempt rather than timing around it, and the store +//! is held with a real `SQLite` write lock. + +use std::path::Path; +use std::time::Duration; + +use serde_json::{Value, json}; +use tempfile::TempDir; +use tracedecay_mcp::{JsonRpcRequest, JsonRpcResponse}; +use tracedecay_store::StoreShardIdV1; +use tracedecay_store_runtime::{ + DaemonSessionRuntimeRegistryV1, RegisteredSchemaConvergenceStatus, + RegisteredSchemaConvergenceTestGate, +}; + +use super::project_server_capacity_journey_test::{ + open_project, seed_project_sessions_pending_convergence, +}; +use crate::daemon::production_harness::ProductionProjectCompositionHarnessV1; +use crate::daemon::project_composition::ProductionProjectComposition; +use crate::daemon::store_runtime_tests::{ + PUBLISHED_WORKFLOW_DIGEST, age_session_store_to_published_workflow_shape, + published_workflow_state, +}; +use crate::test_support::git::git; + +const PROBE: &str = "published_workflow_recovery_probe"; +const STATE_DEADLINE: Duration = Duration::from_secs(90); + +fn committed_project(root: &Path) { + std::fs::create_dir_all(root.join("src")).expect("project source root"); + std::fs::write( + root.join("src/lib.rs"), + format!("pub fn {PROBE}() -> usize {{ 1 }}\n"), + ) + .expect("project source"); + git(root, &["init", "-q"]); + git(root, &["add", "."]); + git(root, &["config", "user.name", "TraceDecay Test"]); + git( + root, + &["config", "user.email", "tracedecay@example.invalid"], + ); + git(root, &["commit", "-qm", "seed project"]); +} + +async fn call( + composition: &ProductionProjectComposition, + tool: &str, + arguments: Value, +) -> JsonRpcResponse { + let request: JsonRpcRequest = serde_json::from_value(json!({ + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": {"name": tool, "arguments": arguments}, + })) + .expect("tool request"); + composition + .server + .handle_request(&request) + .await + .expect("tool response") +} + +/// Ordinary code retrieval finds the project's symbol whatever the upgrade's +/// state. +async fn assert_code_reads_serve(composition: &ProductionProjectComposition, state: &str) { + let response = call( + composition, + "tracedecay_search", + json!({"query": PROBE, "format": "json"}), + ) + .await; + assert!( + response.error.is_none(), + "code search must serve while {state}: {response:?}" + ); + let answer = serde_json::to_string(&response.result).expect("search result text"); + assert!( + answer.contains(PROBE), + "code search must find the symbol while {state}: {answer}" + ); +} + +/// A workflow tool's typed refusal, as an MCP client reads it. +async fn assert_workflow_tools_recovering(composition: &ProductionProjectComposition, state: &str) { + let response = call( + composition, + "tracedecay_workflow_list_definitions", + json!({"format": "json"}), + ) + .await; + let wire = serde_json::to_value(&response).expect("tool response wire"); + let problem = wire + .pointer("/result/structuredContent/problem") + .unwrap_or_else(|| panic!("no typed problem while {state}: {wire}")); + assert_eq!(problem["kind"], "unavailable", "{state}: {problem}"); + assert_eq!( + problem["code"], "workflow.authority_recovering", + "{state}: {problem}" + ); + assert_eq!(problem["retry"], "after_delay", "{state}: {problem}"); +} + +/// Releases every other shard's convergence past the gate until this store's +/// first attempt is the one parked there. One permit admits one shard at a time. +async fn park_first_attempt( + registry: &DaemonSessionRuntimeRegistryV1, + gate: &RegisteredSchemaConvergenceTestGate, + shard: &StoreShardIdV1, +) { + tokio::time::timeout(STATE_DEADLINE, async { + let mut released = 0; + loop { + if registry.registered_schema_convergence_status(shard) + == Some(RegisteredSchemaConvergenceStatus::Running) + { + return; + } + if registry.registered_schema_convergence_execution_count_for_test() > released { + gate.release(); + released += 1; + } + tokio::time::sleep(Duration::from_millis(10)).await; + } + }) + .await + .expect("the store's first attempt must reach the gate"); +} + +async fn wait_for_status( + registry: &DaemonSessionRuntimeRegistryV1, + shard: &StoreShardIdV1, + accepted: impl Fn(&RegisteredSchemaConvergenceStatus) -> bool, +) -> RegisteredSchemaConvergenceStatus { + tokio::time::timeout(STATE_DEADLINE, async { + loop { + if let Some(status) = registry.registered_schema_convergence_status(shard) + && accepted(&status) + { + return status; + } + tokio::time::sleep(Duration::from_millis(10)).await; + } + }) + .await + .expect("the store's upgrade must reach the expected state") +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn code_reads_serve_while_a_transient_lock_blocks_the_workflow_upgrade() { + let isolation = TempDir::new().expect("production harness isolation"); + let bootstrap_project = isolation.path().join("bootstrap-project"); + let target_project = isolation.path().join("target-project"); + committed_project(&bootstrap_project); + committed_project(&target_project); + let harness = ProductionProjectCompositionHarnessV1::open_with_session_maintenance_for_test( + isolation.path(), + std::iter::once(bootstrap_project), + ) + .await + .expect("production harness authority"); + + let project_id = tracedecay_domain::ProjectId::new("project.published-workflow-journey") + .expect("typed project identity"); + seed_project_sessions_pending_convergence(harness.profile_root(), &target_project, &project_id) + .await; + let sessions_path = tracedecay_runtime_core::storage::profile_sharded_data_root( + harness.profile_root(), + project_id.as_str(), + ) + .join(tracedecay_runtime_core::storage::SESSIONS_DB_FILENAME); + age_session_store_to_published_workflow_shape(&sessions_path); + let published = published_workflow_state(&sessions_path); + + let identity = + tracedecay_daemon_identity::profile_identity::load_or_create(harness.profile_root()) + .expect("durable harness profile identity"); + let shard = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id, + ); + let registry = harness + .resources + .as_ref() + .expect("production harness resources") + .store_administration + .session_runtime_registry() + .await + .expect("session runtime registry"); + let gate = registry.block_registered_schema_convergence_for_test(); + + let (composition, serving) = open_project(&harness, &target_project, "recovery", PROBE) + .await + .expect("a published store must not keep the project from opening"); + park_first_attempt(®istry, &gate, &shard).await; + + assert_code_reads_serve(&composition, "the upgrade is parked").await; + assert_workflow_tools_recovering(&composition, "the upgrade is parked").await; + assert_eq!(published_workflow_state(&sessions_path), published); + + let peer = rusqlite::Connection::open(&sessions_path).expect("open the session store"); + peer.execute_batch("BEGIN IMMEDIATE") + .expect("hold the write lock"); + gate.release(); + let status = wait_for_status(®istry, &shard, |status| { + matches!(status, RegisteredSchemaConvergenceStatus::Degraded { .. }) + }) + .await; + assert!( + matches!(&status, RegisteredSchemaConvergenceStatus::Degraded { message } + if message.contains("retrying")), + "{status:?}" + ); + + assert_code_reads_serve(&composition, "a held lock fails the upgrade").await; + assert_workflow_tools_recovering(&composition, "a held lock fails the upgrade").await; + assert!( + registry.reset_required_stores().is_empty(), + "a transient failure is not a reset" + ); + + peer.execute_batch("ROLLBACK").expect("drop the write lock"); + drop(peer); + assert_eq!(published_workflow_state(&sessions_path), published); + gate.release(); + wait_for_status(®istry, &shard, |status| { + *status == RegisteredSchemaConvergenceStatus::Complete + }) + .await; + + let response = call( + &composition, + "tracedecay_workflow_list_definitions", + json!({"format": "json"}), + ) + .await; + let wire = serde_json::to_value(&response).expect("tool response wire"); + assert!( + wire.pointer("/result/structuredContent/problem").is_none() && response.error.is_none(), + "workflow tools serve after the retry commits, over the same mount: {wire}" + ); + assert_code_reads_serve(&composition, "the upgrade has committed").await; + let (digest, rows) = published_workflow_state(&sessions_path); + assert_ne!(digest, PUBLISHED_WORKFLOW_DIGEST); + assert_eq!(rows, published.1); + + drop((composition, serving)); + harness.shutdown().await; +} diff --git a/crates/tracedecay/src/daemon/store_runtime_tests.rs b/crates/tracedecay/src/daemon/store_runtime_tests.rs index 31d276f5cf..7254457f96 100644 --- a/crates/tracedecay/src/daemon/store_runtime_tests.rs +++ b/crates/tracedecay/src/daemon/store_runtime_tests.rs @@ -182,6 +182,35 @@ async fn wait_for_schema_convergence( .expect("registered schema convergence must reach a terminal state") } +/// Bound on an attempt failing behind a held write lock, and on the attempt +/// after the lock clears committing. A failing attempt lasts the writer's whole +/// busy timeout. +const RECOVERY_OBSTRUCTION_DEADLINE: std::time::Duration = std::time::Duration::from_secs(90); + +/// [`wait_for_schema_convergence`] for an attempt that first has to outlast the +/// writer's busy timeout behind a held lock. +async fn wait_for_schema_convergence_past_obstruction( + registry: &DaemonSessionRuntimeRegistryV1, + shard_id: &StoreShardIdV1, +) -> RegisteredSchemaConvergenceStatus { + tokio::time::timeout(RECOVERY_OBSTRUCTION_DEADLINE, async { + loop { + if let Some(status) = registry.registered_schema_convergence_status(shard_id) + && !matches!( + status, + RegisteredSchemaConvergenceStatus::Pending + | RegisteredSchemaConvergenceStatus::Running + ) + { + return status; + } + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + }) + .await + .expect("the obstructed attempt must reach a terminal state") +} + /// The `SQLite` scalar one query returns, for the fixtures that assert on a /// single count or marker. async fn scalar_i64(connection: &(impl QueryExecutor + ?Sized), sql: &str) -> i64 { @@ -827,10 +856,10 @@ const PUBLISHED_WORKFLOW_ARTIFACT_TABLE_SQL: &str = "CREATE TABLE workflow_artif ), payload BLOB NOT NULL ) STRICT"; -const PUBLISHED_WORKFLOW_DIGEST: &str = +pub(crate) const PUBLISHED_WORKFLOW_DIGEST: &str = "sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be"; -fn age_session_store_to_published_workflow_shape(sessions_path: &std::path::Path) { +pub(crate) fn age_session_store_to_published_workflow_shape(sessions_path: &std::path::Path) { rusqlite::Connection::open(sessions_path) .expect("open the stopped session store") .execute_batch(&format!( @@ -843,7 +872,9 @@ fn age_session_store_to_published_workflow_shape(sessions_path: &std::path::Path } /// What an outside reader finds: the identity digest and the artifact rows. -fn published_workflow_state(sessions_path: &std::path::Path) -> (String, Vec<(String, Vec)>) { +pub(crate) fn published_workflow_state( + sessions_path: &std::path::Path, +) -> (String, Vec<(String, Vec)>) { let connection = rusqlite::Connection::open(sessions_path).expect("open the session store"); let digest = connection .query_row("SELECT definition_digest FROM workflow_schema", [], |row| { @@ -907,7 +938,10 @@ async fn published_workflow_shape_recovers_behind_a_serving_session_store() { 1, "concurrent admission must schedule the upgrade once" ); - assert!(registry.reset_required_stores().is_empty()); + assert!( + registry.reset_required_stores().is_empty(), + "a transient failure is not a reset" + ); let finding = registry .registered_schema_convergence_observations() .into_iter() @@ -950,6 +984,146 @@ async fn published_workflow_shape_recovers_behind_a_serving_session_store() { assert_eq!(rows, published.1); } +/// A peer holding the store's write lock fails the upgrade. Nothing reopens the +/// store: its one convergence task tries again until the lock clears, each +/// failed attempt rolled back and the store typed recovering rather than reset. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn published_workflow_recovery_outlasts_a_transient_lock_without_a_reopen() { + let (_temporary, identity, project_id, project_root, sessions_path, _database_scope) = + project_sessions_convergence_fixture("project.published-workflow-retry", false).await; + age_session_store_to_published_workflow_shape(&sessions_path); + let published = published_workflow_state(&sessions_path); + let shard_id = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id.clone(), + ); + let registry = DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity, true) + .await + .expect("session runtime registry"); + let convergence_gate = registry.block_registered_schema_convergence_for_test(); + let database = registry + .project_sessions(project_id, [project_root]) + .await + .expect("a published store admits"); + convergence_gate.wait_until_blocked().await; + let attempts_before = registry.registered_schema_convergence_execution_count_for_test(); + + let peer = rusqlite::Connection::open(&sessions_path).expect("open the session store"); + peer.execute_batch("BEGIN IMMEDIATE") + .expect("hold the write lock"); + convergence_gate.retry_on_timer(std::time::Duration::from_millis(20)); + convergence_gate.release(); + + tokio::time::timeout(RECOVERY_OBSTRUCTION_DEADLINE, async { + while registry.registered_schema_convergence_execution_count_for_test() + < attempts_before + 2 + { + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + }) + .await + .expect("a failed attempt must be followed by another one"); + assert_eq!( + registry.registered_schema_convergence_schedule_count_for_test(), + 1, + "retries belong to the one scheduled task" + ); + assert!( + registry.reset_required_stores().is_empty(), + "a transient failure is not a reset" + ); + let refused = database + .workflow_storage() + .await + .err() + .expect("nothing committed"); + assert!(refused.is_workflow_authority_recovering(), "{refused}"); + assert_eq!(published_workflow_state(&sessions_path), published); + + peer.execute_batch("ROLLBACK").expect("drop the write lock"); + drop(peer); + tokio::time::timeout(RECOVERY_OBSTRUCTION_DEADLINE, async { + while registry.registered_schema_convergence_status(&shard_id) + != Some(RegisteredSchemaConvergenceStatus::Complete) + { + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + }) + .await + .expect("the attempt after the lock clears must commit"); + database + .workflow_storage() + .await + .expect("a client issued before the failure serves after the retry commits"); + let (digest, rows) = published_workflow_state(&sessions_path); + assert_ne!(digest, PUBLISHED_WORKFLOW_DIGEST); + assert_eq!(rows, published.1); +} + +/// A store waiting for its next attempt holds no writer and no admission +/// permit, so shutdown ends the wait at once and the restart resumes the move. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn shutdown_ends_the_wait_between_published_workflow_attempts() { + let (_temporary, identity, project_id, project_root, sessions_path, _database_scope) = + project_sessions_convergence_fixture("project.published-workflow-retry-stop", false).await; + age_session_store_to_published_workflow_shape(&sessions_path); + let published = published_workflow_state(&sessions_path); + let shard_id = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id.clone(), + ); + let registry = DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity, true) + .await + .expect("session runtime registry"); + let convergence_gate = registry.block_registered_schema_convergence_for_test(); + let database = registry + .project_sessions(project_id, [project_root]) + .await + .expect("a published store admits"); + convergence_gate.wait_until_blocked().await; + + let peer = rusqlite::Connection::open(&sessions_path).expect("open the session store"); + peer.execute_batch("BEGIN IMMEDIATE") + .expect("hold the write lock"); + convergence_gate.release(); + let status = wait_for_schema_convergence_past_obstruction(®istry, &shard_id).await; + let RegisteredSchemaConvergenceStatus::Degraded { message } = status else { + panic!("the held lock must fail the attempt: {status:?}"); + }; + assert!(message.contains("retrying"), "{message}"); + peer.execute_batch("ROLLBACK").expect("drop the write lock"); + drop(peer); + let attempts = registry.registered_schema_convergence_execution_count_for_test(); + + registry.cancel_terminal_tasks(); + tokio::time::timeout( + MUST_NOT_BLOCK, + registry.shutdown_terminal_tasks(&tracedecay_runtime_core::native_runtime::cx().unwrap()), + ) + .await + .expect("shutdown must not wait out the delay between attempts") + .expect("session runtime terminal tasks shut down cleanly"); + convergence_gate.release(); + tokio::task::yield_now().await; + + assert_eq!( + registry.registered_schema_convergence_execution_count_for_test(), + attempts, + "a stopped daemon starts no further attempt" + ); + assert!( + database + .workflow_storage() + .await + .err() + .expect("nothing committed") + .is_workflow_authority_recovering() + ); + assert_eq!(published_workflow_state(&sessions_path), published); +} + /// Shutdown stops the upgrade before it commits, and a daemon restart over the /// same store recognizes it and finishes the move. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] From a2ba26eb3145dd41e1d0d80c78e3c70637ce6dfd Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:27:56 -0800 Subject: [PATCH 41/63] fix(dashboard): nest scheduler census store patterns --- crates/tracedecay/src/mcp/tools/handlers/dashboard.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs index 31572b000b..03bab76be6 100644 --- a/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs @@ -1096,8 +1096,8 @@ pub(super) async fn compute_dashboard( let project_id = cg.store_layout().identity.project_id.clone(); Arc::new(move || registry.reset_required_stores().into_iter().filter(|refusal| { match tracedecay_domain::errors::ResettableStoreV1::from_label(&refusal.store) { - Some(tracedecay_domain::errors::ResettableStoreV1::ProjectSessions { project_id: target }) - | Some(tracedecay_domain::errors::ResettableStoreV1::ProjectHookAdmissions { project_id: target }) => project_id.as_deref() == Some(target.as_str()), + Some(tracedecay_domain::errors::ResettableStoreV1::ProjectSessions { project_id: target } + | tracedecay_domain::errors::ResettableStoreV1::ProjectHookAdmissions { project_id: target }) => project_id.as_deref() == Some(target.as_str()), _ => true, } }).collect()) From 8b4c5f05afbdd2f216b3c56f38c852a71dc47eb0 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:00:28 -0800 Subject: [PATCH 42/63] style(retention): format bounded text-artifact scan code //:rustfmt_check, part of the required Repository gates job, rejects the bounded retention scan merged from #4769. Apply the pinned rustfmt to the seven affected files. The diff is whitespace, import order and closure braces only. Co-Authored-By: Claude Opus 5.5 --- .../src/code_index_generations.rs | 12 +- .../text_artifact_scan.rs | 111 +++++++++++++----- .../code_index_generations/text_artifacts.rs | 13 +- .../tracedecay-maintenance/src/generation.rs | 8 +- .../src/store_maintenance/mod.rs | 4 +- .../text_artifact_scan_tests.rs | 5 +- .../src/telemetry/text_artifact_scans.rs | 36 +++--- 7 files changed, 133 insertions(+), 56 deletions(-) diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations.rs b/crates/tracedecay-code-index-retention/src/code_index_generations.rs index ae13fe599d..ee1cd18d21 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations.rs @@ -51,8 +51,6 @@ mod scope_quarantine; mod scope_roots; mod text_artifact_scan; mod text_artifacts; -pub use text_artifact_scan::CodeGenerationRetentionScanV1; -use text_artifact_scan::{TextArtifactPageV1, TextArtifactPageProgressV1}; pub use graph_replay_release::{ CodeGenerationGraphReplayReleasePageV1, CodeGenerationGraphReplayReleaseV1, code_generation_graph_replay_release_page, complete_code_generation_graph_replay_release, @@ -72,6 +70,8 @@ pub use scope_roots::{ plan_scope_root_retention, plan_scope_root_retention_with_liveness_proof, record_scope_root, recover_scope_root_retention, resolve_live_code_index_roots, scope_root_liveness_proof, }; +pub use text_artifact_scan::CodeGenerationRetentionScanV1; +use text_artifact_scan::{TextArtifactPageProgressV1, TextArtifactPageV1}; pub use text_artifacts::{ attach_verified_text_artifact_under_lock, find_shared_text_artifact, withdraw_verified_text_artifact_under_lock, @@ -603,9 +603,11 @@ impl CodeGenerationRetentionPlanV1 { /// including a page containing only preserved files. #[must_use] pub fn has_pending_text_artifact_inventory(&self) -> bool { - self.text_artifact_page_progress.as_ref().is_some_and(|progress| { - progress.page.more || progress.consumed < progress.page.entries.len() - }) + self.text_artifact_page_progress + .as_ref() + .is_some_and(|progress| { + progress.page.more || progress.consumed < progress.page.entries.len() + }) } /// What this plan proved about unreferenced generation segments. diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs index d7e3839b20..621ce088dc 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs @@ -177,7 +177,10 @@ mod tests { fn write_orphan(root: &Path, index: usize) -> PathBuf { std::fs::create_dir_all(root).unwrap(); let bytes = format!("verified artifact {index}"); - let path = root.join(format!("text-artifact-{}.bin", sha256_hex(bytes.as_bytes()))); + let path = root.join(format!( + "text-artifact-{}.bin", + sha256_hex(bytes.as_bytes()) + )); std::fs::write(&path, bytes).unwrap(); path } @@ -204,8 +207,12 @@ mod tests { std::fs::write(&last, &original[&last]).unwrap(); for _ in 0..2 { let stateless = prepare_next_code_generation_retention_cancellable( - store.path(), &BTreeSet::new(), &|| false, None, - ).unwrap(); + store.path(), + &BTreeSet::new(), + &|| false, + None, + ) + .unwrap(); assert_eq!(stateless.collectable_text_artifact_count(), 0); } @@ -213,15 +220,21 @@ mod tests { let mut empty_continuations = 0; let mut finished = false; for tick in 0..(count + 4) { - let plan = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let plan = scan + .prepare(store.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); let progress = plan.text_artifact_page_progress.as_ref().unwrap(); assert!(progress.page.entries.len() <= MAX_CODE_TEXT_ARTIFACT_INVENTORY_ENTRIES_V1); let more = plan.has_pending_text_artifact_inventory(); if plan.has_collectable_work() { let report = execute_code_generation_retention( - store.path(), plan, CodeGenerationRetentionModeV1::Apply, - UtcMicros(tick as i64), None, - ).unwrap(); + store.path(), + plan, + CodeGenerationRetentionModeV1::Apply, + UtcMicros(tick as i64), + None, + ) + .unwrap(); scan.complete(&report.plan); } else { empty_continuations += usize::from(more); @@ -233,7 +246,10 @@ mod tests { } } assert!(finished); - assert!(empty_continuations > 0, "an all-preserved page is not completion"); + assert!( + empty_continuations > 0, + "an all-preserved page is not completion" + ); assert!(!last.exists()); for path in original.keys().filter(|path| **path != last) { assert_eq!(std::fs::read(path).unwrap(), b"untrusted content"); @@ -244,12 +260,18 @@ mod tests { fn successful_batches_keep_unvisited_page_tails_and_reject_stale_acknowledgements() { let store = tempfile::tempdir().unwrap(); let root = code_text_artifacts_root(store.path()); - let paths = (0..100).map(|index| write_orphan(&root, index)).collect::>(); + let paths = (0..100) + .map(|index| write_orphan(&root, index)) + .collect::>(); let mut scan = CodeGenerationRetentionScanV1::default(); let mut stale = None; for tick in 0..20 { - let plan = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); - assert!(plan.collectable_text_artifact_count() <= MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1); + let plan = scan + .prepare(store.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); + assert!( + plan.collectable_text_artifact_count() <= MAX_CODE_TEXT_ARTIFACT_RETENTION_BATCH_V1 + ); let more = plan.has_pending_text_artifact_inventory(); if let Some(stale) = stale.as_ref() { let current = Arc::clone(scan.page.as_ref().unwrap()); @@ -258,20 +280,28 @@ mod tests { } if plan.has_collectable_work() { let report = execute_code_generation_retention( - store.path(), plan, CodeGenerationRetentionModeV1::Apply, - UtcMicros(tick), None, - ).unwrap(); + store.path(), + plan, + CodeGenerationRetentionModeV1::Apply, + UtcMicros(tick), + None, + ) + .unwrap(); scan.complete(&report.plan); stale = Some(report.plan); } else { scan.complete(&plan); } - if !more { break; } + if !more { + break; + } } assert!(paths.iter().all(|path| !path.exists())); assert!(scan.completed.is_none() && scan.staging.is_none()); let newly_published = write_orphan(&root, 101); - let next = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let next = scan + .prepare(store.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); assert_eq!(next.collectable_text_artifact_count(), 1); assert!(newly_published.exists(), "preparing never unlinks"); } @@ -280,20 +310,37 @@ mod tests { fn cancelled_enumeration_and_failed_apply_keep_the_pending_page() { let store = tempfile::tempdir().unwrap(); let root = code_text_artifacts_root(store.path()); - for index in 0..100 { write_orphan(&root, index); } + for index in 0..100 { + write_orphan(&root, index); + } let mut scan = CodeGenerationRetentionScanV1::default(); let polls = Cell::new(0); - let cancelled = || { polls.set(polls.get() + 1); polls.get() > 10 }; - assert!(matches!(scan.prepare(store.path(), &BTreeSet::new(), &cancelled, None), - Err(CodeGenerationRetentionErrorV1::Cancelled))); + let cancelled = || { + polls.set(polls.get() + 1); + polls.get() > 10 + }; + assert!(matches!( + scan.prepare(store.path(), &BTreeSet::new(), &cancelled, None), + Err(CodeGenerationRetentionErrorV1::Cancelled) + )); assert!(!scan.pending.is_empty()); - let plan = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let plan = scan + .prepare(store.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); let page = Arc::clone(&plan.text_artifact_page_progress.as_ref().unwrap().page); // No acknowledgement: the next preparation must revalidate the same // page, as after an apply conflict or cancellation. - let retry = scan.prepare(store.path(), &BTreeSet::new(), &|| false, None).unwrap(); - assert!(Arc::ptr_eq(&page, &retry.text_artifact_page_progress.as_ref().unwrap().page)); - assert_eq!(plan.collectable_text_artifact_count(), retry.collectable_text_artifact_count()); + let retry = scan + .prepare(store.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); + assert!(Arc::ptr_eq( + &page, + &retry.text_artifact_page_progress.as_ref().unwrap().page + )); + assert_eq!( + plan.collectable_text_artifact_count(), + retry.collectable_text_artifact_count() + ); } #[test] @@ -301,13 +348,19 @@ mod tests { let first = tempfile::tempdir().unwrap(); let second = tempfile::tempdir().unwrap(); let mut scan = CodeGenerationRetentionScanV1::default(); - let empty = scan.prepare(first.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let empty = scan + .prepare(first.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); assert!(!empty.has_pending_text_artifact_inventory()); scan.complete(&empty); let live = write_orphan(&code_text_artifacts_root(first.path()), 1); - let first_plan = scan.prepare(first.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let first_plan = scan + .prepare(first.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); assert_eq!(first_plan.collectable_text_artifact_count(), 1); - let second_plan = scan.prepare(second.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let second_plan = scan + .prepare(second.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); scan.complete(&first_plan); assert_eq!(second_plan.collectable_text_artifact_count(), 0); assert!(live.exists()); @@ -316,7 +369,9 @@ mod tests { std::fs::create_dir_all(&staging).unwrap(); let debris = staging.join(format!(".text-artifact-{}.staging", "a".repeat(64))); std::fs::write(&debris, b"abandoned staging").unwrap(); - let next = scan.prepare(second.path(), &BTreeSet::new(), &|| false, None).unwrap(); + let next = scan + .prepare(second.path(), &BTreeSet::new(), &|| false, None) + .unwrap(); assert_eq!(next.collectable_text_artifact_count(), 1); assert!(debris.exists()); } diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs index 6bfa40db97..6c4e749d67 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifacts.rs @@ -16,8 +16,8 @@ use super::journal::{ BoundedJournalSpec, clear_journal, journal_path, load_journal, persist_journal, }; use super::receipt_store; -use super::text_artifact_scan::TextArtifactPageV1; use super::receipt_store::{ReceiptStoreSpec, receipt_digest_file_component}; +use super::text_artifact_scan::TextArtifactPageV1; use super::{ ACTIVE_POINTER_FILE, CodeGenerationRetentionErrorV1, CodeGenerationRetentionPlanV1, CodeGenerationStoreLockV1, CodeTextArtifactRetentionCandidateV1, @@ -255,7 +255,12 @@ pub(super) fn plan_collectable_text_artifacts_budgeted_cancellable( is_cancelled: &dyn Fn() -> bool, ) -> Result { plan_collectable_text_artifacts_budgeted_page_cancellable( - store_root, active_pointer, verification, remaining_entries, is_cancelled, None, + store_root, + active_pointer, + verification, + remaining_entries, + is_cancelled, + None, ) } @@ -601,7 +606,9 @@ fn scope_text_artifact_marks( Ok(marked) } -pub(super) fn private_directory_exists(path: &Path) -> Result { +pub(super) fn private_directory_exists( + path: &Path, +) -> Result { match std::fs::symlink_metadata(path) { Ok(metadata) if metadata.file_type().is_dir() => Ok(true), Ok(_) => Err(CodeGenerationRetentionErrorV1::UnsafeState(format!( diff --git a/crates/tracedecay-maintenance/src/generation.rs b/crates/tracedecay-maintenance/src/generation.rs index 0aa151347a..3319c2d94e 100644 --- a/crates/tracedecay-maintenance/src/generation.rs +++ b/crates/tracedecay-maintenance/src/generation.rs @@ -70,10 +70,10 @@ pub async fn run_project_generation_maintenance( code_index_schedulers, maintenance_observations, ) - .instrument(tracing::trace_span!( - "daemon.maintenance.scope_reconciliation" - )) - .await + .instrument(tracing::trace_span!( + "daemon.maintenance.scope_reconciliation" + )) + .await }); } if !cancellation.is_cancelled() diff --git a/crates/tracedecay-maintenance/src/store_maintenance/mod.rs b/crates/tracedecay-maintenance/src/store_maintenance/mod.rs index 9d82e8cd4c..8475df33b8 100644 --- a/crates/tracedecay-maintenance/src/store_maintenance/mod.rs +++ b/crates/tracedecay-maintenance/src/store_maintenance/mod.rs @@ -161,7 +161,9 @@ async fn plan_collection( let plan_pool_root = graph_replay_pool_root.to_path_buf(); let scan = observations.text_artifact_scan(scan_owner_root, store_root); let plan = native_runtime::spawn_blocking(move || { - let mut scan = scan.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + let mut scan = scan + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner); let plan = scan.prepare( &plan_root, &plan_sources, diff --git a/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs b/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs index 8e70d6d4da..67c476d421 100644 --- a/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs +++ b/crates/tracedecay-maintenance/src/store_maintenance/text_artifact_scan_tests.rs @@ -15,7 +15,10 @@ async fn maintenance_owner_advances_noop_pages_and_applies_a_later_orphan() { let mut contents = BTreeMap::new(); for index in 0..150 { let bytes = format!("orphan payload {index}"); - let path = artifacts.join(format!("text-artifact-{}.bin", sha256_hex(bytes.as_bytes()))); + let path = artifacts.join(format!( + "text-artifact-{}.bin", + sha256_hex(bytes.as_bytes()) + )); std::fs::write(&path, b"untrusted content").unwrap(); contents.insert(path, bytes); } diff --git a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs index 4d8b3c74b4..ddf7c3babe 100644 --- a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs +++ b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs @@ -28,12 +28,13 @@ impl StoreTelemetrySamplingRegistry { .text_artifact_scans .lock() .unwrap_or_else(PoisonError::into_inner); - let entry = scans.entry(store_root.to_path_buf()).or_insert_with(|| { - TextArtifactScanEntryV1 { - data_root: data_root.to_path_buf(), - scan: Arc::new(Mutex::new(CodeGenerationRetentionScanV1::default())), - } - }); + let entry = + scans + .entry(store_root.to_path_buf()) + .or_insert_with(|| TextArtifactScanEntryV1 { + data_root: data_root.to_path_buf(), + scan: Arc::new(Mutex::new(CodeGenerationRetentionScanV1::default())), + }); Arc::clone(&entry.scan) } @@ -104,10 +105,8 @@ mod tests { // The registered project is still present. Only its *scope* inventory // changed, so the retired scan must not keep its ReadDir handles. - registry.retain_text_artifact_scan_scopes( - project, - &BTreeSet::from([survivor.to_path_buf()]), - ); + registry + .retain_text_artifact_scan_scopes(project, &BTreeSet::from([survivor.to_path_buf()])); assert!(removed_weak.upgrade().is_none()); assert!(Arc::ptr_eq( &live, @@ -151,14 +150,17 @@ mod tests { let another_root = data_root.join("code-index-v1").join("live"); let live = registry.text_artifact_scan(&data_root, &another_root); registry.release_text_artifact_scans_before_scope_collection(&BTreeSet::from([ - scope_root.clone(), + scope_root.clone() ])); assert!(Arc::ptr_eq( &live, ®istry.text_artifact_scan(&data_root, &another_root) )); assert!( - !Arc::ptr_eq(&retained, ®istry.text_artifact_scan(&data_root, &scope_root)), + !Arc::ptr_eq( + &retained, + ®istry.text_artifact_scan(&data_root, &scope_root) + ), "a retired scope must not keep a reusable scan owner" ); // On Windows a live ReadDir inside the source prevents this rename. @@ -180,7 +182,10 @@ mod tests { let first = registry.text_artifact_scan(project, scope); // An unmounted registered project is absent from mounted graph // maintenance but must retain scan progress across short ticks. - assert!(Arc::ptr_eq(&first, &clone.text_artifact_scan(project, scope))); + assert!(Arc::ptr_eq( + &first, + &clone.text_artifact_scan(project, scope) + )); let second = registry.text_artifact_scan(project, Path::new("other-scope")); assert!(!Arc::ptr_eq(&first, &second)); let retired = registry.text_artifact_scan(other, retired_scope); @@ -189,7 +194,10 @@ mod tests { registry.retain_project_maintenance_state(&BTreeSet::new()); registry.retain_text_artifact_scan_projects(&BTreeSet::from([project.to_path_buf()])); assert!(retired_weak.upgrade().is_none()); - assert!(Arc::ptr_eq(&first, &clone.text_artifact_scan(project, scope))); + assert!(Arc::ptr_eq( + &first, + &clone.text_artifact_scan(project, scope) + )); let first_weak = Arc::downgrade(&first); let second_weak = Arc::downgrade(&second); drop(first); From a0fb660cdefa737912e933ea3667efbd89fd9bd1 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:00:31 -0800 Subject: [PATCH 43/63] docs: state retention and evaluation invariants plainly Reword comments and HTTP_RUNNER.md text added by this integration. Remove change narration, replace figurative phrasing and symbol shorthand, and name the actor in the runner's publication and hard-link probe behavior. Only comments, one Python docstring and the runner doc change. Co-Authored-By: Claude Opus 5.5 --- .../agents/context_scout/decision_engine.rs | 8 +++--- .../agents/context_scout/session_window.rs | 4 +-- .../text_artifact_scan.rs | 19 +++++++------- .../src/retention/storage_report.rs | 9 ++++--- .../src/telemetry/text_artifact_scans.rs | 2 +- .../src/connection/path_identity_tests.rs | 4 +-- .../src/runtime/hosts/codex/observation.rs | 2 +- evals/intent_engine/HTTP_RUNNER.md | 25 +++++++++++-------- evals/intent_engine/run_http.py | 12 ++++----- evals/intent_engine/test_run_http.py | 4 +-- 10 files changed, 47 insertions(+), 42 deletions(-) diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs index 6277c6976a..b8ba4c8b0e 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/decision_engine.rs @@ -444,8 +444,8 @@ fn parse_answer( answer: &Map, kind: &DecisionQuestionKindV1, ) -> Option { - // An omitted tag is supported, but a malformed explicit tag must not - // disappear into the same optional state and bypass kind validation. + // An omitted tag is valid, but a non-string tag must not also become + // `None` and skip kind validation. let declared = match answer.get("type") { None => None, Some(declared) => Some(declared.as_str()?), @@ -527,7 +527,7 @@ fn choice_probabilities( // not a valid two-way choice. // A three-decimal response can deviate by up to 0.0005 per option. // Scale the sum tolerance with cardinality, but cap it at one percent - // so a large choice set cannot excuse a genuinely unnormalized answer. + // so a large choice set cannot excuse an unnormalized answer. let rounding_tolerance = (CHOICE_EPSILON * probabilities.len() as f64 / 2.0).min(0.01); if (probabilities.values().sum::() - 1.0).abs() > rounding_tolerance { return None; @@ -1201,7 +1201,7 @@ mod tests { ), (score("q", &["low", "high"]), json!({"score": 0.5})), ] { - // A genuinely omitted tag remains compatible for every kind. + // An omitted tag is valid for every kind. let body = json!({"answers": {"q": &answer}}).to_string(); let server = fake_decision_engine(200, &body, Duration::ZERO); let result = answered( diff --git a/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs b/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs index 110396d7b3..6d2be9470c 100644 --- a/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs +++ b/crates/tracedecay-agent-hosts/src/agents/context_scout/session_window.rs @@ -222,8 +222,8 @@ async fn window_message( let role = role_of(&loaded.role); let mut text = loaded.content.trim().to_owned(); // Metadata on a user, tool-result, or system row is not an assistant - // invocation. Only the assistant role may grant recorded tool-action - // evidence; otherwise a tool result could fabricate a tool_calls key. + // invocation. Only assistant rows count as recorded tool-action evidence; + // otherwise a tool result could forge a `tool_calls` key. let mut tool_calls = if role == SessionWindowRoleV1::Assistant { loaded .metadata_json diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs index 621ce088dc..2b932a6748 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations/text_artifact_scan.rs @@ -1,8 +1,8 @@ //! Process-retained directory progress for the maintenance owner. //! -//! Entries are hints, never liveness or unlink authority. Each preparation -//! re-reads current publication pointers and verifies the selected bytes; apply -//! still revalidates under the existing store and project locks. +//! Listed entries are only candidates. They do not decide liveness or permit an +//! unlink. Each preparation re-reads current publication pointers and verifies +//! the selected bytes, and apply revalidates under the store and project locks. use std::collections::BTreeSet; use std::fs::ReadDir; @@ -32,10 +32,11 @@ pub(super) struct TextArtifactPageProgressV1 { /// A maintenance owner's unfinished text-artifact enumeration for one scope. /// -/// Two directory streams and at most one bounded page survive between ticks. -/// Restart discards only scan position, never a safety proof. Completed scans -/// close both streams; the next ordinary tick opens a fresh inventory. No -/// process-global cache or additional durable state is introduced. +/// The scan keeps two directory streams and at most one bounded page between +/// ticks. A restart loses only the scan position, because each preparation +/// repeats the safety checks. A completed scan closes both streams, and the +/// next tick opens a new inventory. The scan keeps no process-global cache or +/// durable state. #[derive(Debug, Default)] pub struct CodeGenerationRetentionScanV1 { root: Option, @@ -328,8 +329,8 @@ mod tests { .prepare(store.path(), &BTreeSet::new(), &|| false, None) .unwrap(); let page = Arc::clone(&plan.text_artifact_page_progress.as_ref().unwrap().page); - // No acknowledgement: the next preparation must revalidate the same - // page, as after an apply conflict or cancellation. + // Without an acknowledgement, the next preparation must revalidate the + // same page, as it does after an apply conflict or cancellation. let retry = scan .prepare(store.path(), &BTreeSet::new(), &|| false, None) .unwrap(); diff --git a/crates/tracedecay-maintenance/src/retention/storage_report.rs b/crates/tracedecay-maintenance/src/retention/storage_report.rs index 3666d83b8b..84e56e9fbb 100644 --- a/crates/tracedecay-maintenance/src/retention/storage_report.rs +++ b/crates/tracedecay-maintenance/src/retention/storage_report.rs @@ -1335,9 +1335,9 @@ fn append_project_report( (true, Err(_)) => {} } let total_bytes = kinds.total(); - // File::open + close on Unix may release an unrelated SQLite connection's - // process-wide record locks. In-process daemon reports do not inspect - // these header bytes; unknown is safer than a fabricated zero. + // Opening and closing this file on Unix may release an unrelated SQLite + // connection's process-wide record locks. In-process daemon reports skip + // these header bytes and report `None` instead of a fabricated zero. let (free_bytes, free_page_ratio) = if project_chain_is_nofollow && sample_free_page_header { sample_free_pages(&data_root.join(tracedecay_runtime_core::config::DB_FILENAME)) .map_or((None, None), |(free_bytes, ratio)| { @@ -1985,7 +1985,8 @@ mod tests { assert_eq!(page.stores[0].free_page_ratio, None); // The project-scoped admin route shares this builder with the offline - // CLI. It must use the daemon policy, not open and close a second FD. + // CLI. It must follow the daemon policy and must not open and close a + // second file descriptor. let project_report = build_project_storage_report_from_daemon( profile_root, &project.project_id, diff --git a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs index ddf7c3babe..869d883fee 100644 --- a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs +++ b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs @@ -1,4 +1,4 @@ -//! Text-artifact scan positions owned by the existing maintenance registry. +//! Text-artifact scan positions owned by the maintenance registry. use std::collections::{BTreeSet, HashMap}; use std::path::{Path, PathBuf}; diff --git a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs index ea0b123c72..a8c0ce5fcf 100644 --- a/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs +++ b/crates/tracedecay-rusqlite-runtime/src/connection/path_identity_tests.rs @@ -281,8 +281,8 @@ fn dropping_secondary_identity_pins_never_releases_rollback_writer_locks() { .expect("hold writer transaction"); probe_external_connection(&path, "write", true); - // In the old implementation these were independent dup(2) descriptors. - // Dropping either one discarded SQLite's unrelated process-wide lock. + // If these pins were independent dup(2) descriptors, dropping either one + // would discard SQLite's unrelated process-wide lock. drop(reader_pin); probe_external_connection(&path, "write", true); drop(writer_pin); diff --git a/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs b/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs index be89d33736..cf3816de8d 100644 --- a/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs +++ b/crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs @@ -905,7 +905,7 @@ mod admission_gate_tests { assert!(Arc::ptr_eq(&first, ®istry.gate_for(key.clone()))); // Once the final holder releases the gate, the next same-source - // admission must receive a new one rather than resurrecting a stale lock. + // admission must receive a new one rather than reuse a stale lock. let retired = Arc::downgrade(&first); drop(first); drop(concurrent); diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index 9ef08f1f82..899a8542e0 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -34,17 +34,20 @@ or silent salvage is performed. Choose a new tag for another experiment or an old unidentifiable log. Completed output files are never overwritten. Use only one writer per tag/configuration. Rows are flushed after each response; -this is not a crash-durable database or a concurrent-writer protocol. Final -results are fully rendered and synced in a same-directory temporary file, then -published exclusively using an atomic hard link. A failed write/link cannot -expose truncated completed JSON and leaves the exact-identity `.partial` log -available for a retry without repeating inference. Completion does not -guarantee directory metadata durability across an abrupt OS crash. Before -making HTTP requests, the runner probes no-clobber hard-link publication in -the results directory and (if needed) the optional sample directory. Volumes -without hard-link support, such as FAT/exFAT, refuse immediately without -creating a partial log or spending inference tokens; use a compatible output -filesystem instead. No unsafe replace-on-rename fallback is attempted. +this is not a crash-durable database or a concurrent-writer protocol. The runner +writes and syncs the final result to a temporary file in the results directory, +then publishes it with a hard link, which fails if the output path already +exists. If the write or link fails, no truncated JSON appears at the output path. +The `.partial` log stays in place, so a retry with the same identity does not +repeat inference. The runner does not sync the directory, so an OS crash can lose +a completed result's directory entry. + +Before any HTTP request, the runner tests hard-link publication in the results +directory and, when `--sample-out` names a file that does not exist yet, in the +sample directory. On a volume without hard links, such as FAT/exFAT, the runner +refuses the run before it creates a partial log or spends inference tokens. Use +an output filesystem that supports hard links. The runner never falls back to +rename, because a rename can replace an existing result. ## Token and truncation evidence diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 623e63e55f..4cf235c6ca 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -100,9 +100,9 @@ def require_exclusive_publication(directory): def publish_final_result(path, document): """Expose a completed JSON result only after its bytes are fully written. - The same-directory hard link is an exclusive publication: a competing - writer's result cannot be replaced, and a failed staged write cannot leave - an apparently completed but truncated JSON file. + The hard link fails if the output path exists, so it cannot replace a + competing writer's result. A failed staged write leaves nothing at the + output path, so no truncated JSON can look complete. """ serialized = json.dumps(document, indent=1, allow_nan=False) directory = os.path.dirname(os.path.abspath(path)) @@ -355,9 +355,9 @@ def main(argv=None): partial.flush() done[case["id"]] = row print(cfg, index, case["id"], "%.0f ms" % ms, flush=True) - # Exclusive publication must never expose a truncated final result: - # an interrupted or failed write leaves the complete partial log - # available for an exact-identity retry without new model calls. + # An interrupted or failed write leaves no truncated result at the + # output path. The complete partial log stays in place, so a retry with + # the same identity makes no new model calls. publish_final_result(path, { "config": name, "dataset_sha256": dataset_sha, "noul_temperature": args.noul_temperature, diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index cc77d85df7..e45eb9e020 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -361,8 +361,8 @@ def test_failed_probe_preserves_a_link_target_it_did_not_create(self): foreign = self.output.parent / ".noul-link-probe-collision.linked" content = b"another publication owns this file\n" foreign.write_bytes(content) - # Force a collision with a real existing file; os.link itself must - # refuse it. Cleanup is not authorized to remove the winning file. + # Force a collision with a real existing file. os.link itself must + # refuse it, and cleanup must not remove the existing file. with patch.object(run_http.secrets, "token_hex", return_value="collision"): with patch.object(run_http, "post") as post: with self.assertRaises(OSError): From 682b66fa304746df1312512d52362c6cd7d052f5 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 02:10:12 -0800 Subject: [PATCH 44/63] fix(evals): constrain HTTP decisions to the selected endpoint Refs #4535. The evaluator followed redirects and honored ambient proxy settings, allowing a transcript-bearing request or its model answer to cross the operator-selected serving boundary. Disable environment proxies and all redirects for each decision request. Test actual local HTTP delivery with an injected dead proxy and verify that a cross-endpoint redirect is refused at the originating response. Preserve byte-exact request-hash coverage. An independent Python transport reproduction passed. The integrated Bazel Python tests still require hosted CI. --- evals/intent_engine/run_http.py | 12 ++++- evals/intent_engine/test_run_http.py | 74 +++++++++++++++++++++++++++- 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 4cf235c6ca..629c24cde0 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -118,12 +118,22 @@ def publish_final_result(path, document): os.unlink(staged) +class RefuseDecisionRedirects(urllib.request.HTTPRedirectHandler): + def redirect_request(self, req, fp, code, msg, headers, newurl): + return None + + def post(url, body, timeout=1800): req = urllib.request.Request( url, request_bytes(body), {"content-type": "application/json"} ) + # Transcript state belongs to the operator-selected endpoint. Ambient + # proxies and redirects can leak the request or misattribute model results. + opener = urllib.request.build_opener( + urllib.request.ProxyHandler({}), RefuseDecisionRedirects() + ) started = time.perf_counter() - with urllib.request.urlopen(req, timeout=timeout) as response: + with opener.open(req, timeout=timeout) as response: out = json.loads(response.read()) return out, (time.perf_counter() - started) * 1000 diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index e45eb9e020..f1abb1cfa2 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -11,6 +11,9 @@ import sys import tempfile import unittest +import urllib.error +from http.server import BaseHTTPRequestHandler, HTTPServer +from threading import Thread from unittest.mock import patch sys.path.insert(0, str(Path(__file__).resolve().parent)) @@ -691,12 +694,79 @@ def test_calibration_remains_finite_at_extreme_positive_temperatures(self): def test_transmitted_bytes_match_the_recorded_request_fingerprint(self): response = io.BytesIO(json.dumps({"answers": {}}).encode()) body = {"state": "Unicode λ", "questions": {"a": {}, "b": {}}} - with patch("urllib.request.urlopen", return_value=response) as urlopen: + with patch("urllib.request.build_opener") as build_opener: + build_opener.return_value.open.return_value = response run_http.post("http://localhost:8009/v1/systemone", body) - sent = urlopen.call_args.args[0].data + sent = build_opener.return_value.open.call_args.args[0].data self.assertEqual(sent, run_http.request_bytes(body)) self.assertEqual(hashlib.sha256(sent).hexdigest(), hashlib.sha256(run_http.request_bytes(body)).hexdigest()) + def test_decision_request_does_not_use_environment_proxy(self): + received = [] + + class Answer(BaseHTTPRequestHandler): + def do_POST(self): + received.append(self.rfile.read(int(self.headers["Content-Length"]))) + body = b'{"answers":{}}' + self.send_response(200) + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def log_message(self, *_): + pass + + server = HTTPServer(("127.0.0.1", 0), Answer) + worker = Thread(target=server.serve_forever, daemon=True) + worker.start() + body = {"state": "private transcript", "questions": {"q": {"type": "noul"}}} + try: + # A dead proxy and an empty bypass list prevent an unguarded + # urllib opener from reaching the explicitly configured server. + with patch.dict(os.environ, { + "http_proxy": "http://127.0.0.1:1", + "HTTP_PROXY": "http://127.0.0.1:1", + "no_proxy": "", + "NO_PROXY": "", + }): + reply, _ = run_http.post( + f"http://127.0.0.1:{server.server_port}/v1/systemone", body, timeout=2, + ) + self.assertEqual(reply, {"answers": {}}) + self.assertEqual(received, [run_http.request_bytes(body)]) + finally: + server.shutdown() + worker.join(timeout=2) + server.server_close() + + def test_decision_request_refuses_cross_endpoint_redirect(self): + class Redirect(BaseHTTPRequestHandler): + def do_POST(self): + self.rfile.read(int(self.headers["Content-Length"])) + self.send_response(302) + self.send_header("Location", "http://127.0.0.1:1/other-model") + self.end_headers() + + def log_message(self, *_): + pass + + server = HTTPServer(("127.0.0.1", 0), Redirect) + worker = Thread(target=server.serve_forever, daemon=True) + worker.start() + try: + with self.assertRaises(urllib.error.HTTPError) as refused: + run_http.post( + f"http://127.0.0.1:{server.server_port}/v1/systemone", + {"state": "private transcript", "questions": {}}, timeout=2, + ) + # Preserve the original 302 instead of following it to an + # unapproved model endpoint and observing a downstream failure. + self.assertEqual(refused.exception.code, 302) + finally: + server.shutdown() + worker.join(timeout=2) + server.server_close() + if __name__ == "__main__": unittest.main() From 14d7608556f74263d306a9a5d88e31e6b21b7b81 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 02:23:06 -0800 Subject: [PATCH 45/63] fix(work): admit output authority before provider effects --- .../src/invocation/work_attempt_exec.rs | 208 ++++++++--- .../src/invocation/work_attempt_exec/tests.rs | 19 +- .../tests/output_admission.rs | 345 ++++++++++++++++++ 3 files changed, 529 insertions(+), 43 deletions(-) create mode 100644 crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs diff --git a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec.rs b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec.rs index 986d4ac79c..0374fad243 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec.rs @@ -719,17 +719,6 @@ async fn run_attempt( return; } }; - let workflow_artifacts = registered - .database - .workflow_storage() - .await - .map_err(|error| { - tracing::warn!( - task = attempt.identity().task_id().as_str(), - ?error, - "work attempt provider output store could not be attached" - ); - }); let identity = attempt.identity().clone(); // The registration-pinned work topology policy carries the concurrency // policy this attempt was admitted under; its canonical digest is the @@ -765,38 +754,56 @@ async fn run_attempt( )) }); match selection { - Ok(selection) => match selection.provider.protocol { - WorkProviderProtocol::CodexAppServerJsonRpc => { - execute_app_server( - &services, - workflow_artifacts.as_ref().ok(), - &context, - &attempt, - &selection, - &admitted_environment, - cancel, - observability_producer.as_deref(), - topology_policy_digest.as_ref(), - timing, - ) - .await; - } - _ => { - execute_provider_with_environment( - &services, - workflow_artifacts.as_ref().ok(), - &context, - &attempt, - &selection, - &admitted_environment, - cancel, - observability_producer.as_deref(), - topology_policy_digest.as_ref(), - timing, - ) - .await; + Ok(selection) => { + // Bind output authority after provider resolution, not at task start. + // Recovery can finish while the binding probe is in flight. Once + // admitted, retain this exact store through output persistence; + // never execute effects without somewhere to retain their output. + let Some(workflow_artifacts) = bind_attempt_output( + ®istered.database, + &services, + &context, + &attempt, + selection.fallback.clone(), + observability_producer.as_deref(), + ) + .await + else { + return; + }; + match selection.provider.protocol { + WorkProviderProtocol::CodexAppServerJsonRpc => { + execute_app_server( + &services, + Some(&workflow_artifacts), + &context, + &attempt, + &selection, + &admitted_environment, + cancel, + observability_producer.as_deref(), + topology_policy_digest.as_ref(), + timing, + ) + .await; + } + _ => { + execute_provider_with_environment( + &services, + Some(&workflow_artifacts), + &context, + &attempt, + &selection, + &admitted_environment, + cancel, + observability_producer.as_deref(), + topology_policy_digest.as_ref(), + timing, + ) + .await; + } } - }, + } Err(denial) => { settle_unstarted( &services, @@ -1080,6 +1087,99 @@ enum EffectDispatchAdmission { Unavailable, } +async fn bind_attempt_output( + database: &tracedecay_global_db::RegisteredGlobalDbLeaseV1, + steps: &impl AttemptStepsV1, + context: &RequestContext, + attempt: &WorkAttemptV1, + fallback: Option, + observability_producer: Option<&BoundedObservabilityProducerV1>, +) -> Option { + match database.workflow_storage().await { + Ok(store) => Some(store), + Err(error) if error.is_workflow_authority_recovering() => { + admit_provider_output( + steps, + context, + attempt, + None, + fallback, + observability_producer, + ) + .await; + None + } + Err(error) => { + tracing::warn!( + task = attempt.identity().task_id().as_str(), + ?error, + "work attempt output authority could not be admitted" + ); + settle_unstarted( + steps, + context, + attempt.identity(), + attempt, + WorkAttemptProviderOutcomeV1::ProviderUnavailable { + state: WorkProviderAvailabilityV1::Unavailable, + }, + fallback, + observability_producer, + ) + .await; + None + } + } +} + +/// A recovering output authority fences the existing attempt for explicit +/// revalidated retry. Its effect receipt proves that no provider launched, so +/// non-repeatable work can also retry safely. No terminal protocol evidence is +/// manufactured. A concurrent cancellation wins +/// through the same durable transition rules as provider admission. +async fn admit_provider_output( + steps: &impl AttemptStepsV1, + context: &RequestContext, + attempt: &WorkAttemptV1, + store: Option<&tracedecay_rusqlite_runtime::workflow::WorkflowSqliteAuthority>, + fallback: Option, + observability_producer: Option<&BoundedObservabilityProducerV1>, +) -> bool { + if store.is_some() { + return true; + } + match steps + .mark_provider_unavailable(context, attempt.identity(), now_micros()) + .await + { + Ok(_) => { + if matches!( + record_effect_dispatch(steps, context, attempt).await, + EffectDispatchAdmission::Recorded + ) { + let _ = settle_effect_dispatch(steps, context, attempt, false).await; + } + } + Err(problem) => { + tracing::warn!( + task = attempt.identity().task_id().as_str(), + ?problem, + "work attempt could not be fenced while output authority recovers" + ); + seal_cancellation_before_running( + steps, + context, + attempt, + None, + fallback, + observability_producer, + ) + .await; + } + } + false +} + async fn record_effect_dispatch( steps: &impl AttemptStepsV1, context: &RequestContext, @@ -1167,6 +1267,18 @@ async fn execute_provider_with_environment( topology_policy_digest: Option<&TopologyPolicyDigestV1>, timing: AttemptAdmissionTimingV1, ) { + if !admit_provider_output( + steps, + context, + attempt, + workflow_artifacts, + selection.fallback.clone(), + observability_producer, + ) + .await + { + return; + } let identity = attempt.identity().clone(); let envelope = attempt.execution(); let resolved = &selection.provider; @@ -1397,6 +1509,18 @@ async fn execute_app_server( topology_policy_digest: Option<&TopologyPolicyDigestV1>, timing: AttemptAdmissionTimingV1, ) { + if !admit_provider_output( + steps, + context, + attempt, + workflow_artifacts, + selection.fallback.clone(), + observability_producer, + ) + .await + { + return; + } let identity = attempt.identity().clone(); let envelope = attempt.execution(); let snapshot = envelope.execution_snapshot(); diff --git a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests.rs b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests.rs index 1b2fd6d3cb..cf9c57e0e2 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests.rs @@ -19,6 +19,9 @@ use super::*; +#[cfg(unix)] +mod output_admission; + use std::collections::{BTreeMap, BTreeSet}; use std::path::Path; use std::sync::Mutex; @@ -741,6 +744,20 @@ impl AttemptStepsV1 for FixtureSteps<'_> { /// provider-runtime fixture does not invent routing evidence through a Work /// event-store double. fn leased_attempt(worktree_root: &Path, instructions: &str, shape: &SnapshotShape) -> Fixture { + leased_attempt_with_effect( + worktree_root, + instructions, + shape, + WorkEffectStateV1::Observational, + ) +} + +fn leased_attempt_with_effect( + worktree_root: &Path, + instructions: &str, + shape: &SnapshotShape, + effect: WorkEffectStateV1, +) -> Fixture { let rows = AttemptStore::default(); let attempts = WorkAttemptService::new(rows.clone()); let context = request_context(); @@ -781,7 +798,7 @@ fn leased_attempt(worktree_root: &Path, instructions: &str, shape: &SnapshotShap id::("0123456789abcdef0123456789abcdef01234567"), instructions.to_owned(), 1, - WorkEffectStateV1::Observational, + effect, ) .unwrap(); let attempt = WorkAttemptV1::new( diff --git a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs new file mode 100644 index 0000000000..be33d509c2 --- /dev/null +++ b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs @@ -0,0 +1,345 @@ +//! Output admission against a real published-shape store and its convergence. +use super::*; +use tracedecay_contracts::{ + RuntimeWorkRetryEvidenceV1, WorkRetryCauseV1, WorkRetryEvidencePortV1, + WorkRetryFailureSelectorV1, WorkRetrySourceV1, +}; +use tracedecay_global_db::{RegisteredGlobalDbLeaseV1, RegisteredGlobalDbOwnerV1}; +use tracedecay_runtime_core::cancellation::CancellationToken; +use tracedecay_runtime_core::db::engine::{Executor, TestConnection}; +use tracedecay_runtime_core::db::{ + Database, DatabaseAuthority, TestDatabaseRuntimeMode, TestDatabaseRuntimeScope, + enter_daemon_database_scope, +}; + +async fn recovering_store() -> ( + tempfile::TempDir, + RegisteredGlobalDbLeaseV1, + tracedecay_global_db::schema_stages::RegisteredSchemaConvergence, + impl Sized, +) { + let directory = tempfile::tempdir().unwrap(); + let profile = directory.path().join("profile"); + std::fs::create_dir_all(&profile).unwrap(); + let path = tracedecay_sessions::runtime::user_sessions_db_path(&profile); + drop( + tracedecay_global_db::tests::harness::open_registered_test_database_fixture( + &path, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .unwrap(), + ); + TestConnection::open(&path) + .execute_batch( + "DROP TABLE workflow_artifact_payloads; + CREATE TABLE workflow_artifact_payloads ( + payload_digest TEXT NOT NULL PRIMARY KEY, + byte_length INTEGER NOT NULL CHECK ( + byte_length = length(payload) AND byte_length <= 4194304 + ), + payload BLOB NOT NULL +) STRICT; + UPDATE workflow_schema SET definition_digest = + 'sha256:a292df6bc47e763f0d20bdb44a4032c0b1d7ac8e4cb83173b66ae7d1ff0d03be';", + ) + .await + .unwrap(); + let scope = enter_daemon_database_scope(&profile, 1, "output admission").unwrap(); + let authority = DatabaseAuthority::for_owned_runtime(&path, "output admission").unwrap(); + let (database, runtime, retirement) = + Database::publish_registered_daemon_test_runtime_with_retirement_control( + &path, + &authority, + TestDatabaseRuntimeMode::Existing, + TestDatabaseRuntimeScope::ProfileSessions, + ) + .await + .unwrap() + .into_parts(); + let (owner, convergence) = + RegisteredGlobalDbOwnerV1::admit_and_attach_for_daemon(database, &CancellationToken::new()) + .await + .unwrap(); + let lease = owner.issue_lease().unwrap(); + assert!( + lease + .workflow_storage() + .await + .err() + .unwrap() + .is_workflow_authority_recovering() + ); + ( + directory, + lease, + convergence.unwrap(), + (owner, runtime, retirement, scope), + ) +} + +async fn execute( + fixture: &Fixture, + executable: PathBuf, + store: Option<&tracedecay_rusqlite_runtime::workflow::WorkflowSqliteAuthority>, + protocol: WorkProviderProtocol, +) { + let backend = if protocol == WorkProviderProtocol::CodexAppServerJsonRpc { + WorkProviderBackendV1::CodexAppServer + } else { + WorkProviderBackendV1::ClaudeCodeCli + }; + let selection = preferred(executable, protocol, &[], requested_route(backend)); + let environment = + admitted_provider_environment(fixture.attempt.execution().execution_snapshot()); + if protocol == WorkProviderProtocol::CodexAppServerJsonRpc { + execute_app_server( + &fixture.steps(), + store, + &fixture.context, + &fixture.attempt, + &selection, + &environment, + Arc::new(Notify::new()), + None, + None, + AttemptAdmissionTimingV1::for_test(), + ) + .await; + } else { + execute_provider_with_environment( + &fixture.steps(), + store, + &fixture.context, + &fixture.attempt, + &selection, + &environment, + Arc::new(Notify::new()), + None, + None, + AttemptAdmissionTimingV1::for_test(), + ) + .await; + } +} + +#[test] +fn recovery_completed_before_admission_retains_output_in_the_same_mount() { + without_tokio(async { + let (_directory, lease, convergence, _held) = recovering_store().await; + let (_other_directory, other_store) = provider_artifact_store().await; + let root = tempfile::tempdir().unwrap(); + let fixture = leased_attempt( + root.path(), + "Retain every output byte.", + &SnapshotShape::default(), + ); + // The attempt already exists while recovery is pending. The output + // authority must be bound after convergence rather than remembering + // the earlier recovering result. + lease + .converge_schema(convergence, &CancellationToken::new()) + .await + .unwrap(); + let store = bind_attempt_output( + &lease, + &fixture.steps(), + &fixture.context, + &fixture.attempt, + None, + None, + ) + .await + .unwrap(); + let executable = fake_executable( + root.path(), + "provider", + "#!/bin/sh\ncat >/dev/null\nprintf 'retained-output'\n", + ); + execute( + &fixture, + executable, + Some(&store), + WorkProviderProtocol::ClaudeStreamJson, + ) + .await; + assert_eq!(fixture.state(), WorkAttemptStateV1::Succeeded); + let settled = fixture.current_attempt(); + let artifact = settled.artifacts().first().unwrap().clone(); + let queried = artifact.clone(); + let payload = store + .transact(move |storage| WorkflowArtifactStorePort::load(&storage, &queried)) + .await + .unwrap() + .unwrap(); + assert_eq!(payload.bytes(), b"retained-output"); + assert_eq!( + other_store + .transact(move |storage| WorkflowArtifactStorePort::load(&storage, &artifact)) + .await + .unwrap(), + Err(tracedecay_contracts::WorkflowArtifactStoreError::Missing) + ); + }); +} + +#[test] +fn canonical_binding_fences_recovering_work_without_terminal_failure() { + without_tokio(async { + let (_directory, lease, _convergence, _held) = recovering_store().await; + let root = tempfile::tempdir().unwrap(); + let fixture = leased_attempt( + root.path(), + "Admission while recovering.", + &SnapshotShape::default(), + ); + assert!( + bind_attempt_output( + &lease, + &fixture.steps(), + &fixture.context, + &fixture.attempt, + None, + None, + ) + .await + .is_none() + ); + let recovery = fixture.current_attempt(); + assert_eq!(recovery.state(), WorkAttemptStateV1::RecoveryRequired); + assert!(recovery.terminal().is_none()); + assert!(recovery.artifacts().is_empty()); + assert_eq!( + fixture + .effects + .load(&fixture.context, fixture.identity()) + .unwrap() + .unwrap() + .resolution(), + Some(WorkAttemptEffectResolutionV1::NoEffect) + ); + }); +} + +#[test] +fn still_recovering_admission_executes_no_effect_and_leaves_retryable_work() { + without_tokio(async { + let (_directory, lease, _convergence, _held) = recovering_store().await; + for protocol in [ + WorkProviderProtocol::ClaudeStreamJson, + WorkProviderProtocol::CodexAppServerJsonRpc, + ] { + let root = tempfile::tempdir().unwrap(); + let marker = root.path().join("effect"); + let executable = fake_executable( + root.path(), + "provider", + &format!("#!/bin/sh\ntouch '{}'\nprintf output\n", marker.display()), + ); + let shape = SnapshotShape { + backend: if protocol == WorkProviderProtocol::CodexAppServerJsonRpc { + WorkProviderBackendV1::CodexAppServer + } else { + WorkProviderBackendV1::ClaudeCodeCli + }, + ..SnapshotShape::default() + }; + let fixture = leased_attempt_with_effect( + root.path(), + "Do not lose output.", + &shape, + WorkEffectStateV1::CompoundNonRepeatable, + ); + let error = lease.workflow_storage().await.err().unwrap(); + assert!(error.is_workflow_authority_recovering()); + execute(&fixture, executable, None, protocol).await; + assert!(!marker.exists()); + assert_eq!(fixture.state(), WorkAttemptStateV1::RecoveryRequired); + assert!(fixture.current_attempt().artifacts().is_empty()); + assert_eq!( + fixture + .effects + .load(&fixture.context, fixture.identity()) + .unwrap() + .unwrap() + .resolution(), + Some(WorkAttemptEffectResolutionV1::NoEffect) + ); + assert_eq!( + fixture.rows.observed_states(), + vec![ + WorkAttemptStateV1::Leased, + WorkAttemptStateV1::RecoveryRequired + ] + ); + let recovery = fixture.current_attempt(); + let failure = RuntimeWorkRetryEvidenceV1 + .resolve_failure( + &fixture.authority, + &recovery, + &WorkRetryFailureSelectorV1 { + source: WorkRetrySourceV1::Runtime, + cause: WorkRetryCauseV1::RestartRecoveryRequired, + evidence_ref: "recovery-required".to_owned(), + }, + ) + .unwrap(); + assert_eq!( + failure.observed_at, + match recovery.recovery() { + WorkRecoveryStateV1::RecoveryRequired { observed_at, .. } => *observed_at, + _ => panic!("expected recoverable output admission"), + } + ); + } + }); +} + +#[test] +fn cancellation_wins_output_admission_during_recovery_without_launching() { + without_tokio(async { + let (_directory, lease, _convergence, _held) = recovering_store().await; + for protocol in [ + WorkProviderProtocol::ClaudeStreamJson, + WorkProviderProtocol::CodexAppServerJsonRpc, + ] { + let root = tempfile::tempdir().unwrap(); + let marker = root.path().join("effect"); + let executable = fake_executable( + root.path(), + "provider", + &format!("#!/bin/sh\ntouch '{}'\n", marker.display()), + ); + let fixture = leased_attempt( + root.path(), + "Cancel before output admission.", + &SnapshotShape::default(), + ); + let identity = fixture.identity(); + fixture + .attempts + .request_cancellation( + &fixture.context, + CancelWorkAttemptCommand { + task_id: identity.task_id().clone(), + run_id: identity.run_id().clone(), + attempt_id: identity.attempt_id().clone(), + request_id: id("cancel.output-admission"), + occurred_at: now_micros(), + }, + ) + .unwrap(); + assert!(lease.workflow_recovery_pending()); + execute(&fixture, executable, None, protocol).await; + assert!(!marker.exists()); + assert_eq!(fixture.state(), WorkAttemptStateV1::Cancelled); + assert!( + fixture + .effects + .load(&fixture.context, identity) + .unwrap() + .is_none() + ); + } + }); +} From 21176185c1017a74d7ebdda8284604b84a4f0a83 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 02:30:53 -0800 Subject: [PATCH 46/63] fix(build): clear root clippy failures on this branch A unix test in the SQLite attachment called a Linux-only helper, so that crate's unit tests did not compile on macOS. The check is now Linux-only, matching the helper. The rest are lint fixes with no behavior change: the daemon reset report builds its section without format-push, and two tests match the outcome directly and show the value when they fail. Co-Authored-By: Claude Opus 5.5 --- .../automation/jobs/scheduler_config_tests.rs | 6 +++--- .../src/automation/runner/retrieval.rs | 11 ++++------ .../tracedecay-daemon-control/src/service.rs | 20 +++++++++++-------- .../src/repository/attachment.rs | 1 + 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs b/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs index 3f7a6b28a9..86d15f8efb 100644 --- a/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs +++ b/crates/tracedecay-automation-runtime/src/automation/jobs/scheduler_config_tests.rs @@ -384,11 +384,11 @@ async fn unconfigured_backend_jobs_are_blocked_without_failure_cooldown_and_reco "a failure under the current backend must keep its cooldown" ); let isolated = tempfile::TempDir::new().unwrap(); - assert!( + assert_eq!( load_run_records_for_task_key(isolated.path(), &super::job_task_key(&job.id), 100) .await - .unwrap() - .is_empty() + .unwrap(), + Vec::new() ); } diff --git a/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs b/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs index a1dfcff713..adda2559b1 100644 --- a/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs +++ b/crates/tracedecay-automation-runtime/src/automation/runner/retrieval.rs @@ -988,19 +988,16 @@ mod authority_tests { "the empty evidence is still hashed so the skip is attributable" ); } - other => match other { - crate::automation::runner::evidence::SessionReflectorEvidenceOutcome::Ready( - bundle, - ) => panic!( + crate::automation::runner::evidence::SessionReflectorEvidenceOutcome::Ready(bundle) => { + panic!( "an empty store must not produce evidence; got {} hits", bundle .evidence .get("hits") .and_then(Value::as_array) .map_or(0, Vec::len) - ), - _ => panic!("expected an empty-evidence skip"), - }, + ) + } } } diff --git a/crates/tracedecay-daemon-control/src/service.rs b/crates/tracedecay-daemon-control/src/service.rs index 4898f11903..e574fcd483 100644 --- a/crates/tracedecay-daemon-control/src/service.rs +++ b/crates/tracedecay-daemon-control/src/service.rs @@ -1766,14 +1766,18 @@ pub fn service_status( let resets = if process.reset_required_stores().is_empty() { String::new() } else { - let mut section = String::from("reset required:\n"); - for refusal in process.reset_required_stores() { - section.push_str(&format!( - " {} ({}) - {}\n remedy: {}\n", - refusal.store, refusal.authority, refusal.reason, refusal.remedy - )); - } - section + let refusals = process + .reset_required_stores() + .iter() + .map(|refusal| { + format!( + " {} ({}) - {}\n remedy: {}\n", + refusal.store, refusal.authority, refusal.reason, refusal.remedy + ) + }) + .collect::>() + .concat(); + format!("reset required:\n{refusals}") }; let display = format!( "state: {state}\nservice: {service}\nservice manager: {service_manager}\n{transport_kind}: {transport} ({socket_state})\nprotocol: {process}\n{resets}{detail}logs: {logs}\n", diff --git a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs index e907ff1118..fff07ab2ea 100644 --- a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs +++ b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs @@ -1443,6 +1443,7 @@ mod tests { thread::sleep(Duration::from_millis(5)); } assert!(attachment.lost_file_closed()); + #[cfg(target_os = "linux")] assert!( deleted_descriptors(directory.path()).is_empty(), "the last lost worker exiting must release every deleted-file descriptor" From 239ae2f8df7575ebf07e3aa3810b183b03971655 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 02:31:05 -0800 Subject: [PATCH 47/63] fix(global-db): report a retrying workflow upgrade as retrying Doctor called a store waiting on its next workflow upgrade attempt stopped, and the only difference between it and a real failure was text in a message. Schema convergence now has a typed retrying state that keeps the last failure, separate from degraded, which now means nothing retries on this mount. Status, the dashboard, and the CLI show it. CLI doctor warns rather than fails, since the daemon clears it by itself. A refusal stays terminal, and the retry delay is unchanged. Three paths could leave a store recovering with no worker, or report retrying with none running: - A retirement refused by a client lease had already stopped the worker, so the restored mount answered recovering until restart. The interrupted plan now runs again on the restored owner. - A retry that woke during a retirement fence exited, though the fence could still roll back. It now waits for the next attempt. - A worker that found its owner gone left retrying on display, and so did a missing timer. Both now report degraded, without overwriting a successor. A retry also takes its strong lease only after the foreground gate and the convergence permit, so queueing no longer holds a client that blocks the store's retirement. Co-Authored-By: Claude Opus 5.5 --- crates/tracedecay-cli/src/status_cmd.rs | 11 + .../src/retrieval/project_info_surface.rs | 1 + .../src/storage/convergence.rs | 5 + .../src/storage/findings.rs | 6 +- .../src/doctor_kernel.rs | 13 +- .../src/handlers/info/status.rs | 18 +- .../src/session_registry/code_reads.rs | 11 +- .../src/session_registry/maintenance.rs | 228 +++++++++-- ...ublished_workflow_recovery_journey_test.rs | 34 +- .../src/daemon/store_runtime_tests.rs | 383 +++++++++++++++++- crates/tracedecay/src/doctor.rs | 6 + crates/tracedecay/src/doctor/tests.rs | 1 + .../schemas/dashboard-contracts.schema.json | 27 +- dashboard/src/contracts/decoders.ts | 2 +- dashboard/src/contracts/types.ts | 2 +- .../workspaces/brain/ScopedBrain.dom.test.tsx | 2 + .../observatory/DoctorInspector.dom.test.tsx | 6 + .../observatory/DoctorInspector.tsx | 1 + plugin/chatgpt-extension/embedded/server.mjs | 2 +- sdks/typescript/src/operations.ts | 8 +- 20 files changed, 689 insertions(+), 78 deletions(-) diff --git a/crates/tracedecay-cli/src/status_cmd.rs b/crates/tracedecay-cli/src/status_cmd.rs index f55e162c31..4d2c42abad 100644 --- a/crates/tracedecay-cli/src/status_cmd.rs +++ b/crates/tracedecay-cli/src/status_cmd.rs @@ -414,6 +414,7 @@ async fn handle_status_command_within( match finding.state { SchemaConvergenceStateV1::Pending | SchemaConvergenceStateV1::Running + | SchemaConvergenceStateV1::Retrying | SchemaConvergenceStateV1::Degraded | SchemaConvergenceStateV1::Completed => { println!("{}", schema_convergence_line(finding)); @@ -678,6 +679,16 @@ mod tests { schema_convergence_line(&convergence), "schema convergence: profile-sessions registered_schema running, started_at=42" ); + let retrying = SchemaConvergenceFindingV1 { + state: SchemaConvergenceStateV1::Retrying, + degraded_row: Some("database is locked".to_owned()), + ..convergence + }; + assert_eq!( + schema_convergence_line(&retrying), + "schema convergence: profile-sessions registered_schema retrying, started_at=42, \ + row database is locked" + ); let project_open = ProjectOpenStatusV1 { state: ProjectOpenStatusStateV1::Stalled, diff --git a/crates/tracedecay-contracts/src/retrieval/project_info_surface.rs b/crates/tracedecay-contracts/src/retrieval/project_info_surface.rs index 378d9990cf..69b8e7bbb8 100644 --- a/crates/tracedecay-contracts/src/retrieval/project_info_surface.rs +++ b/crates/tracedecay-contracts/src/retrieval/project_info_surface.rs @@ -286,6 +286,7 @@ pub struct StatusSchemaConvergenceV1 { pub enum StatusSchemaConvergenceStateV1 { Completed, InProgress, + Retrying, Degraded, } diff --git a/crates/tracedecay-contracts/src/storage/convergence.rs b/crates/tracedecay-contracts/src/storage/convergence.rs index 6badc8d9ff..21596d9541 100644 --- a/crates/tracedecay-contracts/src/storage/convergence.rs +++ b/crates/tracedecay-contracts/src/storage/convergence.rs @@ -20,6 +20,10 @@ impl SchemaConvergenceStageV1 { pub enum SchemaConvergenceStateV1 { Pending, Running, + /// The last attempt failed and the store's convergence task tries again by + /// itself. `degraded_row` carries that attempt's failure. + Retrying, + /// Convergence stopped on a failure and nothing retries it on this mount. Degraded, Completed, } @@ -29,6 +33,7 @@ impl SchemaConvergenceStateV1 { match self { Self::Pending => "pending", Self::Running => "running", + Self::Retrying => "retrying", Self::Degraded => "degraded", Self::Completed => "completed", } diff --git a/crates/tracedecay-contracts/src/storage/findings.rs b/crates/tracedecay-contracts/src/storage/findings.rs index f7b1876a9a..a504df7fe9 100644 --- a/crates/tracedecay-contracts/src/storage/findings.rs +++ b/crates/tracedecay-contracts/src/storage/findings.rs @@ -72,9 +72,9 @@ pub fn wal_checkpoint_pinned_finding( /// Convergence runs the authority-invariant audit, whose cost scales with the /// store, after admission rather than inside an open's write lease, and the /// daemon serves while it runs. `state` carries what the convergence authority -/// observed: `Stale` while it is pending or running, and `Degraded` once it -/// has stopped on a failure. Coverage is complete either way; the state is -/// observed, not inferred. +/// observed: `Stale` while it is pending or running, and `Degraded` once an +/// attempt has failed, whether it retries by itself or has stopped. Coverage is +/// complete either way; the state is observed, not inferred. pub fn schema_convergence_incomplete_finding( store: &StoreKeyV1, state: DoctorEvidenceStateV1, diff --git a/crates/tracedecay-daemon-service/src/doctor_kernel.rs b/crates/tracedecay-daemon-service/src/doctor_kernel.rs index 33ad98dac3..167442e0a0 100644 --- a/crates/tracedecay-daemon-service/src/doctor_kernel.rs +++ b/crates/tracedecay-daemon-service/src/doctor_kernel.rs @@ -216,9 +216,10 @@ fn code_index_mount_state(staleness: Option) -> CodeI /// for minutes after the daemon is already serving. That is deliberate: it /// runs after the fail-closed admission checks and outside any caller's write /// lease, so it blocks neither admission nor retrieval. What it must not do is -/// stay invisible. A shard still pending or running reads as `Stale`, and one -/// whose convergence failed reads as `Degraded`, carrying the failure the -/// convergence task recorded. An empty set is absent rather than a healthy claim, since a +/// stay invisible. A shard still pending or running reads as `Stale`. One whose +/// last attempt failed reads as `Degraded` and carries the failure the +/// convergence task recorded, named `retrying` while the task will try again by +/// itself and `stopped` once nothing will. An empty set is absent rather than a healthy claim, since a /// daemon with no mounted shard has converged nothing. #[must_use] pub fn schema_convergence_incomplete_read( @@ -244,6 +245,12 @@ pub fn schema_convergence_incomplete_read( "running".to_owned(), "schema convergence is running; the store stays served meanwhile", ), + RegisteredSchemaConvergenceStatus::Retrying { message } => ( + DoctorEvidenceStateV1::Degraded, + format!("retrying.{message}"), + "schema convergence failed an attempt and retries by itself; workflow storage \ + answers typed recovering meanwhile", + ), RegisteredSchemaConvergenceStatus::Degraded { message } => ( DoctorEvidenceStateV1::Degraded, format!("stopped.{message}"), diff --git a/crates/tracedecay-mcp/src/handlers/info/status.rs b/crates/tracedecay-mcp/src/handlers/info/status.rs index 0420ba429e..6407b9752e 100644 --- a/crates/tracedecay-mcp/src/handlers/info/status.rs +++ b/crates/tracedecay-mcp/src/handlers/info/status.rs @@ -79,6 +79,11 @@ fn schema_convergence_status(findings: &[SchemaConvergenceFindingV1]) -> StatusS .any(|finding| finding.state == SchemaConvergenceStateV1::Degraded) { StatusSchemaConvergenceStateV1::Degraded + } else if findings + .iter() + .any(|finding| finding.state == SchemaConvergenceStateV1::Retrying) + { + StatusSchemaConvergenceStateV1::Retrying } else if findings.iter().any(|finding| { matches!( finding.state, @@ -1537,6 +1542,7 @@ mod tests { for (state, expected) in [ (SchemaConvergenceStateV1::Pending, "in_progress"), (SchemaConvergenceStateV1::Running, "in_progress"), + (SchemaConvergenceStateV1::Retrying, "retrying"), (SchemaConvergenceStateV1::Degraded, "degraded"), (SchemaConvergenceStateV1::Completed, "completed"), ] { @@ -1545,8 +1551,11 @@ mod tests { stage: SchemaConvergenceStageV1::RegisteredSchema, state, started_at_micros: 42, - degraded_row: (state == SchemaConvergenceStateV1::Degraded) - .then(|| "observation_id=obs-7".to_owned()), + degraded_row: matches!( + state, + SchemaConvergenceStateV1::Retrying | SchemaConvergenceStateV1::Degraded + ) + .then(|| "observation_id=obs-7".to_owned()), }; let value = serde_json::to_value(schema_convergence_status(&[finding])) .expect("schema convergence serializes"); @@ -1556,7 +1565,10 @@ mod tests { let rendered = render_status_md(&serde_json::json!({"schema_convergence": value})); assert!(rendered.contains(state.as_str())); assert!(rendered.contains("profile-sessions")); - if state == SchemaConvergenceStateV1::Degraded { + if matches!( + state, + SchemaConvergenceStateV1::Retrying | SchemaConvergenceStateV1::Degraded + ) { assert!(rendered.contains("observation_id=obs-7")); } } diff --git a/crates/tracedecay-store-runtime/src/session_registry/code_reads.rs b/crates/tracedecay-store-runtime/src/session_registry/code_reads.rs index 6c66fba0ac..e2dd418a90 100644 --- a/crates/tracedecay-store-runtime/src/session_registry/code_reads.rs +++ b/crates/tracedecay-store-runtime/src/session_registry/code_reads.rs @@ -246,12 +246,21 @@ impl DaemonSessionRuntimeRegistryV1 { let lease = replacement.issue_old_lease()?; let path = lease.db_path().to_path_buf(); let (issuer, binding, locator, path) = replacement.replay_descriptor(path)?; + let convergence_issuer = issuer.clone(); + let shard_id = binding.shard_id.clone(); self.rebind_project_session_sync(project_id, &lease).await?; drop(lease); self.remote_replay_transaction .register_target(project_id.clone(), issuer, binding, locator, path) .map_err(|error| session_registry_error("restore project replay target", error))?; - replacement.restore_old_ready() + replacement.restore_old_ready()?; + self.registered_schema_convergence.resume_interrupted( + &shard_id, + convergence_issuer, + self.registry.open_cancellation().clone(), + Arc::clone(&self.reset_required_stores), + ); + Ok(()) } /// Rolls an unattached session-store retirement back to serving: the sync diff --git a/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs b/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs index cb6c102fe3..30d385474f 100644 --- a/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs +++ b/crates/tracedecay-store-runtime/src/session_registry/maintenance.rs @@ -19,6 +19,7 @@ use tracedecay_domain::errors::{ use tracedecay_global_db::RegisteredGlobalDbWeakLeaseIssuerV1; use tracedecay_global_db::schema_stages::RegisteredSchemaConvergence; use tracedecay_runtime_core::cancellation::CancellationToken; +use tracedecay_runtime_core::db::DatabaseOwnerWeakLeaseIssuerErrorV1; use tracedecay_runtime_core::native_runtime::{self, NativeTask}; use tracedecay_runtime_core::storage::profile_root_of_sharded_data_root; use tracedecay_store::{StoreRuntimeBindingV1, StoreShardIdV1, StoreShardScopeV1}; @@ -36,7 +37,14 @@ pub enum RegisteredSchemaConvergenceStatus { Pending, Running, Complete, - Degraded { message: String }, + /// The last attempt failed and the store's task tries again by itself. + Retrying { + message: String, + }, + /// Convergence stopped on a failure and nothing retries it on this mount. + Degraded { + message: String, + }, } type RegisteredSchemaConvergenceStatuses = @@ -52,6 +60,26 @@ pub(super) type ResetRequiredStores = StdMutex, + shard_id: &StoreShardIdV1, + message: String, +) { + let mut statuses = lock_registered_schema_convergence_statuses(statuses); + if matches!( + statuses.get(shard_id), + Some(RegisteredSchemaConvergenceStatus::Retrying { .. }) + ) { + statuses.insert( + shard_id.clone(), + RegisteredSchemaConvergenceStatus::Degraded { message }, + ); + } +} + fn lock_registered_schema_convergence_statuses( statuses: &StdMutex, ) -> MutexGuard<'_, RegisteredSchemaConvergenceStatuses> { @@ -81,6 +109,9 @@ pub(super) struct RegisteredSchemaConvergenceMaintenance { concurrency: Arc, statuses: Arc>, metadata: Arc>, + /// The plan of each scheduled store, kept past a retirement that interrupted + /// it so a retirement rolled back can run it again. + plans: StdMutex>, tasks: StdMutex>>>, #[cfg(any(test, feature = "test-helpers"))] schedule_count: std::sync::atomic::AtomicUsize, @@ -146,13 +177,13 @@ impl SchemaConvergenceTarget { } } - /// The next attempt's target, or `None` once the store's owner is gone. + /// The next attempt's target, unless the store's owner cannot issue one. fn reissued( issuer: &RegisteredGlobalDbWeakLeaseIssuerV1, convergence: RegisteredSchemaConvergence, cancellation: &CancellationToken, - ) -> Option { - issuer.issue_lease().ok().map(|database| Self::Registered { + ) -> std::result::Result { + issuer.issue_lease().map(|database| Self::Registered { database, convergence, cancellation: cancellation.clone(), @@ -217,6 +248,7 @@ impl RegisteredSchemaConvergenceMaintenance { concurrency: Arc::new(Semaphore::new(1)), statuses: Arc::new(StdMutex::new(BTreeMap::new())), metadata: Arc::new(StdMutex::new(BTreeMap::new())), + plans: StdMutex::new(BTreeMap::new()), tasks: StdMutex::new(BTreeMap::new()), #[cfg(any(test, feature = "test-helpers"))] schedule_count: std::sync::atomic::AtomicUsize::new(0), @@ -244,8 +276,8 @@ impl RegisteredSchemaConvergenceMaintenance { /// Every shard whose schema convergence has not completed. /// /// Convergence runs the authority-invariant audit, whose cost scales with - /// the store, so on a large store it can be pending, running, or degraded - /// for a long while after the daemon starts serving. Reporting that is what + /// the store, so on a large store it can be pending, running, retrying, or + /// degraded for a long while after the daemon starts serving. Reporting that is what /// makes the daemon's own answer honest: an operator sees which shard has /// not converged and why, instead of a healthy claim or a crash loop. pub(super) fn unconverged(&self) -> Vec<(StoreShardIdV1, RegisteredSchemaConvergenceStatus)> { @@ -276,6 +308,9 @@ impl RegisteredSchemaConvergenceMaintenance { RegisteredSchemaConvergenceStatus::Complete => { (SchemaConvergenceStateV1::Completed, None) } + RegisteredSchemaConvergenceStatus::Retrying { message } => { + (SchemaConvergenceStateV1::Retrying, Some(message.clone())) + } RegisteredSchemaConvergenceStatus::Degraded { message } => { (SchemaConvergenceStateV1::Degraded, Some(message.clone())) } @@ -358,9 +393,10 @@ impl RegisteredSchemaConvergenceMaintenance { // An attempt holds its store's owner open, so a store mounted // again over a failed upgrade has a new owner. The old worker // can only find its own owner gone; this owner needs its own. - Some(RegisteredSchemaConvergenceStatus::Degraded { .. }) - if convergence.recovers_published_workflow_shape() => - { + Some( + RegisteredSchemaConvergenceStatus::Retrying { .. } + | RegisteredSchemaConvergenceStatus::Degraded { .. }, + ) if convergence.recovers_published_workflow_shape() => { if let Some(superseded) = tasks.remove(&shard_id) { superseded.abort(); } @@ -375,6 +411,10 @@ impl RegisteredSchemaConvergenceMaintenance { statuses.insert(shard_id.clone(), RegisteredSchemaConvergenceStatus::Pending); } drop(metadata); + self.plans + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .insert(shard_id.clone(), convergence); #[cfg(any(test, feature = "test-helpers"))] self.schedule_count.fetch_add(1, Ordering::Relaxed); #[cfg(any(test, feature = "test-helpers"))] @@ -391,15 +431,38 @@ impl RegisteredSchemaConvergenceMaintenance { let task_shard_id = shard_id.clone(); // Erase the worker state machine before instrumentation retains it. let work: Pin + Send>> = Box::pin(async move { - let mut target = target; + let mut first_target = Some(target); #[cfg(any(test, feature = "test-helpers"))] let mut first_attempt_gate = gate.clone(); loop { + if first_target.is_none() { + #[cfg(any(test, feature = "test-helpers"))] + let delay = match &gate { + Some(gate) => gate.pace_retry().await, + None => WORKFLOW_RECOVERY_RETRY_DELAY, + }; + #[cfg(not(any(test, feature = "test-helpers")))] + let delay = WORKFLOW_RECOVERY_RETRY_DELAY; + // Retirement and shutdown abort this wait with the task. + if let Err(error) = native_runtime::sleep_until(Instant::now() + delay).await { + // Without a timer every wait would return at once and spin. + tracing::error!( + event = "registered_schema_convergence_timer_unavailable", + %error + ); + stop_retrying( + &statuses, + &task_shard_id, + format!("the workflow upgrade retry timer is unavailable: {error}"), + ); + return; + } + } foreground_project_opens.wait_until_settled().await; let permit = match Arc::clone(&concurrency).acquire_owned().await { Ok(permit) => permit, Err(error) => { - drop(target); + drop(first_target); lock_registered_schema_convergence_statuses(&statuses).insert( task_shard_id, RegisteredSchemaConvergenceStatus::Degraded { @@ -411,6 +474,35 @@ impl RegisteredSchemaConvergenceMaintenance { return; } }; + // A retry takes its lease only once it may run, so queueing + // behind project opens or another store's convergence holds + // nothing that would block this store's retirement. + let target = match first_target.take() { + Some(target) => target, + None => match SchemaConvergenceTarget::reissued( + &retry_issuer, + convergence, + &cancellation, + ) { + Ok(target) => target, + // A retirement fence can still roll back to this owner, + // and nothing would restart a worker that left now. + Err(DatabaseOwnerWeakLeaseIssuerErrorV1::Retiring) => continue, + Err( + DatabaseOwnerWeakLeaseIssuerErrorV1::Terminal + | DatabaseOwnerWeakLeaseIssuerErrorV1::Unavailable, + ) => { + stop_retrying( + &statuses, + &task_shard_id, + "the store was closed before its workflow upgrade finished; \ + mounting it again resumes the upgrade" + .to_owned(), + ); + return; + } + }, + }; lock_registered_schema_convergence_statuses(&statuses).insert( task_shard_id.clone(), RegisteredSchemaConvergenceStatus::Running, @@ -439,7 +531,6 @@ impl RegisteredSchemaConvergenceMaintenance { // large heap, which would stall this native worker's I/O. let _ = native_runtime::spawn_blocking(release_process_allocator_memory_v1).await; drop(permit); - let mut retry = false; let status = match result { Ok(()) => { crate::session_registry::log_store_runtime_event( @@ -463,24 +554,28 @@ impl RegisteredSchemaConvergenceMaintenance { Some(&refused), ); } - retry = target.awaits_workflow_recovery(); - let message = if retry { - format!("{error}; retrying the workflow upgrade in the background") - } else { - error.to_string() - }; + let retry = target.awaits_workflow_recovery(); + let message = error.to_string(); crate::session_registry::log_store_runtime_event( "registered_schema_convergence", &[ - ("outcome", "degraded".to_owned()), + ( + "outcome", + if retry { "retrying" } else { "degraded" }.to_owned(), + ), ("database", target.db_path().display().to_string()), ("shard", format!("{task_shard_id:?}")), ("error", message.clone()), ], ); - RegisteredSchemaConvergenceStatus::Degraded { message } + if retry { + RegisteredSchemaConvergenceStatus::Retrying { message } + } else { + RegisteredSchemaConvergenceStatus::Degraded { message } + } } }; + let retry = matches!(status, RegisteredSchemaConvergenceStatus::Retrying { .. }); // Between attempts the task holds only the weak issuer, so a // store waiting out a full disk never blocks its owner's // retirement. @@ -490,28 +585,6 @@ impl RegisteredSchemaConvergenceMaintenance { if !retry { return; } - #[cfg(any(test, feature = "test-helpers"))] - let delay = match &gate { - Some(gate) => gate.pace_retry().await, - None => WORKFLOW_RECOVERY_RETRY_DELAY, - }; - #[cfg(not(any(test, feature = "test-helpers")))] - let delay = WORKFLOW_RECOVERY_RETRY_DELAY; - // Retirement and shutdown abort this wait with the task. - if let Err(error) = native_runtime::sleep_until(Instant::now() + delay).await { - // Without a timer every wait would return at once and spin. - tracing::error!( - event = "registered_schema_convergence_timer_unavailable", - %error - ); - return; - } - let Some(next) = - SchemaConvergenceTarget::reissued(&retry_issuer, convergence, &cancellation) - else { - return; - }; - target = next; } }); match NativeTask::spawn(tracing::Instrument::instrument( @@ -568,11 +641,73 @@ impl RegisteredSchemaConvergenceMaintenance { .lock() .unwrap_or_else(std::sync::PoisonError::into_inner) .remove(shard_id); - lock_registered_schema_convergence_statuses(&self.statuses).remove(shard_id); + let status = + lock_registered_schema_convergence_statuses(&self.statuses).remove(shard_id); + if !matches!( + status, + Some( + RegisteredSchemaConvergenceStatus::Pending + | RegisteredSchemaConvergenceStatus::Running + | RegisteredSchemaConvergenceStatus::Retrying { .. } + ) + ) { + self.plans + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .remove(shard_id); + } } Ok(()) } + /// Runs again the plan a retirement interrupted, now that the retirement has + /// rolled back and the same owner serves. Without this a store it cut short + /// would stay recovering, with nothing left to finish its upgrade. + pub(super) fn resume_interrupted( + &self, + shard_id: &StoreShardIdV1, + retry_issuer: RegisteredGlobalDbWeakLeaseIssuerV1, + cancellation: CancellationToken, + reset_required_stores: Arc, + ) { + let plan = self + .plans + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .remove(shard_id); + let Some(convergence) = plan else { + return; + }; + match retry_issuer.issue_lease() { + Ok(database) => self.schedule( + database, + retry_issuer, + Some(convergence), + cancellation, + reset_required_stores, + ), + Err(error) => { + self.metadata + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .entry(shard_id.clone()) + .or_insert(( + SchemaConvergenceStageV1::RegisteredSchema, + tracedecay_contracts::now_micros().0, + )); + lock_registered_schema_convergence_statuses(&self.statuses).insert( + shard_id.clone(), + RegisteredSchemaConvergenceStatus::Degraded { + message: format!( + "schema convergence did not restart after a rolled-back retirement: \ + {error:?}" + ), + }, + ); + } + } + } + pub(super) fn begin_shutdown(&self) { self.accepting.store(false, Ordering::Release); let tasks = self @@ -961,6 +1096,13 @@ impl DaemonSessionRuntimeRegistryV1 { self.registered_schema_convergence.install_gate() } + /// Closes the session-graph open task's admission, so every store mounted + /// after this settles detached, the state a failed graph open leaves behind. + #[cfg(any(test, feature = "test-helpers"))] + pub fn detach_session_graphs_for_test(&self) { + self.retained_hook_tasks.begin_shutdown(); + } + #[cfg(any(test, feature = "test-helpers"))] pub fn registered_schema_convergence_schedule_count_for_test(&self) -> usize { self.registered_schema_convergence diff --git a/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs index e86234f767..d0d025dcef 100644 --- a/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs +++ b/crates/tracedecay/src/daemon/production_harness/published_workflow_recovery_journey_test.rs @@ -154,6 +154,30 @@ async fn wait_for_status( .expect("the store's upgrade must reach the expected state") } +/// What the status tool tells an MCP client about a store between attempts. +async fn assert_status_reports_retrying(composition: &ProductionProjectComposition) { + let response = call(composition, "tracedecay_status", json!({"format": "json"})).await; + let wire = serde_json::to_value(&response).expect("tool response wire"); + let status: Value = serde_json::from_str( + wire.pointer("/result/content/0/text") + .and_then(Value::as_str) + .unwrap_or_else(|| panic!("status has no JSON text: {wire}")), + ) + .expect("status JSON"); + let convergence = &status["schema_convergence"]; + assert_eq!(convergence["status"], "retrying", "{convergence}"); + let retrying = convergence["findings"] + .as_array() + .expect("convergence findings") + .iter() + .find(|finding| finding["state"] == "retrying") + .unwrap_or_else(|| panic!("no retrying finding: {convergence}")); + assert!( + retrying["degraded_row"].is_string(), + "the attempt's failure stays visible: {retrying}" + ); +} + #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn code_reads_serve_while_a_transient_lock_blocks_the_workflow_upgrade() { let isolation = TempDir::new().expect("production harness isolation"); @@ -211,15 +235,11 @@ async fn code_reads_serve_while_a_transient_lock_blocks_the_workflow_upgrade() { peer.execute_batch("BEGIN IMMEDIATE") .expect("hold the write lock"); gate.release(); - let status = wait_for_status(®istry, &shard, |status| { - matches!(status, RegisteredSchemaConvergenceStatus::Degraded { .. }) + wait_for_status(®istry, &shard, |status| { + matches!(status, RegisteredSchemaConvergenceStatus::Retrying { .. }) }) .await; - assert!( - matches!(&status, RegisteredSchemaConvergenceStatus::Degraded { message } - if message.contains("retrying")), - "{status:?}" - ); + assert_status_reports_retrying(&composition).await; assert_code_reads_serve(&composition, "a held lock fails the upgrade").await; assert_workflow_tools_recovering(&composition, "a held lock fails the upgrade").await; diff --git a/crates/tracedecay/src/daemon/store_runtime_tests.rs b/crates/tracedecay/src/daemon/store_runtime_tests.rs index 7254457f96..bc7d191dac 100644 --- a/crates/tracedecay/src/daemon/store_runtime_tests.rs +++ b/crates/tracedecay/src/daemon/store_runtime_tests.rs @@ -1089,10 +1089,10 @@ async fn shutdown_ends_the_wait_between_published_workflow_attempts() { .expect("hold the write lock"); convergence_gate.release(); let status = wait_for_schema_convergence_past_obstruction(®istry, &shard_id).await; - let RegisteredSchemaConvergenceStatus::Degraded { message } = status else { - panic!("the held lock must fail the attempt: {status:?}"); - }; - assert!(message.contains("retrying"), "{message}"); + assert!( + matches!(status, RegisteredSchemaConvergenceStatus::Retrying { .. }), + "the held lock must fail the attempt and leave it retrying: {status:?}" + ); peer.execute_batch("ROLLBACK").expect("drop the write lock"); drop(peer); let attempts = registry.registered_schema_convergence_execution_count_for_test(); @@ -1124,6 +1124,381 @@ async fn shutdown_ends_the_wait_between_published_workflow_attempts() { assert_eq!(published_workflow_state(&sessions_path), published); } +/// The doctor's evidence reference for the one store still converging. +fn schema_convergence_doctor_evidence(registry: &DaemonSessionRuntimeRegistryV1) -> String { + let report = tracedecay_daemon_service::doctor_kernel::schema_convergence_incomplete_read( + ®istry.unconverged_registered_schemas(), + ); + let tracedecay_contracts::doctor::DoctorStorageFamilyReadV1::Observed { findings } = report + else { + panic!("an unconverged store must be reported: {report:?}"); + }; + let [finding] = findings.as_slice() else { + panic!("one unconverged store is one finding: {findings:?}"); + }; + assert_eq!( + finding.finding().state(), + tracedecay_contracts::doctor::DoctorEvidenceStateV1::Degraded + ); + finding.finding().evidence()[0] + .reference() + .as_str() + .to_owned() +} + +/// A mounted published store whose first upgrade attempt failed behind a real +/// write lock, parked between attempts with the lock released, so nothing but +/// the waiting task stands between it and the next attempt. +struct PublishedStoreBetweenAttempts { + _temporary: tempfile::TempDir, + _database_scope: tracedecay_runtime_core::db::DaemonDatabaseScope, + _session_sync: Arc, + registry: DaemonSessionRuntimeRegistryV1, + gate: tracedecay_store_runtime::RegisteredSchemaConvergenceTestGate, + database: Option, + project_id: ProjectId, + project_root: PathBuf, + sessions_path: PathBuf, + shard_id: StoreShardIdV1, + published: (String, Vec<(String, Vec)>), +} + +async fn published_store_between_attempts( + project_name: &str, + detached_session_graph: bool, +) -> PublishedStoreBetweenAttempts { + let (temporary, identity, project_id, project_root, sessions_path, database_scope) = + project_sessions_convergence_fixture(project_name, false).await; + age_session_store_to_published_workflow_shape(&sessions_path); + let published = published_workflow_state(&sessions_path); + let shard_id = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id.clone(), + ); + let registry = DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity, true) + .await + .expect("session runtime registry"); + let session_sync = + Arc::new(tracedecay_session_runtime::session_sync::DaemonSessionSyncService::default()); + registry + .install_session_sync_service(&session_sync) + .expect("install session sync lifecycle authority"); + if detached_session_graph { + registry.detach_session_graphs_for_test(); + } + let gate = registry.block_registered_schema_convergence_for_test(); + let database = registry + .project_sessions(project_id.clone(), [project_root.clone()]) + .await + .expect("a published store admits"); + gate.wait_until_blocked().await; + let peer = rusqlite::Connection::open(&sessions_path).expect("open the session store"); + peer.execute_batch("BEGIN IMMEDIATE") + .expect("hold the write lock"); + gate.release(); + let status = wait_for_schema_convergence_past_obstruction(®istry, &shard_id).await; + assert!( + matches!(status, RegisteredSchemaConvergenceStatus::Retrying { .. }), + "a held lock leaves the upgrade retrying: {status:?}" + ); + peer.execute_batch("ROLLBACK").expect("drop the write lock"); + drop(peer); + registry + .settle_project_session_graph(&project_id) + .await + .expect("the session graph settles"); + PublishedStoreBetweenAttempts { + _temporary: temporary, + _database_scope: database_scope, + _session_sync: session_sync, + registry, + gate, + database: Some(database), + project_id, + project_root, + sessions_path, + shard_id, + published, + } +} + +impl PublishedStoreBetweenAttempts { + async fn assert_mounted_again_finishes_the_upgrade(&self) { + let schedules = self + .registry + .registered_schema_convergence_schedule_count_for_test(); + let attempts = self + .registry + .registered_schema_convergence_execution_count_for_test(); + let database = self + .registry + .project_sessions(self.project_id.clone(), [self.project_root.clone()]) + .await + .expect("a store mounted again admits"); + assert_eq!( + self.registry + .registered_schema_convergence_schedule_count_for_test(), + schedules + 1, + "the new owner must get a worker of its own" + ); + self.gate.release(); + assert_eq!( + wait_for_schema_convergence_past_obstruction(&self.registry, &self.shard_id).await, + RegisteredSchemaConvergenceStatus::Complete + ); + assert_eq!( + self.registry + .registered_schema_convergence_execution_count_for_test(), + attempts + 1, + "only the new worker attempts the upgrade" + ); + database + .workflow_storage() + .await + .expect("the mount's own worker finished the upgrade"); + let (digest, rows) = published_workflow_state(&self.sessions_path); + assert_ne!(digest, PUBLISHED_WORKFLOW_DIGEST); + assert_eq!(rows, self.published.1); + } +} + +/// The doctor names a failed attempt that will retry by itself as retrying, with +/// its failure, rather than as stopped. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn doctor_reports_a_store_between_upgrade_attempts_as_retrying() { + let store = + published_store_between_attempts("project.published-workflow-doctor-retrying", false).await; + let evidence = schema_convergence_doctor_evidence(&store.registry); + assert!(evidence.contains(".retrying."), "{evidence}"); + assert!(!evidence.contains("stopped"), "{evidence}"); + let finding = store + .registry + .registered_schema_convergence_observations() + .into_iter() + .next() + .expect("the waiting store is observable"); + assert_eq!( + finding.state, + tracedecay_contracts::storage::SchemaConvergenceStateV1::Retrying + ); + assert!(finding.degraded_row.is_some(), "the failure stays visible"); +} + +/// Retiring a store between attempts ends the wait at once, whatever is left of +/// it: the gate never lets this wait finish. Its status leaves with it, and +/// mounting the store again starts a worker over the new owner. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn retiring_a_store_between_upgrade_attempts_ends_the_wait() { + let mut store = + published_store_between_attempts("project.published-workflow-retry-retire", false).await; + let attempts = store + .registry + .registered_schema_convergence_execution_count_for_test(); + retire_published_store(&mut store).await; + assert_eq!( + store + .registry + .registered_schema_convergence_status(&store.shard_id), + None, + "a retired store reports nothing" + ); + assert_eq!( + store.registry.registered_schema_convergence_observations(), + Vec::new() + ); + assert_eq!( + store + .registry + .registered_schema_convergence_execution_count_for_test(), + attempts, + "the retired wait starts no attempt" + ); + store.assert_mounted_again_finishes_the_upgrade().await; +} + +/// Closes the store through its registry. The fixture's own client is the only +/// lease that could block this: the waiting task holds none. +async fn retire_published_store(store: &mut PublishedStoreBetweenAttempts) { + store.database = None; + tokio::time::timeout( + MUST_NOT_BLOCK, + store + .registry + .retire_project_session_relation_graph(&store.project_id), + ) + .await + .expect("retirement must not wait out the delay between attempts") + .expect("a store between attempts retires"); + assert!( + store + .registry + .mounted_project_sessions(&store.project_id) + .await + .is_none() + ); +} + +/// A retirement that does not retire the worker leaves it waiting on an owner +/// that is gone. Mounting the store again must not trust that worker: only a new +/// one can finish the upgrade. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_remount_replaces_the_worker_of_a_store_still_retrying() { + let mut store = + published_store_between_attempts("project.published-workflow-remount-retrying", true).await; + retire_published_store(&mut store).await; + assert!( + matches!( + store + .registry + .registered_schema_convergence_status(&store.shard_id), + Some(RegisteredSchemaConvergenceStatus::Retrying { .. }) + ), + "this retirement path leaves the worker's status behind" + ); + store.assert_mounted_again_finishes_the_upgrade().await; +} + +/// A worker that wakes to find its owner gone stops claiming to retry, and a +/// mount over that stopped upgrade still gets a worker of its own. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_remount_replaces_the_worker_of_a_previously_failed_upgrade() { + let mut store = + published_store_between_attempts("project.published-workflow-remount-failed", true).await; + let attempts = store + .registry + .registered_schema_convergence_execution_count_for_test(); + retire_published_store(&mut store).await; + store.gate.release(); + let message = tokio::time::timeout(MUST_NOT_BLOCK, async { + loop { + if let Some(RegisteredSchemaConvergenceStatus::Degraded { message }) = store + .registry + .registered_schema_convergence_status(&store.shard_id) + { + return message; + } + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + }) + .await + .expect("a worker whose owner is gone must stop claiming to retry"); + assert!(message.contains("mounting it again"), "{message}"); + assert_eq!( + store + .registry + .registered_schema_convergence_execution_count_for_test(), + attempts, + "nothing can attempt the upgrade of a closed store" + ); + let evidence = schema_convergence_doctor_evidence(&store.registry); + assert!(evidence.contains(".stopped."), "{evidence}"); + assert!(!evidence.contains(".retrying."), "{evidence}"); + store.assert_mounted_again_finishes_the_upgrade().await; +} + +/// A retirement refused by an outstanding client rolls back to the same owner. +/// It already stopped the worker, so without a new one the mounted store would +/// answer recovering until the daemon restarted. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_rolled_back_retirement_restarts_the_interrupted_upgrade() { + let store = + published_store_between_attempts("project.published-workflow-retire-rollback", false).await; + let client = store + .database + .as_ref() + .expect("the fixture's client") + .clone(); + let refusal = store + .registry + .retire_project_session_relation_graph(&store.project_id) + .await + .expect_err("an outstanding client refuses the Store close"); + assert!(refusal.to_string().contains("ClientLeases"), "{refusal}"); + assert_eq!( + store + .registry + .registered_schema_convergence_schedule_count_for_test(), + 2, + "the rolled-back retirement restarts the interrupted plan" + ); + assert!( + client + .workflow_storage() + .await + .err() + .expect("nothing committed yet") + .is_workflow_authority_recovering() + ); + + store.gate.release(); + assert_eq!( + wait_for_schema_convergence_past_obstruction(&store.registry, &store.shard_id).await, + RegisteredSchemaConvergenceStatus::Complete + ); + client + .workflow_storage() + .await + .expect("the same mount finishes the upgrade"); + let (digest, rows) = published_workflow_state(&store.sessions_path); + assert_ne!(digest, PUBLISHED_WORKFLOW_DIGEST); + assert_eq!(rows, store.published.1); +} + +/// A store that stops being the proven shape refuses the upgrade for good. That +/// is the typed reset, never another attempt, however soon the timer would fire. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_refused_upgrade_is_terminal_rather_than_retrying() { + let (_temporary, identity, project_id, project_root, sessions_path, _database_scope) = + project_sessions_convergence_fixture("project.published-workflow-refused", false).await; + age_session_store_to_published_workflow_shape(&sessions_path); + let shard_id = StoreShardIdV1::project_sessions( + identity.brain_id().clone(), + identity.profile_id().clone(), + project_id.clone(), + ); + let registry = DaemonSessionRuntimeRegistryV1::open_with_session_maintenance(identity, true) + .await + .expect("session runtime registry"); + let gate = registry.block_registered_schema_convergence_for_test(); + let database = registry + .project_sessions(project_id, [project_root]) + .await + .expect("a published store admits"); + gate.wait_until_blocked().await; + rusqlite::Connection::open(&sessions_path) + .expect("open the session store") + .execute_batch( + "CREATE INDEX artifact_digest_copy ON workflow_artifact_payloads (byte_length)", + ) + .expect("add an object the proven shape does not include"); + gate.retry_on_timer(std::time::Duration::from_millis(1)); + gate.release(); + + let status = wait_for_schema_convergence_past_obstruction(®istry, &shard_id).await; + assert!( + matches!(status, RegisteredSchemaConvergenceStatus::Degraded { .. }), + "a refusal must not read as retrying: {status:?}" + ); + let attempts = registry.registered_schema_convergence_execution_count_for_test(); + tokio::time::sleep(std::time::Duration::from_millis(200)).await; + assert_eq!( + registry.registered_schema_convergence_execution_count_for_test(), + attempts, + "a refusal is not attempted again" + ); + assert!( + !registry.reset_required_stores().is_empty(), + "a refusal is recorded as the typed reset" + ); + let evidence = schema_convergence_doctor_evidence(®istry); + assert!(evidence.contains(".stopped."), "{evidence}"); + assert!( + database.workflow_storage().await.is_err(), + "a refused store does not serve workflow storage" + ); +} + /// Shutdown stops the upgrade before it commits, and a daemon restart over the /// same store recognizes it and finishes the move. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] diff --git a/crates/tracedecay/src/doctor.rs b/crates/tracedecay/src/doctor.rs index 181fc9682d..76aab4c387 100644 --- a/crates/tracedecay/src/doctor.rs +++ b/crates/tracedecay/src/doctor.rs @@ -467,6 +467,12 @@ fn render_schema_convergences( Some(row) => dc.fail(&format!("{message}: {row}")), None => dc.fail(&message), }, + // The daemon clears this by itself once the obstruction passes, so + // it warns with the failure rather than failing the report. + SchemaConvergenceStateV1::Retrying => match &finding.degraded_row { + Some(row) => dc.warn(&format!("{message}: {row}")), + None => dc.warn(&message), + }, SchemaConvergenceStateV1::Pending | SchemaConvergenceStateV1::Running => { dc.warn(&message); } diff --git a/crates/tracedecay/src/doctor/tests.rs b/crates/tracedecay/src/doctor/tests.rs index 444c8816e8..089c179df8 100644 --- a/crates/tracedecay/src/doctor/tests.rs +++ b/crates/tracedecay/src/doctor/tests.rs @@ -488,6 +488,7 @@ fn schema_convergence_severity_tracks_typed_state() { for (state, issues, warnings) in [ (SchemaConvergenceStateV1::Pending, 0, 1), (SchemaConvergenceStateV1::Running, 0, 1), + (SchemaConvergenceStateV1::Retrying, 0, 1), (SchemaConvergenceStateV1::Degraded, 1, 0), (SchemaConvergenceStateV1::Completed, 0, 0), ] { diff --git a/dashboard/codegen/schemas/dashboard-contracts.schema.json b/dashboard/codegen/schemas/dashboard-contracts.schema.json index 0122e59332..1d35e5924b 100644 --- a/dashboard/codegen/schemas/dashboard-contracts.schema.json +++ b/dashboard/codegen/schemas/dashboard-contracts.schema.json @@ -24919,13 +24919,26 @@ "type": "string" }, "SchemaConvergenceStateV1": { - "enum": [ - "pending", - "running", - "degraded", - "completed" - ], - "type": "string" + "oneOf": [ + { + "enum": [ + "pending", + "running", + "completed" + ], + "type": "string" + }, + { + "const": "retrying", + "description": "The last attempt failed and the store's convergence task tries again by\nitself. `degraded_row` carries that attempt's failure.", + "type": "string" + }, + { + "const": "degraded", + "description": "Convergence stopped on a failure and nothing retries it on this mount.", + "type": "string" + } + ] }, "SchemaId": { "description": "Stable, canonical catalog identity for `SchemaId`.", diff --git a/dashboard/src/contracts/decoders.ts b/dashboard/src/contracts/decoders.ts index cdb278dcb2..09eca2a5d7 100644 --- a/dashboard/src/contracts/decoders.ts +++ b/dashboard/src/contracts/decoders.ts @@ -8954,7 +8954,7 @@ export const SchemaConvergenceFindingV1Schema: z.ZodObject<{ export const SchemaConvergenceStageV1Schema: z.ZodLiteral<"registered_schema"> = z.literal("registered_schema"); -export const SchemaConvergenceStateV1Schema: z.ZodEnum<{ "completed": "completed"; "degraded": "degraded"; "pending": "pending"; "running": "running" }> = z.enum(["completed", "degraded", "pending", "running"]); +export const SchemaConvergenceStateV1Schema: z.ZodType<"completed" | "pending" | "running" | "retrying" | "degraded", unknown> = z.union([z.enum(["completed", "pending", "running"]), z.literal("retrying"), z.literal("degraded")]); /** Stable, canonical catalog identity for `SchemaId`. */ export const SchemaIdSchema: z.ZodType = z.string(); diff --git a/dashboard/src/contracts/types.ts b/dashboard/src/contracts/types.ts index 1e30f40013..649013d24d 100644 --- a/dashboard/src/contracts/types.ts +++ b/dashboard/src/contracts/types.ts @@ -4997,7 +4997,7 @@ export type SchemaConvergenceFindingV1 = { export type SchemaConvergenceStageV1 = "registered_schema"; -export type SchemaConvergenceStateV1 = "completed" | "degraded" | "pending" | "running"; +export type SchemaConvergenceStateV1 = "completed" | "pending" | "running" | "retrying" | "degraded"; export type SchemaId = string; diff --git a/dashboard/src/workspaces/brain/ScopedBrain.dom.test.tsx b/dashboard/src/workspaces/brain/ScopedBrain.dom.test.tsx index 38e51fe227..e02ce297b0 100644 --- a/dashboard/src/workspaces/brain/ScopedBrain.dom.test.tsx +++ b/dashboard/src/workspaces/brain/ScopedBrain.dom.test.tsx @@ -178,6 +178,7 @@ describe('ScopedBrain', () => { const schemaConvergences = [ 'pending', 'running', + 'retrying', 'degraded', 'completed', ].map((state, index) => ({ @@ -214,6 +215,7 @@ describe('ScopedBrain', () => { expect(await screen.findByText('Schema convergence pending')).toBeTruthy(); expect(screen.getByText('Schema convergence running')).toBeTruthy(); + expect(screen.getByText('Schema convergence retrying')).toBeTruthy(); expect(screen.getByText('Schema convergence degraded')).toBeTruthy(); expect(screen.getByText('Schema convergence completed')).toBeTruthy(); }); diff --git a/dashboard/src/workspaces/observatory/DoctorInspector.dom.test.tsx b/dashboard/src/workspaces/observatory/DoctorInspector.dom.test.tsx index 45cd01bfe3..239c5725b8 100644 --- a/dashboard/src/workspaces/observatory/DoctorInspector.dom.test.tsx +++ b/dashboard/src/workspaces/observatory/DoctorInspector.dom.test.tsx @@ -158,6 +158,10 @@ describe('DoctorInspector', () => { response.payload.schema_convergences = [ convergence('pending', 1), convergence('running', 2), + { + ...convergence('retrying', 5), + degraded_row: 'database is locked', + }, { ...convergence('degraded', 3), degraded_row: 'observation_id=obs-7 projector=session_message', @@ -170,6 +174,8 @@ describe('DoctorInspector', () => { expect(await screen.findByText('Schema convergence pending')).toBeTruthy(); expect(screen.getByText('Schema convergence running')).toBeTruthy(); + expect(screen.getByText('Schema convergence retrying')).toBeTruthy(); + expect(screen.getByText(/database is locked/)).toBeTruthy(); expect(screen.getByText('Schema convergence degraded')).toBeTruthy(); expect(screen.getByText('Schema convergence completed')).toBeTruthy(); expect(screen.getByText(/observation_id=obs-7 projector=session_message/)).toBeTruthy(); diff --git a/dashboard/src/workspaces/observatory/DoctorInspector.tsx b/dashboard/src/workspaces/observatory/DoctorInspector.tsx index a734ec65a3..f4e1bc31dd 100644 --- a/dashboard/src/workspaces/observatory/DoctorInspector.tsx +++ b/dashboard/src/workspaces/observatory/DoctorInspector.tsx @@ -170,6 +170,7 @@ function convergenceStateLabel(state: SchemaConvergenceFindingV1['state']): stri { pending: 'Schema convergence pending', running: 'Schema convergence running', + retrying: 'Schema convergence retrying', degraded: 'Schema convergence degraded', completed: 'Schema convergence completed', } satisfies Record diff --git a/plugin/chatgpt-extension/embedded/server.mjs b/plugin/chatgpt-extension/embedded/server.mjs index 39f320ffea..46939ae1db 100644 --- a/plugin/chatgpt-extension/embedded/server.mjs +++ b/plugin/chatgpt-extension/embedded/server.mjs @@ -74,7 +74,7 @@ data: `;return i&&(o+=`id: ${i} `),o+=`data: ${JSON.stringify(r)} -`,e.enqueue(t.encode(o)),!0}catch(e){return this.onerror?.(e),!1}}handleUnsupportedRequest(){return this.onerror?.(Error("Method not allowed.")),Response.json({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null},{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,t){try{var r,i;let o,n,a,s,d,c=e.headers.get("accept");if(!c?.includes("application/json")||!c.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");if(r=e.headers.get("content-type"),"application/json"!==r&&"application/json"!==function(e){if(e)try{return lU.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(""===t||e.slice(t.length).includes(","))return;return t}}(r))return this.onerror?.(Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");if(t?.parsedBody===void 0)try{let t=await async function(e,t=4194304){if(Number(e.headers.get("content-length"))>t)return{tooLarge:!0};if(null===e.body)return{tooLarge:!1,text:""};let r=e.body.getReader(),i=new TextDecoder,o=0,n="";try{for(;;){let{done:e,value:a}=await r.read();if(e)break;if((o+=a.byteLength)>t)return{tooLarge:!0};n+=i.decode(a,{stream:!0})}}finally{r.releaseLock()}return{tooLarge:!1,text:n+i.decode()}}(e,this._maxRequestBodySize);if(t.tooLarge){let e=(i=this._maxRequestBodySize,`Payload Too Large: Request body must not exceed ${i} bytes`);return this.onerror?.(Error(e)),this.createJsonErrorResponse(413,-32e3,e)}o=JSON.parse(t.text)}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}else o=t.parsedBody;if(Array.isArray(o)&&o.length>100)return this.onerror?.(Error("Invalid Request: Batch must not exceed 100 messages")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Batch must not exceed 100 messages");try{n=Array.isArray(o)?o.map(e=>aA.parse(e)):[aA.parse(o)]}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let l=n.some(e=>aQ.safeParse(e).success);if(l){if(this._initialized&&void 0!==this.sessionId)return this.onerror?.(Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(n.length>1)return this.onerror?.(Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!l){let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");try{a=await this._checkScopeChallenge(n,t?.authInfo)}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(500,-32603,"Internal server error")}if(a)return a;if(!n.some(e=>lc(e))){for(let r of n)this.onmessage?.(r,{authInfo:t?.authInfo,request:e});return new Response(null,{status:202})}let p=crypto.randomUUID(),u=n.find(e=>aQ.safeParse(e).success),m=u?u.params.protocolVersion:e.headers.get("mcp-protocol-version")??"2025-03-26";if(this._enableJsonResponse)return new Promise(r=>{for(let e of(this._streamMapping.set(p,{resolveJson:r,cleanup:()=>{this._streamMapping.delete(p)}}),n))lc(e)&&this._requestToStreamMapping.set(e.id,p);for(let r of n)this.onmessage?.(r,{authInfo:t?.authInfo,request:e})});let f=new TextEncoder,h=new ReadableStream({start:e=>{s=e},cancel:()=>{void 0!==d&&clearInterval(d),this._streamMapping.get(p)?.controller===s&&this._streamMapping.delete(p)}}),y={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};for(let e of(void 0!==this.sessionId&&(y["mcp-session-id"]=this.sessionId),n))lc(e)&&(this._streamMapping.set(p,{controller:s,encoder:f,cleanup:()=>{void 0!==d&&clearInterval(d),this._streamMapping.delete(p);try{s.close()}catch{}}}),this._requestToStreamMapping.set(e.id,p));for(let r of(await this.writePrimingEvent(s,f,p,m),n)){let i,o;lc(r)&&this._eventStore&&this.supportsEmptySSEData(m)&&(i=()=>{this.closeSSEStream(r.id)},o=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(r,{authInfo:t?.authInfo,request:e,closeSSEStream:i,closeStandaloneSSEStream:o})}return this._streamMapping.get(p)?.controller===s&&(d=this.startKeepAlive(s,f)),new Response(h,{status:200,headers:y})}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(e)})}}async handleDeleteRequest(e){let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(void 0===this.sessionIdGenerator)return;if(!this._initialized)return this.onerror?.(Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let t=e.headers.get("mcp-session-id");return t?t!==this.sessionId?(this.onerror?.(Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")):void 0:(this.onerror?.(Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required"))}validateProtocolVersion(e){let t=e.headers.get("mcp-protocol-version");if(null!==t&&!this._supportedProtocolVersions.includes(t)){let e=`Bad Request: Unsupported protocol version: ${t} (supported versions: ${this._supportedProtocolVersions.join(", ")})`;return this.onerror?.(Error(e)),this.createJsonErrorResponse(400,-32e3,e)}}async close(){if(!this._closed){for(let{cleanup:e}of(this._closed=!0,this._streamMapping.values()))e();this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}}closeSSEStream(e){let t=this._requestToStreamMapping.get(e);if(!t)return;let r=this._streamMapping.get(t);r&&r.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);e&&e.cleanup()}async send(e,t){let r=t?.relatedRequestId;if((aO.safeParse(e).success||aE.safeParse(e).success)&&(r=e.id),void 0===r){let t;if(aO.safeParse(e).success||aE.safeParse(e).success)throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");this._eventStore&&(t=await this._eventStore.storeEvent(this._standaloneSseStreamId,e));let r=this._streamMapping.get(this._standaloneSseStreamId);if(void 0===r)return;r.controller&&r.encoder&&(void 0===t||!r.replayedEventIds?.has(t))&&this.writeSSEEvent(r.controller,r.encoder,e,t);return}let i=this._requestToStreamMapping.get(r);if(!i)throw Error(`No connection established for request ID: ${String(r)}`);let o=this._streamMapping.get(i);if(!this._enableJsonResponse){let t;this._eventStore&&(t=await this._eventStore.storeEvent(i,e),o=this._streamMapping.get(i)),o?.controller&&o?.encoder&&(void 0===t||!o.replayedEventIds?.has(t))&&this.writeSSEEvent(o.controller,o.encoder,e,t)}if(aO.safeParse(e).success||aE.safeParse(e).success){this._requestResponseMap.set(r,e);let t=[...this._requestToStreamMapping.entries()].filter(([e,t])=>t===i).map(([e])=>e);if(t.every(e=>this._requestResponseMap.has(e))){if(!o){if(this._enableJsonResponse)throw Error(`No connection established for request ID: ${String(r)}`);if(!this._eventStore){for(let e of(this.onerror?.(Error(`Response for request ID ${String(r)} is undeliverable: per-request stream is disconnected and no eventStore is configured`)),t))this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e);return}for(let e of t)this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e);return}if(this._enableJsonResponse&&o.resolveJson){let e={"Content-Type":"application/json"};void 0!==this.sessionId&&(e["mcp-session-id"]=this.sessionId);let r=t.map(e=>this._requestResponseMap.get(e));1===r.length?o.resolveJson(Response.json(r[0],{status:200,headers:e})):o.resolveJson(Response.json(r,{status:200,headers:e})),o.cleanup()}else o.cleanup();for(let e of t)this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e)}}}};let uY=Symbol("swallowsErrorsAfterClose");var u1=class{_readBuffer;_started=!1;_closed=!1;constructor(e=N.stdin,t=N.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new lH({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");for(let e of(this._started=!0,this._stdout.listeners("error")))e[uY]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[uY]=!0,0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(Error("StdioServerTransport is closed")):new Promise((t,r)=>{let i=JSON.stringify(e)+"\n",o=!1,n=e=>{o||(o=!0,this._stdout.off("error",n),this._stdout.off("drain",a),r(e))},a=()=>{o||(o=!0,this._stdout.off("error",n),this._stdout.off("drain",a),t())};if(this._stdout.once("error",n),this._stdout.write(i)){if(o)return;o=!0,this._stdout.off("error",n),t()}else o||this._stdout.once("drain",a)})}},u0=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}};let u2=new Set(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","server","user-agent"]),u4=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,u6=e=>9===e||10===e||13===e||32===e,u3=e=>{if(!u6(e.charCodeAt(0))&&!u6(e.charCodeAt(e.length-1)))return e;let t=0,r=e.length;for(;tt&&u6(e.charCodeAt(r-1));)r--;return e.slice(t,r)},u9=/[\0\r\n]/,u5=globalThis.Headers,u8=(e,t=u5)=>{let r=new t;for(let t=0;t{e.call(t,r,i,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(u7.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Headers (lightweight) ${r(Object.fromEntries(this),{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(u7.prototype,u5.prototype);let me=e=>globalThis.Headers===u5?new u7(e):u8(e.rawHeaders,globalThis.Headers),mt=/^\/[!#$&-;=?-\[\]_a-z~]*$/,mr=/\/\.\.?(?:[/?#]|$)/,mi=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,mo=global.Request;var mn=class extends mo{constructor(e,t){if("object"==typeof e&&mh in e){let r=void 0!==t&&"body"in t&&null!=t.body;if(e[mV]&&!r)throw TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[mh]()}void 0!==t?.body?.getReader&&(t.duplex??="half"),super(e,t)}};let ma=Symbol("wrapBodyStream"),ms=new Set(["latin1","binary","hex","base64","base64url"]),md=Symbol("bodyBufferedBeforeDisconnect"),mc=Symbol("bodyBufferedLengthBeforeDisconnect"),ml=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),mp=e=>{let t;return!(e instanceof z)&&!!e.complete&&!!e.readableAborted&&"function"==typeof e.read&&(null===(t=e.readableEncoding)||ms.has(t))},mu=e=>{e.readableDidRead||!mp(e)||(e[mc]??=e.readableLength)},mm=(e,t)=>{let r;if(e.readableDidRead&&!t||!mp(e))return;if(void 0!==e[md])return e[md];let i=e.errored;if(i&&"ECONNRESET"!==i.code)r=i;else if(void 0!==e[mc]&&e.readableLength!==e[mc])r=mI();else{let i=t??[],o=e.read();null!==o&&i.push(ml(o,e.readableEncoding));let n=1===i.length?i[0]:Buffer.concat(i);r=n;let a=e.headers["content-length"];if("string"==typeof a&&/^\d+$/.test(a)){let e=Number(a);Number.isSafeInteger(e)&&n.length!==e&&(r=mI())}}return e[md]=r,r},mf=(e,t)=>{t instanceof Error?e.error(t):(t.length>0&&e.enqueue(t),e.close())},mh=Symbol("getRequestCache"),my=Symbol("requestCache"),mg=Symbol("incomingKey"),m_=Symbol("urlKey"),mv=Symbol("methodKey"),mb=Symbol("headersKey"),m$=Symbol("abortControllerKey"),mS=Symbol("getAbortController"),mk=Symbol("abortRequest"),mw=Symbol("bodyBuffer"),mP=Symbol("bodyReadPromise"),mV=Symbol("bodyConsumedDirectly"),mR=Symbol("bodyLockReader"),mq=Symbol("abortReason"),mI=()=>TypeError("Body is unusable"),mx=new TextDecoder,mj=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,mC=(e,t,r)=>{if(e[mV])return Promise.reject(mI());let i=e.method;if("GET"===i||"HEAD"===i)return e[mh]()[t]();let o=(e=>{if(!mj.test(e))return TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if("CONNECT"===t||"TRACK"===t||"TRACE"===t&&"TRACE"!==e)return TypeError(`'${e}' HTTP method is unsupported.`)})(i);if(o)return Promise.reject(o);if(e[my]&&"TRACE"!==i)return e[my][t]();let n=(e=>{if(e[mV])return Promise.reject(mI());e[mV]=!0})(e);if(n)return n;let a=mT(e);if(a){let t=Promise.resolve(r(a,e));return e[mw]=void 0,t}return mE(e).then(t=>{let i=r(t,e);return e[mw]=void 0,i})},mT=e=>{let t=e[mg];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},mO=(e,t)=>{if(t.errored)return t.errored;let r=e[mq];return void 0!==r?r instanceof Error?r:Error(String(r)):Error("Client connection prematurely closed.")},mE=e=>{if(e[mw])return Promise.resolve(e[mw]);if(e[mP])return e[mP];let t=e[mg];if(t.readableDidRead)return Promise.reject(mI());let r=mm(t);if(void 0!==r)return r instanceof Error?Promise.reject(r):(e[mw]=r,Promise.resolve(r));let i=new Promise((r,i)=>{let o=[],n=!1,a=e=>{n||(n=!0,u(),e())},s=n=>{let s=t.errored??n;return!!mp(t)&&(!s||"ECONNRESET"===s.code)&&(a(()=>{let a=mm(t,o);a instanceof Error?i(a):void 0===a?i(n??mO(e,t)):(e[mw]=a,r(a))}),!0)},d=e=>{o.push(ml(e,t.readableEncoding))},c=()=>{a(()=>{let t=1===o.length?o[0]:Buffer.concat(o);e[mw]=t,r(t)})},l=e=>{s(e)||a(()=>{i(e)})},p=()=>{t.readableEnded?c():s()||a(()=>{i(mO(e,t))})},u=()=>{t.off("data",d),t.off("end",c),t.off("error",l),t.off("close",p),e[mP]=void 0};t.on("data",d),t.on("end",c),t.on("error",l),t.on("close",p),queueMicrotask(()=>{!n&&(t.readableEnded?c():t.errored?l(t.errored):t.destroyed&&p())})});return e[mP]=i,i},mA={get method(){return this[mv]},get url(){return this[m_]},get headers(){return this[mb]||=me(this[mg])},[mk](e){void 0===this[mq]&&(this[mq]=e);let t=this[m$];t&&!t.signal.aborted&&t.abort(e)},[mS](){return this[m$]||=new AbortController,void 0===this[mq]||this[m$].signal.aborted||this[m$].abort(this[mq]),this[m$]},[mh](){let e=this[mS]();if(this[my])return this[my];let t=this.method;if(this[mV]&&"GET"!==t&&"HEAD"!==t){this[mw]=void 0;let r={method:"TRACE"===t?"GET":t,headers:this.headers,signal:e.signal};"TRACE"!==t&&(r.body=new ReadableStream({start(e){e.close()}}),r.duplex="half");let i=new mn(this[m_],r);return"TRACE"===t&&Object.defineProperty(i,"method",{get:()=>"TRACE"}),this[my]=i}return this[my]=((e,t,r,i,o)=>{let n={method:e,headers:r,signal:o.signal};if("TRACE"===e){n.method="GET";let e=new mn(t,n);return Object.defineProperty(e,"method",{get:()=>"TRACE"}),e}if("GET"!==e&&"HEAD"!==e)if("rawBody"in i&&i.rawBody instanceof Buffer)n.body=new ReadableStream({start(e){e.enqueue(i.rawBody),e.close()}});else if(i[ma]){let e;n.body=new ReadableStream({async pull(t){try{if(!e){let e=mm(i);if(void 0!==e)return void mf(t,e)}e||=L.toWeb(i).getReader();let{done:r,value:o}=await e.read();r?t.close():t.enqueue(o)}catch(e){t.error(e)}}})}else{let e=mm(i);void 0!==e?n.body=new ReadableStream({start(t){mf(t,e)}}):n.body=L.toWeb(i)}return new mn(t,n)})(this.method,this[m_],this.headers,this[mg],e)},get body(){if(!this[mV])return this[mh]().body;let e=this[mh]();return!this[mR]&&e.body&&(this[mR]=e.body.getReader()),e.body},get bodyUsed(){return!!this[mV]||!!this[my]&&this[my].bodyUsed}};Object.defineProperty(mA,"signal",{get(){return this[mS]().signal}}),["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(mA,e,{get(){return this[mh]()[e]}})}),["clone","formData"].forEach(e=>{Object.defineProperty(mA,e,{value:function(){if(this[mV]){if("clone"===e)throw mI();return Promise.reject(mI())}return this[mh]()[e]()}})}),Object.defineProperty(mA,"text",{value:function(){return mC(this,"text",e=>mx.decode(e))}}),Object.defineProperty(mA,"arrayBuffer",{value:function(){return mC(this,"arrayBuffer",e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}}),Object.defineProperty(mA,"blob",{value:function(){return mC(this,"blob",(e,t)=>{let r=(t[mb]||=me(t[mg])).get("content-type")||"";return new Response(e,r?{headers:{"content-type":r}}:void 0).blob()})}}),Object.defineProperty(mA,"json",{value:function(){return this[mV]?Promise.reject(mI()):this.text().then(JSON.parse)}}),Object.defineProperty(mA,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[my]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mA,mn.prototype);let mW="text/plain; charset=UTF-8",mM=Symbol("responseCache"),mN=Symbol("getResponseCache"),mz=Symbol("cache"),mD=global.Response;var mF=class e{#c;#l;[mN](){let e=this[mz],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[mz],this[mM]||=new mD(this.#c,t?{status:this.#l?.status,statusText:this.#l?.statusText,headers:t}:this.#l)}constructor(t,r){let i;if(this.#c=t,r instanceof mD){let t=r[mM];if(t){this.#l=t,this[mN]();return}this.#l=r instanceof e?r.#l:r,i=new Headers(r.headers)}else this.#l=r;(null==t||"string"==typeof t||void 0!==t?.getReader||t instanceof Blob||t instanceof Uint8Array)&&(this[mz]=[r?.status||200,t??null,i||r?.headers])}get headers(){let e=this[mz];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(null===e[1]?void 0:{"content-type":mW}))),e[2]):this[mN]().headers}get status(){return this[mz]?.[0]??this[mN]().status}get ok(){let e=this.status;return e>=200&&e<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(mF.prototype,e,{get(){return this[mN]()[e]}})}),["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(mF.prototype,e,{value:function(){return this[mN]()[e]()}})}),Object.defineProperty(mF.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[mM]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mF,mD),Object.setPrototypeOf(mF.prototype,mD.prototype);let mL=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,mU=new Set([301,302,303,307,308]);function mH(e,t,r){let i=t=>{e.cancel(t).catch(()=>{})};return t.on("close",i),t.on("error",i),(r??e.read()).then(a,o),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function o(e){e&&t.destroy(e)}function n(){e.read().then(a,o)}function a({done:r,value:i}){try{if(r)t.end();else{if(t.write(i))return e.read().then(a,o);t.once("drain",n)}}catch(e){o(e)}}}function mG(e,t){if(e.locked)throw TypeError("ReadableStream is locked.");if(!t.destroyed)return mH(e.getReader(),t)}Object.defineProperty(mF,"redirect",{value:function(e,t=302){if(!mU.has(t))throw RangeError("Invalid status code");return new mF(null,{status:t,headers:{location:e instanceof URL?e.href:mL.test(e)?e:new URL(e).href}})},writable:!0,configurable:!0}),Object.defineProperty(mF,"json",{value:function(e,t){let r,i=JSON.stringify(e);if(void 0===i)throw TypeError("The data is not JSON serializable");let o=t?.headers;return o?(r=new Headers(o)).has("content-type")||r.set("content-type","application/json"):r={"content-type":"application/json"},new mF(i,{status:t?.status??200,statusText:t?.statusText,headers:r})},writable:!0,configurable:!0});let mB=(e,t)=>{let r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){let t=[];for(let[i,o]of e)"set-cookie"===i?t.push(o):r[i]=o;t.length>0&&(r["set-cookie"]=t)}else for(let[t,i]of e)r[t]=i;return t&&(r["content-type"]??=t),r},mK=Symbol("outgoingEnded"),mJ=Symbol("incomingDraining"),mZ=e=>{if(e.destroyed||e[mJ])return;if(e[mJ]=!0,e instanceof z){try{e.stream?.close?.(D.NGHTTP2_NO_ERROR)}catch{}return}let t=0,r=()=>{clearTimeout(o),e.off("data",n),e.off("end",r),e.off("error",r)},i=()=>{r();let t=e.socket;t&&!t.destroyed&&("function"==typeof t.destroySoon?t.destroySoon():"function"==typeof t.destroy&&t.destroy())},o=setTimeout(i,500);o.unref?.();let n=e=>{(t+=e.length)>0x4000000&&i()};e.on("data",n),e.on("end",r),e.on("error",r),e.resume()},mQ=e=>new Response(null,{status:e instanceof Error&&("TimeoutError"===e.name||"TimeoutError"===e.constructor.name)?504:500}),mX=(e,t)=>{let r=e instanceof Error?e:Error("unknown error",{cause:e});"ERR_STREAM_PREMATURE_CLOSE"===r.code?console.info("The user aborted a request."):(console.error(e),t.headersSent||(t instanceof T&&(t._contentLength=null),t.writeHead(500,{"Content-Type":"text/plain"})),t.end(`Error: ${r.message}`),t.destroy(r))},mY=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},m1=(e,t,r)=>!(null!==e._contentLength||!e._hasBody||!e.useChunkedEncodingByDefault||e._removedContLen||!(t>=200)||204===t||304===t||e.hasHeader("content-length")||e.hasHeader("transfer-encoding")||e.hasHeader("trailer"))&&(e._contentLength=r,!0),m0=(e,t,r)=>{m1(e,t,r)?e.writeHead(t,{"Content-Type":mW}):e.writeHead(t,{"Content-Type":mW,"Content-Length":r})},m2=async(e,t)=>{let[r,i,o]=e[mz];if(!o){null===i?(t.writeHead(r),t.end()):"string"==typeof i?(m0(t,r,Buffer.byteLength(i)),t.end(i)):i instanceof Uint8Array?(m0(t,r,i.byteLength),t.end(i)):i instanceof Blob?(m0(t,r,i.size),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(r,{"Content-Type":mW}),mY(t),await mG(i,t)?.catch(e=>mX(e,t))),t[mK]?.();return}let n=!1,a=!1,s=!0;if(o instanceof Headers)n=o.has("content-length"),o=mB(o,null===i?void 0:mW);else if(Array.isArray(o)){let e=new Headers(o);n=e.has("content-length"),o=mB(e,null===i?void 0:mW)}else for(let e in a=!0,o){if(14===e.length&&"content-length"===e.toLowerCase()){n=!0;break}(17===e.length&&"transfer-encoding"===e.toLowerCase()||7===e.length&&"trailer"===e.toLowerCase())&&(s=!1)}if(!n){let e;"string"==typeof i?e=Buffer.byteLength(i):i instanceof Uint8Array?e=i.byteLength:i instanceof Blob&&(e=i.size),void 0===e||a&&s&&m1(t,r,e)||(a&&(o={...o}),o["Content-Length"]=e)}t.writeHead(r,o),null==i?t.end():"string"==typeof i||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(mY(t),await mG(i,t)?.catch(e=>mX(e,t))),t[mK]?.()},m4=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return!1!==t.overrideGlobalObjects&&global.Request!==mn&&(Object.defineProperty(global,"Request",{value:mn}),Object.defineProperty(global,"Response",{value:mF})),async(i,o)=>{let n,a,s=!1,d=!1,c=()=>{if(a&&!d){let e,t;d=!0,o.on("close",(e=a,t=s,()=>{i.errored?(mu(i),e[mk](i.errored.toString())):(!o.writableFinished||i instanceof z&&i.aborted)&&(mu(i),e[mk]("Client connection prematurely closed.")),t&&!i.readableEnded&&setTimeout(()=>{i.readableEnded||setTimeout(()=>{mZ(i)})})}))}};try{let d;if(a=((e,t)=>{let r,i=Object.create(mA);i[mg]=e,i[mv]=(e=>{if("string"!=typeof e||0===e.length)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return e}let t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}})(e.method);let o=e.url||"";if("/"!==o[0]&&(o.startsWith("http://")||o.startsWith("https://"))){if(e instanceof z)throw new u0("Absolute URL for :path is not allowed in HTTP/2");try{i[m_]=new URL(o).href}catch(e){throw new u0("Invalid absolute URL",{cause:e})}return i}let n=(e instanceof z?e.authority:e.headers.host)||t;if(!n)throw new u0("Missing host header");if(e instanceof z){if("http"!==(r=e.scheme)&&"https"!==r)throw new u0("Unsupported scheme")}else r=e.socket&&e.socket.encrypted?"https":"http";try{i[m_]=((e,t,r)=>{let i=`${e}://${t}${r}`;if(mi.test(t)){if(0===r.length)return i+"/";if(47!==r.charCodeAt(0))throw new u0("Invalid URL");return!mt.test(r)||mr.test(r)?new URL(i).href:i}{let e=new URL(i);if(e.hostname.length!==t.length&&e.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new u0("Invalid host header");return e.href}})(r,n,o)}catch(e){if(e instanceof u0)throw e;throw new u0("Invalid URL",{cause:e})}return i})(i,t.hostname),(s=r&&"GET"!==i.method&&"HEAD"!==i.method)&&(i[ma]=!0,i instanceof z&&(o[mK]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),o.destroy()})})})),d=n=e(a,{incoming:i,outgoing:o}),"function"!=typeof d.then&&(e=>{if(!(mz in e))return!1;let t=e[mz][1];return null===t||"string"==typeof t||t instanceof Uint8Array})(n))return s&&!i.readableEnded&&o.once("finish",()=>{i.readableEnded||mZ(i)}),m2(n,o);c()}catch(e){if(n)return mX(e,o);if(t.errorHandler){if(c(),!(n=await t.errorHandler(a||e instanceof u0?e:new u0(e.message,{cause:e}))))return}else n=a?mQ(e):new Response(null,{status:400})}try{return await (async(e,t,r={})=>{if("function"==typeof e.then)if(r.errorHandler)try{e=await e}catch(i){let t=await r.errorHandler(i);if(!t)return;e=t}else e=await e.catch(mQ);if(mz in e)return m2(e,t);let i=mB(e.headers,null===e.body?void 0:mW);if(e.body){let r,o=e.body.getReader(),n=[],a=!1;if("chunked"!==i["transfer-encoding"]){let e=2;for(let t=0;tPromise.resolve(void 0))])})(r).catch(e=>{console.error(e),a=!0});if(!i){if(1===t){await new Promise(e=>setTimeout(e)),e=3;continue}break}if(r=void 0,i.value&&n.push(i.value),i.done){a=!0;break}}!a||"content-length"in i||(i["content-length"]=n.reduce((e,t)=>e+t.length,0))}t.writeHead(e.status,i),n.forEach(e=>{t.write(e)}),a?t.end():(0===n.length&&mY(t),await mH(o,t,r))}else i["x-hono-already-sent"]||(t.writeHead(e.status,i),t.end());t[mK]?.()})(n,o,t)}catch(e){return mX(e,o)}}};globalThis.CloseEvent??Event,globalThis.ErrorEvent??Event,Symbol("CONNECTION_SYMBOL_KEY"),Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");var m6=class{_webStandardTransport;_requestListener;_requestContext=new WeakMap;constructor(e={}){this._webStandardTransport=new uX(e),this._requestListener=m4(async e=>{let t=this._requestContext.get(e);return this._webStandardTransport.handleRequest(e,{authInfo:t?.authInfo,parsedBody:t?.parsedBody})},{overrideGlobalObjects:!1})}get sessionId(){return this._webStandardTransport.sessionId}set onclose(e){this._webStandardTransport.onclose=e}get onclose(){return this._webStandardTransport.onclose}set onerror(e){this._webStandardTransport.onerror=e}get onerror(){return this._webStandardTransport.onerror}set onmessage(e){this._webStandardTransport.onmessage=e}get onmessage(){return this._webStandardTransport.onmessage}async start(){return this._webStandardTransport.start()}async close(){return this._webStandardTransport.close()}async send(e,t){return this._webStandardTransport.send(e,t)}setSupportedProtocolVersions(e){this._webStandardTransport.setSupportedProtocolVersions(e)}setScopeChallengeResolver(e){this._webStandardTransport.setScopeChallengeResolver(e)}async handleRequest(e,t,r){let i=e.auth;await m4(async e=>this._webStandardTransport.handleRequest(e,{authInfo:i,parsedBody:r}),{overrideGlobalObjects:!1})(e,t)}closeSSEStream(e){this._webStandardTransport.closeSSEStream(e)}closeStandaloneSSEStream(){this._webStandardTransport.closeStandaloneSSEStream()}};function m3(e=process.env){let t=e.TRACEDECAY_DATA_DIR;if(void 0!==t&&t.length>0)return E.resolve(t);let r="win32"===process.platform?e.USERPROFILE:e.HOME,i=void 0!==r&&r.length>0?r:U.homedir();return E.join(i,".tracedecay")}let m9=o5().min(1),m5=nM({pid:nk().int().nonnegative(),process_run_id:o5(),started_at_unix_secs:nk().int(),epoch:nk().int().nonnegative(),version:o5(),endpoint:nT(),http_application_endpoint:m9.nullable().optional(),auth_token:o5().min(1),profile_root:o5().min(1)});function m8(e){if(e<=0)return!1;try{return process.kill(e,0),!0}catch(e){return"object"==typeof e&&null!==e&&"code"in e&&"EPERM"===e.code}}function m7(e){let t=e.http_application_endpoint;return null==t?null:`http://${t}`}function fe(e){let t=JSON.stringify(function e(t){return Array.isArray(t)?t.map(e):"object"==typeof t&&null!==t?Object.fromEntries(Object.entries(t).sort(([e],[t])=>et)).map(([t,r])=>[t,e(r)])):t}(e));if(void 0===t)throw TypeError("value is not canonical JSON");return t}function ft(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical schema: ${t} must be an object`);return e}function fr(e,t){switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"integer":return"number"==typeof e&&Number.isSafeInteger(e);case"number":return"number"==typeof e&&Number.isFinite(e);case"string":return"string"==typeof e;case"array":return Array.isArray(e);case"object":return"object"==typeof e&&null!==e&&!Array.isArray(e);default:throw TypeError(`unsupported canonical schema type: ${t}`)}}function fi(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an object`);return e}function fo(e,t){if("string"!=typeof e)throw TypeError(`malformed canonical envelope: ${t} must be a string`);return e}function fn(e,t){if("number"!=typeof e||!Number.isFinite(e))throw TypeError(`malformed canonical envelope: ${t} must be a finite number`);return e}function fa(e,t){if(!Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an array`);return e}function fs(e,t){let r=fn(e,t);if(!Number.isSafeInteger(r))throw TypeError(`malformed canonical envelope: ${t} must be a safe integer`);return r}function fd(e,t){let r=fs(e,t);if(r<0)throw TypeError(`malformed canonical envelope: ${t} must be non-negative`);return r}let fc=new TextEncoder;function fl(e,t,r){let i=fo(e,t);if(0===i.length||i.trim()!==i||fc.encode(i).byteLength>r||/\p{Cc}/u.test(i))throw TypeError(`malformed canonical envelope: ${t} is not a bounded identifier`);return i}function fp(e,t,r,i,o,n,a,s,d){let c=fi(e,"success envelope");if(fo(c.binding_id,"binding_id")!==t)throw TypeError("malformed canonical envelope: binding mismatch");let l=fi(c.contract,"contract");if(fo(l.schema_id,"contract.schema_id")!==r||fn(l.schema_revision,"contract.schema_revision")!==i)throw TypeError("malformed canonical envelope: result contract mismatch");fo(c.request_id,"request_id"),fi(c.scope,"scope");let p=fi(c.outcome,"outcome"),u=fo(p.outcome,"outcome.outcome");return{...c,outcome:{...p,outcome:u,value:function(e,t,r,i,o,n,a){let s=fi(t,"outcome.value");if(!("payload"in s))throw TypeError("malformed canonical envelope: outcome.value.payload is required");if(("durable_effect"!==o||"required"!==n||"effect"!==e)&&("operation"!==o||"not_required"!==n||"evidence"!==e&&"preview"!==e))throw TypeError(`malformed canonical envelope: outcome ${e} is outside the operation receipt contract`);if(!function(e,t,r){let i=fi(e,"outcome.value.execution");if(fn(i.started_at,"execution.started_at"),fn(i.ended_at,"execution.ended_at"),!("effective_deadline"in i)||!("cancellation"in i))throw TypeError("malformed canonical envelope: receipt fields are required");let o=fi(i.budget,"execution.budget");fn(o.units_consumed,"budget.units_consumed"),fn(o.bytes_consumed,"budget.bytes_consumed"),fn(o.elapsed_micros,"budget.elapsed_micros");let n=fo(i.termination,"execution.termination");if(!t.includes(n))throw TypeError(`malformed canonical envelope: termination ${n} is not legal for this operation`);if(("cancelled"===n||"timed_out"===n)&&null===i.cancellation)throw TypeError("malformed canonical envelope: terminal cancellation observation is required");if(null!==i.cancellation){let e=fi(r,"operation.cancellation"),t=fo(e.mode,"operation.cancellation.mode"),o=fi(i.cancellation,"execution.cancellation"),a=fo(o.stage,"execution.cancellation.stage");if(fs(o.observed_at,"execution.cancellation.observed_at"),!["before_admission","before_read","during_read","before_effect","effect_in_flight","reconciling","after_commit"].includes(a))throw TypeError(`malformed canonical envelope: unknown cancellation stage ${a}`);if("not_cancellable"===t){if("timed_out"!==n)throw TypeError("malformed canonical envelope: non-cancellable operation returned cancellation evidence")}else if(!fa(e.points,"operation.cancellation.points").includes(a))throw TypeError(`malformed canonical envelope: cancellation stage ${a} is not legal for this operation`)}}(s.execution,r,i),"evidence"===e)fi(s.temporal,"temporal"),fi(s.authority,"authority"),fa(s.evidence_authorities,"evidence_authorities"),fi(s.coverage,"coverage"),fa(s.omissions,"omissions"),fa(s.scores,"scores"),fa(s.contributions,"contributions"),function(e){let t=fi(e,"outcome.value.page");if(fl(t.sort_contract_id,"page.sort_contract_id",192),1>fd(t.sort_revision,"page.sort_revision"))throw TypeError("malformed canonical envelope: page sort_revision must be positive");let r=null===t.total?null:fd(t.total,"page.total"),i=fd(t.returned,"page.returned");if(null!==r&&i>r)throw TypeError("malformed canonical envelope: page returned exceeds total");null!==t.cursor&&function(e){let t=fi(e,"page.cursor"),r=fo(t.kind,"page.cursor.kind");if("opaque"===r)fl(t.cursor,"page.cursor.cursor",4096);else throw TypeError(`malformed canonical envelope: unsupported page cursor kind ${r}`)}(t.cursor),null!==t.expires_at&&fs(t.expires_at,"page.expires_at")}(s.page);else if("preview"===e)fo(s.preview_id,"preview_id"),fo(s.preview_digest,"preview_digest"),fo(s.effect_class,"effect_class"),fi(s.authority,"authority"),fo(s.expected_state,"expected_state");else if("effect"===e)fo(s.effect_id,"effect_id"),fo(s.effect_class,"effect_class"),fo(s.idempotency_key,"idempotency_key"),fi(s.authority,"authority"),fo(s.expected_state,"expected_state"),fo(s.reconciliation,"reconciliation"),fi(s.receipt,"receipt");else throw TypeError(`malformed canonical envelope: unsupported outcome ${e}`);return{...s,payload:null===s.payload?null:a(s.payload)}}(u,p.value,o,n,a,s,d)}}}function fu(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function fm(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function ff(e){return"number"==typeof e&&Number.isSafeInteger(e)}function fh(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&fc.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}async function fy(e){let t=await crypto.subtle.digest("SHA-256",fc.encode(fe(e)));return`sha256:${Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}`}function fg(e){return fu(e)&&"string"==typeof e.code&&"string"==typeof e.message}let f_={description:"Strongly typed algorithm-tagged integrity digest: `AccessPolicyDigest`.",type:"string"},fv={description:"Strongly typed canonical identity: `AccessRuleId`.",type:"string"},fb={description:"Strongly typed canonical identity: `ActorId`.",type:"string"},f$={description:"Strongly typed canonical identity: `AgentInstanceId`.",type:"string"},fS={enum:["memory_curator","session_reflector","skill_writer","combined_review","user_job"],type:"string"},fk={properties:{coverage:{$ref:"#/$defs/MetricCoverageV1"},current:{anyOf:[{$ref:"#/$defs/AnalyticsModeV1"},{type:"null"}]},transition_watermark:{type:["string","null"]},unavailable_reason:{type:["string","null"]}},required:["coverage"],type:"object"},fw={enum:["off","local_only","aggregate_share"],type:"string"},fP={oneOf:[{const:"project",description:"Analytics events of the resolved project.",type:"string"},{const:"all",description:"Analytics events of every registered project.",type:"string"}]},fV={description:"Strongly typed canonical identity: `AnalyzerEnvironmentVariable`.",type:"string"},fR={description:"Strongly typed canonical identity: `AnalyzerExecutableId`.",type:"string"},fq={oneOf:[{properties:{executable_id:{$ref:"#/$defs/AnalyzerExecutableId"},kind:{const:"built_in",type:"string"}},required:["kind","executable_id"],type:"object"},{properties:{executable_digest:{$ref:"#/$defs/ManifestDigest"},kind:{const:"approved_external",type:"string"}},required:["kind","executable_digest"],type:"object"}]},fI={description:"Strongly typed canonical identity: `AnalyzerLanguageId`.",type:"string"},fx={additionalProperties:!1,description:"One language's analyzer selection. Host registration may project only the\nnon-sensitive `language_id`/`enabled` pair; all other fields remain in the\nconfiguration authority.",properties:{arguments:{items:{type:"string"},type:"array"},enabled:{type:"boolean"},environment_allowlist:{items:{$ref:"#/$defs/AnalyzerEnvironmentVariable"},type:"array",uniqueItems:!0},executable:{$ref:"#/$defs/AnalyzerExecutableReferenceV1"},initialization_options:{additionalProperties:{$ref:"#/$defs/AnalyzerStructuredValueV1"},type:"object"},language_id:{$ref:"#/$defs/AnalyzerLanguageId"},privacy_class:{$ref:"#/$defs/AnalyzerPrivacyClassV1"},resource_limits:{$ref:"#/$defs/AnalyzerResourceLimitsV1"},restart_policy:{$ref:"#/$defs/AnalyzerRestartPolicyV1"},settings:{additionalProperties:{$ref:"#/$defs/AnalyzerStructuredValueV1"},type:"object"}},required:["language_id","enabled","executable","arguments","initialization_options","settings","environment_allowlist","privacy_class","resource_limits","restart_policy"],type:"object"},fj={enum:["non_sensitive","sensitive","restricted"],type:"string"},fC={additionalProperties:!1,properties:{maximum_memory_mib:{format:"uint32",minimum:0,type:"integer"},request_timeout_millis:{format:"uint64",minimum:0,type:"integer"},startup_timeout_millis:{format:"uint64",minimum:0,type:"integer"}},required:["maximum_memory_mib","startup_timeout_millis","request_timeout_millis"],type:"object"},fT={enum:["restart_on_configuration_change","manual_restart_only"],type:"string"},fO={additionalProperties:!1,description:"Canonical analyzer settings. A changed selection produces a new\nconfiguration revision/digest; cache invalidation remains owned elsewhere.",properties:{schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"},selections:{items:{$ref:"#/$defs/AnalyzerLanguageSelectionV1"},type:"array"}},required:["schema_version","selections"],type:"object"},fE={description:"A structured analyzer option value. This deliberately excludes raw\nenvironment values, commands, credential material, and transport blobs.",oneOf:[{properties:{kind:{const:"boolean",type:"string"},value:{type:"boolean"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"integer",type:"string"},value:{format:"int64",type:"integer"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"text",type:"string"},value:{type:"string"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"text_list",type:"string"},value:{items:{type:"string"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"object",type:"string"},value:{additionalProperties:{$ref:"#/$defs/AnalyzerStructuredValueV1"},type:"object"}},required:["kind","value"],type:"object"}]},fA={description:"The structured facts behind a problem. Adapters read these fields; the\nproblem's `message` is only their one human rendering.",oneOf:[{additionalProperties:!1,description:"The worktree's code index is parked until the operator applies\n`remedy`; repeating the request cannot change the answer.",properties:{cause:{type:"string"},kind:{const:"parked",type:"string"},remedy:{type:"string"},retries_on_wake:{type:"boolean"}},required:["kind","cause","remedy","retries_on_wake"],type:"object"},{additionalProperties:!1,description:"A session refresh asked to begin from a source frontier the\ncommitted projection has already passed.",properties:{active:{format:"uint64",minimum:0,type:"integer"},committed:{format:"uint64",minimum:0,type:"integer"},kind:{const:"stale_refresh_frontier",type:"string"},requested:{format:"uint64",minimum:0,type:"integer"}},required:["kind","requested","committed","active"],type:"object"},{additionalProperties:!1,description:"A compare-and-swap request named `requested` in `field`, but the\nauthority holds `current`. Resending with `current` is a new request.",properties:{current:{format:"uint64",minimum:0,type:"integer"},field:{type:"string"},kind:{const:"stale_precondition",type:"string"},requested:{format:"uint64",minimum:0,type:"integer"}},required:["kind","field","requested","current"],type:"object"},{additionalProperties:!1,description:"A workflow step effect named placement digest `found`, but the step's\ncurrent placement is `expected`: the effect was settled against a\nplacement the run has since replaced.",properties:{expected:{type:"string"},found:{type:"string"},kind:{const:"workflow_placement_digest_stale",type:"string"}},required:["kind","expected","found"],type:"object"},{additionalProperties:!1,description:"A writer lock stayed held by other writers past its admission\ndeadline.",properties:{deadline_ms:{format:"uint64",minimum:0,type:"integer"},kind:{const:"lock_deadline",type:"string"},resource:{type:"string"}},required:["kind","resource","deadline_ms"],type:"object"},{additionalProperties:!1,description:"A persisted store whose shape this binary does not open. It is served\nin this typed state until the operator runs `remedy`, which deletes\nthe old data; nothing is migrated or backed up.",properties:{authority:{type:"string"},found_version:{format:"int64",type:["integer","null"]},kind:{const:"reset_required",type:"string"},reason:{type:"string"},remedy:{type:"string"},required_version:{format:"int64",type:["integer","null"]}},required:["kind","authority","reason","remedy"],type:"object"},{additionalProperties:!1,description:"No compiler runs automatically for the diagnostics scope: no tsconfig\nowns `file`, or, for a workspace read (`file` null), none exists under\nthe project root. `searched` lists the owner search's candidates,\nnearest first; it is empty for a workspace read or a file outside the\nproject root.",properties:{file:{type:["string","null"]},kind:{const:"diagnostics_unsupported",type:"string"},searched:{items:{$ref:"#/$defs/DiagnosticsSearchedTsconfigV1"},type:"array"}},required:["kind","searched"],type:"object"},{additionalProperties:!1,description:"The TypeScript `producer` has not published diagnostics for the\ncurrent code generation yet. `generation` is the last generation it\npublished, null when it has published none.",properties:{generation:{type:["string","null"]},kind:{const:"diagnostics_pending",type:"string"},producer:{type:"string"}},required:["kind","producer"],type:"object"},{additionalProperties:!1,description:"The code graph's engine or catalog was released for memory and was\nstill warming again when the read's budget ran out;\n`retry_after_millis` is the measured warm-up it still needs.",properties:{kind:{const:"code_graph_rewarming",type:"string"},retry_after_millis:{format:"uint64",minimum:0,type:"integer"}},required:["kind","retry_after_millis"],type:"object"},{additionalProperties:!1,description:"No TraceDecay daemon accepts connections on `socket`. `named_by` is\nthe environment variable that chose the socket, when one did;\n`service_unit` is what this client observed of the managed service.",properties:{kind:{const:"daemon_unreachable",type:"string"},named_by:{type:["string","null"]},service_unit:{$ref:"#/$defs/DaemonServiceUnitObservationV1"},socket:{type:"string"}},required:["kind","socket","service_unit"],type:"object"}]},fW={description:"Strongly typed canonical identity: `AttemptId`.",type:"string"},fM={description:"Authoritative scope of a source binding. A mutable path, label, or host\nprofile cannot be represented as authority.",oneOf:[{properties:{id:{$ref:"#/$defs/ProjectId"},kind:{const:"project",type:"string"}},required:["kind","id"],type:"object"},{properties:{id:{$ref:"#/$defs/UserProfileId"},kind:{const:"projectless_hermes",type:"string"}},required:["kind","id"],type:"object"}]},fN={additionalProperties:!1,description:"One exact application scope paired with its registered physical locator.\n\nThe scope remains the identity authority. The locator is retained only so\na later read or restart can reopen the exact registered root without an\nactive-graph or CWD fallback.",properties:{locator:{anyOf:[{$ref:"#/$defs/RegisteredRootLocatorV1"},{type:"null"}]},scope:{$ref:"#/$defs/ResolvedScope"}},required:["scope"],type:"object"},fz={additionalProperties:!1,description:"Immutable canonical set of exact roots admitted by their existing request\ncontexts. A registered locator participates only as frozen reopening\nevidence; its paired [`ResolvedScope`](crate::context::ResolvedScope) remains\nthe root identity authority.",properties:{actor_id:{$ref:"#/$defs/ActorId"},digest:{$ref:"#/$defs/ManifestDigest"},revision:{$ref:"#/$defs/ScopeSetRevision"},roots:{items:{$ref:"#/$defs/AuthorizedRoot"},type:"array"},scope_set_id:{$ref:"#/$defs/ScopeSetId"}},required:["scope_set_id","revision","actor_id","roots","digest"],type:"object"},fD={description:"A terminal automatic-fact receipt state.",enum:["applied","quarantined"],type:"string"},fF={oneOf:[{properties:{kind:{const:"disabled",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"eligible_only",type:"string"},maximum_per_run:{format:"uint16",maximum:65535,minimum:1,type:"integer"},minimum_idle_seconds:{format:"uint64",minimum:1,type:"integer"}},required:["kind","minimum_idle_seconds","maximum_per_run"],type:"object"}]},fL={enum:["disabled","codex_app_server"],type:"string"},fU={enum:["standalone","delegated_host"],type:"string"},fH={description:"The settled status every successful read in this family reports.",enum:["ok"],type:"string"},fG={description:"Which owner's automation schedulers a reconcile covers.",oneOf:[{const:"project",description:"The served project's scheduler, answered by the project's owner.",type:"string"},{const:"profile",description:"Every cached project scheduler of the profile, answered by the\ndaemon's profile owner.",type:"string"}]},fB={properties:{created_at:{type:"string"},kind:{type:"string"},path:{type:"string"},schema_version:{format:"uint32",minimum:0,type:"integer"},sha256:{type:"string"},summary:{type:["string","null"]}},required:["schema_version","kind","path","sha256","created_at"],type:"object"},fK={description:"Automation run reads answer from the active project's ledger only.",enum:["active_project"],type:"string"},fJ={enum:["queued","running","succeeded","failed","skipped"],type:"string"},fZ={additionalProperties:!1,properties:{allow_job_commands:{type:"boolean"},backend:{$ref:"#/$defs/AutomationBackendV1"},combine_due_tasks:{type:"boolean"},enabled:{type:"boolean"},host_mode:{$ref:"#/$defs/AutomationHostModeV1"},model_id:{type:["string","null"]},scheduler_tick_secs:{format:"uint64",minimum:0,type:"integer"},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"},tasks:{$ref:"#/$defs/AutomationTaskSetV1"},timeout_secs:{format:"uint64",minimum:0,type:"integer"}},required:["schema_version","enabled","backend","host_mode","timeout_secs","scheduler_tick_secs","combine_due_tasks","allow_job_commands","tasks"],type:"object"},fQ={additionalProperties:!1,properties:{memory_curator:{$ref:"#/$defs/AutomationTaskSettingsV1"},session_reflector:{$ref:"#/$defs/AutomationTaskSettingsV1"},skill_writer:{$ref:"#/$defs/AutomationTaskSettingsV1"}},required:["memory_curator","session_reflector","skill_writer"],type:"object"},fX={additionalProperties:!1,properties:{cooldown_secs:{format:"uint64",minimum:0,type:["integer","null"]},enabled:{type:"boolean"},interval_secs:{format:"uint64",minimum:0,type:["integer","null"]},min_idle_secs:{format:"uint64",minimum:0,type:["integer","null"]},schedule:{type:["string","null"]},session_evidence_budget_backoff_secs:{description:"Suppression window between session-evidence retrieval attempts while\nthe evidence budget stays exhausted. Unset uses the automation crate's\none-hour default. Distinct from `cooldown_secs`, which paces retries\nafter failed runs; budget exhaustion is a skip, not a failure.",format:"uint64",minimum:0,type:["integer","null"]}},required:["enabled"],type:"object"},fY={enum:["manual_cli","manual_mcp","dashboard","application","scheduler","host_receipt"],type:"string"},f1={description:"Strongly typed canonical identity: `BrainId`.",type:"string"},f0={oneOf:[{properties:{kind:{const:"reject",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"append_monotonic_ordinal",type:"string"},maximum_attempts:{format:"uint16",maximum:65535,minimum:1,type:"integer"}},required:["kind","maximum_attempts"],type:"object"}]},f2={oneOf:[{properties:{bytes:{format:"uint8",maximum:255,minimum:1,type:"integer"},kind:{const:"task_id_digest_prefix",type:"string"}},required:["kind","bytes"],type:"object"},{properties:{kind:{const:"repository_slug",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"work_class",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"monotonic_collision_ordinal",type:"string"}},required:["kind"],type:"object"}]},f4={enum:["hyphen","underscore","slash"],type:"string"},f6={additionalProperties:!1,properties:{collision:{$ref:"#/$defs/BranchCollisionPolicyV1"},components:{items:{$ref:"#/$defs/BranchNameComponentV1"},type:"array"},maximum_bytes:{format:"uint16",maximum:65535,minimum:1,type:"integer"},prefix:{$ref:"#/$defs/CanonicalGitRefPrefix"},separator:{$ref:"#/$defs/BranchNameSeparatorV1"}},required:["prefix","components","separator","maximum_bytes","collision"],type:"object"},f3={additionalProperties:!1,description:"A declared dependency edge; propagation direction remains an application\ndecision and is never inferred from this edge.",properties:{dependency:{$ref:"#/$defs/StackNodeId"},dependent:{$ref:"#/$defs/StackNodeId"}},required:["dependency","dependent"],type:"object"},f9={description:"Strongly typed canonical identity: `BranchStackId`.",type:"string"},f5={additionalProperties:!1,description:"One visible branch/ref at one immutable tip.",properties:{node_id:{$ref:"#/$defs/StackNodeId"},project_id:{$ref:"#/$defs/ProjectId"},reference:{$ref:"#/$defs/RefId"},repository_id:{$ref:"#/$defs/RepositoryId"},tip:{$ref:"#/$defs/CommitId"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["node_id","project_id","repository_id","reference","tip"],type:"object"},f8={description:"Strongly typed canonical identity: `BranchStackRevisionId`.",type:"string"},f7={additionalProperties:!1,description:"Immutable branch-stack projection at one exact inventory revision.",properties:{canonical_order:{items:{$ref:"#/$defs/StackNodeId"},type:"array"},digest:{$ref:"#/$defs/ManifestDigest"},edges:{items:{$ref:"#/$defs/BranchStackEdgeV1"},type:"array"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},inventory_snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},nodes:{items:{$ref:"#/$defs/BranchStackNodeV1"},type:"array"},revision_id:{$ref:"#/$defs/BranchStackRevisionId"},source:{$ref:"#/$defs/BranchStackSourceV1"},stack_id:{$ref:"#/$defs/BranchStackId"}},required:["stack_id","revision_id","inventory_snapshot_id","inventory_epoch","source","nodes","edges","canonical_order","digest"],type:"object"},he={description:"Authoritative source that declared the exact stack topology.",enum:["explicit_declaration","accepted_task_branch_topology"],type:"string"},ht={enum:["no_branches","unbranched","independent_branches","local_stack"],type:"string"},hr={additionalProperties:!1,properties:{allowed:{items:{$ref:"#/$defs/BranchTopologyKindV1"},type:"array",uniqueItems:!0}},required:["allowed"],type:"object"},hi={description:"Strongly typed canonical identity: `CalibrationProfileId`.",type:"string"},ho={additionalProperties:!1,description:"Surface-owned query semantics. Page size remains an invocation control, but\ncontinuation is a request field so CLI, MCP, and HTTP callers all have the\nsame channel for spending a `next_cursor`.",properties:{cursor:{default:null,type:["string","null"]},order:{$ref:"#/$defs/RetrievalOrder"},projection:{$ref:"#/$defs/ResultProjection"}},required:["projection","order"],type:"object"},hn={additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},stage:{$ref:"#/$defs/CancellationStage"}},required:["stage","observed_at"],type:"object"},ha={description:"Exact stage at which cancellation or deadline state was observed.",enum:["before_admission","before_read","during_read","before_effect","effect_in_flight","reconciling","after_commit"],type:"string"},hs={additionalProperties:!1,description:"One retriever's scored contribution to a fused candidate. Every ranked\ncandidate retains every retriever's raw score domain, ordinal rank,\ncalibrated feature, weight, and weighted contribution.",properties:{calibrated_feature_micros:{format:"uint32",minimum:0,type:"integer"},calibration_profile_id:{$ref:"#/$defs/CalibrationProfileId"},ordinal_rank:{format:"uint32",minimum:0,type:"integer"},raw_score:{$ref:"#/$defs/FixedPointScore"},retriever:{$ref:"#/$defs/RetrieverKind"},retriever_revision:{$ref:"#/$defs/ComponentRevision"},score_domain:{$ref:"#/$defs/ScoreDomainId"},source_occurrence_id:{$ref:"#/$defs/SourceOccurrenceId"},weight_micros:{format:"uint32",minimum:0,type:"integer"},weighted_contribution_micros:{format:"uint64",minimum:0,type:"integer"}},required:["retriever","retriever_revision","source_occurrence_id","ordinal_rank","raw_score","score_domain","calibration_profile_id","calibrated_feature_micros","weight_micros","weighted_contribution_micros"],type:"object"},hd={description:"A validated full native Git ref name, such as `refs/heads/main`.",type:"string"},hc={description:"A validated ref/branch prefix. Branch naming accepts a short branch prefix\n(for example `tracedecay/`) while protected-ref selectors use full\n`refs/.../` prefixes.",type:"string"},hl={description:"Strongly typed canonical identity: `CapabilityId`.",type:"string"},hp={description:"Strongly typed canonical identity: `CatalogGenerationId`.",type:"string"},hu={description:"Strongly typed canonical identity: `ChangePlanId`.",type:"string"},hm={additionalProperties:!1,properties:{from_inclusive:{format:"int64",type:["integer","null"]},through_inclusive:{format:"int64",type:["integer","null"]}},type:"object"},hf={additionalProperties:!1,description:'Why co-change mining produced no answer, so an empty\n`missing_co_change_partners` does not read as "no partner is missing".',properties:{reason:{type:"string"},retryable:{type:"boolean"}},required:["reason","retryable"],type:"object"},hh={enum:["kind","language","path"],type:"string"},hy={description:"Strongly typed canonical identity: `CodeGenerationId`.",type:"string"},hg={description:"Freshness of the generation a verified graph read serves.",oneOf:[{properties:{state:{const:"current",type:"string"}},required:["state"],type:"object"},{properties:{rebuild_in_flight:{type:"boolean"},sealed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"last_complete_stale",type:"string"}},required:["state","sealed_at","rebuild_in_flight"],type:"object"}]},h_={description:"A typed reason an otherwise active generation cannot make durable progress.",enum:["resident_memory","source_unavailable","artifact_store_unavailable","retry_backoff","publication_authority_corrupt"],type:"string"},hv={description:'A deterministic contract violation that parked background convergence.\n\nParked is not dead: the worker keeps re-observing the violation on its\nordinary wake cadence, so an operator fix (for example restoring an\nowner-private mode) is picked up on the next wake without a restart. The\nstate exists so `status`, doctor, and the dashboard report the violation\ntyped instead of an indefinite "warming".',properties:{blocked_reason:{anyOf:[{$ref:"#/$defs/CodeIndexBuildBlockedReasonV1"},{type:"null"}],description:"Stable class for callers that must decide whether new work is admissible."},observed_passes:{description:"Background passes that re-observed the violation since parking.",format:"uint64",minimum:0,type:"integer"},parked_at_micros:{description:"When the violation was first observed (microseconds since the Unix epoch).",format:"int64",type:"integer"},reason:{description:"Exact typed failure that parked convergence.",type:"string"},remediation:{description:"Operator action that clears the violation.",type:"string"},retries_on_wake:{description:"Whether the worker re-checks this violation on every ordinary wake.\nTrue for filesystem/contract violations an operator fix clears in\nplace; false for an abnormal task failure that only changed input (a\nnew sealed generation) retries.",type:"boolean"}},required:["reason","remediation","parked_at_micros","observed_passes","retries_on_wake"],type:"object"},hb={properties:{display_path:{description:"`git_path_bytes` decoded for display, invalid UTF-8 replaced.",type:"string"},git_path_bytes:{description:"The exact Git path bytes, which need not be UTF-8.",items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},reason:{$ref:"#/$defs/CodeIndexSourceOmissionReasonV1"}},required:["git_path_bytes","display_path","reason"],type:"object"},h$={description:"Sources a sealed snapshot captured but does not index.",properties:{count:{description:"Every omitted source in the snapshot.",format:"uint64",minimum:0,type:"integer"},sources:{description:"The first omitted sources in Git path order, at most\n[`CODE_INDEX_OMITTED_SOURCE_LIST_LIMIT`].",items:{$ref:"#/$defs/CodeIndexOmittedSourceV1"},type:"array"}},required:["count","sources"],type:"object"},hS={oneOf:[{description:"No logical path can carry the Git path: not UTF-8, a backslash, a\ncontrol character, or leading or trailing whitespace.",properties:{kind:{const:"unrepresentable_path",type:"string"}},required:["kind"],type:"object"},{description:"The privacy boundary withheld the file's bytes.",properties:{detail:{type:"string"},kind:{const:"privacy_withheld",type:"string"}},required:["kind","detail"],type:"object"}]},hk={description:"Closed staleness ladder for one mounted worktree.\n\nThe scheduler publishes one of these tokens. MCP, the dashboard, and the\nCLI must match the variant, not a hand-copied string, so a new ladder\nstate cannot appear at one caller and be missed at the others.",enum:["fresh","stale","indexing","refreshing","restoring","verifying","parked"],type:"string"},hw={description:"Profile-level worker-count intent for the process-wide code-index pool.\n`Automatic` delegates the concrete count to runtime resource admission;\n`Exact` persists an operator-requested positive worker count.",oneOf:[{additionalProperties:!1,properties:{mode:{const:"automatic",type:"string"}},required:["mode"],type:"object"},{additionalProperties:!1,properties:{mode:{const:"exact",type:"string"},workers:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["mode","workers"],type:"object"}]},hP={additionalProperties:!1,properties:{chunk:{anyOf:[{$ref:"#/$defs/CodeSearchChunkId"},{type:"null"}]},file:{$ref:"#/$defs/FileOccurrenceId"},path:{type:"string"},span:{$ref:"#/$defs/SourceSpan"},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["file","path","span"],type:"object"},hV={additionalProperties:!1,description:"One immutable code-index generation inside the authorized single root.\nThe path prefix narrows a query but never establishes project identity.",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},path_prefix:{type:["string","null"]}},required:["generation"],type:"object"},hR={description:"Strongly typed canonical identity: `CodeSearchChunkId`.",type:"string"},hq={description:"Strongly typed canonical identity: `CommitId`.",type:"string"},hI={enum:["promote","reject","insufficient_evidence"],type:"string"},hx={description:"Whether the bounded complexity walk over a symbol's body ran to the end.\n\nThe extractor stops walking a body once its traversal budget is spent. The\ncounters accumulated by then are lower bounds over the visited prefix, not\nfacts about the whole body, so every surface that prints, ranks, or\naggregates complexity must render this state instead of treating those\ncounters as exact.",oneOf:[{enum:["complete"],type:"string"},{const:"traversal_budget_exhausted",description:"The walk stopped when the traversal budget ran out.",type:"string"}]},hj={description:"Strongly typed canonical identity: `ComponentRevision`.",type:"string"},hC={description:"Strongly typed canonical identity: `ComponentVersion`.",type:"string"},hT={enum:["config_summary"],type:"string"},hO={additionalProperties:!1,description:"One entry per changed config file instead of one per config key.",properties:{config_keys:{format:"uint",minimum:0,type:"integer"},file:{type:"string"},kind:{$ref:"#/$defs/ConfigSummaryKindV1"}},required:["file","kind","config_keys"],type:"object"},hE={description:"Strongly typed canonical identity: `ConfigurationIdempotencyKey`.",type:"string"},hA={description:"A typed configuration layer identity. The default layer intentionally has\nno caller-controlled identifier.",oneOf:[{properties:{kind:{const:"default",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"user_profile",type:"string"},profile_id:{$ref:"#/$defs/UserProfileId"}},required:["kind","profile_id"],type:"object"},{properties:{kind:{const:"project",type:"string"},project_id:{$ref:"#/$defs/ProjectId"}},required:["kind","project_id"],type:"object"},{properties:{collection_id:{$ref:"#/$defs/QueryCollectionId"},kind:{const:"collection",type:"string"}},required:["kind","collection_id"],type:"object"}]},hW={description:"Strongly typed canonical identity: `ConfigurationReceiptId`.",type:"string"},hM={description:"Strongly typed canonical identity: `ConfigurationRevisionId`.",type:"string"},hN={description:"Strongly typed canonical identity: `ConfigurationSnapshotId`.",type:"string"},hz={description:"Values that the typed registry can accept.",oneOf:[{properties:{kind:{const:"boolean",type:"string"},value:{type:"boolean"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"unsigned",type:"string"},value:{format:"uint64",minimum:0,type:"integer"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"code_index_worker_selection",type:"string"},value:{$ref:"#/$defs/CodeIndexWorkerSelectionV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"text",type:"string"},value:{type:"string"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"string_list",type:"string"},value:{items:{type:"string"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"source_bindings",type:"string"},value:{items:{$ref:"#/$defs/ScopeSourceBinding"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"access_rules",type:"string"},value:{items:{$ref:"#/$defs/ScopeAccessRule"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"analyzer_settings",type:"string"},value:{$ref:"#/$defs/AnalyzerSettingsV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"work_topology_policy",type:"string"},value:{$ref:"#/$defs/WorkTopologyPolicyV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"work_executable_bindings",type:"string"},value:{items:{$ref:"#/$defs/WorkExecutableBindingV1"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"work_expertise_consent",type:"string"},value:{$ref:"#/$defs/WorkExpertiseConsentV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"context_scout_settings",type:"string"},value:{$ref:"#/$defs/ContextScoutSettingsV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"automation_settings",type:"string"},value:{$ref:"#/$defs/AutomationSettingsV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"lcm_summarizer_executables",type:"string"},value:{$ref:"#/$defs/LcmSummarizerExecutablesV1"}},required:["kind","value"],type:"object"}]},hD={description:"Strongly typed algorithm-tagged integrity digest: `ContentDigest`.",type:"string"},hF={description:"What one caller `lexical_anchors` entry contributed to the response, in\ncaller order.",oneOf:[{additionalProperties:!1,description:"`matched` indexed rows carried the anchor; `admitted` result sites\ncarrying it are in this response, and `dropped` counts the sites the\nlexical lane admitted that a later stage removed, by reason.",properties:{admitted:{format:"uint64",minimum:0,type:"integer"},anchor:{type:"string"},dropped:{items:{$ref:"#/$defs/LexicalAnchorDropV1"},type:"array"},matched:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"matched",type:"string"}},required:["outcome","anchor","matched","admitted"],type:"object"},{additionalProperties:!1,description:"No indexed row carries the anchor.",properties:{anchor:{type:"string"},outcome:{const:"unmatched",type:"string"}},required:["outcome","anchor"],type:"object"},{additionalProperties:!1,description:"The anchor's route did not serve; `coverage` names the lane state.",properties:{anchor:{type:"string"},outcome:{const:"not_served",type:"string"}},required:["outcome","anchor"],type:"object"}]},hL={enum:["explore","plan"],type:"string"},hU={additionalProperties:!1,description:"Exact opaque destination for one public Context Scout operation.\n\nThe daemon converts this transport-neutral address into its runtime value\nonly after catalog admission. Keeping the public wire here makes CLI, MCP,\nHTTP, and both SDKs share one generated schema authority.",properties:{agent_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},logical_message_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},profile_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},project_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},protected_session_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},provider_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},thread_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},turn_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"}},required:["profile_id","provider_id","protected_session_id","thread_id","turn_id","agent_id","logical_message_id","project_id"],type:"object"},hH={enum:["retrieval","diagnostic","coordination","verification"],type:"string"},hG={additionalProperties:!1,description:"Public lease proof. It carries only opaque identities; the daemon resolves\nit back to the durable queue row before recording delivery.",properties:{envelope_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},lease_expires_at:{$ref:"#/$defs/UtcMicros"},lease_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},work:{$ref:"#/$defs/ContextScoutWorkV1"}},required:["work","envelope_id","lease_id","lease_expires_at"],type:"object"},hB={additionalProperties:!1,properties:{max_candidates:{format:"uint32",minimum:0,type:"integer"},max_evidence:{format:"uint32",minimum:0,type:"integer"},max_model_input_tokens:{format:"uint32",minimum:0,type:"integer"},max_model_output_tokens:{format:"uint32",minimum:0,type:"integer"},max_text_bytes:{format:"uint32",minimum:0,type:"integer"}},required:["max_candidates","max_evidence","max_text_bytes","max_model_input_tokens","max_model_output_tokens"],type:"object"},hK={enum:["deterministic","configured_model"],type:"string"},hJ={enum:["active","paused","disabled"],type:"string"},hZ={enum:["codex_app_server"],type:"string"},hQ={enum:["attempted","delayed","displayed","expanded","explicitly_accepted","explicitly_rejected","dismissed","expired_unseen","corrected","unknown"],type:"string"},hX={additionalProperties:!1,properties:{delivered_at:{$ref:"#/$defs/UtcMicros"},envelope_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},outcome:{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"},receipt_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"}},required:["receipt_id","envelope_id","delivered_at","outcome"],type:"object"},hY={enum:["immediate","next_boundary","idle_window","on_request","suppressed"],type:"string"},h1={enum:["complete","partial","stale","cancelled","unavailable"],type:"string"},h0={additionalProperties:!1,properties:{anchor_ids:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},availability:{$ref:"#/$defs/ContextScoutEvidenceAvailabilityV1"},claim_digest:{$ref:"#/$defs/ManifestDigest"},content_generation:{$ref:"#/$defs/CodeGenerationId"},session_window:{anyOf:[{$ref:"#/$defs/ContextScoutSessionWindowV1"},{type:"null"}],description:"Session turns a session-evidence suggestion was judged from. Absent for\ncode evidence."}},required:["content_generation","availability","anchor_ids","claim_digest"],type:"object"},h2={enum:["explicitly_accepted","explicitly_rejected","dismissed","corrected"],type:"string"},h4={additionalProperties:!1,properties:{kind:{$ref:"#/$defs/ContextScoutFeedbackKindV1"},receipt_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"}},required:["receipt_id","kind"],type:"object"},h6={description:"One user intent the Scout can recognize. The serialized keys are the\nhistorical hook hint category keys, so persisted hint analytics, hint\nsettlement, and evals keep one vocabulary.",enum:["search","semantic_search","file_read","tool_descriptor_read","broad_read","call_graph","impact","symbol_lookup","file_lookup","project_context","session_recall","atomic_edit","type_orientation","explore_subagent","subagent_start_context","build_diagnostics","review_changes","memory_store","edit_redundancy","unexpected_changes"],type:"string"},h3={additionalProperties:!1,description:"Operator configuration for the Context Scout intent pass.",properties:{action_fact_score_permille:{description:"Score a deterministic action fact contributes for its intent.",format:"uint16",maximum:65535,minimum:0,type:"integer"},enabled:{type:"boolean"},engine:{$ref:"#/$defs/DecisionEngineSettingsV1"},min_delivery_gap_secs:{format:"uint32",minimum:0,type:"integer"},prompt_lookup_deadline_ms:{format:"uint32",minimum:0,type:"integer"},questions:{items:{$ref:"#/$defs/IntentQuestionSettingsV1"},type:"array"},ttl_secs:{format:"uint32",minimum:0,type:"integer"},window:{$ref:"#/$defs/IntentWindowSettingsV1"}},required:["enabled","engine","window","questions","action_fact_score_permille","ttl_secs","min_delivery_gap_secs","prompt_lookup_deadline_ms"],type:"object"},h9={additionalProperties:!1,properties:{max_candidates:{format:"uint",minimum:0,type:"integer"},max_evidence:{format:"uint",minimum:0,type:"integer"},max_model_input_tokens:{format:"uint",minimum:0,type:"integer"},max_model_output_tokens:{format:"uint",minimum:0,type:"integer"},max_text_bytes:{format:"uint",minimum:0,type:"integer"}},required:["max_candidates","max_evidence","max_text_bytes","max_model_input_tokens","max_model_output_tokens"],type:"object"},h5={enum:["disabled","codex_app_server","unsupported","decision_engine"],type:"string"},h8={oneOf:[{enum:["not_requested","succeeded","disabled","unavailable","denied","disconnected","cancelled","deadline_exceeded","token_budget_exceeded","invalid_output"],type:"string"},{const:"backpressured",description:"The engine's concurrency bound was full; the request was not sent.",type:"string"}]},h7={additionalProperties:!1,properties:{actual_model:{type:["string","null"]},actual_provider:{type:["string","null"]},estimated_cost_microusd:{format:"uint64",minimum:0,type:["integer","null"]},input_tokens:{format:"uint64",minimum:0,type:["integer","null"]},output_tokens:{format:"uint64",minimum:0,type:["integer","null"]},requested_backend:{$ref:"#/$defs/ContextScoutModelBackendV1"}},required:["requested_backend"],type:"object"},ye={additionalProperties:!1,properties:{feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackV1"},{type:"null"}]},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"},suggestion:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"}},required:["suggestion","receipt"],type:"object"},yt={oneOf:[{enum:["deterministic","model_assisted","deterministic_fallback"],type:"string"},{const:"decision_engine",description:"Produced by the session intent pass: decision-engine answers combined\nwith deterministic action facts.",type:"string"}]},yr={enum:["deterministic","configured_model"],type:"string"},yi={enum:["active","paused","disabled"],type:"string"},yo={additionalProperties:!1,description:"Exact bounded span of one session's transcript an intent pass read. The\nwindow body is never retained; only its digest and store-id bounds are.",properties:{first_store_id:{format:"int64",type:"integer"},last_store_id:{format:"int64",type:"integer"},message_count:{format:"uint16",maximum:65535,minimum:0,type:"integer"},newest_timestamp:{format:"int64",type:["integer","null"]},window_digest:{$ref:"#/$defs/ManifestDigest"}},required:["first_store_id","last_store_id","message_count","window_digest"],type:"object"},yn={additionalProperties:!1,description:"Canonical Context Scout control-plane value. Disabled is the only stock\nstate; deterministic or configured-model execution requires an explicit\nconfiguration revision.",properties:{intent:{anyOf:[{$ref:"#/$defs/ContextScoutIntentSettingsV1"},{type:"null"}],description:"Session intent pass. Absent means the Scout runs no intent pass; the\nfield is omitted from the canonical encoding so settings written before\nit existed keep their behavior digest."},limits:{$ref:"#/$defs/ContextScoutConfigurationLimitsV1"},mode:{$ref:"#/$defs/ContextScoutConfigurationModeV1"},model_id:{type:["string","null"]},model_path:{anyOf:[{$ref:"#/$defs/ContextScoutConfiguredModelPathV1"},{type:"null"}]},model_timeout_secs:{format:"uint64",minimum:0,type:["integer","null"]},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"},state:{$ref:"#/$defs/ContextScoutConfigurationStateV1"}},required:["schema_version","state","mode","limits"],type:"object"},ya={enum:["stored","duplicate","superseded"],type:"string"},ys={additionalProperties:!1,properties:{category:{$ref:"#/$defs/ContextScoutCategoryV1"},configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},dedupe_key:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},delivery_window:{$ref:"#/$defs/ContextScoutDeliveryWindowV1"},envelope_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},evidence:{$ref:"#/$defs/ContextScoutEvidenceProjectionV1"},expires_at:{$ref:"#/$defs/UtcMicros"},model_outcome:{$ref:"#/$defs/ContextScoutModelOutcomeV1"},model_receipt:{anyOf:[{$ref:"#/$defs/ContextScoutModelReceiptV1"},{type:"null"}]},relevance_score:{format:"uint16",maximum:65535,minimum:0,type:"integer"},route:{$ref:"#/$defs/ContextScoutRouteV1"},suggestion_text:{type:"string"},work:{$ref:"#/$defs/ContextScoutWorkV1"}},required:["work","envelope_id","configuration_revision","delivery_window","route","model_outcome","dedupe_key","category","relevance_score","suggestion_text","evidence","expires_at"],type:"object"},yd={oneOf:[{enum:["disabled","paused","dirty_overlay","quiet_or_unreceptive","no_eligible_candidate","expired","duplicate","cancelled","model_output_invalid","evidence_partial","evidence_stale","evidence_unavailable"],type:"string"},{const:"pending_sibling",description:"A suggestion for the same session is already pending delivery.",type:"string"}]},yc={additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},generation:{format:"uint64",minimum:0,type:"integer"},input_watermark:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"}},required:["address","generation","input_watermark"],type:"object"},yl={properties:{authorized_scope_ref:{type:"string"},current:{type:"boolean"},estimated_cost:{items:{$ref:"#/$defs/MetricValueV1"},type:"array"},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},latency:{description:"Provider-backed operation latency, projected from the same retained\nPlan 26 operation-resource events as Observatory. Each entry keeps\nprovider/model identity explicit; `None` is a real uncorrelated state,\nnever a client-side guess.",items:{$ref:"#/$defs/ProviderLatencyReadModelV1"},type:"array"},observed_at_micros:{format:"int64",type:"integer"},pricing_revision:{type:["string","null"]},usage:{items:{$ref:"#/$defs/MetricValueV1"},type:"array"},watermark:{type:"string"}},required:["authorized_scope_ref","horizon","watermark","observed_at_micros","current","usage","estimated_cost","latency"],type:"object"},yp={description:"Which side of a file dependency the coupling report counts.",enum:["fan_in","fan_out"],type:"string"},yu={description:"Completeness is explicit; unknown never renders as clean.",enum:["complete","partial","unknown"],type:"string"},ym={additionalProperties:!1,properties:{completeness:{$ref:"#/$defs/CoverageCompleteness"},domain:{$ref:"#/$defs/EvidenceDomain"}},required:["domain","completeness"],type:"object"},yf={enum:["known","partial","stale","unknown","sampled","capped"],type:"string"},yh={description:"Strongly typed canonical identity: `CredentialReferenceId`.",type:"string"},yy={enum:["disabled","manual_receipt_only","fast_forward_only","merge_commit","cherry_pick_exact_commits"],type:"string"},yg={additionalProperties:!1,properties:{allow_cross_repository:{type:"boolean"},allowed_modes:{items:{$ref:"#/$defs/CrossMergeModeV1"},type:"array",uniqueItems:!0},default_mode:{$ref:"#/$defs/CrossMergeModeV1"}},required:["allowed_modes","default_mode","allow_cross_repository"],type:"object"},y_={description:"The managed daemon service unit as a client observed it, from the unit\nfile alone.",oneOf:[{additionalProperties:!1,properties:{state:{const:"not_installed",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The unit file could not be read.",properties:{error:{type:"string"},state:{const:"unobservable",type:"string"}},required:["state","error"],type:"object"},{additionalProperties:!1,description:"The unit file at `path` serves the socket `serves`.",properties:{path:{type:"string"},serves:{type:"string"},state:{const:"installed",type:"string"}},required:["state","path","serves"],type:"object"}]},yv={additionalProperties:!1,description:"One immutable deadline supplied by the caller or upstream admission layer.",properties:{expires_at:{$ref:"#/$defs/UtcMicros"}},required:["expires_at"],type:"object"},yb={additionalProperties:!1,description:"The decision engine the intent pass asks. There is no default endpoint or\nmodel; both come only from explicit operator configuration.",properties:{base_url:{type:"string"},max_concurrent:{format:"uint8",maximum:255,minimum:0,type:"integer"},max_state_bytes:{format:"uint32",minimum:0,type:"integer"},model:{type:["string","null"]},timeout_ms:{format:"uint32",minimum:0,type:"integer"}},required:["base_url","timeout_ms","max_concurrent","max_state_bytes"],type:"object"},y$={description:"Diagnostic severity. Source severity is preserved exactly; TraceDecay\nnever raises severity because several producers agree.",enum:["error","warning","information","hint"],type:"string"},yS={additionalProperties:!1,description:"One tsconfig location the diagnostics owner search checked.",properties:{path:{description:"Relative to the project root, forward-slash separated.",type:"string"},present:{description:"The config exists, but neither it nor its references include the\nfile.",type:"boolean"}},required:["path","present"],type:"object"},yk={description:"Whether Doctor observed all of a family's evidence sources.",oneOf:[{const:"complete",description:"Every relevant evidence source for the family was observed.",type:"string"},{const:"partial",description:"Some evidence sources were observed; others were omitted.",type:"string"},{const:"unknown",description:"Whether coverage is complete could not be determined.",type:"string"}]},yw={description:"Shape of the design-structure-matrix report.",enum:["stats","clusters","matrix"],type:"string"},yP={enum:["prevented","committed","unknown","not_applicable"],type:"string"},yV={enum:["exact_duplicate","superseded_overlap","repeated_investigation","duplicate_effect","not_duplicate","censored","unknown"],type:"string"},yR={description:"The stable effect classification of one application operation.\n\nGit index writes remain separate classes so policy cannot accidentally\nsubstitute one index mutation for another.",oneOf:[{enum:["read","preview","source_edit","git_index_stage","git_index_unstage","configuration_write","administrative"],type:"string"},{const:"spawns_process",description:"Runs a child process in the project (e.g. the project's test runner).",type:"string"},{const:"binds_server",description:"Binds a listening server in the daemon process.",type:"string"},{const:"schedules_work",description:"Queues work on a daemon-owned scheduler; the call answers with the\nscheduler's admission, not the finished work.",type:"string"},{const:"maintains_owner_state",description:"Maintains bookkeeping the daemon keeps for the project or profile it\nserves: resets a usage counter, records registry token accounting, or\nreconciles automation schedulers with the saved configuration. Each\nwrite settles within the call and answers its new state.",type:"string"},{const:"maintains_profile_state",description:"Reads and rewrites the daemon profile's own state: its project\nregistry, accounting ledgers, and session stores. Unlike bookkeeping,\nit includes long work, a registry collection or a transcript import,\nthat a cancelled call stops.",type:"string"},{const:"records_host_evidence",description:"Records a host's session evidence (transcripts, hook admissions,\nreceipts) in daemon-owned session stores.",type:"string"}]},yq={additionalProperties:!1,description:"Durable effect proof. It records identities and receipts, never credentials\nor arbitrary command text.",properties:{actor:{$ref:"#/$defs/ActorId"},catalog_digest:{$ref:"#/$defs/ManifestDigest"},committed_state:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},configuration_digest:{$ref:"#/$defs/ManifestDigest"},effect_class:{$ref:"#/$defs/EffectClass"},expected_state:{$ref:"#/$defs/ManifestDigest"},external_proof:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},idempotency_key:{type:"string"},input_digest:{$ref:"#/$defs/ManifestDigest"},operation:{$ref:"#/$defs/UseCaseId"},outcome:{$ref:"#/$defs/EffectTermination"},policy_digest:{$ref:"#/$defs/ManifestDigest"},privacy_digest:{$ref:"#/$defs/ManifestDigest"},request_id:{type:"string"},scope:{$ref:"#/$defs/ResolvedScope"}},required:["operation","request_id","actor","scope","effect_class","idempotency_key","input_digest","expected_state","policy_digest","configuration_digest","catalog_digest","privacy_digest","outcome"],type:"object"},yI={description:"Durable effect receipt terminal state.",enum:["completed","cancelled","timed_out","failed","partial","effect_unknown"],type:"string"},yx={additionalProperties:!1,description:"Deterministic coverage fold input for an evidence packet.",properties:{completeness:{$ref:"#/$defs/CoverageCompleteness"},domains:{items:{$ref:"#/$defs/CoverageDomainState"},type:"array"},eligible:{format:"uint64",minimum:0,type:["integer","null"]},requested_domains:{items:{$ref:"#/$defs/EvidenceDomain"},type:"array"},returned:{format:"uint64",minimum:0,type:"integer"},visited:{format:"uint64",minimum:0,type:["integer","null"]}},required:["requested_domains","returned","completeness","domains"],type:"object"},yj={description:"Requested evidence domain for bounded coverage and omissions.",enum:["symbol","source","graph","test","temporal","anchor","operational","diagnostic"],type:"string"},yC={description:"Evidence role used by dedupe/diversity caps. Independent corroboration\nand contradictions are preserved.",enum:["primary","corroboration","contradiction","context"],type:"string"},yT={description:"The exact tiers, lexicographically ordered above all approximate\ncandidates. Fusion derives this only from a validated [`ExactAdmissionProof`].",enum:["exact_message","exact_literal_phrase","approximate"],type:"string"},yO={description:"The classification of one whole exact technical term. Whole exact terms\nand language-profiled subtokens are distinct fields.",enum:["whole_symbol","qualified_name","path","compiler_error_code","compiler_error_text","runtime_error_code","runtime_error_text","cli_flag","tool_name","configuration_key","commit_identifier"],type:"string"},yE={description:"Strongly typed canonical identity: `FactAssertionId`.",type:"string"},yA={enum:["general","user_pref","project","tool","decision","code_area"],type:"string"},yW={enum:["committed","idempotent_replay"],type:"string"},yM={oneOf:[{additionalProperties:!1,properties:{kind:{const:"profile",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"project",type:"string"},project_id:{$ref:"#/$defs/ProjectId"}},required:["kind","project_id"],type:"object"}]},yN={additionalProperties:!1,properties:{active_assertion_id:{anyOf:[{$ref:"#/$defs/FactAssertionId"},{type:"null"}]},committed_event_ids:{items:{$ref:"#/$defs/FactEventId"},type:"array"},disposition:{$ref:"#/$defs/FactCommitDispositionV1"},fact_id:{$ref:"#/$defs/FactId"},last_event_id:{$ref:"#/$defs/FactEventId"},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["disposition","fact_id","owner","committed_event_ids","last_event_id"],type:"object"},yz={description:"Strongly typed canonical identity: `FactEventId`.",type:"string"},yD={enum:["helpful","unhelpful"],type:"string"},yF={description:"Strongly typed canonical identity: `FactId`.",type:"string"},yL={oneOf:[{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},kind:{const:"evidence",type:"string"},stable_key:{$ref:"#/$defs/LocatorDigest"}},required:["kind","anchor_id","stable_key"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"application",type:"string"},operation_id:{$ref:"#/$defs/ProvenanceId"}},required:["kind","operation_id"],type:"object"}]},yU={description:"Payload states that structurally cannot expose an available fact payload.",enum:["redacted","quarantined","retention_expired","deleted","unavailable","ambiguous"],type:"string"},yH={oneOf:[{additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},kind:{const:"available",type:"string"}},required:["kind","fact"],type:"object"},{additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},kind:{const:"superseded",type:"string"},superseded_by:{$ref:"#/$defs/FactId"}},required:["kind","fact","superseded_by"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"unavailable",type:"string"},status:{$ref:"#/$defs/FactStatusV1"}},required:["kind","status"],type:"object"}]},yG={oneOf:[{additionalProperties:!1,properties:{kind:{const:"not_applicable",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"not_mounted",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{expanded_fact_count:{format:"uint",minimum:0,type:"integer"},kind:{const:"complete",type:"string"},relation_count:{format:"uint",minimum:0,type:"integer"},root_count:{format:"uint",minimum:0,type:"integer"}},required:["kind","root_count","relation_count","expanded_fact_count"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"degraded",type:"string"},reason:{$ref:"#/$defs/FactSearchGraphDegradationV1"}},required:["kind","reason"],type:"object"}]},yB={enum:["conflict","unavailable","budget_exhausted","deadline_exceeded"],type:"string"},yK={additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},scores:{$ref:"#/$defs/FactSearchScoresV1"},why:{type:["string","null"]}},required:["fact","scores"],type:"object"},yJ={additionalProperties:!1,properties:{fts_score_millionths:{format:"uint32",minimum:0,type:"integer"},holographic_score_millionths:{format:"uint32",minimum:0,type:"integer"},jaccard_score_millionths:{format:"uint32",minimum:0,type:"integer"},score_millionths:{format:"uint32",minimum:0,type:"integer"},trust_score_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["score_millionths","fts_score_millionths","jaccard_score_millionths","holographic_score_millionths","trust_score_millionths"],type:"object"},yZ={additionalProperties:!1,properties:{fact_id:{$ref:"#/$defs/FactId"},owner:{$ref:"#/$defs/FactCommitOwnerV1"},payload_access:{$ref:"#/$defs/FactPayloadAccessV1"},projected_as_of:{$ref:"#/$defs/UtcMicros"}},required:["owner","fact_id","payload_access","projected_as_of"],type:"object"},yQ={additionalProperties:!1,properties:{access_count:{format:"uint64",minimum:0,type:"integer"},created_at:{$ref:"#/$defs/UtcMicros"},helpful_count:{format:"uint64",minimum:0,type:"integer"},last_feedback_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},last_recalled_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},last_retrieved_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},retrieval_count:{format:"uint64",minimum:0,type:"integer"},unhelpful_count:{format:"uint64",minimum:0,type:"integer"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["retrieval_count","access_count","helpful_count","unhelpful_count","created_at","updated_at"],type:"object"},yX={additionalProperties:!1,description:"Available fact projection. Unavailable payload states use\n[`FactProjectionV1::Unavailable`] and cannot fabricate payload fields.",properties:{active_assertion_id:{$ref:"#/$defs/FactAssertionId"},category:{$ref:"#/$defs/FactCategoryV1"},content:{type:"string"},entities:{items:{type:"string"},type:"array"},fact_id:{$ref:"#/$defs/FactId"},last_event_id:{$ref:"#/$defs/FactEventId"},metadata:{additionalProperties:!0,type:"object"},owner:{$ref:"#/$defs/FactCommitOwnerV1"},projected_as_of:{$ref:"#/$defs/UtcMicros"},source:{$ref:"#/$defs/FactIdentitySourceResultV1"},source_label:{type:["string","null"]},tags:{items:{type:"string"},type:"array"},telemetry:{$ref:"#/$defs/FactTelemetryV1"},trust_score_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["owner","fact_id","content","category","tags","entities","trust_score_millionths","source","active_assertion_id","last_event_id","projected_as_of","telemetry","metadata"],type:"object"},yY={additionalProperties:!1,description:"Exact source-owned state for one advisory producer in a composed feedback\ncycle. The producer tag is part of the durable cycle result so consumers\nnever infer provenance from the position of an aggregate provider state.",properties:{producer:{$ref:"#/$defs/FeedbackDiagnosticProducerV1"},state:{$ref:"#/$defs/ProviderEvaluationStateV1"}},required:["producer","state"],type:"object"},y1={description:"Availability of the canonical baseline used to classify a current\ndiagnostic. An unavailable or partial baseline never upgrades a finding\nto `New`; only an authoritative `NoPriorBaseline` state may do so without\na baseline record.",oneOf:[{enum:["complete","partial","stale","unavailable"],type:"string"},{const:"no_prior_baseline",description:"The authoritative runtime confirmed that there is no prior saved\ngeneration to compare. This is authoritative empty history, not an\ninvented horizon and not unavailable/partial coverage.",type:"string"}]},y0={description:"Content identity distinguishes durable saved content from an authorized\nephemeral document overlay. Overlay identity is deliberately local to its\nowning session and cannot be made durable by converting it to a digest.",oneOf:[{properties:{file_digest:{$ref:"#/$defs/ManifestDigest"},generation_digest:{$ref:"#/$defs/ManifestDigest"},kind:{const:"saved_content",type:"string"}},required:["kind","generation_digest","file_digest"],type:"object"},{properties:{agent_id:{anyOf:[{$ref:"#/$defs/AgentInstanceId"},{type:"null"}]},document_version:{format:"uint64",minimum:0,type:"integer"},kind:{const:"ephemeral_overlay",type:"string"},overlay_digest:{$ref:"#/$defs/ManifestDigest"},owner_client_id:{$ref:"#/$defs/HostInstanceId"},session_id:{$ref:"#/$defs/SessionId"}},required:["kind","session_id","owner_client_id","document_version","overlay_digest"],type:"object"}]},y2={description:"Strongly typed canonical identity: `FeedbackCycleId`.",type:"string"},y4={enum:["clean","duplicate_noop","blocked","incomplete_coverage","stale_replan_required","budget_exceeded","cancelled","user_stop","daemon_unavailable"],type:"string"},y6={enum:["new","pre_existing","unknown"],type:"string"},y3={description:"Closed producer vocabulary for standard diagnostic projection.",enum:["code_diagnostic","git_hub_review","ci_localization","proximity"],type:"string"},y9={additionalProperties:!1,description:"Bounded code location used only to project an anchored advisory finding\ninto an editor. The finding's `retrieval_anchor_id` remains the evidence\nexpansion authority; this value carries no source body or provider payload.",properties:{code:{type:"string"},code_description_uri:{type:["string","null"]},file:{$ref:"#/$defs/FileOccurrenceId"},producer:{$ref:"#/$defs/FeedbackDiagnosticProducerV1"},safe_bounded_message:{type:"string"},severity:{$ref:"#/$defs/DiagnosticSeverityV1"},span:{$ref:"#/$defs/SourceSpan"},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["file","span","code","severity","safe_bounded_message","producer"],type:"object"},y5={enum:["durable","session_only"],type:"string"},y8={description:"Strongly typed canonical identity: `FeedbackFindingId`.",type:"string"},y7={enum:["active","superseded","resolved","cleared"],type:"string"},ge={additionalProperties:!1,properties:{cycle_id:{$ref:"#/$defs/FeedbackCycleId"},expand_handle:{description:"Server-minted request handle for `feedback_expand`, present only when\nthe canonical finding has a retained retrieval anchor.",type:["string","null"]},finding:{$ref:"#/$defs/FeedbackFindingV1"},get_handle:{description:"Server-minted request handle for `feedback_get`; durable identity remains\n`finding.finding_id`.\n\nCursor identity types are deliberately absent from the generated schema\nsurface; the public wire form is the bounded opaque string.",type:"string"},result_id:{$ref:"#/$defs/FeedbackResultId"},scope:{$ref:"#/$defs/FeedbackScopeV1"}},required:["result_id","cycle_id","scope","finding","get_handle"],type:"object"},gt={additionalProperties:!1,description:"Reference-only post-edit feedback finding. The safe preview is bounded display framing,\nnever a source-text copy or a second diagnostic store.",properties:{classification:{$ref:"#/$defs/FeedbackDiagnosticClassificationV1"},diagnostic_projection:{anyOf:[{$ref:"#/$defs/FeedbackDiagnosticProjectionV1"},{type:"null"}]},finding_id:{$ref:"#/$defs/FeedbackFindingId"},lifecycle:{$ref:"#/$defs/FeedbackFindingLifecycleV1"},provider_state:{$ref:"#/$defs/ProviderEvaluationStateV1"},retrieval_anchor_id:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},safe_bounded_preview:{type:["string","null"]}},required:["finding_id","classification","lifecycle","provider_state"],type:"object"},gr={description:"Coverage state for graph impact and affected-test evidence. An empty impact\nset is clean only when its state is complete.",enum:["complete","partial","stale","unavailable"],type:"string"},gi={additionalProperties:!1,description:"Reference-only graph and test impact for one feedback target. The owning\ngraph/query layer supplies these identities; this contract does not create\nanother graph, test map, or evidence store.",properties:{affected_callers:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},affected_files:{items:{$ref:"#/$defs/FileOccurrenceId"},type:"array"},affected_tests:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},affected_tests_state:{$ref:"#/$defs/FeedbackImpactStateV1"},evidence_anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},state:{$ref:"#/$defs/FeedbackImpactStateV1"},target:{$ref:"#/$defs/FeedbackTargetV1"}},required:["target","affected_files","affected_callers","affected_tests","evidence_anchors","state","affected_tests_state"],type:"object"},go={description:"Strongly typed canonical identity: `FeedbackResultId`.",type:"string"},gn={additionalProperties:!1,description:"Exact repository scope used for a feedback evaluation. A path, current\nworking directory, repository display name, or mutable branch label is not\na substitute for this identity.",properties:{branch_ref:{type:"string"},head_commit_id:{$ref:"#/$defs/CommitId"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","branch_ref","head_commit_id"],type:"object"},ga={additionalProperties:!1,description:"Exact changed-code address for one single-root feedback evaluation. The\naddress carries canonical file/range/symbol identities, never a path or\nmutable line number.",properties:{file:{$ref:"#/$defs/FileOccurrenceId"},generation_id:{anyOf:[{$ref:"#/$defs/CodeGenerationId"},{type:"null"}]},span:{anyOf:[{$ref:"#/$defs/SourceSpan"},{type:"null"}]},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["file"],type:"object"},gs={description:"Strongly typed canonical identity: `FileOccurrenceId`.",type:"string"},gd={description:"How `tracedecay_files` lays out its listing.",oneOf:[{const:"flat",description:"One file per line.",type:"string"},{const:"grouped",description:"Grouped by directory.",type:"string"}]},gc={description:"Deterministic fixed-point score in millionths. No floating point crosses\nthis boundary.",format:"uint64",minimum:0,type:"integer"},gl={description:"Compatibility state of one source/projection pair.",enum:["current","stale","incompatible","missing","unknown"],type:"string"},gp={additionalProperties:!1,description:"A candidate after contribution grouping and fixed-point fusion.",properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},contributions:{items:{$ref:"#/$defs/CandidateContribution"},type:"array"},decisions:{items:{$ref:"#/$defs/RankingDecision"},type:"array"},exact_class:{$ref:"#/$defs/ExactClass"},freshness:{items:{$ref:"#/$defs/SourceFreshness"},type:"array"},logical_evidence_id:{$ref:"#/$defs/LogicalEvidenceId"},occurrences:{items:{$ref:"#/$defs/OccurrenceProvenance"},type:"array"},source_role:{$ref:"#/$defs/RetrievalSourceRoleV1",description:"Strongest source role across the fused occurrences."},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","logical_evidence_id","occurrences","exact_class","source_role","utility_micros","contributions","freshness","decisions"],type:"object"},gu={description:"Metric whose distribution the Gini report measures.",enum:["complexity","lines","fan_in","fan_out","members"],type:"string"},gm={description:"Unit the Gini report aggregates its metric over.",enum:["file","symbol"],type:"string"},gf={description:"Expected blob identity, or explicit absent-file state.",oneOf:[{enum:["absent_file"],type:"string"},{additionalProperties:!1,properties:{present:{$ref:"#/$defs/GitOidV1"}},required:["present"],type:"object"}]},gh={description:"Native change kind for one side (index or worktree) of a status entry,\nor for a whole-file diff record.",enum:["unmodified","modified","added","deleted","renamed","copied","type_changed","unmerged"],type:"string"},gy={additionalProperties:!1,description:"A symbol the exact base/head branch-generation comparison reports.",properties:{content_digest:{type:"string"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},name:{type:"string"},qualified_name:{type:"string"}},required:["id","name","qualified_name","kind","file","content_digest"],type:"object"},gg={oneOf:[{additionalProperties:!1,description:"Caller-selected files: symbols may be unchanged or not yet edited.",properties:{kind:{const:"proposed_files",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{base:{$ref:"#/$defs/GitOidV1"},head:{$ref:"#/$defs/GitOidV1"},kind:{const:"commit_range",type:"string"}},required:["kind","base","head"],type:"object"},{additionalProperties:!1,description:"Pinned HEAD (or empty tree) to the selected immutable index blobs.",properties:{head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},kind:{const:"staged",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,description:"Selected index blobs to captured working-tree bytes.",properties:{kind:{const:"working_tree",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,description:"Net change from pinned HEAD (or empty tree), including untracked files.",properties:{head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},kind:{const:"head_to_worktree",type:"string"}},required:["kind"],type:"object"}]},g_={additionalProperties:!1,description:"A verified-graph symbol a git-context read reports.",properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line"],type:"object"},gv={additionalProperties:!1,description:"Typed coverage of a read-only Git result: the sorted, de-duplicated set\nof degradations observed while capturing it.",properties:{degradations:{items:{$ref:"#/$defs/GitDegradationV1"},type:"array"}},required:["degradations"],type:"object"},gb={description:"Typed coverage/degradation reasons for a read-only Git result. A result\ncarrying any degradation is truthful but not complete; callers must not\ntreat it as a clean full view.",oneOf:[{enum:["detached_head","unborn_branch","sparse_checkout","split_index","unreadable_state","unsupported_object_format","in_progress_operation","shallow_boundary","truncated_output"],type:"string"},{const:"ignored_collision",description:"Ignored content shares a directory with live tracked/untracked\nentries, so the untracked/ignored view may be collapsed by Git.",type:"string"},{const:"conflicted_state",description:"Unmerged index stages are present.",type:"string"},{const:"submodule_state",description:"Submodule entries exist; the adapter does not recurse into them.",type:"string"}]},g$={description:"A native Git file mode as stored in tree/index records (six octal digits,\ne.g. `100644`, `100755`, `120000` symlink, `160000` gitlink/submodule).",type:"string"},gS={description:"A changed file's semantic role.",enum:["config","docs","source","test"],type:"string"},gk={description:"Native HEAD state. Missing, unborn, and detached states are explicit,\nnever guessed.",oneOf:[{properties:{branch:{type:"string"},commit:{$ref:"#/$defs/GitOidV1"},state:{const:"attached",type:"string"}},required:["state","branch","commit"],type:"object"},{properties:{commit:{$ref:"#/$defs/GitOidV1"},state:{const:"detached",type:"string"}},required:["state","commit"],type:"object"},{properties:{branch:{type:"string"},state:{const:"unborn",type:"string"}},required:["state","branch"],type:"object"}]},gw={enum:["disabled","probe_private_preview"],type:"string"},gP={additionalProperties:!1,description:"Expected index entry state for compare-and-swap: blob identity (or\nabsent), mode, and unmerged-stage state. `unmerged_stage` is `None` for a\nmerged (stage-0) entry.",properties:{blob:{$ref:"#/$defs/GitBlobExpectationV1"},mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},unmerged_stage:{format:"uint8",maximum:255,minimum:0,type:["integer","null"]}},required:["blob"],type:"object"},gV={description:"Strongly typed canonical identity: `GitIndexPreviewId`.",type:"string"},gR={description:"The only native Git mutations represented by the index-transaction runtime. Generic Git execution,\nref rewrites, commits, merge/rebase/cherry-pick, push, and worktree writes are\ndeliberately absent.",enum:["stage_hunks","unstage_hunks"],type:"string"},gq={description:"A native Git object id (commit, tree, or blob), lowercase hex, SHA-1 or\nSHA-256 length. This is identity evidence only; it never authorizes\nobject reconstruction or traversal outside native Git.",type:"string"},gI={description:"In-progress native Git operation state, read from repository metadata.",enum:["none","merge","rebase","cherry_pick","revert","bisect","sequencer","unknown"],type:"string"},gx={description:"Whether a bounded page holds every answer or stopped at its limit.",enum:["complete","partial"],type:"string"},gj={enum:["complete"],type:"string"},gC={enum:["partial"],type:"string"},gT={enum:["unavailable"],type:"string"},gO={enum:["result_limit"],type:"string"},gE={additionalProperties:!1,properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},worktree:{type:["string","null"]}},type:"object"},gA={description:"Flat public selector for an admitted Git diff scope.\n\nThis intentionally differs from [`tracedecay_domain::GitDiffScopeV1`]: MCP\nand CLI accept `scope`, `base`, and `head` as sibling fields, then\ntransport parsing builds the canonical domain scope after checking their\nlegal combinations.",enum:["working_tree","staged","commit_range"],type:"string"},gW={enum:["git"],type:"string"},gM={additionalProperties:!1,properties:{kind:{$ref:"#/$defs/GitToolErrorKindV1"},message:{type:"string"},operation:{$ref:"#/$defs/GitToolOperationV1"}},required:["kind","operation","message"],type:"object"},gN={additionalProperties:!1,description:"Git itself refused the refs, worktree status, or history the tool reads.",properties:{error:{$ref:"#/$defs/GitToolErrorV1"}},required:["error"],type:"object"},gz={description:"The git step that refused the read.",enum:["diff","status","log"],type:"string"},gD={additionalProperties:!1,properties:{binding_digest:{$ref:"#/$defs/ManifestDigest"},consumed_at:{$ref:"#/$defs/UtcMicros"},input_digest:{$ref:"#/$defs/ManifestDigest"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},request_id:{type:"string"},token_digest:{$ref:"#/$defs/ManifestDigest"}},required:["binding_digest","token_digest","request_id","input_digest","consumed_at","receipt_digest"],type:"object"},gF={enum:["forbid_force_and_rebase"],type:"string"},gL={description:"Strongly typed canonical identity: `HostInstanceId`.",type:"string"},gU={description:"`HunkRef` operation direction: working tree to index, or index to\nHEAD/base. No other direction is encodable.",enum:["working_tree_to_index","index_to_head"],type:"string"},gH={additionalProperties:!1,description:"Immutable hunk identity for compare-and-swap. A hunk is identified by exact repository,\ndirection, path, expected base/index/worktree identity, normalized hunk\nheader, context and patch digests, and the preview that issued the\nreference, never by display ordinal or line number alone.\n\nquery mints these as read-only identity evidence only. Applying them is a\ndaemon Git mutation path and is not representable here.",properties:{attributes_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Attributes/filter identity relevant to clean/smudge and EOL handling."},context_digest:{$ref:"#/$defs/ManifestDigest"},direction:{$ref:"#/$defs/HunkDirectionV1"},expected_base_blob:{$ref:"#/$defs/GitBlobExpectationV1"},expected_index_entry:{$ref:"#/$defs/GitIndexEntryExpectationV1"},expected_worktree_blob:{anyOf:[{$ref:"#/$defs/GitBlobExpectationV1"},{type:"null"}],description:"Expected working-tree identity when the operation reads the worktree:\na native content digest or explicit absent-file state. `None` means\nthe operation direction does not read the worktree."},expected_worktree_mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},hunk_header:{description:"Normalized `@@ -o,l +n,m @@` header text.",type:"string"},original_path:{description:"Old path for a rename or copy.",type:["string","null"]},patch_digest:{$ref:"#/$defs/ManifestDigest"},path:{type:"string"},preview_id:{type:"string"},repository:{$ref:"#/$defs/RepositoryId"},schema_version:{type:"string"},selected_line_bitmap:{description:"Selected hunk-line bitmap (little-endian word order, line 1 = bit 0\nof word 0). Full-hunk identity covers the larger old/new side so\ndeletion-only hunks remain representable.",items:{format:"uint64",minimum:0,type:"integer"},type:"array"},snapshot_digest:{$ref:"#/$defs/ManifestDigest"},worktree:{$ref:"#/$defs/WorktreeId"}},required:["repository","worktree","direction","path","expected_base_blob","expected_index_entry","hunk_header","context_digest","patch_digest","selected_line_bitmap","preview_id","schema_version","snapshot_digest"],type:"object"},gG={enum:["available","retained_but_unavailable","redacted","deleted","retention_expired","unauthorized","locked","unverifiable"],type:"string"},gB={additionalProperties:!1,description:"One yes/no question asked of the decision engine for one intent. The\nintent is a candidate when the engine's probability reaches\n`threshold_permille` and, when set, exceeds the runner-up by\n`margin_permille`.",properties:{instructions:{type:"string"},intent:{$ref:"#/$defs/ContextScoutIntentKindV1"},margin_permille:{format:"uint16",maximum:65535,minimum:0,type:["integer","null"]},threshold_permille:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["intent","instructions","threshold_permille"],type:"object"},gK={additionalProperties:!1,description:"Bounds on the recent-session window one intent pass reads.",properties:{freshen_budget_ms:{description:"Time the pass may wait for the transcript store to ingest the newest\nturn before it reads the window as it stands.",format:"uint32",minimum:0,type:"integer"},max_age_secs:{format:"uint32",minimum:0,type:"integer"},max_bytes:{format:"uint32",minimum:0,type:"integer"},max_messages:{format:"uint8",maximum:255,minimum:0,type:"integer"},max_user_turns:{format:"uint8",maximum:255,minimum:0,type:"integer"}},required:["max_user_turns","max_messages","max_bytes","max_age_secs","freshen_budget_ms"],type:"object"},gJ={description:"p50/p95/p99 for one provider operation latency stage.",properties:{p50:{$ref:"#/$defs/MetricValueV1"},p95:{$ref:"#/$defs/MetricValueV1"},p99:{$ref:"#/$defs/MetricValueV1"}},required:["p50","p95","p99"],type:"object"},gZ={oneOf:[{properties:{state:{const:"ready",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"cancelled",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"timed_out",type:"string"}},required:["state"],type:"object"},{properties:{reason:{type:"string"},state:{const:"unavailable",type:"string"}},required:["state","reason"],type:"object"},{properties:{diagnostic:{type:"string"},state:{const:"failed",type:"string"}},required:["state","diagnostic"],type:"object"}]},gQ={additionalProperties:!1,properties:{limit:{format:"uint64",minimum:0,type:"integer"},offset:{format:"uint64",minimum:0,type:"integer"},returned_chars:{format:"uint64",minimum:0,type:"integer"},total_chars:{format:"uint64",minimum:0,type:"integer"},truncated:{type:"boolean"}},required:["offset","limit","returned_chars","total_chars","truncated"],type:"object"},gX={description:"Whether historical discovery, projection publication, and summary\nconvergence have all settled for everything the store's sources hold.",oneOf:[{const:"converging",description:"A stage still owes committed work.",type:"string"},{const:"converged",description:"The worker committed the last owed item and has nothing pending.",type:"string"},{const:"blocked",description:"Every runnable stage settled, but historical discovery is blocked.",type:"string"},{const:"unavailable",description:"No worker is serving the store.",type:"string"}]},gY={additionalProperties:!1,properties:{converged_at_unix_micros:{description:"When the latest convergence event was published.",format:"int64",type:["integer","null"]},epoch:{description:"Convergence events this worker has published; a larger value is a\nnewer event.",format:"uint64",minimum:0,type:"integer"},reason:{description:"The historical discovery blocker when `state` is `blocked`.",type:["string","null"]},state:{$ref:"#/$defs/LcmConvergenceStateV1"}},required:["state","epoch"],type:"object"},g1={description:"Whether the refresh worker that serves this store's temporal projection\nis current, still converging history, or not serving at all.",enum:["current","stale","unavailable"],type:"string"},g0={additionalProperties:!1,description:"The temporal projection's serving state at diagnosis time. A store whose\nschema is healthy can still have nothing to serve while history is being\nre-derived (for example on a fresh profile); this is where\nthat state is named instead of being read as absent data.",properties:{convergence:{$ref:"#/$defs/LcmConvergenceV1"},reason:{description:"Machine reason for a non-current state: `historical_convergence`,\n`historical_retry:`, `historical_blocked:`, or the worker\nunavailability (`worker_missing`, `worker_recovering`, `worker_stalled`,\n`worker_stopped`).",type:["string","null"]},state:{$ref:"#/$defs/LcmDoctorProjectionStateV1"},worker:{$ref:"#/$defs/RetrievalWorkerStatusV1"}},required:["state","worker","convergence"],type:"object"},g2={additionalProperties:!1,properties:{content:{type:"string"},content_hash:{type:"string"},message_id:{type:"string"},metadata_json:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},payload_ref:{type:["string","null"]},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:"integer"},timestamp:{format:"int64",type:["integer","null"]}},required:["provider","message_id","session_id","store_id","role","ordinal","content","content_hash","storage_kind"],type:"object"},g4={oneOf:[{properties:{freshness:{$ref:"#/$defs/TemporalFreshnessV1"},outcome:{const:"complete",type:"string"}},required:["outcome","freshness"],type:"object"},{properties:{freshness:{$ref:"#/$defs/TemporalFreshnessV1"},omitted:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"partial",type:"string"}},required:["outcome","freshness","omitted"],type:"object"},{properties:{freshness:{$ref:"#/$defs/TemporalFreshnessV1"},outcome:{const:"stale",type:"string"}},required:["outcome","freshness"],type:"object"}]},g6={oneOf:[{properties:{kind:{const:"raw_message",type:"string"},store_id:{format:"int64",type:"integer"}},required:["kind","store_id"],type:"object"},{properties:{kind:{const:"summary_node",type:"string"},node_id:{type:"string"}},required:["kind","node_id"],type:"object"}]},g3={enum:["inline","external","canonical_occurrence"],type:"string"},g9={description:"One provider's summarizer executable: absent by default, or the exact\nabsolute path the operator configured with its optional tuning.",oneOf:[{properties:{state:{const:"unconfigured",type:"string"}},required:["state"],type:"object"},{properties:{canonical_path:{type:"string"},model:{description:"Model requested for summary turns; the provider default when absent.",type:["string","null"]},state:{const:"configured",type:"string"},timeout_secs:{description:"Wall-clock budget for one summary run, within\n[`LCM_SUMMARIZER_TIMEOUT_SECS_RANGE`]; the caller's default when absent.",format:"uint64",minimum:0,type:["integer","null"]}},required:["state","canonical_path"],type:"object"}]},g5={additionalProperties:!1,description:"The per-provider summarizer executables one configuration snapshot admits.",properties:{codex:{$ref:"#/$defs/LcmSummarizerExecutableV1",default:{state:"unconfigured"},description:"`codex`, driven over app-server JSON-RPC for Codex sessions."},cursor_agent:{$ref:"#/$defs/LcmSummarizerExecutableV1",default:{state:"unconfigured"},description:"`cursor-agent`, asked for a summary of Cursor sessions."}},type:"object"},g8={additionalProperties:!1,properties:{conversation_id:{type:"string"},created_at:{format:"int64",type:"integer"},depth:{format:"int64",type:"integer"},expand_hint:{type:["string","null"]},metadata_json:{type:["string","null"]},node_id:{type:"string"},provider:{type:"string"},session_id:{type:"string"},source_refs:{items:{$ref:"#/$defs/LcmSourceRefV1"},type:"array"},source_time_end:{format:"int64",type:["integer","null"]},source_time_start:{format:"int64",type:["integer","null"]},source_token_count:{format:"int64",type:"integer"},summary_hash:{type:"string"},summary_text:{type:"string"},summary_token_count:{format:"int64",type:"integer"}},required:["node_id","provider","conversation_id","session_id","depth","summary_text","summary_hash","source_refs","summary_token_count","source_token_count","created_at"],type:"object"},g7={additionalProperties:!1,properties:{anchors:{items:{type:"string"},type:"array"},authorized_root:{type:["string","null"]},coverage:{$ref:"#/$defs/TemporalCoverageV1"},explanations:{items:{$ref:"#/$defs/TemporalExplanationV1"},type:"array"},next_cursor:{type:["string","null"]},omissions:{items:{$ref:"#/$defs/TemporalOmissionV1"},type:"array"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},watermarks:{$ref:"#/$defs/TemporalWatermarksV1"}},required:["anchors","watermarks","coverage","explanations"],type:"object"},_e={description:"Why a site the lexical lane admitted for a caller anchor is absent from\nthe response.",oneOf:[{const:"diversity_cap",description:"Collapsed as a duplicate or held back by the per-file diversity cap.",type:"string"},{const:"outside_page",description:"Ranked, but outside the returned page: an earlier page, or behind\n`next_cursor`.",type:"string"},{const:"not_hydrated",description:"On the page, but late hydration returned no source for it.",type:"string"},{const:"out_of_scope",description:"Outside the caller's scope prefix.",type:"string"}]},_t={additionalProperties:!1,description:"Anchor sites one serving stage removed from the response.",properties:{reason:{$ref:"#/$defs/LexicalAnchorDropReasonV1"},sites:{format:"uint64",minimum:0,type:"integer"}},required:["reason","sites"],type:"object"},_r={description:"Strongly typed algorithm-tagged integrity digest: `LocatorDigest`.",type:"string"},_i={description:"Strongly typed canonical identity: `LogicalCopyClusterId`.",type:"string"},_o={description:"Strongly typed canonical identity: `LogicalEvidenceId`.",type:"string"},_n={enum:["global","project"],type:"string"},_a={properties:{absorbed_into:{type:["string","null"]},activated_at:{format:"int64",type:["integer","null"]},archived_reason:{type:["string","null"]},category:{type:"string"},checksum:{type:"string"},created_at:{format:"int64",type:"integer"},id:{type:"string"},materialization_scope:{$ref:"#/$defs/ManagedSkillMaterializationScope"},pinned:{type:"boolean"},provenance:{$ref:"#/$defs/ManagedSkillProvenance"},routing_description:{type:"string"},state:{$ref:"#/$defs/ManagedSkillState"},summary:{type:"string"},targets:{default:["cursor","codex","claude","agents","opencode","kimi","kiro","hermes"],items:{$ref:"#/$defs/SkillInstallTarget"},type:"array"},title:{type:"string"},updated_at:{format:"int64",type:"integer"}},required:["id","title","summary","routing_description","category","state","pinned","checksum","created_at","updated_at","provenance"],type:"object"},_s={properties:{actor:{type:"string"},run_id:{type:["string","null"]},source:{$ref:"#/$defs/ManagedSkillSource"}},required:["source","actor"],type:"object"},_d={enum:["automation_run","user","import"],type:"string"},_c={enum:["active","disabled","archived"],type:"string"},_l={description:"Strongly typed algorithm-tagged integrity digest: `ManifestDigest`.",type:"string"},_p={description:"The only Git histories this product operation can create.",enum:["fast_forward","two_parent_merge","cherry_pick_exact_commits"],type:"string"},_u={enum:["project","user"],type:"string"},_m={enum:["all","parents_only","subagents_only"],type:"string"},_f={enum:["all","direct_user","tool_result"],type:"string"},_h={properties:{calibration_revision:{type:"string"},cohort_revision:{type:"string"},drift_valid:{type:"boolean"},estimator_revision:{type:"string"},support:{format:"uint64",minimum:0,type:"integer"}},required:["estimator_revision","calibration_revision","cohort_revision","support","drift_valid"],type:"object"},_y={properties:{descriptor_revision:{type:"string"},eligible_population:{type:"string"}},required:["descriptor_revision","eligible_population"],type:"object"},_g={properties:{censored:{format:"uint64",minimum:0,type:"integer"},completed:{format:"uint64",minimum:0,type:"integer"},eligible:{description:"Exact denominator cardinality. `None` means the denominator is unknown.",format:"uint64",minimum:0,type:["integer","null"]},excluded:{format:"uint64",minimum:0,type:"integer"},observed:{format:"uint64",minimum:0,type:"integer"},state:{$ref:"#/$defs/CoverageStateV1"},unknown:{format:"uint64",minimum:0,type:"integer"}},required:["observed","completed","censored","unknown","excluded","state"],type:"object"},__={enum:["measurement","association","calibrated_prediction"],type:"string"},_v={properties:{projector_revision:{type:"string"},source:{$ref:"#/$defs/MetricSourceV1"},source_revision:{type:"string"},watermark:{type:"string"}},required:["source","source_revision","projector_revision","watermark"],type:"object"},_b={enum:["observability_envelope","feedback_observations","provider_usage_observation","savings_ledger"],type:"string"},_$={properties:{baseline_watermark:{type:["string","null"]},delta:{format:"double",type:["number","null"]},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"}},required:["horizon"],type:"object"},_S={properties:{lower:{format:"double",type:["number","null"]},reason:{type:["string","null"]},upper:{format:"double",type:["number","null"]}},type:"object"},_k={properties:{calibration:{anyOf:[{$ref:"#/$defs/MetricCalibrationV1"},{type:"null"}]},cohort:{$ref:"#/$defs/MetricCohortV1"},coverage:{$ref:"#/$defs/MetricCoverageV1"},denominator:{type:"string"},denominator_value:{format:"uint64",minimum:0,type:["integer","null"]},descriptor_revision:{type:"string"},evidence_class:{$ref:"#/$defs/MetricEvidenceClassV1"},metric:{type:"string"},provenance:{$ref:"#/$defs/MetricProvenanceV1"},temporal:{$ref:"#/$defs/MetricTemporalV1"},unavailable_reason:{type:["string","null"]},uncertainty:{$ref:"#/$defs/MetricUncertaintyV1"},unit:{type:"string"},value:{description:"Aggregate value. It is absent whenever its denominator or coverage is\ninsufficient; observed lower bounds remain available in `coverage`.",format:"double",type:["number","null"]}},required:["descriptor_revision","metric","unit","denominator","coverage","evidence_class","provenance","cohort","temporal","uncertainty"],type:"object"},_w={additionalProperties:!1,description:"A file that historically changes with `partner_of` but is missing from the\nchange set under review, e.g. a migration beside its schema.",properties:{co_changes:{description:"Commits that changed both `partner_of` and `file`.",format:"uint64",minimum:0,type:"integer"},file:{type:"string"},partner_of:{type:"string"},partner_of_changes:{description:"Commits that changed `partner_of`.",format:"uint64",minimum:0,type:"integer"}},required:["file","partner_of","co_changes","partner_of_changes"],type:"object"},_P={additionalProperties:!1,description:"Frozen continuation identity shared by all participating roots.",properties:{digest:{$ref:"#/$defs/ManifestDigest"},next_page:{format:"uint64",minimum:1,type:"integer"},order_digest:{$ref:"#/$defs/ManifestDigest"},query_digest:{$ref:"#/$defs/ManifestDigest"},root_cursors:{items:{$ref:"#/$defs/RootScopeOutcomeV1_for_Nullable_string"},type:"array"},root_generations:{items:{$ref:"#/$defs/RootScopeOutcomeV1_for_Nullable_RootGenerationV1"},type:"array"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_set_digest","root_generations","root_cursors","query_digest","order_digest","next_page","digest"],type:"object"},_V={description:"Strongly typed canonical identity: `NativeIntegrationApprovalId`.",type:"string"},_R={description:"Explicit direction of one integration. Stack meaning is never inferred.",enum:["propagate_dependency_to_dependent","land_dependent_into_dependency","integrate_independent_branch"],type:"string"},_q={description:"Truthful preview classification. Only `MechanicalIntegrationEligible`\ncarries apply-eligible evidence.",oneOf:[{properties:{detail:{$ref:"#/$defs/MechanicalIntegrationModeV1"},state:{const:"mechanical_integration_eligible",type:"string"}},required:["state","detail"],type:"object"},{properties:{state:{const:"already_integrated",type:"string"}},required:["state"],type:"object"},{properties:{detail:{properties:{conflict_digest:{$ref:"#/$defs/ManifestDigest"}},required:["conflict_digest"],type:"object"},state:{const:"native_conflict",type:"string"}},required:["state","detail"],type:"object"},{properties:{detail:{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"}},required:["evidence_digest"],type:"object"},state:{const:"semantic_review_required",type:"string"}},required:["state","detail"],type:"object"},{properties:{detail:{properties:{reason:{$ref:"#/$defs/NativeIntegrationUnavailabilityV1"}},required:["reason"],type:"object"},state:{const:"partial",type:"string"}},required:["state","detail"],type:"object"},{properties:{detail:{properties:{reason:{$ref:"#/$defs/NativeIntegrationUnavailabilityV1"}},required:["reason"],type:"object"},state:{const:"unavailable",type:"string"}},required:["state","detail"],type:"object"}]},_I={description:"Strongly typed canonical identity: `NativeIntegrationPreviewId`.",type:"string"},_x={additionalProperties:!1,description:"Canonical stack-snapshot proof returned by `stack_snapshot` and consumed\nverbatim by preflight.",properties:{authorized_scope_set_digest:{$ref:"#/$defs/ManifestDigest"},authorized_scope_set_id:{$ref:"#/$defs/ScopeSetId"},authorized_scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},destination:{$ref:"#/$defs/ResolvedScope"},grant_digest:{$ref:"#/$defs/ManifestDigest"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},inventory_snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},policy_digest:{$ref:"#/$defs/ManifestDigest"},selection:{$ref:"#/$defs/NativeIntegrationSelectionBindingV1"},source:{$ref:"#/$defs/ResolvedScope"}},required:["source","destination","authorized_scope_set_id","authorized_scope_set_revision","authorized_scope_set_digest","inventory_snapshot_id","inventory_epoch","selection","grant_digest","policy_digest"],type:"object"},_j={description:"Canonically sealed selection passed to the topology authority.\n\n`stack_snapshot` requests carry declaration content; its boundary seals\nthat declaration into this proof, and preflight accepts the proof verbatim.\nThe topology authority never discovers roots or edges.",oneOf:[{properties:{binding:{properties:{declared_revision:{$ref:"#/$defs/BranchStackRevisionV1"},destination_node_id:{$ref:"#/$defs/StackNodeId"},direction:{$ref:"#/$defs/NativeIntegrationDirectionV1"},revision_digest:{$ref:"#/$defs/ManifestDigest"},revision_id:{$ref:"#/$defs/BranchStackRevisionId"},source_node_id:{$ref:"#/$defs/StackNodeId"},stack_id:{$ref:"#/$defs/BranchStackId"}},required:["stack_id","revision_id","revision_digest","declared_revision","source_node_id","destination_node_id","direction"],type:"object"},kind:{const:"declared_stack_edge",type:"string"}},required:["kind","binding"],type:"object"},{properties:{binding:{properties:{destination_ref:{$ref:"#/$defs/RefId"},proposal_digest:{$ref:"#/$defs/ManifestDigest"},source_ref:{$ref:"#/$defs/RefId"}},required:["proposal_digest","source_ref","destination_ref"],type:"object"},kind:{const:"independent_branch",type:"string"}},required:["kind","binding"],type:"object"}]},_C={description:"The only truthful terminal outcomes after recovery.",enum:["committed","aborted_no_change","rolled_back","needs_inspection"],type:"string"},_T={description:"Strongly typed canonical identity: `NativeIntegrationTransactionId`.",type:"string"},_O={description:"Why a preflight cannot authorize apply.",enum:["partial_evidence","stale_scope","denied","native_state_unavailable","reset_required","durability_uncertain","unsupported_hooks","signing_required","destination_occupied"],type:"string"},_E={description:"A target selected by exact registered identity. Repository inventory names\none repository; cleanup names one worktree within that repository.",oneOf:[{properties:{kind:{const:"repository",type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"}},required:["kind","project_id","repository_id"],type:"object"},{properties:{kind:{const:"worktree",type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["kind","project_id","repository_id","worktree_id"],type:"object"}]},_A={additionalProperties:!1,properties:{body:{format:"uint64",minimum:0,type:"integer"},full_file:{format:"uint64",minimum:0,type:"integer"}},required:["body","full_file"],type:"object"},_W={properties:{since_micros:{format:"int64",type:"integer"},until_micros:{format:"int64",type:"integer"}},required:["since_micros","until_micros"],type:"object"},_M={additionalProperties:!1,description:"Stable logical identity of one provider observation source.\n\nThe session identity is provider-native evidence. The physical file identity\nis represented separately by [`ObservationSourceGenerationV1`].",properties:{provider:{$ref:"#/$defs/ProviderId"},session_id:{$ref:"#/$defs/SessionId"},source_key:{anyOf:[{$ref:"#/$defs/SessionId"},{type:"null"}]}},required:["provider","session_id"],type:"object"},_N={properties:{analytics_mode:{$ref:"#/$defs/AnalyticsModeReadModelV1"},authorized_scope_ref:{type:"string"},comparison:{$ref:"#/$defs/PerformanceComparisonReadModelV1"},current:{type:"boolean"},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},metrics:{items:{$ref:"#/$defs/MetricValueV1"},type:"array"},observed_at_micros:{format:"int64",type:"integer"},rejected_arguments:{$ref:"#/$defs/RejectedArgumentAnalyticsV1"},watermark:{type:"string"}},required:["authorized_scope_ref","horizon","watermark","observed_at_micros","current","metrics","analytics_mode","comparison","rejected_arguments"],type:"object"},_z={additionalProperties:!1,description:"Structured occurrence provenance retained through fusion. Fusion\npreserves each exact `(source_occurrence_id, retriever_evidence_anchor)`\npair; parallel unassociated provenance vectors are forbidden.",properties:{evidence_role:{$ref:"#/$defs/EvidenceRole"},file_occurrence_id:{anyOf:[{$ref:"#/$defs/FileOccurrenceId"},{type:"null"}]},freshness:{$ref:"#/$defs/SourceFreshness"},logical_copy_cluster_id:{anyOf:[{$ref:"#/$defs/LogicalCopyClusterId"},{type:"null"}]},logical_copy_evidence_anchor:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},repository_id:{anyOf:[{$ref:"#/$defs/RepositoryId"},{type:"null"}]},retriever_evidence_anchor:{$ref:"#/$defs/RetrievalAnchorId"},session_or_thread_id:{anyOf:[{$ref:"#/$defs/SessionOrThreadId"},{type:"null"}]},source_namespace:{$ref:"#/$defs/SourceNamespace"},source_occurrence_id:{$ref:"#/$defs/SourceOccurrenceId"}},required:["source_occurrence_id","retriever_evidence_anchor","source_namespace","evidence_role","freshness"],type:"object"},_D={additionalProperties:!1,description:"Bounded work accounting supplied by an owning port or transaction.",properties:{bytes_consumed:{format:"uint64",minimum:0,type:"integer"},elapsed_micros:{format:"uint64",minimum:0,type:"integer"},units_consumed:{format:"uint64",minimum:0,type:"integer"}},required:["units_consumed","bytes_consumed","elapsed_micros"],type:"object"},_F={additionalProperties:!1,description:"Canonical operation evidence. An admitted failure remains represented here\nrather than being replaced by a transport exception.",properties:{budget:{$ref:"#/$defs/OperationBudgetUsage"},cancellation:{anyOf:[{$ref:"#/$defs/CancellationObservation"},{type:"null"}]},effective_deadline:{$ref:"#/$defs/Deadline"},ended_at:{$ref:"#/$defs/UtcMicros"},started_at:{$ref:"#/$defs/UtcMicros"},termination:{$ref:"#/$defs/OperationTermination"}},required:["started_at","ended_at","effective_deadline","budget","termination"],type:"object"},_L={description:"Terminal state after an operation has been admitted.",enum:["completed","cancelled","timed_out","failed","unavailable","partial","effect_unknown"],type:"string"},_U={additionalProperties:!1,description:"Bounded opaque page request. Resume authorization occurs before an adapter\ndecodes or hydrates the cursor.",properties:{cursor:{description:"Opaque resume token. The identifier type is deliberately absent from the\ngenerated schema surface, so the public wire form is its bounded string.",type:["string","null"]},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],type:"object"},_H={properties:{baseline_build:{type:["string","null"]},candidate_build:{type:["string","null"]},configuration:{type:["string","null"]},corpus:{type:["string","null"]},coverage:{$ref:"#/$defs/MetricCoverageV1"},disposition:{$ref:"#/$defs/ComparisonDispositionV1"},eligible_outcomes:{format:"uint64",minimum:0,type:["integer","null"]},environment:{type:["string","null"]},oracle:{type:["string","null"]},paired_outcomes:{format:"uint64",minimum:0,type:["integer","null"]},platform:{type:["string","null"]},regression_observed:{type:["boolean","null"]},rollback_profile:{type:["string","null"]},unavailable_reason:{type:["string","null"]},workload:{type:["string","null"]}},required:["disposition","coverage"],type:"object"},_G={oneOf:[{enum:["brief"],type:"string"},{const:"symbols",description:"Exact changed-symbol enumeration, with its existing continuation cursor.",type:"string"}]},_B={description:"Whether the served code generation is known current at serve time.",enum:["fresh","possibly_stale"],type:"string"},_K={additionalProperties:!1,description:"The indexing state behind a `possibly_stale` verdict: the served\ngeneration, the scheduler's latest sealed generation, its staleness-ladder\nstate, and the lanes that answered from an older generation. `summary` is\nthe one-line rendering agents read.",properties:{latest_generation:{type:["string","null"]},parked:{anyOf:[{$ref:"#/$defs/CodeIndexConvergenceParkedV1"},{type:"null"}],description:"The park holding convergence until the operator applies its remedy.\nNo wake retries it, so repeating the request cannot change the answer."},reason:{type:["string","null"]},rebuild_in_flight:{type:["boolean","null"]},served_generation:{type:["string","null"]},stale_lanes:{items:{type:"string"},type:"array"},staleness_state:{anyOf:[{$ref:"#/$defs/CodeIndexStalenessStateV1"},{type:"null"}]},summary:{type:"string"}},required:["summary"],type:"object"},_J={enum:["complete"],type:"string"},_Z={additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},message:{type:"string"},node_id:{type:"string"},reason_code:{type:"string"},status:{type:"string"},suggestions:{description:"Nearest served symbols by edit distance to the requested id, by id,\nsimple name, or qualified name.",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"}},required:["status","reason_code","node_id","message"],type:"object"},_Q={enum:["full","partial"],type:"string"},_X={additionalProperties:!1,description:"Freshness verdict carried by every search and context response. `indexing`\nis present exactly when the state is `possibly_stale`.",properties:{indexing:{anyOf:[{$ref:"#/$defs/PrimitiveIndexingStateV1"},{type:"null"}]},state:{$ref:"#/$defs/PrimitiveFreshnessStateV1"}},required:["state"],type:"object"},_Y={additionalProperties:!1,properties:{language:{type:["string","null"]},provider:{type:["string","null"]},reason:{type:"string"}},required:["reason"],type:"object"},_1={additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},kind:{type:"string"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"},unavailable_fields:{items:{type:"string"},type:"array"}},required:["node_id","name","qualified_name","kind","file","start_line","end_line","unavailable_fields"],type:"object"},_0={additionalProperties:!1,properties:{detail:{type:"string"},reason_code:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/PrimitiveUnavailableStatusV1"}},required:["status","reason_code","retryable","detail"],type:"object"},_2={enum:["unavailable"],type:"string"},_4={description:"Strongly typed canonical identity: `ProjectId`.",type:"string"},_6={properties:{alias_count:{format:"uint",minimum:0,type:"integer"},artifact_count:{format:"uint",minimum:0,type:"integer"},branches:{items:{type:"string"},type:"array"},canonical_root:{type:"string"},default_branch:{description:"Repository default branch recorded at registration.",type:["string","null"]},head_branch:{description:"Branch the checkout's HEAD names now; `None` when HEAD is detached or\nno checkout of this project could be read.",type:["string","null"]},is_active:{type:["boolean","null"]},kind:{type:"string"},label:{type:"string"},last_seen_at:{format:"int64",type:"integer"},project_id:{type:"string"},project_root:{type:"string"},store_count:{format:"uint",minimum:0,type:"integer"}},required:["project_id","label","project_root","canonical_root","kind","branches","store_count","artifact_count","alias_count","last_seen_at"],type:"object"},_3={properties:{project_count:{format:"uint",minimum:0,type:"integer"},repo_count:{format:"uint",minimum:0,type:"integer"},truncated:{type:"boolean"}},required:["project_count","repo_count","truncated"],type:"object"},_9={properties:{branches:{items:{type:"string"},type:"array"},git_common_dir:{type:["string","null"]},label:{type:"string"},project_count:{format:"uint",minimum:0,type:"integer"},projects:{items:{$ref:"#/$defs/ProjectRegistryEntry"},type:"array"}},required:["label","project_count","branches","projects"],type:"object"},_5={description:"Strongly typed canonical identity: `ProjectionGenerationId`.",type:"string"},_8={description:"Strongly typed canonical identity: `ProposalId`.",type:"string"},_7={enum:["reject","require_human_approval_and_independent_review"],type:"string"},ve={additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/ProtectedRefDispositionV1"},selector:{$ref:"#/$defs/ProtectedRefSelectorV1"}},required:["selector","disposition"],type:"object"},vt={oneOf:[{properties:{kind:{const:"native_default_branch",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"exact",type:"string"},value:{$ref:"#/$defs/CanonicalGitRefNameV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"prefix",type:"string"},value:{$ref:"#/$defs/CanonicalGitRefPrefix"}},required:["kind","value"],type:"object"}]},vr={description:"Strongly typed canonical identity: `ProvenanceId`.",type:"string"},vi={description:"Complete provider states remain distinct. Empty findings are clean only\nwhen every requested provider completed with complete supported coverage.",enum:["supported_completed_complete","unsupported","absent","indexing","stale","cancelled","timed_out","failed","partial","unavailable"],type:"string"},vo={description:"Strongly typed canonical identity: `ProviderId`.",type:"string"},vn={description:"One provider/model cohort in the Costs latency read model.\n\nThe percentile cells are ordinary canonical metrics so every value carries\nits exact unit, horizon, denominator, coverage/censoring, and projector\nprovenance. Identity provenance is kept separately because latency is\nmeasured by `OperationResourceObservedV1`, while provider/model identity\nmay be joined from an exact `ProviderUsageObservationV1` request/session.",properties:{first_progress:{$ref:"#/$defs/LatencyDistributionReadModelV1"},identity_provenance:{$ref:"#/$defs/MetricProvenanceV1"},identity_unavailable_reason:{type:["string","null"]},model:{type:["string","null"]},provider:{type:["string","null"]},queue:{$ref:"#/$defs/LatencyDistributionReadModelV1"},service:{$ref:"#/$defs/LatencyDistributionReadModelV1"},start:{$ref:"#/$defs/LatencyDistributionReadModelV1"},terminal:{$ref:"#/$defs/LatencyDistributionReadModelV1"}},required:["identity_provenance","queue","start","first_progress","service","terminal"],type:"object"},va={properties:{canonical_root:{type:"string"},created_at:{format:"int64",type:"integer"},default_branch:{description:"Repository default branch recorded at registration.",type:["string","null"]},display_root:{type:"string"},git_common_dir:{type:["string","null"]},head_branch:{description:"Branch the checkout's HEAD names now; `None` when HEAD is detached or\nno checkout of this project could be read.",type:["string","null"]},is_active:{type:["boolean","null"]},label:{type:"string"},last_seen_at:{format:"int64",type:"integer"},project_id:{type:"string"},project_root:{type:"string"}},required:["project_id","label","project_root","display_root","canonical_root","created_at","last_seen_at"],type:"object"},vs={enum:["owner_receipt","locally_measured","estimated","unknown"],type:"string"},vd={description:"Strongly typed canonical identity: `QueryCollectionId`.",type:"string"},vc={description:"Which endpoint of each counted edge the rank report ranks.",enum:["incoming","outgoing"],type:"string"},vl={description:"Relationship the rank report counts.",enum:["implements","extends","calls","uses","contains","annotates","type_of","returns","receives"],type:"string"},vp={additionalProperties:!1,description:"One recorded ranking decision. Explanations are rendered from this\nprovenance, never reconstructed from a final scalar score.",properties:{detail:{type:"string"},evidence_anchor:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},kind:{$ref:"#/$defs/RankingDecisionKind"},policy_anchor:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},retriever:{anyOf:[{$ref:"#/$defs/RetrieverKind"},{type:"null"}]}},required:["kind","detail"],type:"object"},vu={description:"The decision kinds the pipeline must record.",enum:["exact_tier_admission","same_source_duplicate_collapse","logical_copy_representative_selection","contradiction_preservation","diversity_cap","comparator_provenance","fallback"],type:"string"},vm={description:"Strongly typed canonical identity: `RefId`.",type:"string"},vf={additionalProperties:!1,description:"Exact registered root locator retained with an authorized scope.\n\n`canonical_root` is routing evidence for the already-resolved\n[`ResolvedScope`]. It cannot replace or manufacture that scope identity.",properties:{canonical_root:{type:"string"},profile:{$ref:"#/$defs/SharedProfileStoreLocatorV1"},project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id","profile","canonical_root"],type:"object"},vh={description:"Frequency and rate projection for dispatcher rejected-argument observations.\n\nCounts may be known while `rejection_rate` stays absent: Plan 26 forbids\nfabricating a rate when the eligible-attempt denominator is unknown.",properties:{coverage:{$ref:"#/$defs/MetricCoverageV1"},eligible_attempts:{format:"uint64",minimum:0,type:["integer","null"]},groups:{items:{$ref:"#/$defs/RejectedArgumentGroupV1"},type:"array"},projector_revision:{type:"string"},redacted_name_count:{format:"uint64",minimum:0,type:"integer"},rejected_total:{format:"uint64",minimum:0,type:["integer","null"]},rejection_rate:{format:"double",type:["number","null"]},unavailable_reason:{type:["string","null"]},watermark:{type:"string"}},required:["coverage","projector_revision","watermark","redacted_name_count","groups"],type:"object"},vy={description:"Closed error class for a rejected surface argument.",enum:["missing","invalid_shape","out_of_bounds","unsupported","unauthorized","stale","unknown"],type:"string"},vg={description:"One surface \xd7 operation \xd7 argument \xd7 error-class cell in the rejected-argument view.",properties:{argument:{$ref:"#/$defs/RejectedArgumentNameV1"},count:{format:"uint64",minimum:0,type:"integer"},error_class:{$ref:"#/$defs/RejectedArgumentErrorClassV1"},operation:{type:"string"},rate:{description:"Eligible-attempt rate for this cell. Absent when the attempt\ndenominator or coverage is insufficient.",format:"double",type:["number","null"]},surface:{$ref:"#/$defs/RejectedArgumentSurfaceV1"}},required:["surface","operation","argument","error_class","count"],type:"object"},v_={description:"Normalized rejected-argument name. Raw flags, values, and tokens never\nenter this vocabulary.",enum:["request_body","pagination","request_handle","operation","lifecycle","unknown"],type:"string"},vv={description:"Transport that rejected a surface argument. Unknown preserves missing\nattribution instead of inventing cli/mcp/http.",enum:["cli","mcp","http","unknown"],type:"string"},vb={description:"Strongly typed canonical identity: `RepositoryId`.",type:"string"},v$={oneOf:[{properties:{kind:{const:"all_authorized",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"allowlist",type:"string"},repositories:{items:{$ref:"#/$defs/RepositoryId"},type:"array",uniqueItems:!0}},required:["kind","repositories"],type:"object"}]},vS={enum:["successful_terminal"],type:"string"},vk={additionalProperties:!1,properties:{capability_id:{$ref:"#/$defs/CapabilityId"},expectation:{$ref:"#/$defs/RequiredCheckExpectationV1"},maximum_age_seconds:{format:"uint32",minimum:1,type:"integer"}},required:["capability_id","expectation","maximum_age_seconds"],type:"object"},vw={additionalProperties:!1,description:"The resolved configuration scope is one exact project/repository/worktree root.\n\nPaths, CWDs, labels, and mutable branch spellings are deliberately absent.",properties:{project_id:{$ref:"#/$defs/ProjectId"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository_id:{$ref:"#/$defs/RepositoryId"},scope_digest:{$ref:"#/$defs/ManifestDigest"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","scope_digest"],type:"object"},vP={description:"Bounded output projection chosen by a concrete use case.",enum:["summary","evidence","references_only"],type:"string"},vV={additionalProperties:!1,properties:{code:{type:"string"},kind:{type:["string","null"]},maximum:{format:"uint",minimum:0,type:["integer","null"]},message:{type:"string"},observed:{format:"uint",minimum:0,type:["integer","null"]},reason:{type:["string","null"]},retryable:{type:["boolean","null"]}},required:["code","message"],type:"object"},vR={enum:["aborted","budget_exhausted","busy","cancelled","complete","complete_zero","cursor_manifest_limit_exceeded","deadline_exceeded","deleted","denied","error","failed","joined","locked","not_found","ok","partial","recorded","redacted","running","stale","started","unavailable","unsupported_filter","wrong_scope"],type:"string"},vq={anyOf:[{format:"uint64",minimum:0,type:"integer"},{type:"string"}],description:"The temporal filter intentionally retains the established integer-or-text\nwire form (Unix timestamps, RFC3339, and relative expressions)."},vI={description:"Strongly typed canonical identity: `RetrievalAnchorId`.",type:"string"},vx={description:"Stable semantic ordering; adapters may not replace it with transport order.",enum:["relevance","source_position","temporal_descending","stable_identity"],type:"string"},vj={additionalProperties:!1,properties:{order:{$ref:"#/$defs/RetrievalOrder"},page:{$ref:"#/$defs/PageRequest"},projection:{$ref:"#/$defs/ResultProjection"},temporal:{$ref:"#/$defs/TemporalModeV1"}},required:["temporal","page","projection","order"],type:"object"},vC={description:"Source-role evidence used at lane admission and fusion.\n\nA production definition outranks a test-file hit for the same symbol even\nwhen the test has a higher measured score. Non-definition production hits\ncompete with test hits on measured scores so comments and references do\nnot crowd out relevant tests.",oneOf:[{const:"production_definition",description:"Non-test path whose name or signature matched the query.",type:"string"},{const:"production_other",description:"Non-test path that is not a name or signature definition match.",type:"string"},{const:"test_reference",description:"Hit under a test path.",type:"string"}]},vT={additionalProperties:!1,properties:{backlog:{format:"uint",minimum:0,type:"integer"},blocker:{type:["string","null"]},last_progress_at_unix_micros:{format:"int64",type:["integer","null"]},retry_class:{type:["string","null"]}},required:["backlog"],type:"object"},vO={description:"Runtime-backed retrieval lanes. Each lane is independently testable,\ndisableable, budgeted, and attributable; one lane is never an alias over\nanother.",enum:["exact_literal","lexical","graph","temporal","task_session","diagnostic"],type:"string"},vE={oneOf:[{properties:{kind:{const:"none",type:"string"}},required:["kind"],type:"object"},{properties:{count:{format:"uint16",maximum:65535,minimum:1,type:"integer"},kind:{const:"independent_review_count",type:"string"}},required:["kind","count"],type:"object"},{properties:{kind:{const:"code_owner_and_independent_review",type:"string"}},required:["kind"],type:"object"}]},vA={enum:["no_review","independent_review","standard_pull_requests","git_hub_stacked_pull_requests"],type:"string"},vW={additionalProperties:!1,properties:{allowed:{items:{$ref:"#/$defs/ReviewTopologyKindV1"},type:"array",uniqueItems:!0},github_stacked_prs:{$ref:"#/$defs/GitHubStackedPullRequestPolicyV1"}},required:["allowed","github_stacked_prs"],type:"object"},vM={additionalProperties:!1,description:"Immutable collection and stack revisions for one exact resolved root.",properties:{collection_revision:{$ref:"#/$defs/ManifestDigest"},generation_digest:{$ref:"#/$defs/ManifestDigest"},scope_digest:{$ref:"#/$defs/ManifestDigest"},stack_revision:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","collection_revision","stack_revision","generation_digest"],type:"object"},vN={additionalProperties:!1,description:"One typed outcome pinned to the digest of an exact resolved root.",properties:{outcome:{$ref:"#/$defs/ScopeOutcome_for_Nullable_RootGenerationV1"},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","outcome"],type:"object"},vz={additionalProperties:!1,description:"One typed outcome pinned to the digest of an exact resolved root.",properties:{outcome:{$ref:"#/$defs/ScopeOutcome_for_Nullable_string"},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","outcome"],type:"object"},vD={enum:["allow","deny"],type:"string"},vF={description:"Strongly typed canonical identity: `RunId`.",type:"string"},vL={additionalProperties:!1,properties:{degraded_row:{type:["string","null"]},stage:{$ref:"#/$defs/SchemaConvergenceStageV1"},started_at_micros:{format:"int64",type:"integer"},state:{$ref:"#/$defs/SchemaConvergenceStateV1"},store:{type:"string"}},required:["store","stage","state","started_at_micros"],type:"object"},vU={enum:["registered_schema"],type:"string"},vH={enum:["pending","running","degraded","completed"],type:"string"},vG={additionalProperties:!1,description:"Restrictive policy input. An allow never grants capabilities absent from\nthe independently authorized capability set passed to the resolver.",properties:{authority:{$ref:"#/$defs/AuthorityRef"},capabilities:{items:{$ref:"#/$defs/CapabilityId"},type:"array",uniqueItems:!0},effect:{$ref:"#/$defs/RuleEffect"},expires_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},rule_id:{$ref:"#/$defs/AccessRuleId"},subject:{$ref:"#/$defs/ScopeAccessSubjectV1"}},required:["rule_id","subject","authority","capabilities","effect"],type:"object"},vB={additionalProperties:!1,description:"Typed rule selectors. Unset dimensions match all values at that dimension,\nbut at least one dimension must be constrained. Free-form paths, labels,\ncollection names, and branch names are deliberately absent.",properties:{actor:{anyOf:[{$ref:"#/$defs/ActorId"},{type:"null"}]},operation:{anyOf:[{$ref:"#/$defs/ScopeControlOperationV1"},{type:"null"}]},source_kind:{anyOf:[{$ref:"#/$defs/SourceKindV1"},{type:"null"}]}},type:"object"},vK={enum:["read","source_bind","source_rebind","source_unbind","access_rule_upsert","access_rule_remove","replace_topology_policy","rollback"],type:"string"},vJ={description:"Truthful outcome for one authorized root or an aggregate over roots.\n\n`Denied` and `Unavailable` carry no value and therefore cannot be confused\nwith a successful empty result.",oneOf:[{properties:{outcome:{const:"exact",type:"string"},value:{anyOf:[{$ref:"#/$defs/RootGenerationV1"},{type:"null"}]}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"partial",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopePartialReasonV1"},value:{anyOf:[{$ref:"#/$defs/RootGenerationV1"},{type:"null"}]}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"denied",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopeUnavailableReasonV1"}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"}]},vZ={description:"Truthful outcome for one authorized root or an aggregate over roots.\n\n`Denied` and `Unavailable` carry no value and therefore cannot be confused\nwith a successful empty result.",oneOf:[{properties:{outcome:{const:"exact",type:"string"},value:{type:["string","null"]}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"partial",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopePartialReasonV1"},value:{type:["string","null"]}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"denied",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopeUnavailableReasonV1"}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"}]},vQ={description:"Typed explanation for a root that returned usable but incomplete data.",enum:["incomplete","stale","budget_exceeded","root_denied","root_unavailable"],type:"string"},vX={description:"Stable identity of one authorized scope-set record.",type:"string"},vY={description:"Monotonic optimistic-concurrency revision of one scope set.",format:"uint64",minimum:1,type:"integer"},v1={additionalProperties:!1,description:"A source-to-authority binding. It stores only the source kind, a redacted\nlocator digest, and the pre-resolved authority reference.",properties:{authority:{$ref:"#/$defs/AuthorityRef"},binding_id:{$ref:"#/$defs/SourceBindingId"},source_kind:{$ref:"#/$defs/SourceKindV1"},source_locator_digest:{$ref:"#/$defs/LocatorDigest"}},required:["binding_id","source_kind","source_locator_digest","authority"],type:"object"},v0={description:"Typed explanation for a root that could not return usable data.",enum:["authority_unavailable","root_missing","store_unavailable"],type:"string"},v2={description:"Strongly typed canonical identity: `ScoreDomainId`.",type:"string"},v4={additionalProperties:!1,description:"Reference-only filesystem locator. The raw path is sealed outside this\ncontract; only the privacy-bound locator digest and sealed-value digest are\nrepresentable here.",properties:{locator_digest:{$ref:"#/$defs/LocatorDigest"},sealed_value_digest:{$ref:"#/$defs/ManifestDigest"}},required:["locator_digest","sealed_value_digest"],type:"object"},v6={additionalProperties:!1,properties:{knowledge:{$ref:"#/$defs/ClosedUtcIntervalV1"},valid:{$ref:"#/$defs/ValidCoverageIntervalV1"}},required:["knowledge","valid"],type:"object"},v3={oneOf:[{properties:{kind:{const:"caught_up",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"projection_behind_source",type:"string"},lag:{format:"uint64",minimum:0,type:"integer"}},required:["kind","lag"],type:"object"},{properties:{kind:{const:"source_behind_target",type:"string"},lag:{format:"uint64",minimum:0,type:"integer"}},required:["kind","lag"],type:"object"},{properties:{kind:{const:"projection_and_source_behind",type:"string"},projection_lag:{format:"uint64",minimum:0,type:"integer"},source_lag:{format:"uint64",minimum:0,type:"integer"}},required:["kind","projection_lag","source_lag"],type:"object"},{properties:{kind:{const:"locked",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"redacted",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"retention_withheld",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"unavailable",type:"string"}},required:["kind"],type:"object"}]},v9={additionalProperties:!1,properties:{mode:{$ref:"#/$defs/TemporalModeV1"}},required:["mode"],type:"object"},v5={enum:["fresh","stale","partial","locked","redacted","retention_withheld","unavailable"],type:"string"},v8={description:"Strongly typed canonical identity: `SessionId`.",type:"string"},v7={description:"Strongly typed canonical identity: `SessionOrThreadId`.",type:"string"},be={additionalProperties:!1,properties:{committed_through:{format:"uint64",minimum:0,type:"integer"},observed_through:{format:"uint64",minimum:0,type:"integer"}},required:["observed_through","committed_through"],type:"object"},bt={additionalProperties:!1,properties:{committed_batches:{format:"uint64",minimum:0,type:"integer"},committed_records:{format:"uint64",minimum:0,type:"integer"},coverage:{$ref:"#/$defs/TemporalCoverageV1"},frontier:{$ref:"#/$defs/SessionRefreshFrontierResultV1"},operation_id:{type:"string"},session_id:{type:"string"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},updated_at:{format:"int64",type:"integer"}},required:["operation_id","session_id","frontier","coverage","committed_batches","committed_records","updated_at"],type:"object"},br={additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/TemporalCoverageV1"},failure_code:{type:["string","null"]},frontier:{$ref:"#/$defs/SessionRefreshFrontierResultV1"},operation_id:{type:"string"},session_id:{type:"string"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},state:{$ref:"#/$defs/SessionRefreshTerminalStateResultV1"},terminal_at:{format:"int64",type:"integer"}},required:["operation_id","session_id","frontier","coverage","state","terminal_at"],type:"object"},bi={enum:["complete","failed","cancelled"],type:"string"},bo={description:"Structural budget boundary that rejected a session retrieval request.\nThese causes are non-retryable request corrections; concurrent permit or\nqueue pressure remains a separate capacity-saturation failure.",enum:["request_result_limit","request_hydration_limit","request_context_bytes","request_candidate_bytes","request_record_bytes","request_hydration_bytes","estimator_version_mismatch","execution_work_exhausted","candidate_read_exhausted","record_read_exhausted","kernel_result_limit","participant_manifest_participants","participant_manifest_canonical_bytes","cursor_manifest_limit","hydration_bytes","context_bytes","context_tokens"],type:"string"},bn={additionalProperties:!1,properties:{committed_frontier:{format:"uint64",minimum:0,type:"integer"},covered_intervals:{items:{$ref:"#/$defs/SessionCoverageIntervalV1"},type:"array"},missing_intervals:{items:{$ref:"#/$defs/SessionCoverageIntervalV1"},type:"array"},observed_frontier:{format:"uint64",minimum:0,type:"integer"},reason:{$ref:"#/$defs/SessionCoverageReasonV1"},request:{$ref:"#/$defs/SessionCoverageRequestV1"},source_id:{type:"string"},state:{$ref:"#/$defs/SessionCoverageStateV1"},target_watermark:{format:"uint64",minimum:0,type:"integer"}},required:["source_id","observed_frontier","committed_frontier","target_watermark","request","covered_intervals","missing_intervals","state","reason"],type:"object"},ba={description:"Typed configuration key. Keys are lowercase, dotted product identifiers;\nuntyped host/adapter keys are not representable.",type:"string"},bs={additionalProperties:!1,description:"Logical and verified physical identity of the shared Profile shard.\n\nBrain and profile IDs select the shard; the verified store locator binds its\nphysical store. Lease incarnations and authority epochs remain runtime fences.",properties:{brain_id:{$ref:"#/$defs/BrainId"},profile_id:{$ref:"#/$defs/UserProfileId"},store_id:{type:"string"}},required:["brain_id","profile_id","store_id"],type:"object"},bd={additionalProperties:!1,properties:{complete:{type:"boolean"},family_digest:{$ref:"#/$defs/ManifestDigest"},match_class:{$ref:"#/$defs/SimilarMatchClassV1"},member_count:{format:"uint",minimum:0,type:"integer"},members:{items:{$ref:"#/$defs/SimilarOccurrenceV1"},type:"array"},next_cursor:{type:["string","null"]},normalization_revision:{format:"uint16",maximum:65535,minimum:0,type:"integer"},representative_payload_digest:{$ref:"#/$defs/ManifestDigest"}},required:["match_class","normalization_revision","family_digest","representative_payload_digest","member_count","members","complete"],type:"object"},bc={enum:["conservative_exact","rename_normalized_exact"],type:"string"},bl={additionalProperties:!1,properties:{body_span:{$ref:"#/$defs/SourceSpan"},path:{type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},snapshot_digest:{$ref:"#/$defs/ManifestDigest"},source_generation:{$ref:"#/$defs/CodeGenerationId"},symbol_occurrence_id:{$ref:"#/$defs/SymbolOccurrenceId"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["project_id","repository_id","source_generation","snapshot_digest","symbol_occurrence_id","path","body_span"],type:"object"},bp={properties:{evidence:{default:[],items:{type:"string"},type:"array"},improvement:{type:"boolean"},priority:{type:"string"},reason:{type:"string"},recommendation:{type:"string"},skill_id:{type:"string"}},required:["skill_id","improvement","recommendation","reason","priority"],type:"object"},bu={enum:["cursor","codex","claude","agents","opencode","kimi","kiro","hermes"],type:"string"},bm={properties:{evidence:{default:[],items:{type:"string"},type:"array"},reason:{type:"string"},recommendation:{type:"string"},skill_id:{type:"string"},stale:{type:"boolean"}},required:["skill_id","stale","recommendation","reason"],type:"object"},bf={description:"One skill's durable usage counters. The ledger stores one per skill; a\nsummary is the same record merged with the skill's current metadata.",properties:{activated_at:{description:"When the skill last transitioned into the active state; mirrors the\nmanaged skill metadata so outcome scoring works from summaries alone.",format:"int64",type:["integer","null"]},category:{type:["string","null"]},created_by:{type:["string","null"]},first_seen_at:{format:"int64",type:"integer"},imported_analytics_events:{description:"Import keys that already counted toward this skill. They are not a\nstore-wide set: each key names this skill, so another skill must not\nshare the write.",items:{type:"string"},type:"array",uniqueItems:!0},last_activity_at:{format:"int64",type:"integer"},last_patched_at:{format:"int64",type:["integer","null"]},last_used_at:{format:"int64",type:["integer","null"]},last_viewed_at:{format:"int64",type:["integer","null"]},patch_count:{format:"uint64",minimum:0,type:"integer"},pinned:{type:"boolean"},provenance_source:{anyOf:[{$ref:"#/$defs/ManagedSkillSource"},{type:"null"}]},schema_version:{format:"uint32",minimum:0,type:"integer"},skill_id:{type:"string"},state:{anyOf:[{$ref:"#/$defs/ManagedSkillState"},{type:"null"}]},targets:{default:[],items:{type:"string"},type:"array"},title:{type:["string","null"]},use_count:{format:"uint64",minimum:0,type:"integer"},use_count_at_activation:{format:"uint64",minimum:0,type:["integer","null"]},view_count:{format:"uint64",minimum:0,type:"integer"},view_count_at_activation:{description:"View/use totals captured at activation time so activity since activation\nis an exact delta rather than a heuristic.",format:"uint64",minimum:0,type:["integer","null"]}},required:["schema_version","skill_id","pinned","view_count","use_count","patch_count","first_seen_at","last_activity_at"],type:"object"},bh={description:"Strongly typed canonical identity: `SourceBindingId`.",type:"string"},by={additionalProperties:!1,description:"Source freshness is source- and retriever-specific: there is no global\nage-decay multiplier. Missing, stale, incompatible, and current are\ndistinct states.",properties:{compatibility:{$ref:"#/$defs/FreshnessCompatibilityV1"},generation_lag:{format:"uint64",minimum:0,type:["integer","null"]},observed_at:{$ref:"#/$defs/UtcMicros"},policy_revision:{$ref:"#/$defs/ComponentRevision"},projection_watermark:{format:"uint64",minimum:0,type:["integer","null"]},source_generation:{format:"uint64",minimum:0,type:["integer","null"]},source_instance:{$ref:"#/$defs/SourceInstanceKey"},source_namespace:{$ref:"#/$defs/SourceNamespace"},source_watermark:{format:"uint64",minimum:0,type:["integer","null"]}},required:["source_namespace","source_instance","observed_at","compatibility","policy_revision"],type:"object"},bg={description:"Strongly typed canonical identity: `SourceInstanceKey`.",type:"string"},b_={enum:["claude","codex","cursor","git_hub","hermes","kiro"],type:"string"},bv={description:"Strongly typed canonical identity: `SourceNamespace`.",type:"string"},bb={description:"Strongly typed canonical identity: `SourceOccurrenceId`.",type:"string"},b$={additionalProperties:!1,description:"Byte range inside one sanitized source file. Mutable line numbers are\nnever part of identity.",properties:{end_byte:{format:"uint64",minimum:0,type:"integer"},start_byte:{format:"uint64",minimum:0,type:"integer"}},required:["start_byte","end_byte"],type:"object"},bS={description:"Strongly typed canonical identity: `SourceStoreId`.",type:"string"},bk={description:"Strongly typed canonical identity: `StackDeliveryWatermarkId`.",type:"string"},bw={description:"Strongly typed canonical identity: `StackNodeId`.",type:"string"},bP={description:"Strongly typed canonical identity: `StackSignalId`.",type:"string"},bV={additionalProperties:!1,description:"Exact base/head symbol comparison was unavailable; the git evidence beside\nit is still the answer.",properties:{reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","reason","retryable"],type:"object"},bR={additionalProperties:!1,description:"Optional narrowing inside the immutable project/repository/worktree scope\ncarried by [`RequestContext`]. A path prefix never establishes identity or\nauthorization.",properties:{path_prefix:{type:["string","null"]}},type:"object"},bq={description:"Strongly typed canonical identity: `SymbolOccurrenceId`.",type:"string"},bI={additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},is_async:{type:"boolean"},kind:{type:"string"},line:{description:"One-based user-facing line.",format:"uint32",minimum:0,type:"integer"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},score:{format:"double",type:["number","null"]},signature:{type:["string","null"]}},required:["node_id","name","qualified_name","kind","file","line","end_line","is_async"],type:"object"},bx={additionalProperties:!1,properties:{depth:{format:"uint32",minimum:0,type:["integer","null"]},dispatch_from:{type:["string","null"]},dispatch_via_trait:{type:"boolean"},edge_kind:{type:"string"},symbol:{$ref:"#/$defs/SymbolPrimitiveRecord"}},required:["symbol","edge_kind","dispatch_via_trait"],type:"object"},bj={additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},link_id:{type:"string"},observed_at:{$ref:"#/$defs/UtcMicros"},revision:{format:"uint64",minimum:0,type:"integer"},task_id:{$ref:"#/$defs/TaskId"}},required:["link_id","revision","task_id","anchor_id","evidence_digest","observed_at"],type:"object"},bC={additionalProperties:!1,properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},from_actor_id:{$ref:"#/$defs/ActorId"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},run_id:{$ref:"#/$defs/RunId"},step_id:{$ref:"#/$defs/WorkflowStepId"},task_id:{$ref:"#/$defs/TaskId"},thread_id:{$ref:"#/$defs/ThreadId"},to_actor_id:{$ref:"#/$defs/ActorId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","definition_id","definition_version","step_id","task_id","thread_id","run_id","from_actor_id","to_actor_id"],type:"object"},bT={description:"Strongly typed canonical identity: `TaskId`.",type:"string"},bO={additionalProperties:!1,properties:{hidden:{format:"uint64",minimum:0,type:"integer"},redacted:{format:"uint64",minimum:0,type:"integer"},unknown:{format:"uint64",minimum:0,type:"integer"},visible:{format:"uint64",minimum:0,type:"integer"}},required:["visible","hidden","unknown","redacted"],type:"object"},bE={additionalProperties:!1,properties:{anchor:{type:"string"},summary:{type:"string"}},required:["anchor","summary"],type:"object"},bA={oneOf:[{properties:{state:{const:"fresh",type:"string"}},required:["state"],type:"object"},{properties:{generation_lag:{format:"uint64",minimum:0,type:"integer"},state:{const:"stored",type:"string"}},required:["state","generation_lag"],type:"object"},{properties:{generation_lag:{format:"uint64",minimum:0,type:"integer"},state:{const:"partial",type:"string"}},required:["state","generation_lag"],type:"object"}]},bW={description:"Requested temporal interpretation.",oneOf:[{additionalProperties:!1,properties:{kind:{const:"current",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{cutoff:{$ref:"#/$defs/UtcMicros"},kind:{const:"as_of",type:"string"}},required:["kind","cutoff"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"evolution",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"forensic",type:"string"}},required:["kind"],type:"object"}]},bM={additionalProperties:!1,properties:{anchor:{type:"string"},rank:{format:"uint32",minimum:0,type:"integer"},reason:{$ref:"#/$defs/HydrationStateResultV1"}},required:["rank","anchor","reason"],type:"object"},bN={additionalProperties:!1,properties:{generation:{format:"uint64",minimum:0,type:"integer"},index:{format:"uint64",minimum:0,type:"integer"},projection:{format:"uint64",minimum:0,type:"integer"},source:{format:"uint64",minimum:0,type:"integer"},summary:{format:"uint64",minimum:0,type:"integer"}},required:["generation","source","projection","index","summary"],type:"object"},bz={description:"Strongly typed canonical identity: `ThreadId`.",type:"string"},bD={additionalProperties:!1,description:"What a token budget did to an answer. `est_tokens` is the kept rows.\n`over_ceiling` means a single row was larger than its section quota and\nwas kept anyway.",properties:{budget_tokens:{format:"uint32",minimum:0,type:"integer"},est_tokens:{format:"uint32",minimum:0,type:"integer"},over_ceiling:{type:"boolean"},sections:{items:{$ref:"#/$defs/TokenBudgetSectionV1"},type:"array"}},required:["budget_tokens","est_tokens","over_ceiling","sections"],type:"object"},bF={additionalProperties:!1,description:"One section a token budget kept or cut.",properties:{section:{type:"string"},shown:{format:"uint32",minimum:0,type:"integer"},total:{format:"uint32",minimum:0,type:"integer"}},required:["section","total","shown"],type:"object"},bL={additionalProperties:!1,properties:{maximum_active_per_repository:{format:"uint16",maximum:65535,minimum:1,type:"integer"},maximum_global_active:{format:"uint16",maximum:65535,minimum:1,type:"integer"},maximum_parallel_per_task:{format:"uint16",maximum:65535,minimum:1,type:"integer"},maximum_stack_depth:{format:"uint16",maximum:65535,minimum:1,type:"integer"}},required:["maximum_active_per_repository","maximum_parallel_per_task","maximum_global_active","maximum_stack_depth"],type:"object"},bU={enum:["reject","require_explicit_human_approval","require_human_approval_and_independent_review"],type:"string"},bH={additionalProperties:!1,properties:{cleanliness:{$ref:"#/$defs/WorktreeCleanlinessRequirementV1"},maximum_preflight_age_seconds:{format:"uint32",minimum:1,type:"integer"},require_fresh_preflight:{type:"boolean"},review:{$ref:"#/$defs/ReviewRequirementV1"},tests:{items:{$ref:"#/$defs/RequiredCheckV1"},type:"array"}},required:["cleanliness","tests","review","require_fresh_preflight","maximum_preflight_age_seconds"],type:"object"},bG={enum:["critical_only","lifecycle","verbose"],type:"string"},bB={description:"Risky construct the pattern scan looks for.",enum:["unwrap","expect","panic","todo","unimplemented","unsafe_block"],type:"string"},bK={description:"Stable, canonical catalog identity for `UseCaseId`.",type:"string"},bJ={description:"Strongly typed canonical identity: `UserProfileId`.",type:"string"},bZ={description:"UTC timestamp represented as microseconds from the Unix epoch.",format:"int64",type:"integer"},bQ={oneOf:[{properties:{interval:{$ref:"#/$defs/ClosedUtcIntervalV1"},kind:{const:"known",type:"string"}},required:["kind","interval"],type:"object"},{properties:{kind:{const:"unknown",type:"string"}},required:["kind"],type:"object"}]},bX={additionalProperties:!1,description:"One exact verified graph snapshot identity.",properties:{event_sequence:{format:"uint64",minimum:0,type:"integer"},graph_version:{format:"uint64",minimum:0,type:"integer"},recovered_graph_digest:{$ref:"#/$defs/ManifestDigest"},source_watermark:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},type:"object"}},required:["graph_version","event_sequence","source_watermark","recovered_graph_digest"],type:"object"},bY={additionalProperties:!1,properties:{criterion_id:{type:"string"},description:{type:"string"},evidence_required:{type:"boolean"}},required:["criterion_id","description","evidence_required"],type:"object"},b1={enum:["never","on_request"],type:"string"},b0={description:"Strongly typed canonical identity: `WorkArtifactId`.",type:"string"},b2={additionalProperties:!1,properties:{artifact_id:{$ref:"#/$defs/WorkArtifactId"},byte_length:{format:"uint64",minimum:0,type:"integer"},digest:{$ref:"#/$defs/ManifestDigest"}},required:["artifact_id","digest","byte_length"],type:"object"},b4={additionalProperties:!1,description:"Sealed terminal evidence for one provider attempt. The digest of this\nrecord is the evidence digest carried by [`WorkTerminalEvidenceV1`] and by\nthe `RuntimeEvidenceRef` attached to the Work projection, so the receipt\nin Work always names an inspectable record.",properties:{actual_route:{anyOf:[{$ref:"#/$defs/WorkProviderRouteV1"},{type:"null"}]},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{$ref:"#/$defs/WorkAttemptProviderOutcomeV1"},provider_fallback:{anyOf:[{$ref:"#/$defs/WorkProviderFallbackRecordV1"},{type:"null"}],description:"Present only when the pinned preferred backend was disqualified before\nstartup. `None` means the attempt ran on its first-choice backend."},provider_session:{anyOf:[{$ref:"#/$defs/ObservationSourceIdentityV1"},{type:"null"}],description:"Native provider-qualified session/thread identity, when the provider\nreported one. Admission cannot supply this value and no fallback is\nfabricated."},requested_route:{$ref:"#/$defs/WorkProviderRouteV1"},stderr:{anyOf:[{$ref:"#/$defs/WorkAttemptStreamSummaryV1"},{type:"null"}]},stdout:{anyOf:[{$ref:"#/$defs/WorkAttemptStreamSummaryV1"},{type:"null"}]}},required:["identity","requested_route","outcome","observed_at"],type:"object"},b6={additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_id"],type:"object"},b3={description:"How much of the authorized attempt set one page covers.",oneOf:[{additionalProperties:!1,description:"Every attempt after the page start was returned; zero returned is the\nexplicit empty authorized result, not a concealment.",properties:{coverage:{const:"complete",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned"],type:"object"},{additionalProperties:!1,description:"The page cap was reached; `resume` continues under the same verified\ntopology generation.",properties:{coverage:{const:"capped",type:"string"},remaining:{format:"uint32",minimum:0,type:"integer"},resume:{$ref:"#/$defs/WorkAttemptListCursorV1"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","remaining","resume"],type:"object"}]},b9={description:"Opaque resume point for the next page of one attempt-list-family read,\nbound to the operation and `page_size` that minted it and pinned to the\nverified topology generation the page was read under.",type:"string"},b5={additionalProperties:!1,properties:{completed:{format:"uint64",minimum:0,type:"integer"},total:{format:"uint64",minimum:0,type:"integer"}},required:["completed","total"],type:"object"},b8={additionalProperties:!1,properties:{accepted_proposal:{$ref:"#/$defs/ProposalId",description:"Exact accepted proposal the attempt was admitted against. A superseded\nor cleared proposal is a different binding, not a compatible refresh."},event_sequence:{description:"Exact immutable product event that verified this graph version.",format:"uint64",minimum:0,type:"integer"},graph_version:{format:"uint64",minimum:0,type:"integer"},recovered_graph_digest:{$ref:"#/$defs/ManifestDigest",description:"Digest of the graph recovered and verified at admission."},source_watermark:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},description:"Source-frontier identity preserved from the verified product graph.",type:"object"}},required:["graph_version","event_sequence","source_watermark","recovered_graph_digest","accepted_proposal"],type:"object"},b7={description:"How one provider attempt ended, as observed by the daemon runtime.",oneOf:[{properties:{code:{format:"int32",type:"integer"},outcome:{const:"exited",type:"string"}},required:["outcome","code"],type:"object"},{properties:{outcome:{const:"signalled",type:"string"},signal:{format:"int32",type:"integer"}},required:["outcome","signal"],type:"object"},{properties:{outcome:{const:"timed_out",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"cancelled",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"provider_unavailable",type:"string"},state:{$ref:"#/$defs/WorkProviderAvailabilityV1"}},required:["outcome","state"],type:"object"},{properties:{channel:{$ref:"#/$defs/WorkAttemptStreamChannelV1"},outcome:{const:"stream_overflow",type:"string"}},required:["outcome","channel"],type:"object"},{properties:{outcome:{const:"launch_failed",type:"string"}},required:["outcome"],type:"object"},{description:"The provider started but its typed protocol session did not reach a\nterminal answer: a malformed, out-of-order, oversized, or lost frame.\nPlan 32 requires such a stream to seal failed evidence rather than a\ntext-scraped success.",properties:{outcome:{const:"protocol_failed",type:"string"}},required:["outcome"],type:"object"}]},$e={additionalProperties:!1,properties:{artifacts:{items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},evidence:{anyOf:[{$ref:"#/$defs/WorkAttemptEvidenceRecordV1"},{type:"null"}]},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["identity","artifacts"],type:"object"},$t={enum:["leased","running","cancellation_requested","cancellation_acknowledged","cancellation_escalated","recovery_required","succeeded","failed","timed_out","cancelled"],type:"string"},$r={enum:["stdout","stderr"],type:"string"},$i={additionalProperties:!1,description:"Bounded summary of one captured provider stream.",properties:{byte_length:{format:"uint64",minimum:0,type:"integer"},digest:{$ref:"#/$defs/ManifestDigest"},truncated:{type:"boolean"}},required:["byte_length","truncated","digest"],type:"object"},$o={additionalProperties:!1,description:"The verified Work topology snapshot one attempt-list page was read under.",properties:{generation:{description:"The verified graph generation the topology snapshot is published under.",type:"string"},task_count:{description:"The number of tasks in the verified topology.",format:"uint32",minimum:0,type:"integer"}},required:["generation","task_count"],type:"object"},$n={properties:{actual_route:{anyOf:[{$ref:"#/$defs/WorkProviderRouteV1"},{type:"null"}]},artifacts:{items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},cancellation:{$ref:"#/$defs/WorkCancellationStateV1"},execution:{$ref:"#/$defs/WorkExecutionEnvelopeV1"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},lease:{$ref:"#/$defs/WorkLeaseFenceV1"},progress:{anyOf:[{$ref:"#/$defs/WorkAttemptProgressV1"},{type:"null"}]},projection_binding:{$ref:"#/$defs/WorkAttemptProjectionBindingV1"},recovery:{$ref:"#/$defs/WorkRecoveryStateV1"},requested_route:{$ref:"#/$defs/WorkProviderRouteV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"},terminal:{anyOf:[{$ref:"#/$defs/WorkTerminalEvidenceV1"},{type:"null"}]}},required:["identity","projection_binding","execution","lease","state","artifacts","cancellation","recovery","requested_route"],type:"object"},$a={additionalProperties:!1,properties:{acknowledged_at:{$ref:"#/$defs/UtcMicros"},request:{$ref:"#/$defs/WorkCancellationRequestV1"}},required:["request","acknowledged_at"],type:"object"},$s={additionalProperties:!1,properties:{acknowledgement:{$ref:"#/$defs/WorkCancellationAcknowledgementV1"},escalated_at:{$ref:"#/$defs/UtcMicros"}},required:["acknowledgement","escalated_at"],type:"object"},$d={description:"Strongly typed canonical identity: `WorkCancellationRequestId`.",type:"string"},$c={additionalProperties:!1,properties:{request_id:{$ref:"#/$defs/WorkCancellationRequestId"},requested_at:{$ref:"#/$defs/UtcMicros"}},required:["request_id","requested_at"],type:"object"},$l={oneOf:[{properties:{state:{const:"none",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"requested",type:"string"},value:{$ref:"#/$defs/WorkCancellationRequestV1"}},required:["state","value"],type:"object"},{properties:{state:{const:"acknowledged",type:"string"},value:{$ref:"#/$defs/WorkCancellationAcknowledgementV1"}},required:["state","value"],type:"object"},{properties:{state:{const:"escalated",type:"string"},value:{$ref:"#/$defs/WorkCancellationEscalationV1"}},required:["state","value"],type:"object"}]},$p={description:"Strongly typed canonical identity: `WorkCommandId`.",type:"string"},$u={description:"Where a configured route places task content.",enum:["local","tenant","external"],type:"string"},$m={additionalProperties:!1,properties:{topology_generation:{$ref:"#/$defs/WorkTopologyGenerationRefV1"},work_generation:{$ref:"#/$defs/ProjectionGenerationId"}},required:["work_generation","topology_generation"],type:"object"},$f={additionalProperties:!1,properties:{cost_micros:{format:"uint64",minimum:0,type:["integer","null"]},coverage:{$ref:"#/$defs/CoverageStateV1"},effect_count:{format:"uint64",minimum:0,type:["integer","null"]},effect_outcome:{$ref:"#/$defs/DuplicateEffectOutcomeV1"},evidence:{$ref:"#/$defs/QuantityEvidenceClassV1"},test_count:{format:"uint64",minimum:0,type:["integer","null"]},token_count:{format:"uint64",minimum:0,type:["integer","null"]},wall_micros:{format:"uint64",minimum:0,type:["integer","null"]}},required:["evidence","effect_outcome","coverage"],type:"object"},$h={description:"Effect semantics admitted for one provider attempt.",enum:["observational","intercepted","compound_non_repeatable"],type:"string"},$y={description:"Declared effort class of a configured route.",enum:["minimal","standard","extended"],type:"string"},$g={enum:["deny","allowlisted"],type:"string"},$_={oneOf:[{additionalProperties:!1,properties:{cursor:{type:"string"},kind:{const:"anchor",type:"string"},link_id:{type:"string"}},required:["kind","link_id","cursor"],type:"object"},{additionalProperties:!1,properties:{continuation:{$ref:"#/$defs/WorkTaskSessionContinuationV1"},kind:{const:"task_session",type:"string"}},required:["kind","continuation"],type:"object"}]},$v={additionalProperties:!1,description:"One immutable evidence frontier. Local code/session evidence and live Git\nevidence each carry their own frontier; the evaluator never merges,\nsubstitutes, or advances one from the other.",properties:{digest:{$ref:"#/$defs/ManifestDigest"},watermark:{$ref:"#/$defs/UtcMicros"}},required:["watermark","digest"],type:"object"},$b={additionalProperties:!1,description:"Exact on-disk executable selected for one opaque executable identity.\n\nThe path is configuration data, never a lookup hint. Runtime admission\ncanonicalizes it again and verifies the file bytes against\n`executable.artifact_digest` before returning an executable binding.",properties:{canonical_path:{type:"string"},capabilities:{items:{$ref:"#/$defs/WorkExecutableCapabilityV1"},type:"array"},executable:{$ref:"#/$defs/WorkExecutableReference"},routes:{items:{$ref:"#/$defs/WorkRouteCandidateV1"},type:"array"}},required:["executable","canonical_path","capabilities","routes"],type:"object"},$$={description:"One executable capability admitted by a configured artifact binding.\n\nThe closed variants bind a provider backend to its exact wire protocol.\nCallers cannot claim an arbitrary backend/protocol combination.",enum:["claude_code_stream_json","codex_app_server_json_rpc","codex_cli_exec_json"],type:"string"},$S={additionalProperties:!1,properties:{artifact_digest:{$ref:"#/$defs/ManifestDigest"},executable_id:{type:"string"}},required:["executable_id","artifact_digest"],type:"object"},$k={additionalProperties:!1,description:"Exact immutable provider admission attached to the durable Work attempt.\n\nCallers name typed route and scope facts, never argv, environment entries,\nor executable paths. The daemon resolves the registered executable only\nafter this envelope has been persisted and admitted to the canonical queue.",properties:{attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},cancellation_generation:{format:"uint64",minimum:0,type:"integer"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},instructions:{description:"Exact provider instructions admitted with this attempt. The adapter\ndelivers these bytes verbatim on the provider's typed input channel;\nthey are never interpolated into argv or an ambient prompt source.",type:"string"},operation:{$ref:"#/$defs/WorkflowOperationRef"},project_id:{$ref:"#/$defs/ProjectId"},projection_binding:{$ref:"#/$defs/WorkAttemptProjectionBindingV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"},worktree_root:{type:"string"}},required:["attempt_identity","projection_binding","operation","execution_snapshot","project_id","repository_id","worktree_id","worktree_root","commit","instructions","cancellation_generation","effect_state"],type:"object"},$w={additionalProperties:!1,properties:{max_concurrency:{format:"uint32",minimum:0,type:"integer"},max_input_tokens:{format:"uint64",minimum:0,type:"integer"},max_output_tokens:{format:"uint64",minimum:0,type:"integer"},max_protocol_bytes:{format:"uint64",minimum:0,type:"integer"},max_stderr_bytes:{format:"uint64",minimum:0,type:"integer"},max_stdout_bytes:{format:"uint64",minimum:0,type:"integer"}},required:["max_input_tokens","max_output_tokens","max_stdout_bytes","max_stderr_bytes","max_protocol_bytes","max_concurrency"],type:"object"},$P={additionalProperties:!1,description:"Immutable provider and topology authority pinned for exactly one Work\nexecution. Every constraint the execution is governed by is named here;\nnothing in this value is an opaque stand-in that a reader must resolve\nagainst a mutable store.",properties:{approval:{$ref:"#/$defs/WorkApprovalPolicy"},backend:{$ref:"#/$defs/WorkProviderBackendV1"},configuration_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},configuration_snapshot_id:{$ref:"#/$defs/ConfigurationSnapshotId"},credential_references:{items:{$ref:"#/$defs/CredentialReferenceId"},type:"array",uniqueItems:!0},deadline:{$ref:"#/$defs/UtcMicros"},effective_behavior_digest:{$ref:"#/$defs/ManifestDigest"},egress:{$ref:"#/$defs/WorkEgressPolicy"},environment_allowlist:{items:{type:"string"},type:"array",uniqueItems:!0},executable:{$ref:"#/$defs/WorkExecutableReference"},fallback:{$ref:"#/$defs/WorkFallbackTopology"},filesystem:{$ref:"#/$defs/WorkFilesystemPolicy"},limits:{$ref:"#/$defs/WorkExecutionLimits"},model:{type:"string"},protocol:{$ref:"#/$defs/WorkProviderProtocol"},resolution_provenance_digest:{$ref:"#/$defs/ManifestDigest"},route:{$ref:"#/$defs/WorkProviderRouteV1"},sandbox:{$ref:"#/$defs/WorkSandboxPolicy"},topology:{$ref:"#/$defs/WorkTopologyPolicyV1",description:"See [`WorkExecutionSnapshotInput::topology`]. Validated on construction,\nso an admitted snapshot can never pin a topology that weakens the\nprotected-ref floor or permits a native integration without its gates."}},required:["configuration_revision_id","configuration_snapshot_id","effective_behavior_digest","resolution_provenance_digest","route","backend","protocol","model","executable","sandbox","approval","filesystem","egress","environment_allowlist","credential_references","limits","deadline","fallback","topology"],type:"object"},$V={enum:["language","framework","architecture","testing","operations","security","domain"],type:"string"},$R={additionalProperties:!1,description:"Explicit, expiring consent for ephemeral expertise context.\n\nUser-profile and project authorization are separate registered settings;\nWork requires both and uses only their category intersection.",properties:{allowed_categories:{items:{$ref:"#/$defs/WorkExpertiseCategoryV1"},type:"array",uniqueItems:!0},enabled:{type:"boolean"},expires_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},granted_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["schema_version","enabled","allowed_categories"],type:"object"},$q={oneOf:[{additionalProperties:!1,properties:{kind:{const:"disabled",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{executable:{$ref:"#/$defs/WorkExecutableReference"},kind:{const:"codex_cli",type:"string"},route:{$ref:"#/$defs/WorkProviderRouteV1"}},required:["kind","route","executable"],type:"object"}]},$I={format:"uint64",minimum:0,title:"WorkFenceEpochV1",type:"integer"},$x={enum:["read_only","workspace_write"],type:"string"},$j={oneOf:[{additionalProperties:!1,properties:{item:{$ref:"#/$defs/WorkItemV1"},kind:{const:"task_added",type:"string"}},required:["kind","item"],type:"object"},{additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},kind:{const:"task_created",type:"string"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"}},required:["kind","initiative","plan","milestone","item"],type:"object"},{additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},kind:{const:"relation_replan_decided",type:"string"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["kind","proposal","disposition","decided_at"],type:"object"},{additionalProperties:!1,properties:{applied_at:{$ref:"#/$defs/UtcMicros"},kind:{const:"task_relations_replanned",type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"}},required:["kind","proposal_id","applied_at"],type:"object"},{additionalProperties:!1,properties:{evidence:{$ref:"#/$defs/TaskEvidenceLinkV1"},kind:{const:"evidence_linked",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","evidence"],type:"object"},{additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},kind:{const:"proposal_decided",type:"string"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["kind","proposal","disposition","decided_at"],type:"object"},{additionalProperties:!1,properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},kind:{const:"proposal_accepted",type:"string"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["kind","proposal","accepted_at"],type:"object"},{additionalProperties:!1,properties:{admitted_at:{$ref:"#/$defs/UtcMicros"},based_on_version:{format:"uint64",minimum:0,type:"integer"},kind:{const:"execution_admitted",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","based_on_version","admitted_at"],type:"object"},{additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},kind:{const:"accepted_attempt_linked",type:"string"},linked_at:{$ref:"#/$defs/UtcMicros"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","based_on_version","identity","linked_at"],type:"object"},{additionalProperties:!1,properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},evidence_by_criterion:{additionalProperties:{type:"string"},type:"object"},kind:{const:"task_accepted",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","evidence_by_criterion","accepted_at"],type:"object"},{additionalProperties:!1,properties:{handoff:{$ref:"#/$defs/WorkHandoffV1"},kind:{const:"handoff_recorded",type:"string"}},required:["kind","handoff"],type:"object"}]},$C={additionalProperties:!1,description:"One attempt on the evidence frontier: exactly which attempt, in which\nstate, backed by which sealed evidence digest (when the attempt has\nreported one). No lease or fence is part of the frontier. Those are\nruntime authority, not checkpoint evidence.",properties:{evidence_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"The digest of the sealed terminal evidence record, when the attempt\nhas one. `None` is the typed not-yet-reported state."},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["identity","state"],type:"object"},$T={additionalProperties:!1,description:"The exact work/evidence frontier one handoff records.",properties:{attempts:{description:"The evidence frontier: every attempt the issuer knows about, in\nstable identity order.",items:{$ref:"#/$defs/WorkHandoffAttemptFrontierV1"},type:"array"},blockers:{description:"What is blocking progress. Bounded, non-empty entries.",items:{type:"string"},type:"array"},legal_actions:{description:"The actions the issuer believes are legal next steps.",items:{type:"string"},type:"array"},lineage:{$ref:"#/$defs/WorkHandoffLineageV1"},task_id:{$ref:"#/$defs/TaskId"},unknowns:{description:"What the issuer does not know yet. Bounded, non-empty entries.",items:{type:"string"},type:"array"},work_version:{description:"The exact Work version the frontier was cut at.",format:"uint64",minimum:0,type:"integer"}},required:["task_id","work_version","attempts","unknowns","blockers","legal_actions","lineage"],type:"object"},$O={additionalProperties:!1,description:"Who issued this frontier and what it supersedes.",properties:{issued_at:{$ref:"#/$defs/UtcMicros"},issued_by:{$ref:"#/$defs/ActorId"},prior_frontier_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"The canonical digest of the frontier this one supersedes, when the\ntask has been handed off before. `None` states a first handoff."}},required:["issued_by","issued_at"],type:"object"},$E={additionalProperties:!1,properties:{evidence_frontier:{items:{type:"string"},type:"array",uniqueItems:!0},from_actor:{$ref:"#/$defs/ActorId"},handed_off_at:{$ref:"#/$defs/UtcMicros"},handoff_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"},to_actor:{$ref:"#/$defs/ActorId"},unknowns:{items:{type:"string"},type:"array",uniqueItems:!0}},required:["handoff_id","task_id","from_actor","to_actor","evidence_frontier","unknowns","handed_off_at"],type:"object"},$A={additionalProperties:!1,properties:{initiative_id:{type:"string"},milestone_id:{type:"string"},plan_id:{type:"string"}},required:["initiative_id","plan_id","milestone_id"],type:"object"},$W={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},title:{type:"string"}},required:["id","title","created_at"],type:"object"},$M={additionalProperties:!1,properties:{acceptance_criteria:{items:{$ref:"#/$defs/WorkAcceptanceCriterionV1"},type:"array"},causal_candidates:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},created_at:{$ref:"#/$defs/UtcMicros"},deadline:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},dependencies:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},effort:{format:"uint32",minimum:0,type:"integer"},hierarchy:{$ref:"#/$defs/WorkHierarchyV1"},informational_relations:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},scheduled_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},task_id:{$ref:"#/$defs/TaskId"},title:{type:"string"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","hierarchy","title","dependencies","informational_relations","causal_candidates","acceptance_criteria","effort","created_at","updated_at"],type:"object"},$N={additionalProperties:!1,properties:{accepted_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},accepted_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},accepted_criteria:{additionalProperties:{type:"string"},type:"object"},accepted_proposal:{anyOf:[{$ref:"#/$defs/ProposalId"},{type:"null"}]},accepted_route:{anyOf:[{$ref:"#/$defs/WorkRouteDecisionV1"},{type:"null"}]},archived_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},evidence_links:{items:{type:"string"},type:"array",uniqueItems:!0},execution_admitted_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},handoffs:{items:{$ref:"#/$defs/WorkHandoffV1"},type:"array"},input:{$ref:"#/$defs/WorkItemInputV1"}},required:["input","evidence_links","accepted_criteria","accepted_attempts","handoffs"],type:"object"},$z={description:"A job task key: `[a-z0-9-]`, 1 to 48 bytes. Identities derive from it.",type:"string"},$D={additionalProperties:!1,properties:{epoch:{$ref:"#/$defs/WorkFenceEpochV1"},lease_id:{$ref:"#/$defs/WorkLeaseId"}},required:["lease_id","epoch"],type:"object"},$F={description:"Strongly typed canonical identity: `WorkLeaseId`.",type:"string"},$L={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},plan_id:{type:"string"},title:{type:"string"}},required:["id","plan_id","title","created_at"],type:"object"},$U={description:"Ordinal band. Never a probability, never a scalar score.\n\nBands are ordered `Lowest` .. `Highest`. Comparison is the only operation\nconsumers perform over them, so no weighted sum can be reconstructed from\na recorded decision.",enum:["lowest","low","moderate","high","highest"],type:"string"},$H={description:"Closed set of conditions that block admission or removal.",oneOf:[{const:"dirty_tracked_files",description:"Tracked files differ from the index or HEAD.",type:"string"},{const:"untracked_data",description:"Untracked data is present in the target.",type:"string"},{const:"unique_commits",description:"The target holds commits reachable from nowhere else.",type:"string"},{const:"active_holder",description:"Another admitted placement holds this target.",type:"string"},{const:"unresolved_effect",description:"An effect against this placement is unresolved.",type:"string"},{const:"unacknowledged_receipt",description:"A receipt produced against this placement is unacknowledged.",type:"string"},{const:"uncertain_pull_request",description:"A pull request produced from this placement is in an uncertain state.",type:"string"},{const:"shared_ref",description:"A ref in this target is shared with another holder.",type:"string"},{const:"missing_anchor",description:"A retrieval or evidence anchor this placement referenced is missing.",type:"string"},{const:"stale_scope",description:"The authorized scope no longer matches the placement.",type:"string"},{const:"authorization_lost",description:"Authorization for this placement was lost.",type:"string"},{const:"target_unreadable",description:"The target could not be read, so its state is unknown.",type:"string"},{const:"network_required",description:"The placement declared itself network-free but the action needs network.",type:"string"}],title:"WorkPlacementBlockerV1"},$G={additionalProperties:!1,description:"Which run a placement belongs to. Placement never redefines TaskId.",properties:{run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id"],title:"WorkPlacementIdentityV1",type:"object"},$B={description:"The supported placement choices, and only those.",oneOf:[{const:"no_managed_placement",description:"TraceDecay manages no checkout for this run. No-Git work is first class.",type:"string"},{const:"clean_in_place",description:"The caller's own strictly clean checkout, explicitly acknowledged.",type:"string"},{const:"linked_worktree",description:"A linked worktree of the same repository.",type:"string"},{const:"isolated_clone",description:"An isolated local clone.",type:"string"}],title:"WorkPlacementKindV1"},$K={description:"The durable state of one admitted placement.",oneOf:[{const:"admitted",description:"The placement holds its target.",type:"string"},{const:"released",description:"The placement gave its target up cleanly. Nothing was deleted by this\ntransition; removal is a separate cleanup preflight.",type:"string"},{const:"quarantined",description:"The placement was retained because removal is blocked.",type:"string"}],title:"WorkPlacementStateV1"},$J={additionalProperties:!1,description:"The exact placement a caller asked for.",properties:{in_place_acknowledged:{description:"Set only for `CleanInPlace`: the caller states it accepts running in\nits own checkout. Acknowledgement is explicit, never inferred.",type:"boolean"},kind:{$ref:"#/$defs/WorkPlacementKindV1"},network_free:{description:"The placement declares it needs no network. Declared, not detected.",type:"boolean"},root:{description:"Absolute root, present exactly when the kind manages one.",type:["string","null"]}},required:["kind","in_place_acknowledged","network_free"],title:"WorkPlacementTargetV1",type:"object"},$Z={additionalProperties:!1,description:"One run's durable placement relation.",properties:{authority_version:{format:"uint64",minimum:0,type:"integer"},blockers:{items:{$ref:"#/$defs/WorkPlacementBlockerV1"},type:"array",uniqueItems:!0},identity:{$ref:"#/$defs/WorkPlacementIdentityV1"},retention_eligible_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],description:"When retention makes this placement *eligible* for a fresh cleanup\npreflight. Eligibility is not delete authority."},state:{$ref:"#/$defs/WorkPlacementStateV1"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["identity","target","state","authority_version","transitioned_at","blockers"],title:"WorkPlacementV1",type:"object"},$Q={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},initiative_id:{type:"string"},title:{type:"string"}},required:["id","initiative_id","title","created_at"],type:"object"},$X={oneOf:[{additionalProperties:!1,properties:{kind:{const:"project",type:"string"},project_id:{$ref:"#/$defs/ProjectId"}},required:["kind","project_id"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"repository",type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"}},required:["kind","project_id","repository_id"],type:"object"}]},$Y={additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},source_store_id:{$ref:"#/$defs/SourceStoreId"}},required:["source_store_id","anchor_id","evidence_digest"],type:"object"},$1={oneOf:[{additionalProperties:!1,properties:{graph:{$ref:"#/$defs/WorkProductGraphV1"},kind:{const:"created",type:"string"}},required:["kind","graph"],type:"object"},{additionalProperties:!1,properties:{change:{$ref:"#/$defs/WorkGraphChangeV1"},kind:{const:"changed",type:"string"}},required:["kind","change"],type:"object"}]},$0={additionalProperties:!1,properties:{actor_id:{$ref:"#/$defs/ActorId"},authorized_relation_scopes:{items:{$ref:"#/$defs/WorkProductAuthorizedRelationScopeV1"},type:"array"},canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},catalog_generation_id:{$ref:"#/$defs/CatalogGenerationId"},causation_event_id:{type:["string","null"]},command_id:{$ref:"#/$defs/WorkCommandId"},configuration_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},event_id:{type:"string"},evidence:{items:{$ref:"#/$defs/WorkProductEventEvidenceV1"},type:"array"},expected_graph_version:{format:"uint64",minimum:0,type:["integer","null"]},occurred_at:{$ref:"#/$defs/UtcMicros"},owner_scope:{$ref:"#/$defs/WorkProductProfileScopeV1"},payload:{$ref:"#/$defs/WorkProductEventPayloadV1"},policy_revision_id:{type:"string"},result_graph_version:{format:"uint64",minimum:0,type:"integer"},sequence:{format:"uint64",minimum:0,type:"integer"},source_watermark:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},type:"object"}},required:["event_id","sequence","actor_id","owner_scope","authorized_relation_scopes","result_graph_version","command_id","canonical_input_digest","evidence","source_watermark","occurred_at","policy_revision_id","configuration_revision_id","catalog_generation_id","payload"],type:"object"},$2={oneOf:[{additionalProperties:!1,properties:{authority:{const:"no_prior_graph",type:"string"}},required:["authority"],type:"object"},{additionalProperties:!1,properties:{authority:{const:"verified",type:"string"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["authority","verified_version"],type:"object"}]},$4={additionalProperties:!1,properties:{evidence:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},initiatives:{items:{$ref:"#/$defs/WorkInitiativeV1"},type:"array"},items:{items:{$ref:"#/$defs/WorkItemV1"},type:"array"},milestones:{items:{$ref:"#/$defs/WorkMilestoneV1"},type:"array"},plans:{items:{$ref:"#/$defs/WorkPlanV1"},type:"array"},proposal_decisions:{items:{$ref:"#/$defs/WorkProposalDecisionV1"},type:"array"},relation_replan_decisions:{items:{$ref:"#/$defs/WorkRelationReplanDecisionV1"},type:"array"},version:{format:"uint64",minimum:0,type:"integer"}},required:["version","initiatives","plans","milestones","items","proposal_decisions","relation_replan_decisions","evidence"],type:"object"},$6={additionalProperties:!1,properties:{causation_event_id:{type:["string","null"]},command_id:{$ref:"#/$defs/WorkCommandId"},evidence:{items:{$ref:"#/$defs/WorkProductEventEvidenceV1"},type:"array"},expected_authority:{$ref:"#/$defs/WorkProductExpectedAuthorityV1"},occurred_at:{$ref:"#/$defs/UtcMicros"},revisions:{$ref:"#/$defs/WorkProductRevisionPinsV1"}},required:["expected_authority","command_id","evidence","occurred_at","revisions"],type:"object"},$3={additionalProperties:!1,properties:{event:{$ref:"#/$defs/WorkProductEventV1"},replayed:{type:"boolean"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["event","verified_graph_version","replayed"],type:"object"},$9={additionalProperties:!1,properties:{brain_id:{$ref:"#/$defs/BrainId"},profile_id:{$ref:"#/$defs/UserProfileId"}},required:["brain_id","profile_id"],type:"object"},$5={oneOf:[{properties:{initiative_id:{type:"string"},kind:{const:"initiative_contains_plan",type:"string"},plan_id:{type:"string"}},required:["kind","initiative_id","plan_id"],type:"object"},{properties:{kind:{const:"plan_contains_milestone",type:"string"},milestone_id:{type:"string"},plan_id:{type:"string"}},required:["kind","plan_id","milestone_id"],type:"object"},{properties:{kind:{const:"milestone_contains_task",type:"string"},milestone_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","milestone_id","task_id"],type:"object"},{properties:{dependency:{$ref:"#/$defs/TaskId"},dependent:{$ref:"#/$defs/TaskId"},kind:{const:"gates",type:"string"}},required:["kind","dependency","dependent"],type:"object"},{properties:{kind:{const:"informational",type:"string"},source:{$ref:"#/$defs/TaskId"},target:{$ref:"#/$defs/TaskId"}},required:["kind","source","target"],type:"object"},{properties:{cause:{$ref:"#/$defs/TaskId"},effect:{$ref:"#/$defs/TaskId"},kind:{const:"causal_candidate",type:"string"}},required:["kind","cause","effect"],type:"object"},{properties:{kind:{const:"evidence",type:"string"},link_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","link_id"],type:"object"},{properties:{identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},kind:{const:"accepted_attempt",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","identity"],type:"object"},{properties:{handoff_id:{type:"string"},kind:{const:"handoff",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","handoff_id"],type:"object"},{properties:{kind:{const:"proposal_decision",type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","proposal_id"],type:"object"}]},$8={additionalProperties:!1,properties:{catalog_generation_id:{$ref:"#/$defs/CatalogGenerationId"},configuration_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},policy_revision_id:{type:"string"}},required:["policy_revision_id","configuration_revision_id","catalog_generation_id"],type:"object"},$7={description:"The exact owner-relative relation set selected for a canonical Work graph.\n\nThis identity lives in the domain because attempt admission must retain\nit byte-for-byte through provider settlement. Reconstructing it from a\nproject context would conflate explicit no-Git work with a scoped\nrepository relation.",oneOf:[{properties:{selection:{const:"profile_owned_no_git",type:"string"}},required:["selection"],type:"object"},{properties:{relation_scopes:{items:{$ref:"#/$defs/WorkProductAuthorizedRelationScopeV1"},type:"array",uniqueItems:!0},selection:{const:"relations",type:"string"}},required:["selection","relation_scopes"],type:"object"}]},Se={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},St={enum:["accepted","rejected","superseded"],type:"string"},Sr={additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},children:{items:{$ref:"#/$defs/WorkProposedChildV1"},type:"array"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},explanation:{type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"},route:{$ref:"#/$defs/WorkRouteDecisionV1"},shape:{$ref:"#/$defs/WorkShapeAssessmentV1"},sizing:{$ref:"#/$defs/WorkSizingV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["proposal_id","task_id","based_on_version","shape","sizing","children","route","explanation","evidence_digest","configuration_digest"],type:"object"},Si={additionalProperties:!1,properties:{dependencies:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},effort:{format:"uint32",minimum:0,type:"integer"},task_id:{$ref:"#/$defs/TaskId"},title:{type:"string"}},required:["task_id","title","effort","dependencies"],type:"object"},So={description:"Typed provider availability observed at negotiation. These are product\nstates, not transport errors: each one names why the configured native\nprovider could not run, without inventing a fallback.",oneOf:[{const:"absent",description:"No executable binding is configured for the pinned executable identity.",type:"string"},{const:"stale",description:"The configured binding no longer matches the pinned reference.",type:"string"},{const:"unsupported",description:"The configured binding does not admit the pinned backend/protocol.",type:"string"},{const:"digest_mismatch",description:"The on-disk executable bytes do not match the pinned digest.",type:"string"},{const:"unavailable",description:"The configured executable could not be read or is not executable.",type:"string"}]},Sn={description:"Provider protocol selected by the pinned Work configuration snapshot.",enum:["claude_code_cli","codex_app_server","codex_cli"],type:"string"},Sa={additionalProperties:!1,description:'Why an admitted attempt did not run on the backend its pinned execution\nsnapshot preferred.\n\nPlan 32 (`docs/plans/tracedecay-v2/32-dynamic-workflow-runtime-and-sdk.md`,\n"Native provider execution") admits the Codex CLI "only when app-server is\nunsupported or absent before session start and the pinned Plan 20 snapshot\nexplicitly allows that fallback", and the plan index requires that fallback\nto be "reported rather than hidden". This record is that report: it names\nthe preferred backend, the typed state that disqualified it, and the\nconfiguration-bounded fallback that was selected, so a fallback run can\nnever be read as a first choice.\n\nIt is also written when the fallback itself was refused, so a denial keeps\nboth failures instead of collapsing them into one state.',properties:{fallback_backend:{$ref:"#/$defs/WorkProviderBackendV1",description:"The backend named by the snapshot's configured fallback topology."},fallback_route:{$ref:"#/$defs/WorkProviderRouteV1",description:"The route that fallback runs on."},fallback_state:{anyOf:[{$ref:"#/$defs/WorkProviderAvailabilityV1"},{type:"null"}],description:"`None` when the fallback actually started; `Some(state)` when the\nfallback was itself refused."},preferred_backend:{$ref:"#/$defs/WorkProviderBackendV1",description:"The backend the pinned snapshot named first."},preferred_route:{$ref:"#/$defs/WorkProviderRouteV1",description:"The route that backend would have run on."},preferred_state:{$ref:"#/$defs/WorkProviderAvailabilityV1",description:"Why the preferred backend could not be used."}},required:["preferred_backend","preferred_route","preferred_state","fallback_backend","fallback_route"],type:"object"},Ss={enum:["claude_stream_json","codex_app_server_json_rpc","codex_exec_json"],type:"string"},Sd={description:"Strongly typed canonical identity: `WorkProviderRouteId`.",type:"string"},Sc={additionalProperties:!1,properties:{provider_id:{$ref:"#/$defs/ProviderId"},route_id:{$ref:"#/$defs/WorkProviderRouteId"}},required:["provider_id","route_id"],type:"object"},Sl={oneOf:[{properties:{state:{const:"fresh",type:"string"}},required:["state"],type:"object"},{properties:{checkpoint:{anyOf:[{$ref:"#/$defs/WorkArtifactRefV1"},{type:"null"}]},source_attempt_id:{$ref:"#/$defs/AttemptId"},state:{const:"resumed",type:"string"}},required:["state","source_attempt_id"],type:"object"},{properties:{reason:{$ref:"#/$defs/WorkRestartReasonV1"},source_attempt_id:{$ref:"#/$defs/AttemptId"},state:{const:"restarted",type:"string"}},required:["state","source_attempt_id","reason"],type:"object"},{description:"The attempt cannot continue and must be recovered. A first attempt\nlost before it ever resumed anything has no predecessor, so the source\nis absent rather than pointing at the attempt itself.",properties:{observed_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/WorkRestartReasonV1"},source_attempt_id:{anyOf:[{$ref:"#/$defs/AttemptId"},{type:"null"}],default:null},state:{const:"recovery_required",type:"string"}},required:["state","reason","observed_at"],type:"object"}]},Sp={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},Su={additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},causal_candidates:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},dependencies:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},informational_relations:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},payload_digest:{$ref:"#/$defs/ManifestDigest"},proposal_id:{$ref:"#/$defs/ProposalId"},task_id:{$ref:"#/$defs/TaskId"}},required:["proposal_id","task_id","based_on_version","dependencies","informational_relations","causal_candidates","payload_digest"],type:"object"},Sm={enum:["lease_lost","provider_unavailable","process_lost","failure_observed"],type:"string"},Sf={enum:["runtime_failure","restart_recovery_required"],type:"string"},Sh={additionalProperties:!1,description:"A selector into the owning runtime-terminal evidence authority.\n\n`evidence_ref` is an opaque local reference. The Work retry owner resolves\nit through [`WorkRetryEvidencePortV1`]; callers never submit the evidence\ndigest, outcome, or observation time that decides eligibility.",properties:{cause:{$ref:"#/$defs/WorkRetryCauseV1"},evidence_ref:{type:"string"},source:{$ref:"#/$defs/WorkRetrySourceV1"}},required:["source","cause","evidence_ref"],type:"object"},Sy={enum:["runtime"],type:"string"},Sg={additionalProperties:!1,description:"One eligible route supplied by the authorized configuration snapshot.\n\nThe application filters these candidates by the current request grant and\nverifies the exact pinned executable before policy evaluates them.",properties:{autonomy:{$ref:"#/$defs/WorkOrdinalBandV1"},content_location:{$ref:"#/$defs/WorkContentLocationClassV1"},correctness:{$ref:"#/$defs/WorkOrdinalBandV1"},cost:{$ref:"#/$defs/WorkOrdinalBandV1"},declared_budget_ceiling:{format:"uint64",minimum:0,type:"integer"},effort:{$ref:"#/$defs/WorkEffortClassV1"},evidence_quality:{$ref:"#/$defs/WorkOrdinalBandV1"},execution:{$ref:"#/$defs/WorkRouteExecutionProfileV1"},latency:{$ref:"#/$defs/WorkOrdinalBandV1"},model_id:{type:"string"},provider_capability_id:{type:"string"},route_id:{type:"string"},sensitive_data_fitness:{$ref:"#/$defs/WorkOrdinalBandV1"}},required:["route_id","provider_capability_id","model_id","effort","declared_budget_ceiling","content_location","correctness","sensitive_data_fitness","latency","cost","autonomy","evidence_quality","execution"],type:"object"},S_={oneOf:[{properties:{alternatives:{items:{$ref:"#/$defs/WorkProviderRouteV1"},type:"array"},decision:{const:"selected",type:"string"},exclusions:{items:{type:"string"},type:"array",uniqueItems:!0},fallback:{type:"string"},recommended:{$ref:"#/$defs/WorkProviderRouteV1"}},required:["decision","recommended","alternatives","exclusions","fallback"],type:"object"},{properties:{decision:{const:"abstained",type:"string"},reason:{type:"string"}},required:["decision","reason"],type:"object"}]},Sv={additionalProperties:!1,description:"Complete execution constraints configured for one provider route.\n\nThe route candidate is the configuration authority for these values. Work\nadmission copies them into the immutable execution snapshot; provider\nadapters never supply defaults.",properties:{approval:{$ref:"#/$defs/WorkApprovalPolicy"},credential_references:{items:{$ref:"#/$defs/CredentialReferenceId"},type:"array",uniqueItems:!0},egress:{$ref:"#/$defs/WorkEgressPolicy"},environment_allowlist:{items:{type:"string"},type:"array",uniqueItems:!0},fallback:{$ref:"#/$defs/WorkFallbackTopology"},filesystem:{$ref:"#/$defs/WorkFilesystemPolicy"},limits:{$ref:"#/$defs/WorkExecutionLimits"},maximum_duration_micros:{description:"Maximum elapsed time from execution admission to provider completion.",format:"uint64",minimum:0,type:"integer"},sandbox:{$ref:"#/$defs/WorkSandboxPolicy"}},required:["sandbox","approval","filesystem","egress","environment_allowlist","credential_references","limits","maximum_duration_micros","fallback"],type:"object"},Sb={description:"A monotonically versioned control authority.",format:"uint64",minimum:0,title:"WorkRunControlAuthorityV1",type:"integer"},S$={description:"Why a run was paused or resumed. A closed vocabulary keeps the reason out\nof free text so it can be read by a projection without being a prompt.",oneOf:[{const:"operator_request",description:"An authorized operator asked for the transition.",type:"string"},{const:"human_wait",description:"The run is waiting on a human approval or answer.",type:"string"},{const:"budget_exhausted",description:"The shared budget ledger is exhausted for now.",type:"string"},{const:"recovery",description:"Recovery or failover is reconciling the run.",type:"string"}],title:"WorkRunControlReasonV1"},SS={description:'The published control state of one run.\n\nThere is no `Cancelled` here: cancellation is an attempt-level authority\nowned through the lease fence, and duplicating it as a run state would\ncreate a second place a run could be "over".',oneOf:[{const:"running",description:"New reservations are admitted.",type:"string"},{const:"paused",description:"New reservations are fenced; committed evidence is preserved.",type:"string"}],title:"WorkRunControlStateV1"},Sk={additionalProperties:!1,description:"The run's deadline as of the last control transition.\n\n`remaining_micros` is the authority; `deadline` is the absolute instant that\nremaining resolves to while the run is running. Both are recorded so a\nreader never has to recompute one from a clock it does not trust.",properties:{checkpoint_at:{$ref:"#/$defs/UtcMicros",description:"The instant the checkpoint was taken."},deadline:{$ref:"#/$defs/UtcMicros",description:"The absolute deadline the run is measured against right now."},remaining_micros:{description:"Micros left against that deadline at `checkpoint_at`. Never negative,\nand never larger than the value the previous checkpoint carried.",format:"int64",type:"integer"}},required:["deadline","remaining_micros","checkpoint_at"],title:"WorkRunDeadlineCheckpointV1",type:"object"},Sw={enum:["required"],type:"string"},SP={enum:["ordinal","heuristic","calibrated_range"],type:"string"},SV={additionalProperties:!1,properties:{ambiguity:{format:"uint8",maximum:255,minimum:0,type:"integer"},blast_radius:{format:"uint8",maximum:255,minimum:0,type:"integer"},complexity:{format:"uint8",maximum:255,minimum:0,type:"integer"},integration_overhead:{format:"uint8",maximum:255,minimum:0,type:"integer"},score_kind:{$ref:"#/$defs/WorkScoreKindV1"}},required:["score_kind","complexity","ambiguity","blast_radius","integration_overhead"],type:"object"},SR={additionalProperties:!1,properties:{coverage:{type:"string"},high:{format:"uint32",minimum:0,type:"integer"},likely:{format:"uint32",minimum:0,type:"integer"},low:{format:"uint32",minimum:0,type:"integer"},score_kind:{$ref:"#/$defs/WorkScoreKindV1"}},required:["score_kind","low","likely","high","coverage"],type:"object"},Sq={additionalProperties:!1,description:"Succeeded sources grouped by the exact artifact digest list they produced.\nGroups are ordered largest first; smaller groups are the minority\nevidence, and more than one group is the disagreement, preserved as\nstructure instead of being resolved by fiat.",properties:{artifacts:{description:"The artifact digest list every source in this group produced.",items:{$ref:"#/$defs/ManifestDigest"},type:"array"},sources:{description:"The concurring sources, in the caller's requested order.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["artifacts","sources"],type:"object"},SI={description:"Why a synthesis request was answered with the unsynthesized set instead\nof an admitted attempt.",oneOf:[{const:"no_citable_sources",description:"No source contributed a citable artifact: every source failed, was\ncancelled, timed out, is still unknown, or succeeded without\ndeclaring artifacts. There is nothing a synthesis could truthfully\ncite.",type:"string"}]},Sx={additionalProperties:!1,description:"One immutable source envelope: which attempt, and what it truthfully\ncontributed at admission time.",properties:{outcome:{$ref:"#/$defs/WorkSynthesisSourceOutcomeV1"},source:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["source","outcome"],type:"object"},Sj={description:"One sibling attempt's terminal contribution, captured verbatim from the\nWork authority at admission time.",oneOf:[{description:"The source succeeded; its declared artifact digests, in declaration\norder, are the evidence a synthesis may cite.",properties:{artifacts:{items:{$ref:"#/$defs/ManifestDigest"},type:"array"},outcome:{const:"succeeded",type:"string"}},required:["outcome","artifacts"],type:"object"},{description:"The source failed; its sealed terminal evidence digest is preserved\nso the failure stays visible in the synthesis record.",properties:{evidence:{$ref:"#/$defs/ManifestDigest"},outcome:{const:"failed",type:"string"}},required:["outcome","evidence"],type:"object"},{description:"The source timed out; preserved like a failure.",properties:{evidence:{$ref:"#/$defs/ManifestDigest"},outcome:{const:"timed_out",type:"string"}},required:["outcome","evidence"],type:"object"},{description:"The source was cancelled; preserved like a failure.",properties:{evidence:{$ref:"#/$defs/ManifestDigest"},outcome:{const:"cancelled",type:"string"}},required:["outcome","evidence"],type:"object"},{description:"The source has not reached a terminal state. The unknown is preserved\nas an unknown; it contributes no citable evidence and is never\nguessed at.",properties:{outcome:{const:"unknown",type:"string"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["outcome","state"],type:"object"}]},SC={additionalProperties:!1,description:"The ordered, digest-sealed source envelope set a synthesis admission\nconsumed. Reordering or mutating any envelope changes the digest, so a\nreplayed or tampered set is distinguishable from the admitted one.",properties:{set_digest:{$ref:"#/$defs/ManifestDigest",description:"Canonical digest over the ordered envelopes."},sources:{description:"The envelopes, exactly in the caller's requested order.",items:{$ref:"#/$defs/WorkSynthesisSourceEnvelopeV1"},type:"array"}},required:["sources","set_digest"],type:"object"},ST={additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},binding:{description:"Binds the continuation to the retrieve-evidence operation and the\nresult-shaping request fields the envelope does not echo.",type:"string"},participant_epoch:{$ref:"#/$defs/ManifestDigest"},ranking_cursor:{type:["string","null"]},source:{$ref:"#/$defs/ObservationSourceIdentityV1"},temporal_cursor:{type:["string","null"]},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["verified_version","attempt","source","participant_epoch","binding"],type:"object"},SO={oneOf:[{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"succeeded",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"},{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"failed",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"},{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"timed_out",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"},{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"cancelled",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"}]},SE={description:"Strongly typed algorithm-tagged integrity digest: `WorkTopologyGenerationRefV1`.",type:"string"},SA={additionalProperties:!1,description:"Complete V1 policy. Partial values are intentionally impossible: callers\nmust provide the entire policy and validation rejects adapter-local defaults.",properties:{branch_naming:{$ref:"#/$defs/BranchNamingPolicyV1"},branch_topology:{$ref:"#/$defs/BranchTopologyPolicyV1"},concurrency:{$ref:"#/$defs/TopologyConcurrencyPolicyV1"},cross_merge:{$ref:"#/$defs/CrossMergePolicyV1"},escalation:{$ref:"#/$defs/TopologyEscalationPolicyV1"},gates:{$ref:"#/$defs/TopologyGatePolicyV1"},history_rewrite:{$ref:"#/$defs/HistoryRewritePolicyV1"},notifications:{$ref:"#/$defs/TopologyNotificationLevelV1"},placement:{$ref:"#/$defs/WorktreePlacementModeV1"},protected_refs:{items:{$ref:"#/$defs/ProtectedRefRuleV1"},type:"array"},retention:{$ref:"#/$defs/WorktreeRetentionPolicyV1"},review_topology:{$ref:"#/$defs/ReviewTopologyPolicyV1"},roots:{items:{$ref:"#/$defs/WorktreeRootPolicyV1"},type:"array"},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["schema_version","placement","roots","branch_topology","review_topology","branch_naming","concurrency","cross_merge","gates","protected_refs","history_rewrite","escalation","retention","notifications"],type:"object"},SW={additionalProperties:!1,properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:0,type:"integer"},pinned_catalog_digest:{$ref:"#/$defs/ManifestDigest",description:"Must equal the live Work executable catalog digest. Validation and\nactivation report the current digest when this pin is stale."},pinned_configuration_digest:{$ref:"#/$defs/ManifestDigest"},pinned_policy_digest:{$ref:"#/$defs/ManifestDigest"},project_id:{$ref:"#/$defs/ProjectId"},steps:{items:{$ref:"#/$defs/WorkflowStep"},type:"array"}},required:["definition_id","definition_version","project_id","steps","pinned_policy_digest","pinned_configuration_digest","pinned_catalog_digest"],type:"object"},SM={description:"Strongly typed canonical identity: `WorkflowDefinitionId`.",type:"string"},SN={additionalProperties:!1,properties:{max_width:{format:"uint32",minimum:0,type:"integer"}},required:["max_width"],type:"object"},Sz={description:"Strongly typed canonical identity: `WorkflowOperationRef`.",type:"string"},SD={description:"Strongly typed canonical identity: `WorkflowOutputName`.",type:"string"},SF={additionalProperties:!1,properties:{output_name:{$ref:"#/$defs/WorkflowOutputName"},producer_step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["producer_step_id","output_name"],type:"object"},SL={additionalProperties:!1,properties:{fan_out:{anyOf:[{$ref:"#/$defs/WorkflowFanOut"},{type:"null"}]},inputs:{items:{$ref:"#/$defs/WorkflowOutputReference"},type:"array"},operation:{$ref:"#/$defs/WorkflowOperationRef"},outputs:{items:{$ref:"#/$defs/WorkflowOutputName"},type:"array"},predecessors:{items:{$ref:"#/$defs/WorkflowStepId"},type:"array",uniqueItems:!0},step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["step_id","operation","predecessors","inputs","outputs"],type:"object"},SU={description:"Strongly typed canonical identity: `WorkflowStepId`.",type:"string"},SH={additionalProperties:!1,description:"A provider's claim that one artifact of a fan-out output synthesizes its\nsibling source artifacts.",properties:{cited_source_digests:{description:"Content digests of every source artifact the synthesis consumed.",items:{$ref:"#/$defs/ManifestDigest"},type:"array",uniqueItems:!0},output_name:{$ref:"#/$defs/WorkflowOutputName",description:"The fan-out output the synthesis belongs to."},synthesis_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1",description:"The attempt that produced the synthesis artifact inside that output."}},required:["output_name","synthesis_attempt","cited_source_digests"],type:"object"},SG={enum:["require_clean","allow_untracked_only_for_preflight","read_only_preflight_only"],type:"string"},SB={description:"Strongly typed canonical identity: `WorktreeId`.",type:"string"},SK={description:"Monotonic epoch of the worktree inventory frozen into a stack revision.",format:"uint64",minimum:0,type:"integer"},SJ={description:"Strongly typed canonical identity: `WorktreeInventorySnapshotId`.",type:"string"},SZ={oneOf:[{properties:{kind:{const:"existing_worktree_only",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"sibling_of_primary_checkout",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"repository_local_root",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"configured_root",type:"string"},root_id:{type:"string"}},required:["kind","root_id"],type:"object"}]},SQ={additionalProperties:!1,properties:{abandoned_retention_seconds:{format:"uint64",minimum:1,type:["integer","null"]},automatic_gc:{$ref:"#/$defs/AutomaticWorktreeGcV1"},maximum_retained_per_repository:{format:"uint16",maximum:65535,minimum:1,type:["integer","null"]},terminal_retention_seconds:{format:"uint64",minimum:1,type:["integer","null"]}},required:["automatic_gc"],type:"object"},SX={additionalProperties:!1,properties:{locator:{$ref:"#/$defs/SensitiveFilesystemLocatorV1"},maximum_active_worktrees:{format:"uint16",maximum:65535,minimum:1,type:"integer"},repository_scope:{$ref:"#/$defs/RepositoryPlacementScopeV1"},root_id:{type:"string"}},required:["root_id","locator","repository_scope","maximum_active_worktrees"],type:"object"},SY=[{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"ActiveProjectSurfaceRequestV1",type:"object"},{$defs:{ActiveProjectBranchV1:{additionalProperties:!1,properties:{branch_drifted:{type:"boolean"},branch_resolution:{type:"string"},current_branch:{type:["string","null"]},open_active_branch:{type:["string","null"]},serving_branch:{type:["string","null"]},tracked_branch_count:{format:"uint",minimum:0,type:"integer"},warnings:{items:{type:"string"},type:"array"}},required:["branch_resolution","branch_drifted","tracked_branch_count","warnings"],type:"object"},ActiveProjectResolutionSourceV1:{enum:["active_project"],type:"string"},ActiveProjectStorageV1:{additionalProperties:!1,properties:{class:{type:"string"},data_root:{type:"string"},graph_db_exists:{type:"boolean"},graph_db_path:{type:"string"},graph_db_size_bytes:{format:"uint64",minimum:0,type:"integer"},lcm_payload_root:{type:"string"},mode:{type:"string"},response_handle_root:{type:"string"},sessions_db_path:{type:"string"}},required:["class","mode","data_root","graph_db_path","graph_db_exists","graph_db_size_bytes","sessions_db_path","response_handle_root","lcm_payload_root"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The resolved active project of this MCP session.",properties:{branch:{$ref:"#/$defs/ActiveProjectBranchV1"},project_id:{type:["string","null"]},project_root:{type:"string"},repository_id:{type:"string"},resolution_source:{$ref:"#/$defs/ActiveProjectResolutionSourceV1"},scope_prefix:{type:["string","null"]},storage:{$ref:"#/$defs/ActiveProjectStorageV1"}},required:["repository_id","project_root","resolution_source","storage","branch"],title:"ActiveProjectResultV1",type:"object"},{$defs:{AdminCliScopeV1:{description:"What a cost or analytics action reads: the served project's ledgers and\nsessions, or the whole profile's.",enum:["project","profile"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,description:"Savings and provider-usage cost over `range` (`today`, `7d`, ...).",properties:{action:{const:"cost_summary",type:"string"},range:{type:"string"},scope:{$ref:"#/$defs/AdminCliScopeV1"}},required:["action","range","scope"],type:"object"},{additionalProperties:!1,description:"Import every host's transcripts into the project's session store.",properties:{action:{const:"sessions_import",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Converge project sessions with Git history.",properties:{action:{const:"sessions_git_sync",type:"string"},dry_run:{type:"boolean"},limit_sessions:{format:"uint",minimum:0,type:"integer"},since:{format:"int64",type:"integer"}},required:["action","since","limit_sessions","dry_run"],type:"object"},{additionalProperties:!1,properties:{action:{const:"sessions_sync_status",type:"string"},idempotency_key:{type:"string"}},required:["action","idempotency_key"],type:"object"},{additionalProperties:!1,properties:{action:{const:"sessions_sync_cancel",type:"string"},idempotency_key:{type:"string"}},required:["action","idempotency_key"],type:"object"},{additionalProperties:!1,properties:{action:{const:"sessions_unfinished",type:"string"},limit:{format:"uint",minimum:0,type:"integer"}},required:["action","limit"],type:"object"},{additionalProperties:!1,description:"Import hook analytics JSONL into the accounting ledger.",properties:{action:{const:"analytics_sync",type:"string"},scope:{$ref:"#/$defs/AdminCliScopeV1"}},required:["action","scope"],type:"object"},{additionalProperties:!1,properties:{action:{const:"analytics_diagnostics",type:"string"},all:{type:"boolean"},no_sync:{type:"boolean"},scope:{$ref:"#/$defs/AdminCliScopeV1"}},required:["action","scope","all","no_sync"],type:"object"},{additionalProperties:!1,description:"Record the served project's saved-token total.",properties:{action:{const:"registry_update",type:"string"},tokens:{format:"uint64",minimum:0,type:"integer"}},required:["action","tokens"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_list",type:"string"},limit:{format:"uint",minimum:0,type:"integer"},project_arg:{description:"Checkout to mark active when the caller's connection names no\nproject.",type:["string","null"]},query:{type:["string","null"]}},required:["action","limit"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_context",type:"string"},project_arg:{description:"Project path or alias; the caller's project when omitted.",type:["string","null"]}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_empty",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_project_tokens",type:"string"},project_args:{items:{type:"string"},type:"array"}},required:["action","project_args"],type:"object"},{additionalProperties:!1,description:"Plan, or with `apply` execute, collection of registry rows whose\ncheckout is gone.",properties:{action:{const:"registry_gc",type:"string"},apply:{type:"boolean"},prefix:{type:["string","null"]}},required:["action","apply"],type:"object"},{additionalProperties:!1,description:"One project's storage (`project_id` with `project_root`), or one page\nof the profile's.",properties:{action:{const:"storage_report",type:"string"},cursor:{default:null,type:["string","null"]},limit:{default:8,format:"uint",minimum:0,type:"integer"},project_id:{type:["string","null"]},project_root:{type:["string","null"]}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"gain_query",type:"string"},history:{type:"boolean"},project_arg:{type:["string","null"]},since:{format:"int64",type:"integer"}},required:["action","since","history"],type:"object"}],title:"AdminCliSurfaceRequestV1"},{$defs:{AdminCliAnalyticsImportV1:{additionalProperties:!1,properties:{imported:{format:"uint64",minimum:0,type:"integer"},sources:{description:"One row per hook JSONL source: `path`, `imported`, `skipped`, `error`.",items:!0,type:"array"}},required:["imported","sources"],type:"object"},AdminCliCostSummaryV1:{additionalProperties:!1,properties:{range:{type:"string"},summary:{$ref:"#/$defs/AdminCliCostTotalsV1"},today:{$ref:"#/$defs/AdminCliCostTodayV1"}},required:["range","summary","today"],type:"object"},AdminCliCostTodayV1:{additionalProperties:!1,properties:{provider_usage:!0},required:["provider_usage"],type:"object"},AdminCliCostTotalsV1:{additionalProperties:!1,properties:{efficiency_ratio:{description:"Saved over saved-plus-consumed; null when consumption is unmeasured.",format:"double",type:["number","null"]},provider_usage:{description:"The provider-usage cost summary as the session memory prices it."},tokens_saved:{format:"uint64",minimum:0,type:"integer"}},required:["provider_usage","tokens_saved"],type:"object"},AdminCliGainDayV1:{additionalProperties:!1,properties:{calls:{format:"uint64",minimum:0,type:"integer"},day:{description:"Start-of-day epoch seconds (UTC).",format:"int64",type:"integer"},saved_tokens:{format:"uint64",minimum:0,type:"integer"}},required:["day","saved_tokens","calls"],type:"object"},AdminCliGainHistoryV1:{additionalProperties:!1,properties:{history:{items:{$ref:"#/$defs/AdminCliGainDayV1"},type:"array"}},required:["history"],type:"object"},AdminCliGainTotalV1:{additionalProperties:!1,properties:{calls:{format:"uint64",minimum:0,type:"integer"},saved_tokens:{format:"uint64",minimum:0,type:"integer"}},required:["saved_tokens","calls"],type:"object"},AdminCliProjectTokenTotalV1:{additionalProperties:!1,description:"A project whose ledger could not be read reports a null total and the\nreason, never a measured zero.",properties:{error:{type:["string","null"]},project:{type:"string"},tokens:{format:"uint64",minimum:0,type:["integer","null"]}},required:["project"],type:"object"},AdminCliProjectTokensV1:{additionalProperties:!1,properties:{projects:{items:{$ref:"#/$defs/AdminCliProjectTokenTotalV1"},type:"array"}},required:["projects"],type:"object"},AdminCliRegistryContextV1:{oneOf:[{additionalProperties:!1,properties:{aliases:{description:"Alias rows exactly as the registry serializes them.",items:!0,type:"array"},profile_id:{type:"string"},project:{$ref:"#/$defs/PublicCodeProject"},status:{const:"ok",type:"string"},stores:{description:"Store rows exactly as the registry serializes them.",items:!0,type:"array"}},required:["status","profile_id","project","aliases","stores"],type:"object"},{additionalProperties:!1,description:"The call named no project and its connection has none.",properties:{project:{type:"null"},status:{const:"invalid",type:"string"}},required:["status","project"],type:"object"},{additionalProperties:!1,properties:{project:{type:"null"},status:{const:"not_found",type:"string"}},required:["status","project"],type:"object"}]},AdminCliRegistryEmptyV1:{additionalProperties:!1,properties:{empty:{type:"boolean"}},required:["empty"],type:"object"},AdminCliRegistryGcV1:{additionalProperties:!1,description:"The registry collection plan, with its deletion counters filled when it\nwas applied.",properties:{apply:{type:"boolean"},candidate_count:{format:"uint",minimum:0,type:"integer"},candidate_paths:{items:{type:"string"},type:"array"},candidates:{description:"Registry project rows exactly as the registry serializes them.",items:!0,type:"array"},code_project_candidate_count:{format:"uint",minimum:0,type:"integer"},deleted_code_project_count:{format:"uint",minimum:0,type:"integer"},deleted_count:{format:"uint",minimum:0,type:"integer"},deleted_storage_project_count:{format:"uint",minimum:0,type:"integer"},metadata_candidate_count:{format:"uint",minimum:0,type:"integer"},prefix:{type:["string","null"]},protected_code_project_count:{format:"uint",minimum:0,type:"integer"},protected_code_projects:{items:!0,type:"array"},storage_project_candidate_count:{format:"uint",minimum:0,type:"integer"},storage_project_candidates:{items:{type:"string"},type:"array"}},required:["apply","candidate_count","metadata_candidate_count","code_project_candidate_count","storage_project_candidate_count","protected_code_project_count","deleted_count","deleted_code_project_count","deleted_storage_project_count","candidate_paths","candidates","protected_code_projects","storage_project_candidates"],type:"object"},AdminCliRegistryListV1:{oneOf:[{additionalProperties:!1,properties:{limit:{format:"uint",minimum:0,type:"integer"},project_tree:{items:{$ref:"#/$defs/ProjectRepoGroup"},type:"array"},projects:{items:{$ref:"#/$defs/PublicCodeProject"},type:"array"},query:{type:["string","null"]},status:{const:"ok",type:"string"},summary:{$ref:"#/$defs/ProjectRegistrySummary"},truncated:{type:"boolean"}},required:["status","limit","truncated","summary","project_tree","projects"],type:"object"}]},AdminCliRegistryUpdateV1:{additionalProperties:!1,properties:{current:{format:"uint64",minimum:0,type:"integer"},previous:{description:"The total before this write; null when the ledger could not be read.",format:"uint64",minimum:0,type:["integer","null"]},previous_error:{type:["string","null"]}},required:["current"],type:"object"},AdminCliSessionSyncV1:{description:"The daemon session-sync owner's answer.",oneOf:[{additionalProperties:!1,properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},idempotency_key:{type:"string"},operation_id:{type:"string"},status:{const:"accepted",type:"string"}},required:["status","operation_id","idempotency_key","accepted_at"],type:"object"},{additionalProperties:!1,description:"An identical sync was already running; this call joined it.",properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},idempotency_key:{type:"string"},operation_id:{type:"string"},status:{const:"joined",type:"string"}},required:["status","operation_id","idempotency_key","accepted_at"],type:"object"},{additionalProperties:!1,properties:{coalesced_primary:{type:["string","null"]},completed_at:{$ref:"#/$defs/UtcMicros"},coverage:{items:{$ref:"#/$defs/SessionSyncSourceCoverageV1"},type:"array"},failure_codes:{items:{type:"string"},type:"array"},idempotency_key:{type:"string"},operation_id:{type:"string"},source:{$ref:"#/$defs/SessionSyncSourceV1"},source_frontiers:{items:{$ref:"#/$defs/SessionSyncSourceFrontierV1"},type:"array"},stats:{$ref:"#/$defs/SessionSyncStatsV1"},status:{const:"complete",type:"string"},termination:{$ref:"#/$defs/OperationTermination"}},required:["status","operation_id","idempotency_key","source","termination","stats","coverage","source_frontiers","failure_codes","completed_at"],type:"object"},{additionalProperties:!1,properties:{status:{const:"cancelled",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{status:{const:"deadline_exceeded",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{status:{const:"wrong_scope",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{reason_code:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason_code"],type:"object"}]},AdminCliStorageReportV1:{additionalProperties:!1,description:"One storage report page, or one project's report.",properties:{code_generation_retention:{items:!0,type:"array"},code_generation_retention_availability:{items:!0,type:"array"},coverage:!0,full_profile_size:!0,global_db_bytes:{format:"uint64",minimum:0,type:"integer"},profile_root:{type:"string"},stores:{description:"Report rows exactly as the retention report serializes them.",items:!0,type:"array"},unregistered_bytes:{format:"uint64",minimum:0,type:"integer"},unregistered_dir_count:{format:"uint",minimum:0,type:"integer"},user_sessions_db_bytes:{default:0,format:"uint64",minimum:0,type:"integer"}},required:["profile_root","stores","code_generation_retention","code_generation_retention_availability","unregistered_dir_count","unregistered_bytes","global_db_bytes","coverage"],type:"object"},AdminCliUnfinishedSessionsV1:{additionalProperties:!1,properties:{items:{description:"Workflow state rows exactly as the session store serializes them.",items:!0,type:"array"}},required:["items"],type:"object"},OperationTermination:_L,ProjectRegistryEntry:_6,ProjectRegistrySummary:_3,ProjectRepoGroup:_9,PublicCodeProject:va,SessionSyncCoverageV1:{oneOf:[{properties:{outcome:{const:"complete",type:"string"}},required:["outcome"],type:"object"},{properties:{deferred_units:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"partial",type:"string"}},required:["outcome","deferred_units"],type:"object"},{properties:{admitted_units:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"backpressured",type:"string"},rejected_units:{format:"uint64",minimum:0,type:"integer"}},required:["outcome","admitted_units","rejected_units"],type:"object"}]},SessionSyncSourceCoverageV1:{properties:{coverage:{$ref:"#/$defs/SessionSyncCoverageV1"},store_scope:{type:"string"}},required:["store_scope","coverage"],type:"object"},SessionSyncSourceFrontierV1:{description:"Exact canonical observation cursor committed by one source/store authority.",properties:{committed_cursor_json:{type:"string"},scope_json:{type:"string"},source_json:{type:"string"},store_scope:{type:"string"}},required:["store_scope","source_json","scope_json","committed_cursor_json"],type:"object"},SessionSyncSourceV1:{description:"The command that started a session sync, without its options.",oneOf:[{const:"import_transcripts",description:"Hands its remaining historical catch-up to the background refresh\nworkers.",type:"string"},{const:"synchronize_git",description:"A bounded foreground pass; nothing resumes its unfinished coverage.",type:"string"}]},SessionSyncStatsV1:{properties:{commits_attributed:{format:"uint64",minimum:0,type:"integer"},messages_imported:{format:"uint64",minimum:0,type:"integer"},sessions_imported:{format:"uint64",minimum:0,type:"integer"},sessions_scanned:{format:"uint64",minimum:0,type:"integer"},skipped:{format:"uint64",minimum:0,type:"integer"},spans_written:{format:"uint64",minimum:0,type:"integer"}},required:["sessions_imported","messages_imported","sessions_scanned","spans_written","commits_attributed","skipped"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AdminCliCostSummaryV1"},{$ref:"#/$defs/AdminCliSessionSyncV1"},{$ref:"#/$defs/AdminCliUnfinishedSessionsV1"},{$ref:"#/$defs/AdminCliAnalyticsImportV1"},{$ref:"#/$defs/AdminCliRegistryUpdateV1"},{$ref:"#/$defs/AdminCliRegistryListV1"},{$ref:"#/$defs/AdminCliRegistryContextV1"},{$ref:"#/$defs/AdminCliRegistryEmptyV1"},{$ref:"#/$defs/AdminCliProjectTokensV1"},{$ref:"#/$defs/AdminCliRegistryGcV1"},{$ref:"#/$defs/AdminCliStorageReportV1"},{$ref:"#/$defs/AdminCliGainHistoryV1"},{$ref:"#/$defs/AdminCliGainTotalV1"},{description:"The diagnostics report is the analytics bridge's open document; it\ndecodes last so it never claims another action's body."}],description:"One action's answer.",title:"AdminCliResultV1"},{$defs:{AutomaticFactReceiptStateV1:fD,AutomationReconcileScope:fG},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Every action is a struct variant: an internally tagged unit variant would\nignore keys beside its tag instead of refusing them.",oneOf:[{additionalProperties:!1,description:"Read the project's local usage counter.",properties:{action:{const:"counter_get",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Reset the project's local usage counter to zero.",properties:{action:{const:"counter_reset",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Record the project's saved-token total in the profile registry and\nread it back beside the other projects' total.",properties:{action:{const:"status_accounting",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"List terminal automatic-fact receipts.",properties:{action:{const:"automatic_fact_receipt_list",type:"string"},limit:{format:"uint",minimum:0,type:"integer"},state:{anyOf:[{$ref:"#/$defs/AutomaticFactReceiptStateV1"},{type:"null"}],description:"Only receipts in this state (default: every state)."}},required:["action","limit"],type:"object"},{additionalProperties:!1,description:"Read one automatic-fact receipt by its apply id.",properties:{action:{const:"automatic_fact_receipt_view",type:"string"},id:{type:"string"}},required:["action","id"],type:"object"},{additionalProperties:!1,description:"Reconcile automation schedulers with the saved configuration.",properties:{action:{const:"automation_reconcile",type:"string"},scope:{$ref:"#/$defs/AutomationReconcileScope"}},required:["action","scope"],type:"object"}],title:"AdminProjectSurfaceRequestV1"},{$defs:{AdminProjectCounterResetV1:{additionalProperties:!1,properties:{reset:{description:"Always true: a reset that did not settle is a refusal.",type:"boolean"}},required:["reset"],type:"object"},AdminProjectCounterV1:{additionalProperties:!1,properties:{counter:{format:"uint64",minimum:0,type:"integer"}},required:["counter"],type:"object"},AdminProjectStatusAccountingV1:{additionalProperties:!1,properties:{global_tokens_saved:{description:"Tokens the profile's other projects saved; null when they saved none.",format:"uint64",minimum:0,type:["integer","null"]},tokens_saved:{format:"uint64",minimum:0,type:"integer"}},required:["tokens_saved"],type:"object"},AutomaticFactAddRequestV1:{additionalProperties:!1,description:"The add-fact request an automatic apply recorded.",properties:{category:{$ref:"#/$defs/FactCategoryV1"},content:{type:"string"},entities:{items:{type:"string"},type:"array"},metadata:!0,source_label:{type:["string","null"]},tags:{items:{type:"string"},type:"array"},trust:{format:"double",type:"number"}},required:["content","category","tags","entities","trust","metadata"],type:"object"},AutomaticFactEvidenceV1:{additionalProperties:!1,description:"Automation evidence retained with the receipt.",properties:{evidence_hash:{type:["string","null"]},item:!0,validation:!0},type:"object"},AutomaticFactReceiptAvailabilityV1:{oneOf:[{additionalProperties:!1,properties:{state:{const:"available",type:"string"}},required:["state"],type:"object"}]},AutomaticFactReceiptListV1:{additionalProperties:!1,properties:{availability:{$ref:"#/$defs/AutomaticFactReceiptAvailabilityV1"},count:{format:"uint",minimum:0,type:"integer"},next_after_apply_id:{description:"Continue after this apply id; null on the last page.",type:["string","null"]},receipts:{items:{$ref:"#/$defs/AutomaticFactReceiptV1"},type:"array"}},required:["availability","count","receipts"],type:"object"},AutomaticFactReceiptStateV1:fD,AutomaticFactReceiptV1:{additionalProperties:!1,description:"One terminal automatic-fact apply receipt.",properties:{add_fact_request:{$ref:"#/$defs/AutomaticFactAddRequestV1"},applied_fact_id:{description:"Present when the fact was applied.",type:["string","null"]},apply_id:{type:"string"},evidence:{$ref:"#/$defs/AutomaticFactEvidenceV1"},operation_id:{type:"string"},quarantine_reason:{description:"Present when the fact was quarantined.",type:["string","null"]},recorded_at_micros:{format:"int64",type:"integer"},state:{$ref:"#/$defs/AutomaticFactReceiptStateV1"}},required:["apply_id","state","operation_id","add_fact_request","evidence","recorded_at_micros"],type:"object"},AutomaticFactReceiptViewV1:{additionalProperties:!1,properties:{receipt:{$ref:"#/$defs/AutomaticFactReceiptV1"}},required:["receipt"],type:"object"},AutomationReconcileScope:fG,AutomationSchedulerOwnerReconcileOutcome:{additionalProperties:!1,properties:{graph_db_path:{type:"string"},outcome:{$ref:"#/$defs/AutomationSchedulerReconcileOutcome"},project_id:{type:["string","null"]},scope_prefix:{type:["string","null"]},store_root:{type:"string"}},required:["store_root","graph_db_path","outcome"],type:"object"},AutomationSchedulerReconcileOutcome:{description:"What reconciling one automation scheduler did.",enum:["started","running_notified","exiting","finished","retiring","not_configured","lifecycle_inactive","owner_unavailable"],type:"string"},FactCategoryV1:yA,ProfileAutomationReconcileReport:{additionalProperties:!1,description:"Every cached project scheduler of the profile, reconciled.",properties:{cached_owners:{format:"uint",minimum:0,type:"integer"},outcomes:{items:{$ref:"#/$defs/AutomationSchedulerOwnerReconcileOutcome"},type:"array"},scope:{$ref:"#/$defs/AutomationReconcileScope",description:"Always `profile`."},uncached_projects:{$ref:"#/$defs/UncachedProjectReconcileOutcome"}},required:["scope","cached_owners","outcomes","uncached_projects"],type:"object"},ProjectAutomationReconcileReport:{additionalProperties:!1,description:"The served project's scheduler reconcile.",properties:{outcome:{$ref:"#/$defs/AutomationSchedulerReconcileOutcome"},scope:{$ref:"#/$defs/AutomationReconcileScope",description:"Always `project`."}},required:["scope","outcome"],type:"object"},UncachedProjectReconcileOutcome:{description:"A project whose scheduler is not cached reconciles when it next starts.",enum:["deferred_until_project_startup"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AdminProjectCounterV1"},{$ref:"#/$defs/AdminProjectCounterResetV1"},{$ref:"#/$defs/AdminProjectStatusAccountingV1"},{$ref:"#/$defs/AutomaticFactReceiptListV1"},{$ref:"#/$defs/AutomaticFactReceiptViewV1"},{$ref:"#/$defs/ProjectAutomationReconcileReport"},{$ref:"#/$defs/ProfileAutomationReconcileReport"}],description:"One action's result, in the shape the action has always answered.",title:"AdminProjectResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`tracedecay_admin_sync` takes no arguments: it reconciles the served\nproject.",title:"AdminSyncSurfaceRequestV1",type:"object"},{$defs:{AdminSyncAdmissionV1:{description:"The code-index scheduler's admission of the reconcile.",oneOf:[{enum:["queued"],type:"string"},{const:"not_applicable",description:"Code indexing does not apply to this project.",type:"string"}]},AdminSyncReconcileScopeV1:{description:"What the reconcile covers.",enum:["authoritative_project"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{project_root:{type:"string"},reconcile_scope:{$ref:"#/$defs/AdminSyncReconcileScopeV1"},status:{$ref:"#/$defs/AdminSyncAdmissionV1"}},required:["reconcile_scope","status","project_root"],title:"AdminSyncResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{depth:{description:"Maximum dependency traversal depth (default: 5, at most 10).",format:"uint32",minimum:0,type:["integer","null"]},files:{description:"List of changed file paths to analyze.",items:{type:"string"},type:"array"},filter:{description:"Custom glob pattern for test files (default: common test patterns).",type:["string","null"]}},required:["files"],title:"AffectedSurfaceRequestV1",type:"object"},{$defs:{AffectedRankingMetadataV1:{additionalProperties:!1,properties:{distance:{type:"string"},recommended_proximity:{items:{type:"string"},type:"array"},strategy:{type:"string"}},required:["strategy","distance","recommended_proximity"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RankedAffectedTestV1:{additionalProperties:!1,properties:{distance:{format:"uint",minimum:0,type:"integer"},path:{type:"string"},proximity:{type:"string"},rank:{format:"uint",minimum:0,type:"integer"}},required:["path","rank","distance","proximity"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{changed_files:{items:{type:"string"},type:"array"},count:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranked_tests:{items:{$ref:"#/$defs/RankedAffectedTestV1"},type:"array"},ranking_metadata:{$ref:"#/$defs/AffectedRankingMetadataV1"},recommended_tests:{description:"Tests within two dependency hops of a changed file.",items:{type:"string"},type:"array"}},required:["changed_files","count","ranked_tests","recommended_tests","ranking_metadata"],title:"AffectedResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Opaque daemon-minted handle accepted by the first feedback read invocation.",properties:{request_handle:{type:"string"}},required:["request_handle"],title:"FeedbackHandleRequestV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackImpactStateV1:gr,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical affected-tests projection returned by `affected_tests`.",properties:{affected_tests:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},evidence_anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},result_id:{$ref:"#/$defs/FeedbackResultId"},scope:{$ref:"#/$defs/FeedbackScopeV1"},state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},target:{anyOf:[{$ref:"#/$defs/FeedbackTargetV1"},{type:"null"}]}},required:["result_id","cycle_id","scope","affected_tests","evidence_anchors"],title:"CanonicalAffectedTestsProjectionV1",type:"object"},{$defs:{AnalyticsScopeV1:fP,AnalyticsSectionV1:{enum:["tools","hints","facts","automation"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope:{anyOf:[{$ref:"#/$defs/AnalyticsScopeV1"},{type:"null"}],description:'"project" (default) scopes analytics_events to the resolved project;\n"all" reports across every registered project.'},section:{anyOf:[{$ref:"#/$defs/AnalyticsSectionV1"},{type:"null"}],description:"Optional filter to a single section. Omit to return all sections."},window_days:{description:"Lookback window in days for events and automation runs (default: 14,\n1-365).",format:"uint32",maximum:365,minimum:1,type:["integer","null"]}},title:"AnalyticsSurfaceRequestV1",type:"object"},{$defs:{AnalyticsAutomationJobOutcomesV1:{additionalProperties:!1,properties:{failed:{format:"int64",type:"integer"},job:{type:"string"},other:{format:"int64",type:"integer"},skipped:{format:"int64",type:"integer"},succeeded:{format:"int64",type:"integer"}},required:["job","succeeded","failed","skipped","other"],type:"object"},AnalyticsAutomationOutcomesV1:{additionalProperties:!1,description:"`available` is always `true`.",properties:{available:{type:"boolean"},by_job:{items:{$ref:"#/$defs/AnalyticsAutomationJobOutcomesV1"},type:"array"},dashboard_root:{type:"string"},records_considered:{format:"uint",minimum:0,type:"integer"},records_in_window:{format:"uint",minimum:0,type:"integer"},records_truncated:{type:"boolean"}},required:["available","dashboard_root","records_considered","records_in_window","records_truncated","by_job"],type:"object"},AnalyticsAutomationSectionV1:{anyOf:[{$ref:"#/$defs/AnalyticsAutomationOutcomesV1"},{$ref:"#/$defs/AnalyticsLedgerUnavailableV1"},{$ref:"#/$defs/AnalyticsSectionUnavailableV1"}],description:"The automation run outcomes of the resolved project's ledger, or why the\nledger is unavailable."},AnalyticsCanonicalCallNameV1:{additionalProperties:!1,description:"A recorded event name that resolved to a canonical tool under another\nspelling.",properties:{calls:{format:"int64",type:"integer"},canonical_tool_name:{type:"string"},errors:{format:"int64",type:"integer"},event_name:{type:"string"}},required:["event_name","canonical_tool_name","calls","errors"],type:"object"},AnalyticsEventCallNameV1:{additionalProperties:!1,description:"A recorded event name with no advertised canonical tool.",properties:{calls:{format:"int64",type:"integer"},errors:{format:"int64",type:"integer"},event_name:{type:"string"}},required:["event_name","calls","errors"],type:"object"},AnalyticsFactFunnelV1:{additionalProperties:!1,description:"`available` is always `true`.",properties:{available:{type:"boolean"},facts:{format:"uint64",minimum:0,type:"integer"},facts_rated:{format:"uint64",minimum:0,type:"integer"},facts_retrieved:{format:"uint64",minimum:0,type:"integer"},helpful_feedback:{format:"uint64",minimum:0,type:"integer"},project_root:{type:"string"},retrievals:{format:"uint64",minimum:0,type:"integer"},unhelpful_feedback:{format:"uint64",minimum:0,type:"integer"}},required:["available","project_root","facts","retrievals","facts_retrieved","helpful_feedback","unhelpful_feedback","facts_rated"],type:"object"},AnalyticsFactsSectionV1:{anyOf:[{$ref:"#/$defs/AnalyticsFactFunnelV1"},{$ref:"#/$defs/AnalyticsProjectSectionUnavailableV1"},{$ref:"#/$defs/AnalyticsSectionUnavailableV1"}],description:"The fact-store funnel of the resolved project, or why it is unavailable.\n\nThe variants are distinguished by their exact field sets, so each one\ndenies unknown fields and the most specific shape is tried first."},AnalyticsHintCategoryV1:{properties:{category:{type:"string"},emitted:{format:"int64",type:"integer"},followed:{format:"int64",type:"integer"},ignored:{format:"int64",type:"integer"},suppressed:{format:"int64",type:"integer"}},required:["category","emitted","followed","ignored","suppressed"],type:"object"},AnalyticsHintsPayloadV1:{properties:{available:{type:"boolean"},by_category:{items:{$ref:"#/$defs/AnalyticsHintCategoryV1"},type:"array"},error:{default:null,type:["string","null"]},source:{type:"string"}},required:["available","source","by_category"],type:"object"},AnalyticsLedgerUnavailableV1:{additionalProperties:!1,description:"The ledger exists but failed to read. `available` is always `false`.",properties:{available:{type:"boolean"},dashboard_root:{type:"string"},reason:{type:"string"}},required:["available","reason","dashboard_root"],type:"object"},AnalyticsModeReadModelV1:fk,AnalyticsModeV1:fw,AnalyticsProjectSectionUnavailableV1:{additionalProperties:!1,description:"A project-scoped section whose store failed to read. `available` is\nalways `false`.",properties:{available:{type:"boolean"},project_root:{type:"string"},reason:{type:"string"}},required:["available","reason","project_root"],type:"object"},AnalyticsReportStatusV1:{description:"The settled status of an analytics report.",enum:["ok"],type:"string"},AnalyticsScopeV1:fP,AnalyticsSectionUnavailableV1:{additionalProperties:!1,description:"A section the report could not read. `available` is always `false`.",properties:{available:{type:"boolean"},reason:{type:"string"}},required:["available","reason"],type:"object"},AnalyticsTierCountsV1:{additionalProperties:!1,properties:{calls:{format:"int64",type:"integer"},errors:{format:"int64",type:"integer"},tier:{type:"string"}},required:["tier","calls","errors"],type:"object"},AnalyticsToolsSectionV1:{additionalProperties:!1,properties:{aliased_call_names:{items:{$ref:"#/$defs/AnalyticsCanonicalCallNameV1"},type:"array"},available:{type:"boolean"},available_defined_tool_count:{format:"uint",minimum:0,type:"integer"},bound_internal_call_names:{items:{$ref:"#/$defs/AnalyticsEventCallNameV1"},type:"array"},called_available_defined_tool_count:{format:"uint",minimum:0,type:"integer"},raw_distinct_event_name_count:{format:"uint",minimum:0,type:"integer"},tiers:{items:{$ref:"#/$defs/AnalyticsTierCountsV1"},type:"array"},top_tools:{items:{$ref:"#/$defs/AnalyticsTopToolV1"},type:"array"},unknown_or_retired_call_names:{items:{$ref:"#/$defs/AnalyticsEventCallNameV1"},type:"array"},zero_call_available_defined_tools:{$ref:"#/$defs/AnalyticsZeroCallToolsV1"}},required:["available","tiers","top_tools","raw_distinct_event_name_count","called_available_defined_tool_count","available_defined_tool_count","aliased_call_names","bound_internal_call_names","unknown_or_retired_call_names","zero_call_available_defined_tools"],type:"object"},AnalyticsTopToolV1:{additionalProperties:!1,properties:{calls:{format:"int64",type:"integer"},errors:{format:"int64",type:"integer"},tier:{type:"string"},tool_name:{type:"string"}},required:["tool_name","tier","calls","errors"],type:"object"},AnalyticsZeroCallToolsV1:{additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},sample:{items:{type:"string"},type:"array"},sample_truncated:{type:"boolean"}},required:["count","sample","sample_truncated"],type:"object"},ComparisonDispositionV1:hI,CostsReadModelV1:yl,CoverageStateV1:yf,LatencyDistributionReadModelV1:gJ,MetricCalibrationV1:_h,MetricCohortV1:_y,MetricCoverageV1:_g,MetricEvidenceClassV1:__,MetricProvenanceV1:_v,MetricSourceV1:_b,MetricTemporalV1:_$,MetricUncertaintyV1:_S,MetricValueV1:_k,ObservabilityHorizonV1:_W,ObservatoryReadModelV1:_N,PerformanceComparisonReadModelV1:_H,ProviderLatencyReadModelV1:vn,RejectedArgumentAnalyticsV1:vh,RejectedArgumentErrorClassV1:vy,RejectedArgumentGroupV1:vg,RejectedArgumentNameV1:v_,RejectedArgumentSurfaceV1:vv},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{automation:{anyOf:[{$ref:"#/$defs/AnalyticsAutomationSectionV1"},{type:"null"}]},costs:{anyOf:[{$ref:"#/$defs/CostsReadModelV1"},{type:"null"}],description:"Present only when no section filter was requested."},event_count:{format:"int64",type:"integer"},event_count_truncated:{type:"boolean"},facts:{anyOf:[{$ref:"#/$defs/AnalyticsFactsSectionV1"},{type:"null"}]},hints:{anyOf:[{$ref:"#/$defs/AnalyticsHintsPayloadV1"},{type:"null"}]},observatory:{anyOf:[{$ref:"#/$defs/ObservatoryReadModelV1"},{type:"null"}],description:"Present only when no section filter was requested."},project_id:{description:'The canonical analytics project key; `None` for `scope: "all"`.',type:["string","null"]},project_root:{type:"string"},scope:{$ref:"#/$defs/AnalyticsScopeV1"},since:{format:"int64",type:"integer"},status:{$ref:"#/$defs/AnalyticsReportStatusV1"},tools:{anyOf:[{$ref:"#/$defs/AnalyticsToolsSectionV1"},{type:"null"}]},window_days:{format:"uint32",minimum:0,type:"integer"}},required:["status","scope","project_root","window_days","since","event_count","event_count_truncated"],title:"AnalyticsResultV1",type:"object"},{$defs:{ManifestDigest:_l,NativeIntegrationApprovalId:_V,NativeIntegrationPreviewId:_I,NativeIntegrationTransactionId:_T},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact one-use apply request.\n\nApply accepts only an unexpired preview identity/digest plus a one-use\ncontent-bound approval. Arbitrary Git arguments, caller-supplied paths,\nSHAs, patches, commit lists, messages, environment, or config are\nunrepresentable.",properties:{approval_digest:{$ref:"#/$defs/ManifestDigest"},approval_id:{$ref:"#/$defs/NativeIntegrationApprovalId"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["preview_id","preview_digest","approval_id","approval_digest","transaction_id"],title:"NativeIntegrationApplySurfaceRequest",type:"object"},{$defs:{ActorId:fb,BranchStackEdgeV1:f3,BranchStackId:f9,BranchStackNodeV1:f5,BranchStackRevisionId:f8,BranchStackRevisionV1:f7,BranchStackSourceV1:he,CapabilityId:hl,CodeGenerationId:hy,CommitId:hq,ContentDigest:hD,GitOidV1:gq,GitOperationStateV1:gI,ManifestDigest:_l,MechanicalIntegrationModeV1:_p,NativeIntegrationAnalysisAnchorV1:{additionalProperties:!1,description:"Source-local anchor for a semantic conflict finding.",properties:{generation_id:{$ref:"#/$defs/CodeGenerationId"},logical_path:{type:"string"},source_span:{$ref:"#/$defs/SourceSpan"}},required:["generation_id","logical_path","source_span"],type:"object"},NativeIntegrationAnalysisCoverageV1:{description:"Completeness of one independently evaluated semantic evidence lane.",enum:["complete","partial","unsupported"],type:"string"},NativeIntegrationAnalysisGapV1:{description:"Why one semantic evidence lane cannot authorize integration.",enum:["parser_failure","unresolved_required_edge","withheld_source","stale_evidence","unsupported_language","dynamic_schema","unbound_migration_order","capacity_unavailable","authority_unavailable"],type:"string"},NativeIntegrationAnalysisLaneV1:{additionalProperties:!1,description:"Coverage and exact gaps for one independently evaluated analysis lane.",properties:{coverage:{$ref:"#/$defs/NativeIntegrationAnalysisCoverageV1"},gaps:{items:{$ref:"#/$defs/NativeIntegrationAnalysisGapV1"},type:"array"}},required:["coverage","gaps"],type:"object"},NativeIntegrationAnalysisReportV1:{additionalProperties:!1,description:"Daemon-produced semantic evidence for one exact native candidate tree.",properties:{analyzer_revision:{type:"string"},candidate:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},conflicts:{items:{$ref:"#/$defs/NativeIntegrationSemanticConflictV1"},type:"array"},destination:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},digest:{$ref:"#/$defs/ManifestDigest"},graph:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"},merge_base:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},migrations:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"},schema:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"},source:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},tests:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"}},required:["merge_base","source","destination","candidate","graph","tests","schema","migrations","conflicts","analyzer_revision","digest"],type:"object"},NativeIntegrationApprovalId:_V,NativeIntegrationDirectionV1:_R,NativeIntegrationGenerationBindingV1:{additionalProperties:!1,description:"One immutable code-generation binding used by native integration analysis.",properties:{content_identity:{$ref:"#/$defs/ContentDigest"},generation_id:{$ref:"#/$defs/CodeGenerationId"},project_id:{$ref:"#/$defs/ProjectId"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository_id:{$ref:"#/$defs/RepositoryId"},seal_digest:{$ref:"#/$defs/ManifestDigest"},snapshot_digest:{$ref:"#/$defs/ManifestDigest"},source_revision:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},source_tree:{$ref:"#/$defs/GitOidV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["generation_id","project_id","repository_id","snapshot_digest","content_identity","source_tree","seal_digest"],type:"object"},NativeIntegrationPhaseV1:{description:"Durable transaction phase. `RefCommitStarted` is the cancellation boundary.",enum:["prepared","candidate_verified","ref_commit_started","final_state_verification","terminal"],type:"string"},NativeIntegrationPreviewDispositionV1:_q,NativeIntegrationPreviewId:_I,NativeIntegrationSealedStackSnapshotV1:_x,NativeIntegrationSelectionBindingV1:_j,NativeIntegrationSemanticConflictKindV1:{description:"Static conflict class produced from canonical generation evidence.",enum:["divergent_symbol","signature_dependent","test_write_interaction","divergent_schema","migration_order"],type:"string"},NativeIntegrationSemanticConflictV1:{additionalProperties:!1,description:"One deterministic conflict finding with source evidence from both branches.",properties:{destination:{$ref:"#/$defs/NativeIntegrationAnalysisAnchorV1"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},kind:{$ref:"#/$defs/NativeIntegrationSemanticConflictKindV1"},source:{$ref:"#/$defs/NativeIntegrationAnalysisAnchorV1"}},required:["kind","source","destination","evidence_digest"],type:"object"},NativeIntegrationSnapshotProjectionV1:{additionalProperties:!1,description:"Bounded projection of one frozen selection.",properties:{destination_ref:{$ref:"#/$defs/RefId"},frozen_at:{$ref:"#/$defs/UtcMicros"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},selection_digest:{$ref:"#/$defs/ManifestDigest"},source_ref:{$ref:"#/$defs/RefId"}},required:["selection_digest","project_id","repository_id","source_ref","destination_ref","inventory_epoch","frozen_at"],type:"object"},NativeIntegrationStatusProjectionV1:{additionalProperties:!1,description:"Bounded projection of one durable transaction status.",properties:{cancellation_requested:{type:"boolean"},destination_ref:{$ref:"#/$defs/RefId"},phase:{$ref:"#/$defs/NativeIntegrationPhaseV1"},phase_revision:{format:"uint64",minimum:0,type:"integer"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},repository_id:{$ref:"#/$defs/RepositoryId"},terminal_outcome:{anyOf:[{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"},{type:"null"}]},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["transaction_id","preview_id","preview_digest","repository_id","destination_ref","phase","phase_revision","cancellation_requested","updated_at"],type:"object"},NativeIntegrationSurfaceUnavailableV1:{description:"Why a native-integration operation produced no advancing state.\n\nEvery variant is read-only and truthful. None of them authorizes apply, and\na denied or absent target is reported indistinguishably from an unavailable\nauthority so no identity, path, count, or topology leaks.",oneOf:[{enum:["partial","stale","denied","reset_required","durability_uncertain","cancelled","approval_conflict","transaction_conflict","recovery_required","needs_inspection","unknown_transaction"],type:"string"},{const:"authority_unmounted",description:"No native-integration runtime authority is mounted for this daemon.",type:"string"}]},NativeIntegrationTerminalOutcomeV1:_C,NativeIntegrationTransactionId:_T,NativeIntegrationUnavailabilityV1:_O,NativeWorktreeSurfaceResultV1:{oneOf:[{oneOf:[{properties:{coverage:{$ref:"#/$defs/WorktreeCoverageV1"},digest:{$ref:"#/$defs/ManifestDigest"},entries:{items:{$ref:"#/$defs/WorktreeInventoryEntryV1"},type:"array"},epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},observed_at:{$ref:"#/$defs/UtcMicros"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},state:{const:"snapshot",type:"string"}},required:["state","scope_set_id","scope_set_revision","scope_set_digest","snapshot_id","epoch","entries","coverage","observed_at","digest"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}],properties:{operation:{const:"inventory",type:"string"}},required:["operation"],type:"object"},{oneOf:[{properties:{clean:{$ref:"#/$defs/WorktreeObservationV1",description:"Whether Git status contains no tracked or untracked changes."},head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},holder:{$ref:"#/$defs/WorktreeObservationV1"},inspection_digest:{$ref:"#/$defs/ManifestDigest"},kind:{anyOf:[{$ref:"#/$defs/WorktreeKindV1"},{type:"null"}]},locked:{$ref:"#/$defs/WorktreeObservationV1"},observed_at:{$ref:"#/$defs/UtcMicros"},operation_state:{anyOf:[{$ref:"#/$defs/GitOperationStateV1"},{type:"null"}]},presence:{$ref:"#/$defs/WorktreePresenceV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},state:{const:"inspection",type:"string"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"},unique_data:{$ref:"#/$defs/WorktreeObservationV1"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["state","target","presence","worktree_id","clean","locked","holder","unique_data","observed_at","inspection_digest"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"foreign",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}],properties:{operation:{const:"inspection",type:"string"}},required:["operation"],type:"object"},{oneOf:[{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},confirmed_at:{$ref:"#/$defs/UtcMicros"},inspection_digest:{$ref:"#/$defs/ManifestDigest"},state:{const:"confirmed",type:"string"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["state","target","inspection_digest","confirmation_digest","confirmed_at"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"needs_inspection",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}],properties:{operation:{const:"confirmation",type:"string"}},required:["operation"],type:"object"},{$ref:"#/$defs/WorktreeCleanupRemovalV1",properties:{operation:{const:"removal",type:"string"}},required:["operation"],type:"object"},{$ref:"#/$defs/WorktreeCleanupReconciliationV1",properties:{operation:{const:"reconciliation",type:"string"}},required:["operation"],type:"object"}]},NativeWorktreeTargetV1:_E,ProjectId:_4,RefId:vm,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,SourceSpan:b$,StackNodeId:bw,UtcMicros:bZ,WorktreeCleanupReconciliationV1:{oneOf:[{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"removed",type:"string"}},required:["state","confirmation_digest","observed_at"],type:"object"},{properties:{state:{const:"still_present",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"durability_uncertain",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}]},WorktreeCleanupRemovalV1:{oneOf:[{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"removed",type:"string"}},required:["state","confirmation_digest","observed_at"],type:"object"},{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"already_removed",type:"string"}},required:["state","confirmation_digest","observed_at"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"durability_uncertain",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}]},WorktreeCoverageV1:{enum:["complete","partial"],type:"string"},WorktreeId:SB,WorktreeInventoryEntryV1:{additionalProperties:!1,properties:{clean:{$ref:"#/$defs/WorktreeObservationV1",description:"Whether Git status contains no tracked or untracked changes."},evidence_digest:{$ref:"#/$defs/ManifestDigest"},head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},holder:{$ref:"#/$defs/WorktreeObservationV1"},kind:{anyOf:[{$ref:"#/$defs/WorktreeKindV1"},{type:"null"}]},locked:{$ref:"#/$defs/WorktreeObservationV1"},observed_at:{$ref:"#/$defs/UtcMicros"},operation:{anyOf:[{$ref:"#/$defs/GitOperationStateV1"},{type:"null"}]},presence:{$ref:"#/$defs/WorktreePresenceV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},target:{$ref:"#/$defs/NativeWorktreeTargetV1"},unique_data:{$ref:"#/$defs/WorktreeObservationV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["target","presence","clean","locked","holder","unique_data","observed_at","evidence_digest"],type:"object"},WorktreeInventoryEpoch:SK,WorktreeInventorySnapshotId:SJ,WorktreeKindV1:{description:"Native Git worktree kind visible to an authorized caller.",enum:["main","linked","bare"],type:"string"},WorktreeObservationV1:{enum:["yes","no","unknown"],type:"string"},WorktreePresenceV1:{description:"Presence is intentionally not a bool: stale, unavailable and foreign are\npolicy-safe states with different reconciliation consequences.",enum:["present","stale","unavailable","foreign"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One typed result for every native-integration surface operation.",oneOf:[{additionalProperties:!1,description:"Frozen selection summary plus the exact sealed proof preflight accepts.",properties:{outcome:{const:"stack_snapshot",type:"string"},sealed_snapshot:{$ref:"#/$defs/NativeIntegrationSealedStackSnapshotV1"},selection:{$ref:"#/$defs/NativeIntegrationSnapshotProjectionV1"}},required:["outcome","selection","sealed_snapshot"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one immutable preview.\n\nCandidate trees, conflict bodies, and ordered commit objects stay behind the\npreview digest: the surface reports identity, classification, and expiry so\na caller can approve exactly this preview and nothing else.",properties:{analysis:{anyOf:[{$ref:"#/$defs/NativeIntegrationAnalysisReportV1"},{type:"null"}]},created_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/NativeIntegrationPreviewDispositionV1"},expires_at:{$ref:"#/$defs/UtcMicros"},ordered_commit_count:{format:"uint32",minimum:0,type:"integer"},outcome:{const:"preview",type:"string"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},selection:{$ref:"#/$defs/NativeIntegrationSnapshotProjectionV1"}},required:["outcome","preview_id","preview_digest","selection","disposition","ordered_commit_count","created_at","expires_at"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one issued one-use approval.\n\nThe approval digest is the caller's proof-of-issuance handle for apply;\nthe preview binding and expiry are audit metadata. No preview body,\ncandidate tree, or commit content crosses this boundary.",properties:{approval_digest:{$ref:"#/$defs/ManifestDigest"},approval_id:{$ref:"#/$defs/NativeIntegrationApprovalId"},capability:{$ref:"#/$defs/CapabilityId"},expires_at:{$ref:"#/$defs/UtcMicros"},issued_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"approval",type:"string"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},principal:{$ref:"#/$defs/ActorId"},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId",description:"Daemon-minted identity consumed verbatim by apply, status, and cancel."}},required:["outcome","transaction_id","approval_id","preview_id","preview_digest","principal","capability","issued_at","expires_at","approval_digest"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one durable terminal receipt.\n\nThe receipt digest and final ref/tree identity are audit metadata; no patch,\nworktree body, or source content crosses this boundary.",properties:{completed_at:{$ref:"#/$defs/UtcMicros"},final_ref_tip:{type:"string"},final_tree:{type:"string"},outcome:{const:"receipt",type:"string"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},status:{$ref:"#/$defs/NativeIntegrationStatusProjectionV1"},terminal_outcome:{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"}},required:["outcome","status","terminal_outcome","final_ref_tip","final_tree","completed_at","receipt_digest"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one durable transaction status.",properties:{cancellation_requested:{type:"boolean"},destination_ref:{$ref:"#/$defs/RefId"},outcome:{const:"status",type:"string"},phase:{$ref:"#/$defs/NativeIntegrationPhaseV1"},phase_revision:{format:"uint64",minimum:0,type:"integer"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},repository_id:{$ref:"#/$defs/RepositoryId"},terminal_outcome:{anyOf:[{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"},{type:"null"}]},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["outcome","transaction_id","preview_id","preview_digest","repository_id","destination_ref","phase","phase_revision","cancellation_requested","updated_at"],type:"object"},{description:"Cancellation disposition. After the native commit point the committed\nreceipt is returned instead of a cancellation claim.",oneOf:[{enum:["cancellation_requested","commit_point_passed"],type:"string"},{properties:{already_terminal:{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"}},required:["already_terminal"],type:"object"}],properties:{outcome:{const:"cancellation",type:"string"}},required:["outcome"],type:"object"},{$ref:"#/$defs/NativeWorktreeSurfaceResultV1",properties:{outcome:{const:"worktree",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},reason:{$ref:"#/$defs/NativeIntegrationSurfaceUnavailableV1"}},required:["outcome","reason"],type:"object"}],title:"NativeIntegrationSurfaceResultV1"},{$defs:{ManifestDigest:_l,NativeIntegrationPreviewId:_I},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact approval-issuance request (the owner-decided sixth operation).\n\nThe caller names one unexpired preview by exact identity *and* digest;\napproving an identity without its content digest is unrepresentable. The\ndaemon mints the one-use approval bound to the requesting principal, the\napply capability, the current grant lineage, and a bounded expiry, none\nof which the caller can choose.",properties:{preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"}},required:["preview_id","preview_digest"],title:"NativeIntegrationApproveSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_ast_grep_rewrite`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},path:{type:"string"},pattern:{type:"string"},rewrite:{type:"string"},verify:{default:!1,type:"boolean"}},required:["path","pattern","rewrite"],title:"AstGrepRewriteSurfaceRequestV1",type:"object"},{$defs:{ActorId:fb,AstGrepResult:{description:"Result of an ast-grep rewrite operation.",properties:{diff:{description:"Bounded preview of the would-be change. Populated only on a successful\ndry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: the rewrite was resolved but nothing was\nwritten.",type:"boolean"},file_path:{type:"string"},message:{type:"string"},pattern:{type:"string"},rewrite:{type:"string"},success:{type:"boolean"}},required:["success","file_path","pattern","rewrite","message"],type:"object"},AuthorityReceipt:{additionalProperties:!1,description:"Proof that this request crossed the current authorization boundary.",properties:{authorized_scope_digest:{$ref:"#/$defs/ManifestDigest"},disclosure:{$ref:"#/$defs/DisclosureClass"},grant_digest:{$ref:"#/$defs/ManifestDigest"},grant_id:{type:"string"},grant_revision:{format:"uint64",minimum:0,type:"integer"},policy:{$ref:"#/$defs/PolicyDecisionRef"},revalidated_at:{$ref:"#/$defs/UtcMicros"}},required:["grant_id","grant_revision","grant_digest","authorized_scope_digest","disclosure","policy","revalidated_at"],type:"object"},CancellationObservation:hn,CancellationStage:ha,ComponentVersion:hC,Deadline:yv,DisclosureClass:{description:"Disclosure ceiling carried by an immutable grant and revalidated at sinks.",enum:["metadata","evidence","sensitive"],type:"string"},EditResult:{description:"Result of a single string replacement edit.",properties:{diff:{description:"Bounded preview diff of the would-be change. Populated only on a\nsuccessful dry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: validation, spans, and the resulting\ncontent were all computed, but nothing was written to disk.",type:"boolean"},file_path:{type:"string"},matched_str:{type:"string"},message:{type:"string"},new_str:{type:"string"},replaced_span:{description:"The exact source text that was replaced. For `replace_symbol` this is\nthe item's full span, including any leading doc-comment / attribute\nblock, so callers can recover its docs/attrs if the replacement\ndropped them; for `str_replace` it is the matched `old_str` text.\n`None` only on a failed edit, where nothing was resolved to replace.",type:["string","null"]},success:{type:"boolean"}},required:["success","file_path","matched_str","new_str","message"],type:"object"},EffectClass:yR,EffectReceipt:yq,EffectResult:{additionalProperties:!1,description:"Result of an admitted effect. `EffectUnknown` remains a receipt state and\ncannot be remapped into a pre-admission problem.",properties:{authority:{$ref:"#/$defs/AuthorityReceipt"},effect_class:{$ref:"#/$defs/EffectClass"},effect_id:{type:"string"},execution:{$ref:"#/$defs/OperationReceipt"},expected_state:{$ref:"#/$defs/ManifestDigest"},idempotency_key:{type:"string"},payload:{anyOf:[{$ref:"#/$defs/SourceEditDurableEffectPayloadV1"},{type:"null"}]},receipt:{$ref:"#/$defs/EffectReceipt"},reconciliation:{$ref:"#/$defs/ReconciliationState"}},required:["effect_id","effect_class","idempotency_key","authority","expected_state","execution","reconciliation","receipt"],type:"object"},EffectTermination:yI,InsertResult:{description:"Result of an insert-at operation.",properties:{anchor_line:{format:"uint32",minimum:0,type:"integer"},before:{type:"boolean"},content:{type:"string"},diff:{description:"Bounded preview diff of the would-be change. Populated only on a\nsuccessful dry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: the insertion point was resolved and the\nresulting content computed, but nothing was written to disk.",type:"boolean"},file_path:{type:"string"},message:{type:"string"},success:{type:"boolean"}},required:["success","file_path","anchor_line","content","before","message"],type:"object"},ManifestDigest:_l,MoveHint:{description:"One evidence-based, actionable finding produced by the `move_symbol` impact\nengine. Each hint points at a concrete file/line and carries a suggestion\nthe caller (or a follow-up refactor) can act on. Hints are derived from graph\nedges (callers/callees) and parse-level facts (identifiers, `use` lines,\nmodule declarations), never speculative noise.",properties:{detail:{description:"Human-readable description of what the move breaks or affects.",type:"string"},file:{description:"File the finding concerns (the caller's file, the destination, or the\nsource), project-relative.",type:"string"},kind:{description:"Taxonomy tag: `caller_reference`, `dependency_broken`, `import_needed`,\n`visibility_required`, `collision`, `module_missing`, `cycle_risk`,\n`orphaned_import`, or `cfg_context`.",type:"string"},line:{description:"1-based line the finding concerns, when a specific site is known.",format:"uint32",minimum:0,type:["integer","null"]},suggestion:{description:"The exact change to make (e.g. a `use` line to add, a path to rewrite, a\nvisibility to escalate). `None` when no single mechanical fix applies.",type:["string","null"]}},required:["kind","file","detail"],type:"object"},MoveResult:{description:"Result of a `move_symbol` operation: the moved span, a dry-run diff of the\nsource + destination files, and the centerpiece, the impact report of\neverything the move breaks or that needs attention.",properties:{applied_imports:{description:"`use` lines auto-inserted at the destination because the moved body's\ndependency on them was unambiguous. Reported so the caller sees exactly\nwhat the move added.",items:{type:"string"},type:"array"},dest_file:{type:"string"},diff:{description:"Combined preview diff of the source (removal) and destination (insertion)\nfiles. Populated on a successful dry run; `None` for real moves.",type:["string","null"]},dry_run:{description:"True when this was a dry run: spans, the destination shape, and the\nimpact report were all computed, but nothing was written to disk.",type:"boolean"},impact:{description:"The impact report: every actionable finding. Empty on a truly clean\nmove.",items:{$ref:"#/$defs/MoveHint"},type:"array"},message:{type:"string"},moved_span:{description:"The exact source span that was moved, including its leading\ndoc-comment / attribute block. `None` on failure.",type:["string","null"]},source_file:{type:"string"},success:{type:"boolean"},symbol:{description:"The resolved symbol that was (or would be) moved, `name (kind)`.",type:"string"}},required:["success","symbol","source_file","dest_file","message"],type:"object"},MultiEditResult:{description:"Result of a multi-string replacement edit.",properties:{applied_count:{format:"uint",minimum:0,type:"integer"},diff:{description:"Bounded preview diff of the would-be change. Populated only on a\nsuccessful dry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: replacements were validated and the\nresulting content computed, but nothing was written to disk.",type:"boolean"},file_path:{type:"string"},message:{type:"string"},success:{type:"boolean"}},required:["success","file_path","applied_count","message"],type:"object"},OperationBudgetUsage:_D,OperationReceipt:_F,OperationTermination:_L,PolicyDecisionRef:{additionalProperties:!1,description:"A policy decision pinned into a receipt or provider identity.",properties:{decision_id:{type:"string"},digest:{$ref:"#/$defs/ManifestDigest"},evaluator_revision:{$ref:"#/$defs/ComponentVersion"},revision:{format:"uint64",minimum:0,type:"integer"}},required:["decision_id","revision","digest","evaluator_revision"],type:"object"},ProjectId:_4,ReconciliationState:{description:"Reconciliation state retained after an admitted effect.",enum:["pending","reconciled","failed"],type:"string"},RefId:vm,RenameDispositionCountsV1:{additionalProperties:!1,properties:{blocked:{format:"uint",minimum:0,type:"integer"},changed:{format:"uint",minimum:0,type:"integer"},skipped:{format:"uint",minimum:0,type:"integer"},unchanged:{format:"uint",minimum:0,type:"integer"}},required:["changed","unchanged","skipped","blocked"],type:"object"},RenameFileEditV1:{additionalProperties:!1,description:"One file a rename changed (or would change), with the exact bound-site count.",properties:{file:{type:"string"},replaced_count:{format:"uint",minimum:0,type:"integer"}},required:["file","replaced_count"],type:"object"},RenameHazardKindV1:{enum:["invalid_identifier","stale_evidence","ambiguous_symbol","namespace_collision","changed_resolution","shadowing","unsupported_syntax","macro_expansion","generated_source","overlapping_site"],type:"string"},RenameHazardV1:{additionalProperties:!1,properties:{blocking:{type:"boolean"},kind:{$ref:"#/$defs/RenameHazardKindV1"},message:{type:"string"},site_id:{type:["string","null"]}},required:["kind","blocking","message"],type:"object"},RenameImpactV1:{additionalProperties:!1,properties:{affected_files:{items:{type:"string"},type:"array"},affected_tests:{items:{type:"string"},type:"array"},callers:{items:{type:"string"},type:"array"},reexports:{items:{type:"string"},type:"array"}},required:["callers","reexports","affected_files","affected_tests"],type:"object"},RenameProtectedValueCategoryV1:{enum:["wire_value","serialized_name","sql_identifier","persisted_name","schema_epoch","hash_domain","protocol_name","contract_snapshot","string_literal","byte_literal"],type:"string"},RenameProtectedValueV1:{additionalProperties:!1,description:"A byte-exact stable value deliberately preserved by the rename.",properties:{category:{$ref:"#/$defs/RenameProtectedValueCategoryV1"},end_byte:{format:"uint64",minimum:0,type:"integer"},exact_bytes:{type:"string"},file:{type:"string"},site_id:{type:"string"},start_byte:{format:"uint64",minimum:0,type:"integer"}},required:["site_id","file","start_byte","end_byte","category","exact_bytes"],type:"object"},RenameResult:{description:"The same typed payload is serialized by application, CLI, and MCP paths.",properties:{diff:{type:["string","null"]},dispositions:{$ref:"#/$defs/RenameDispositionCountsV1"},dry_run:{type:"boolean"},files:{items:{$ref:"#/$defs/RenameFileEditV1"},type:"array"},graph_revision:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest of the admitted generation, exact target, same-name symbols,\nand graph edges used to classify bound and protected sites."},hazards:{items:{$ref:"#/$defs/RenameHazardV1"},type:"array"},impact:{$ref:"#/$defs/RenameImpactV1"},message:{type:"string"},new_name:{type:"string"},old_name:{type:"string"},plan_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest of the complete typed site/hazard/protected-value manifest."},preview_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Exact candidate-state digest that apply must echo as `expected_state`."},preview_id:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest-addressed identity of the bound symbol plus proposed name."},protected_values:{items:{$ref:"#/$defs/RenameProtectedValueV1"},type:"array"},reference_count:{format:"uint",minimum:0,type:"integer"},repository_revision:{default:null,description:"Current Git HEAD when the worktree has one; dirty bytes remain bound by\n`preview_digest` independently of this revision.",type:["string","null"]},sites:{items:{$ref:"#/$defs/RenameSiteV1"},type:"array"},success:{type:"boolean"},symbol:{description:"Qualified name of the renamed symbol at plan time.",type:"string"}},required:["success","symbol","old_name","new_name","reference_count","dispositions","impact","message"],type:"object"},RenameSiteDispositionV1:{enum:["changed","unchanged","skipped","blocked"],type:"string"},RenameSiteKindV1:{enum:["declaration","import","reexport","qualified_path","unqualified_path","annotation","generic_argument","constructor","pattern","trait_declaration","trait_implementation","resolved_call","inherent_method","enum_variant","test","example","documentation","protected_value","unresolved_text"],type:"string"},RenameSiteV1:{additionalProperties:!1,description:"One exact old-name occurrence and the rename planner's disposition.",properties:{disposition:{$ref:"#/$defs/RenameSiteDispositionV1"},end_byte:{format:"uint64",minimum:0,type:"integer"},expected_bytes:{type:"string"},file:{type:"string"},kind:{$ref:"#/$defs/RenameSiteKindV1"},line:{format:"uint32",minimum:0,type:"integer"},reason:{type:"string"},replacement_bytes:{type:"string"},site_id:{type:"string"},source_node_id:{description:"Canonical source `SymbolOccurrenceId` that attested this site.",type:["string","null"]},start_byte:{format:"uint64",minimum:0,type:"integer"}},required:["site_id","kind","disposition","file","line","start_byte","end_byte","expected_bytes","replacement_bytes","reason"],type:"object"},RepositoryId:vb,ResolvedScope:vw,RetrievalAnchorId:vI,SourceEditCancelledResultV1:{description:"Terminal payload when cancellation is observed before an edit commits.",properties:{cancelled:{type:"boolean"},message:{type:"string"},success:{type:"boolean"}},required:["success","cancelled","message"],type:"object"},SourceEditDiagnosticV1:{properties:{code:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},message:{type:"string"}},required:["line","code","message"],type:"object"},SourceEditDurableEffectPayloadV1:{additionalProperties:!1,description:"Body-free source-edit evidence retained inside durable effect receipts.\n\nThis payload intentionally contains no caller-supplied edit text, preview\ndiff, moved span, import, diagnostic, or impact detail. It is also the\nexact replay outcome, so replay never fabricates a live edit body.",properties:{before:{type:["boolean","null"]},cancelled:{type:"boolean"},change_count:{format:"uint",minimum:0,type:["integer","null"]},durable_metadata_only:{type:"boolean"},effect_unknown:{type:"boolean"},failed:{type:"boolean"},files:{items:{type:"string"},type:"array"},finding_count:{format:"uint",minimum:0,type:["integer","null"]},import_count:{format:"uint",minimum:0,type:["integer","null"]},line:{format:"uint32",minimum:0,type:["integer","null"]},message:{type:"string"},observed_state:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Exact candidate-file observation from an inspection attempt."},operation:{$ref:"#/$defs/UseCaseId"},reconciled:{type:"boolean"},success:{type:"boolean"},timed_out:{type:"boolean"}},required:["operation","success","files","failed","cancelled","timed_out","effect_unknown","reconciled","durable_metadata_only","message"],type:"object"},SourceEditEffectUnknownResultV1:{description:"Terminal payload when publication may have occurred and inspection is required.",properties:{effect_unknown:{type:"boolean"},message:{type:"string"},success:{type:"boolean"}},required:["success","effect_unknown","message"],type:"object"},SourceEditFailedResultV1:{description:"Terminal payload when an edit is refused before it can publish an effect.",properties:{failed:{type:"boolean"},message:{type:"string"},success:{type:"boolean"}},required:["success","failed","message"],type:"object"},SourceEditReconciledResultV1:{description:"Terminal payload returned by explicit reconciliation.",properties:{message:{type:"string"},reconciled:{type:"boolean"},success:{type:"boolean"}},required:["success","reconciled","message"],type:"object"},SourceEditTimedOutResultV1:{description:"Terminal payload when an edit deadline expires before commit.",properties:{message:{type:"string"},success:{type:"boolean"},timed_out:{type:"boolean"}},required:["success","timed_out","message"],type:"object"},SourceEditVerificationStateV1:{enum:["clean","errors","unavailable","failed","cancelled"],type:"string"},SourceEditVerificationV1:{properties:{error_count:{format:"uint",minimum:0,type:"integer"},first_errors:{items:{$ref:"#/$defs/SourceEditDiagnosticV1"},type:"array"},message:{type:["string","null"]},state:{$ref:"#/$defs/SourceEditVerificationStateV1"},verdict:{type:"string"},warning_count:{format:"uint",minimum:0,type:"integer"}},required:["state","verdict","error_count","warning_count","first_errors"],type:"object"},UseCaseId:bK,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/SourceEditDurableEffectPayloadV1"},{$ref:"#/$defs/EditResult"},{$ref:"#/$defs/MultiEditResult"},{$ref:"#/$defs/InsertResult"},{$ref:"#/$defs/AstGrepResult"},{$ref:"#/$defs/MoveResult"},{$ref:"#/$defs/RenameResult"},{$ref:"#/$defs/SourceEditFailedResultV1"},{$ref:"#/$defs/SourceEditCancelledResultV1"},{$ref:"#/$defs/SourceEditTimedOutResultV1"},{$ref:"#/$defs/SourceEditEffectUnknownResultV1"},{$ref:"#/$defs/SourceEditReconciledResultV1"}],description:"Canonical result returned directly by every source-edit use case.",properties:{effect:{anyOf:[{$ref:"#/$defs/EffectResult"},{type:"null"}]},expected_state:{$ref:"#/$defs/ManifestDigest"},predicted_state:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},replayed:{type:"boolean"},verification:{anyOf:[{$ref:"#/$defs/SourceEditVerificationV1"},{type:"null"}]}},required:["expected_state","replayed"],title:"SourceEditSurfaceResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{lang:{description:"Optional language key to force (e.g. 'rust', 'typescript', 'python').\nOmit to auto-detect each file from its extension.",type:["string","null"]},max_results:{description:"Maximum number of matches to return (default: 50, max: 200).",format:"uint32",minimum:0,type:["integer","null"]},path_glob:{description:"Optional glob restricting which files are searched, matched against\nproject-relative paths (e.g. 'src/**/*.rs').",type:["string","null"]},pattern:{description:"ast-grep structural pattern (SGPattern syntax), e.g.\n'reserve_stock($$$)' or 'Result<$T, $E>'.",type:"string"}},required:["pattern"],title:"AstGrepSearchSurfaceRequestV1",type:"object"},{$defs:{AstGrepSearchMatchV1:{additionalProperties:!1,properties:{column:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},lang:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},line_text:{type:"string"},match:{type:"string"}},required:["file","line","column","lang","match","line_text"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{files_scanned:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},results:{items:{$ref:"#/$defs/AstGrepSearchMatchV1"},type:"array"},truncated:{type:"boolean"}},required:["results","match_count","files_scanned","truncated"],title:"AstGrepSearchResultV1",type:"object"},{$defs:{AutomationRunArtifactKind:{enum:["traces","feedback","generated_evals","validation_gate","optimizer_diagnosis","codex_handoff"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kind:{$ref:"#/$defs/AutomationRunArtifactKind",description:"Artifact kind to read."},run_id:{description:"Automation run id to inspect.",type:"string"}},required:["run_id","kind"],title:"AutomationRunArtifactViewSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,AutomationRunArtifact:fB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{artifact:{$ref:"#/$defs/AutomationRunArtifact"},payload:{description:"The hash-verified artifact document, as the run wrote it."},run_id:{type:"string"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","run_id","artifact","payload"],title:"AutomationRunArtifactViewResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum run records to return (default: 50, max: 200).",format:"uint32",maximum:200,minimum:1,type:["integer","null"]}},title:"AutomationRunListSurfaceRequestV1",type:"object"},{$defs:{AgentTaskKind:fS,AutomationReadStatusV1:fH,AutomationRunListEntryV1:{additionalProperties:!1,description:"One run as the list shows it: the ledger record's identity, outcome and\nartifact kinds, without the artifact payloads or operation bodies.",properties:{accepted_count:{format:"uint",minimum:0,type:"integer"},artifact_kinds:{items:{type:"string"},type:"array"},backend:{type:"string"},completed_at:{type:"string"},error:{type:["string","null"]},model:{type:["string","null"]},rejected_count:{format:"uint",minimum:0,type:"integer"},reviewed_count:{format:"uint",minimum:0,type:"integer"},run_id:{type:"string"},skipped_count:{format:"uint",minimum:0,type:"integer"},started_at:{type:"string"},status:{$ref:"#/$defs/AutomationRunStatus"},task:{$ref:"#/$defs/AgentTaskKind"},task_key:{type:"string"},trigger:{$ref:"#/$defs/AutomationTrigger"}},required:["run_id","task","task_key","trigger","backend","status","reviewed_count","accepted_count","rejected_count","skipped_count","started_at","completed_at","artifact_kinds"],type:"object"},AutomationRunPageCompletenessV1:{description:"Whether a run page read every ledger row it examined.",oneOf:[{const:"known",description:"Every examined row decoded.",type:"string"},{const:"partial",description:"The page skipped malformed rows or more runs exist past it.",type:"string"}]},AutomationRunScopeV1:fK,AutomationRunStatus:fJ,AutomationTrigger:fY},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{completeness:{$ref:"#/$defs/AutomationRunPageCompletenessV1"},count:{format:"uint",minimum:0,type:"integer"},has_more:{type:"boolean"},limit:{format:"uint32",minimum:0,type:"integer"},malformed_row_count:{format:"uint",minimum:0,type:"integer"},runs:{items:{$ref:"#/$defs/AutomationRunListEntryV1"},type:"array"},scope:{$ref:"#/$defs/AutomationRunScopeV1"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","scope","runs","count","limit","has_more","malformed_row_count","completeness"],title:"AutomationRunListResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{description:"Exact automation run id to inspect.",minLength:1,type:"string"}},required:["run_id"],title:"AutomationRunViewSurfaceRequestV1",type:"object"},{$defs:{AgentTaskFailureClass:{oneOf:[{enum:["retryable","permanent","timeout","unavailable","denied","disconnected","malformed_output"],type:"string"},{const:"input_too_large",description:"The backend refused the request because it exceeds its input or\ncontext-window limit.",type:"string"}]},AgentTaskKind:fS,AgentTaskRetryAttempt:{properties:{attempt:{format:"uint32",minimum:0,type:"integer"},backoff_millis:{format:"uint64",minimum:0,type:"integer"},failure_classification:{anyOf:[{$ref:"#/$defs/AgentTaskFailureClass"},{type:"null"}]},succeeded:{type:"boolean"}},required:["attempt","succeeded","backoff_millis"],type:"object"},AutomationReadStatusV1:fH,AutomationRunArtifact:fB,AutomationRunLedgerRecord:{properties:{accepted_count:{format:"uint",minimum:0,type:"integer"},applied_ops:!0,artifacts:{items:{$ref:"#/$defs/AutomationRunArtifact"},type:"array"},backend:{type:"string"},backend_attempt_count:{default:0,format:"uint",minimum:0,type:"integer"},backend_attempts:{items:{$ref:"#/$defs/AgentTaskRetryAttempt"},type:"array"},backend_identity:{description:"The durable backend/configuration identity this run executed under.\n\nA settled deterministic failure stays suppressed only while this\nmatches the identity now configured, so the scheduler can re-admit the\ntask the moment the backend or configuration changes. Records written\nbefore this field existed carry `None` and never suppress: an\nunidentified failure cannot be shown to have failed under the current\nidentity.",type:["string","null"]},completed_at:{type:"string"},completed_at_micros:{format:"int64",type:["integer","null"]},error:{type:["string","null"]},error_classification:{anyOf:[{$ref:"#/$defs/AgentTaskFailureClass"},{type:"null"}]},error_retryable:{type:["boolean","null"]},evidence_hash:{type:["string","null"]},fallback_status:{type:["string","null"]},host_mode:{type:["string","null"]},input_hash:{type:["string","null"]},model:{type:["string","null"]},output_hash:{type:["string","null"]},prompt_version:{type:["string","null"]},proposed_ops:!0,rejected_count:{format:"uint",minimum:0,type:"integer"},rejected_ops:!0,report_ref:!0,response_schema:!0,reviewed_count:{default:0,format:"uint",minimum:0,type:"integer"},run_id:{type:"string"},schema_version:{format:"uint32",minimum:0,type:"integer"},session_evidence_budget_stage:{anyOf:[{$ref:"#/$defs/SessionRetrievalBudgetStageV1"},{type:"null"}],description:"Exhausted retrieval boundary of a `session_evidence_budget_exhausted`\nskip; present exactly on those skips."},skipped_count:{default:0,format:"uint",minimum:0,type:"integer"},started_at:{type:"string"},status:{$ref:"#/$defs/AutomationRunStatus"},strict_json:{type:["boolean","null"]},task:{$ref:"#/$defs/AgentTaskKind"},task_key:{type:"string"},trigger:{$ref:"#/$defs/AutomationTrigger"},validation_report:!0},required:["schema_version","run_id","trigger","task","task_key","backend","status","accepted_count","rejected_count","started_at","completed_at"],type:"object"},AutomationRunScopeV1:fK,AutomationRunStatus:fJ,AutomationTrigger:fY,SessionRetrievalBudgetStageV1:bo},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run:{$ref:"#/$defs/AutomationRunLedgerRecord"},scope:{$ref:"#/$defs/AutomationRunScopeV1"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","scope","run"],title:"AutomationRunViewResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{base:{description:"Base local branch name (e.g. 'main').",type:"string"},cursor:{description:"Authenticated continuation cursor returned by the preceding exact\nbranch-diff page.",type:["string","null"]},file:{description:"Optional file path filter, only show diffs for symbols in this file.",type:["string","null"]},head:{description:"Head local branch name (e.g. 'feature/foo'). Defaults to the current\nbranch.",type:["string","null"]},kind:{description:"Optional kind filter, only show diffs for this symbol kind (e.g.\n'function', 'struct').",type:["string","null"]},limit:{description:"Maximum combined added, removed, and changed results (default: 100,\nat most 256).",format:"uint32",minimum:0,type:["integer","null"]}},required:["base"],title:"BranchDiffSurfaceRequestV1",type:"object"},{$defs:{BranchDiffCompleteV1:{additionalProperties:!1,properties:{base:{type:"string"},base_generation:{type:"string"},base_revision:{type:"string"},base_tree:{type:"string"},changes:{items:{$ref:"#/$defs/BranchSymbolChangeV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},head:{type:"string"},head_generation:{type:"string"},head_revision:{type:"string"},head_tree:{type:"string"},status:{$ref:"#/$defs/GitReadCompleteV1"},summary:{$ref:"#/$defs/BranchDiffSummaryV1"},total_changes:{format:"uint",minimum:0,type:"integer"}},required:["status","base","head","base_revision","base_tree","head_revision","head_tree","base_generation","head_generation","total_changes","summary","changes"],type:"object"},BranchDiffPartialV1:{additionalProperties:!1,properties:{base:{type:"string"},base_generation:{type:"string"},base_revision:{type:"string"},base_tree:{type:"string"},changes:{items:{$ref:"#/$defs/BranchSymbolChangeV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},head:{type:"string"},head_generation:{type:"string"},head_revision:{type:"string"},head_tree:{type:"string"},next_cursor:{type:"string"},reason:{$ref:"#/$defs/GitResultLimitV1"},status:{$ref:"#/$defs/GitReadPartialV1"},summary:{$ref:"#/$defs/BranchDiffSummaryV1"},total_changes:{format:"uint",minimum:0,type:"integer"}},required:["status","reason","base","head","base_revision","base_tree","head_revision","head_tree","base_generation","head_generation","total_changes","next_cursor","summary","changes"],type:"object"},BranchDiffReferenceUnavailableV1:{additionalProperties:!1,description:"Either branch of `base..head` does not resolve to a local commit.",properties:{base_or_head:{description:"The requested range, `base..head`.",type:"string"},reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","base_or_head","reason","retryable"],type:"object"},BranchDiffSummaryV1:{additionalProperties:!1,properties:{added:{format:"uint",minimum:0,type:"integer"},changed:{format:"uint",minimum:0,type:"integer"},removed:{format:"uint",minimum:0,type:"integer"}},required:["added","removed","changed"],type:"object"},BranchDiffUnavailableV1:{additionalProperties:!1,description:"No sealed code-index generations compare the two branches' commits.",properties:{base:{type:"string"},base_generation:{type:["string","null"]},base_revision:{type:"string"},head:{type:"string"},head_generation:{type:["string","null"]},head_revision:{type:"string"},reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","base","head","base_revision","head_revision","reason","retryable"],type:"object"},BranchSymbolChangeV1:{oneOf:[{additionalProperties:!1,properties:{change:{const:"added",type:"string"},symbol:{$ref:"#/$defs/BranchSymbolV1"}},required:["change","symbol"],type:"object"},{additionalProperties:!1,properties:{change:{const:"removed",type:"string"},symbol:{$ref:"#/$defs/BranchSymbolV1"}},required:["change","symbol"],type:"object"},{additionalProperties:!1,properties:{base:{$ref:"#/$defs/BranchSymbolV1"},change:{const:"changed",type:"string"},head:{$ref:"#/$defs/BranchSymbolV1"}},required:["change","base","head"],type:"object"}]},BranchSymbolV1:{additionalProperties:!1,description:"A symbol in one branch's sealed generation.",properties:{content_digest:{type:"string"},file:{type:"string"},file_identity:{type:"string"},file_occurrence_id:{type:"string"},kind:{type:"string"},name:{type:"string"},qualified_name:{type:"string"},symbol_identity:{type:"string"},symbol_occurrence_id:{type:"string"}},required:["symbol_identity","symbol_occurrence_id","file_identity","file_occurrence_id","name","qualified_name","kind","file","content_digest"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitReadCompleteV1:gj,GitReadPartialV1:gC,GitReadUnavailableV1:gT,GitResultLimitV1:gO,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/BranchDiffCompleteV1"},{$ref:"#/$defs/BranchDiffPartialV1"},{$ref:"#/$defs/BranchDiffUnavailableV1"},{$ref:"#/$defs/BranchDiffReferenceUnavailableV1"}],title:"BranchDiffResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{description:"Continuation cursor returned as `next_cursor` by the preceding page\nwith the same `limit`.",type:["string","null"]},limit:{description:"Maximum local refs to return (default: 100, at most 128).",format:"uint32",minimum:0,type:["integer","null"]}},title:"BranchListSurfaceRequestV1",type:"object"},{$defs:{BranchListPageV1:{additionalProperties:!1,properties:{examined:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint",minimum:0,type:"integer"},next_cursor:{type:["string","null"]},reason:{anyOf:[{$ref:"#/$defs/GitReferenceLimitV1"},{type:"null"}]},snapshot_count:{format:"uint",minimum:0,type:"integer"},snapshots:{items:{$ref:"#/$defs/BranchSnapshotEntryV1"},type:"array"},status:{$ref:"#/$defs/GitPageStatusV1"}},required:["status","snapshot_count","examined","limit","snapshots"],type:"object"},BranchReadUnavailableV1:{additionalProperties:!1,description:"A local branch read refused before any snapshot was taken.",properties:{reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","reason","retryable"],type:"object"},BranchSnapshotEntryV1:{additionalProperties:!1,properties:{branch:{type:"string"},source_revision:{type:"string"},source_tree:{type:"string"}},required:["branch","source_revision","source_tree"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitPageStatusV1:gx,GitReadUnavailableV1:gT,GitReferenceLimitV1:{enum:["reference_limit"],type:"string"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/BranchListPageV1"},{$ref:"#/$defs/BranchReadUnavailableV1"}],title:"BranchListResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{branch:{description:"Exact local branch name to search.",type:"string"},cursor:{description:"Authenticated continuation cursor returned by the preceding exact\nbranch-search page.",type:["string","null"]},limit:{description:"Maximum number of results to return (default: 10, at most 500).",format:"uint32",minimum:0,type:["integer","null"]},query:{description:"Search query string to match against symbol names.",type:"string"}},required:["branch","query"],title:"BranchSearchSurfaceRequestV1",type:"object"},{$defs:{BranchReferenceUnavailableV1:{additionalProperties:!1,description:"The named branch does not resolve to a local commit.",properties:{branch:{type:"string"},reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","branch","reason","retryable"],type:"object"},BranchSearchHitV1:{additionalProperties:!1,properties:{branch:{type:"string"},candidate:{$ref:"#/$defs/RankedCandidate"},code_generation:{type:"string"},kind:{type:["string","null"]},name:{type:["string","null"]},path:{type:["string","null"]},qualified_name:{type:["string","null"]},source_reference:{type:"string"},source_revision:{type:"string"},source_tree:{type:"string"}},required:["candidate","branch","source_reference","source_revision","source_tree","code_generation"],type:"object"},BranchSearchPageV1:{additionalProperties:!1,properties:{branch:{type:"string"},code_generation:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},next_cursor:{type:["string","null"]},reason:{anyOf:[{$ref:"#/$defs/GitResultLimitV1"},{type:"null"}]},results:{items:{$ref:"#/$defs/BranchSearchHitV1"},type:"array"},source_reference:{type:"string"},source_revision:{type:"string"},source_tree:{type:"string"},status:{$ref:"#/$defs/GitPageStatusV1"}},required:["status","branch","source_reference","source_revision","source_tree","code_generation","results"],type:"object"},BranchSearchUnavailableV1:{additionalProperties:!1,description:"No sealed code-index generation answers for the branch's commit.",properties:{branch:{type:"string"},code_generation:{type:["string","null"]},reason:{type:"string"},retryable:{type:"boolean"},source_revision:{type:"string"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","branch","source_revision","reason","retryable"],type:"object"},CalibrationProfileId:hi,CandidateContribution:hs,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComponentRevision:hj,EvidenceRole:yC,ExactClass:yT,FileOccurrenceId:gs,FixedPointScore:gc,FreshnessCompatibilityV1:gl,FusedCandidate:gp,GitPageStatusV1:gx,GitReadUnavailableV1:gT,GitResultLimitV1:gO,LogicalCopyClusterId:_i,LogicalEvidenceId:_o,OccurrenceProvenance:_z,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RankedCandidate:{additionalProperties:!1,description:"A fused candidate with its final deterministic ordinal.",properties:{candidate:{$ref:"#/$defs/FusedCandidate"},final_ordinal:{format:"uint32",minimum:0,type:"integer"}},required:["candidate","final_ordinal"],type:"object"},RankingDecision:vp,RankingDecisionKind:vu,RepositoryId:vb,RetrievalAnchorId:vI,RetrievalSourceRoleV1:vC,RetrieverKind:vO,ScoreDomainId:v2,SessionOrThreadId:v7,SourceFreshness:by,SourceInstanceKey:bg,SourceNamespace:bv,SourceOccurrenceId:bb,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/BranchSearchPageV1"},{$ref:"#/$defs/BranchSearchUnavailableV1"},{$ref:"#/$defs/BranchReferenceUnavailableV1"}],title:"BranchSearchResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{qualified_name:{description:"The exact qualified name to look up.",type:"string"}},required:["qualified_name"],title:"ByQualifiedNameSurfaceRequestV1",type:"object"},{$defs:{PrimitiveSymbolLocationV1:_1},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Every indexed symbol sharing one qualified name (overloads, generics,\nseparate impl blocks).",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},title:"ByQualifiedNameResultV1",type:"array"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{from_node_id:{type:"string"},maximum_depth:{default:8,format:"uint32",minimum:0,type:"integer"},to_node_id:{type:"string"}},required:["from_node_id","to_node_id"],title:"CallChainPrimitiveRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{edge_kinds:{items:{type:"string"},type:"array"},node_ids:{items:{type:"string"},type:"array"}},required:["node_ids","edge_kinds"],title:"CallChainPrimitiveResult",type:"object"},{$defs:{NativeIntegrationTransactionId:_T},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["transaction_id"],title:"NativeIntegrationCancelSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{from_ref:{description:"Starting git ref (commit, branch, tag).",type:"string"},to_ref:{description:"Ending git ref (commit, branch, tag).",type:"string"}},required:["from_ref","to_ref"],title:"ChangelogSurfaceRequestV1",type:"object"},{$defs:{ChangelogCompleteV1:{additionalProperties:!1,properties:{base_generation:{type:"string"},changed_file_count:{format:"uint",minimum:0,type:"integer"},changed_files:{items:{type:"string"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},from_ref:{type:"string"},head_generation:{type:"string"},status:{$ref:"#/$defs/GitReadCompleteV1"},symbol_changes_coverage:{$ref:"#/$defs/SymbolChangesCompleteV1"},symbols_added:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_modified:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},to_ref:{type:"string"}},required:["status","from_ref","to_ref","changed_file_count","changed_files","base_generation","head_generation","symbols_added","symbols_removed","symbols_modified","symbol_changes_coverage"],type:"object"},ChangelogPartialV1:{additionalProperties:!1,description:"The tree diff without symbol changes: the refs are not both exact local\nbranches with sealed generations.",properties:{changed_file_count:{format:"uint",minimum:0,type:"integer"},changed_files:{items:{type:"string"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},from_ref:{type:"string"},status:{$ref:"#/$defs/GitReadPartialV1"},symbol_changes_coverage:{$ref:"#/$defs/SymbolChangesUnavailableV1"},symbols_added:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_modified:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},to_ref:{type:"string"}},required:["status","from_ref","to_ref","changed_file_count","changed_files","symbols_added","symbols_removed","symbols_modified","symbol_changes_coverage"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitComparedSymbolV1:gy,GitReadCompleteV1:gj,GitReadPartialV1:gC,GitReadUnavailableV1:gT,GitToolErrorKindV1:gW,GitToolErrorV1:gM,GitToolFailureV1:gN,GitToolOperationV1:gz,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,SymbolChangesCompleteV1:{additionalProperties:!1,properties:{status:{$ref:"#/$defs/GitReadCompleteV1"}},required:["status"],type:"object"},SymbolChangesUnavailableV1:bV},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ChangelogCompleteV1"},{$ref:"#/$defs/ChangelogPartialV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"ChangelogResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of cycles to report, largest first (default: 25, max:\n200). The response always states the total detected and how many were\nomitted.",format:"uint32",minimum:0,type:["integer","null"]},member_limit:{description:"Maximum member files listed per reported cycle (default: 12, max:\n200). Each entry states its true member_count and\nomitted_member_count.",format:"uint32",minimum:0,type:["integer","null"]}},title:"CircularSurfaceRequestV1",type:"object"},{$defs:{CircularCycleV1:{additionalProperties:!1,description:"One reported file cycle: the members that fit the member bound, plus the\ncomponent's true size so the omission is stated rather than hidden.",properties:{member_count:{format:"uint64",minimum:0,type:"integer"},members:{items:{type:"string"},type:"array"},omitted_member_count:{format:"uint64",minimum:0,type:"integer"}},required:["members","member_count","omitted_member_count"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycle_count:{format:"uint64",minimum:0,type:"integer"},cycles:{items:{$ref:"#/$defs/CircularCycleV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint64",minimum:0,type:"integer"},member_limit:{format:"uint64",minimum:0,type:"integer"},omitted_cycle_count:{format:"uint64",minimum:0,type:"integer"},reported_cycle_count:{format:"uint64",minimum:0,type:"integer"}},required:["cycle_count","reported_cycle_count","omitted_cycle_count","limit","member_limit","cycles"],title:"CircularResultV1",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{maximum_depth:{default:3,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},node_id:{type:"string"},resolve_trait_dispatch:{default:!0,type:"boolean"},scope:{$ref:"#/$defs/CodeQueryScope",default:{generation:"code-generation:unpinned-latest.v1",path_prefix:null}}},required:["node_id"],title:"CodeCalleesSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,SymbolPrimitiveRecord:bI,SymbolRelationRecord:bx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolRelationRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{maximum_depth:{default:3,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},node_id:{type:"string"},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}}},required:["node_id"],title:"CodeCallersSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,SymbolRelationRecord:bx,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolRelationRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},node_id:{type:"string"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["node_id","scope","meta"],title:"CodeNavigationSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ExactTechnicalTermKindV1:yO,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kind:{anyOf:[{$ref:"#/$defs/ExactTechnicalTermKindV1"},{type:"null"}]},literal:{type:"string"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["literal","scope","meta"],title:"CodeExactOccurrenceSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeOccurrenceRecord:hP,CodeSearchChunkId:hR,ExactOccurrenceRecord:{additionalProperties:!1,properties:{matched_kind:{$ref:"#/$defs/ExactTechnicalTermKindV1"},matched_literal:{type:"string"},occurrence:{$ref:"#/$defs/CodeOccurrenceRecord"}},required:["occurrence","matched_kind","matched_literal"],type:"object"},ExactTechnicalTermKindV1:yO,FileOccurrenceId:gs,SourceSpan:b$,SymbolOccurrenceId:bq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/ExactOccurrenceRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeFacetDimension:hh,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{dimension:{$ref:"#/$defs/CodeFacetDimension"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["dimension","scope","meta"],title:"CodeFacetSurfaceRequest",type:"object"},{$defs:{CodeFacetDimension:hh,CodeFacetRecord:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},dimension:{$ref:"#/$defs/CodeFacetDimension"},value:{type:"string"}},required:["dimension","value","count"],type:"object"},CodeGenerationId:hy},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/CodeFacetRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ImplementationSelector:{oneOf:[{properties:{name:{type:"string"},selector:{const:"trait",type:"string"}},required:["selector","name"],type:"object"},{properties:{name:{type:"string"},selector:{const:"method",type:"string"}},required:["selector","name"],type:"object"}]},ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}},selector:{$ref:"#/$defs/ImplementationSelector"}},required:["selector"],title:"CodeImplementationsSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,ImplementationRecord:{additionalProperties:!1,description:"One implementation match with its exact source: the implementing\nimpl/class block (methods included) for a trait selector, or the function\nbody for a method selector.",properties:{body:{type:"string"},dispatch_from:{description:"Trait or interface node a trait-selector match was reached through.",type:["string","null"]},edge_kind:{type:"string"},symbol:{$ref:"#/$defs/SymbolPrimitiveRecord"}},required:["symbol","edge_kind","body"],type:"object"},PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/ImplementationRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeLexicalField:{description:"Typed code fields accepted by the generation-owned lexical authority.",enum:["symbol_name","qualified_name","path","signature","documentation","body_text","preamble_text","exact_term","subtoken"],type:"string"},CodeLexicalFieldFilter:{additionalProperties:!1,properties:{field:{$ref:"#/$defs/CodeLexicalField"},include:{type:"boolean"}},required:["field","include"],type:"object"},CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Serializable adapter DTO for the request-local phrase query view.\n\nThe callable application request deliberately keeps its sanitized query\nnon-serializable. The owning runtime supplies the exact sanitizer\nrevisions when converting this transport DTO.",properties:{field_filters:{default:[],items:{$ref:"#/$defs/CodeLexicalFieldFilter"},type:"array"},fuzzy_budget:{default:0,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},phrases:{items:{type:"string"},type:"array"},query:{type:"string"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["query","phrases","scope","meta"],title:"CodePhraseSearchSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeOccurrenceRecord:hP,CodeSearchChunkId:hR,FileOccurrenceId:gs,LexicalOccurrenceRecord:{additionalProperties:!1,properties:{matched_phrases:{items:{type:"string"},type:"array"},matched_terms:{items:{type:"string"},type:"array"},occurrence:{$ref:"#/$defs/CodeOccurrenceRecord"},score_micros:{format:"uint64",minimum:0,type:"integer"}},required:["occurrence","score_micros","matched_phrases","matched_terms"],type:"object"},SourceSpan:b$,SymbolOccurrenceId:bq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/LexicalOccurrenceRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{is_async:{type:["boolean","null"]},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},params:{default:[],items:{type:"string"},type:"array"},returns:{type:["string","null"]},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}}},title:"CodeSignatureSearchSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{lazy_index_ignored_dependencies:{type:"boolean"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},query:{type:"string"},scope:{$ref:"#/$defs/SymbolGraphScope"}},required:["query","scope","lazy_index_ignored_dependencies","meta"],title:"CodeSymbolSearchSurfaceRequest",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["scope","meta"],title:"CodeTimelineSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeTimelineRecord:{additionalProperties:!1,properties:{file_count:{format:"uint64",minimum:0,type:"integer"},generation:{$ref:"#/$defs/CodeGenerationId"},indexed_at:{$ref:"#/$defs/UtcMicros"},symbol_count:{format:"uint64",minimum:0,type:"integer"}},required:["generation","indexed_at","file_count","symbol_count"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/CodeTimelineRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{maximum_depth:{default:5,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},node_id:{type:"string"},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}}},required:["node_id"],title:"CodeTypeHierarchySurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,TypeHierarchyRecord:{additionalProperties:!1,properties:{depth:{format:"uint32",minimum:0,type:"integer"},edge_kind:{type:"string"},parent_node_id:{type:"string"},symbol:{$ref:"#/$defs/SymbolPrimitiveRecord"}},required:["symbol","parent_node_id","edge_kind","depth"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/TypeHierarchyRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{staged_only:{description:"If true, compare pinned HEAD with immutable staged index blobs. The\ndefault compares HEAD with captured working-tree bytes, including\nuntracked files: a staged edit undone in the working tree cancels out.",type:["boolean","null"]}},title:"CommitContextSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CommitCategoryV1:{description:"The commit category the changed file roles suggest.",enum:["feature/fix (source + tests)","feature/fix/refactor","test","chore/docs/config"],type:"string"},CommitContextSummaryV1:{additionalProperties:!1,properties:{changed_files:{items:{$ref:"#/$defs/CommitFileRoleV1"},type:"array"},comparison:{anyOf:[{$ref:"#/$defs/GitContextComparisonV1"},{type:"null"}]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},recent_commits:{items:{type:"string"},type:"array"},source_coverage:{anyOf:[{$ref:"#/$defs/GitContextSourceCoverageV1"},{type:"null"}]},suggested_category:{anyOf:[{$ref:"#/$defs/CommitCategoryV1"},{type:"null"}],description:"Absent when the worktree has no changes."},summary:{type:"string"},symbols_by_role:{additionalProperties:!1,properties:{config:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"},docs:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"},source:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"},test:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"}},type:"object"}},required:["changed_files","symbols_by_role","recent_commits","summary"],type:"object"},CommitFileRoleV1:{additionalProperties:!1,properties:{comparison:{anyOf:[{$ref:"#/$defs/GitContextFileComparisonV1"},{type:"null"}]},file:{type:"string"},role:{$ref:"#/$defs/GitFileRoleV1"},symbols:{format:"uint",minimum:0,type:"integer"}},required:["file","role","symbols"],type:"object"},CommitSymbolEntryV1:{anyOf:[{$ref:"#/$defs/CommitSymbolV1"},{$ref:"#/$defs/ConfigSummaryV1"}]},CommitSymbolV1:{additionalProperties:!1,properties:{change:{anyOf:[{$ref:"#/$defs/GitDeclarationChangeKindV1"},{type:"null"}]},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},source_side:{anyOf:[{$ref:"#/$defs/GitContextSourceSideV1"},{type:"null"}]}},required:["name","kind","file","line"],type:"object"},ConfigSummaryKindV1:hT,ConfigSummaryV1:hO,GitChangeKindV1:gh,GitContextComparisonV1:gg,GitContextFileComparisonV1:{additionalProperties:!1,properties:{after_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},before_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},change:{$ref:"#/$defs/GitChangeKindV1"},previous_file:{type:["string","null"]}},required:["change"],type:"object"},GitContextSourceConsistencyV1:{oneOf:[{enum:["immutable_blobs"],type:"string"},{const:"per_file_worktree_capture",description:"Each file is checked around its bounded read; this is not an atomic\nsnapshot of the entire working tree.",type:"string"}]},GitContextSourceCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},consistency:{$ref:"#/$defs/GitContextSourceConsistencyV1"},gaps:{items:{$ref:"#/$defs/GitContextSourceGapV1"},type:"array"},git:{$ref:"#/$defs/GitCoverageV1"}},required:["complete","git","gaps","consistency"],type:"object"},GitContextSourceGapV1:{additionalProperties:!1,properties:{file:{type:"string"},reason:{type:"string"}},required:["file","reason"],type:"object"},GitContextSourceSideV1:{enum:["before","after"],type:"string"},GitCoverageV1:gv,GitDeclarationChangeKindV1:{enum:["added","removed","modified","signature_changed","visibility_changed","renamed","ambiguous_overload"],type:"string"},GitDegradationV1:gb,GitFileRoleV1:gS,GitOidV1:gq,GitToolErrorKindV1:gW,GitToolErrorV1:gM,GitToolFailureV1:gN,GitToolOperationV1:gz,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/CommitContextSummaryV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"CommitContextResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},node_kind:{description:"Filter by node kind (default: every kind).",type:["string","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"ComplexitySurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComplexityAnalysisV1:hx,ComplexityReportEntryV1:{additionalProperties:!1,properties:{branches:{format:"uint32",minimum:0,type:["integer","null"]},complexity_analysis:{$ref:"#/$defs/ComplexityAnalysisV1"},cyclomatic_complexity:{description:"The counters are `None` when `complexity_analysis` reports the bounded\nwalk did not cover the body.",format:"uint32",minimum:0,type:["integer","null"]},fan_in:{format:"uint64",minimum:0,type:"integer"},fan_out:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},lines:{format:"uint32",minimum:0,type:"integer"},loops:{format:"uint32",minimum:0,type:["integer","null"]},max_nesting:{format:"uint32",minimum:0,type:["integer","null"]},name:{type:"string"},score:{format:"uint64",minimum:0,type:"integer"}},required:["id","name","kind","file","line","lines","complexity_analysis","fan_out","fan_in","score"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{formula:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},note:{type:"string"},ranking:{items:{$ref:"#/$defs/ComplexityReportEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["formula","note","result_count","ranking"],title:"ComplexityReportV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exactly one of `path` or `glob` names the files to query.",properties:{glob:{description:"Glob pattern to match multiple config files (e.g. '**/Cargo.toml').\nMutually exclusive with 'path'.",type:["string","null"]},key:{description:"Dot-separated key path (e.g. 'package.version',\n'dependencies.tokio.version').",type:"string"},path:{description:"Project-relative path to a single config file (e.g. 'Cargo.toml').\nMutually exclusive with 'glob'.",type:["string","null"]}},required:["key"],title:"ConfigSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ConfigKeyFoundV1:{additionalProperties:!1,properties:{file:{type:"string"},key:{type:"string"},line:{description:"The first line whose text starts with the key's leaf segment.",format:"uint32",minimum:0,type:["integer","null"]},value:!0},required:["file","key","value"],type:"object"},ConfigKeyMissingV1:{additionalProperties:!1,description:"`value` is always null and `found` always false; both stay on the wire\nso a missing key reads the same as it always has.",properties:{file:{type:"string"},found:{type:"boolean"},key:{type:"string"},value:{type:"null"}},required:["file","key","value","found"],type:"object"},ConfigMatchV1:{anyOf:[{$ref:"#/$defs/ConfigParseErrorV1"},{$ref:"#/$defs/ConfigKeyMissingV1"},{$ref:"#/$defs/ConfigKeyFoundV1"}],description:"One queried config file: the file's parse error, the key's absence, or the\nkey's value and defining line.\n\nThe variants are distinguished by their exact field sets, so each one\ndenies unknown fields and the most specific shapes are tried first."},ConfigParseErrorV1:{additionalProperties:!1,properties:{error:{type:"string"},file:{type:"string"}},required:["file","error"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{description:"Files where the key was found or that failed to parse.",format:"uint",minimum:0,type:"integer"},matches:{items:{$ref:"#/$defs/ConfigMatchV1"},type:"array"}},required:["match_count","matches"],title:"ConfigResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{default:null,description:"The previous page's `next_cursor`, valid only with the same `limit`.",type:["string","null"]},limit:{format:"uint",minimum:0,type:"integer"}},required:["limit"],title:"ConfigurationAuditRequestV1",type:"object"},{$defs:{ActorId:fb,ConfigurationAuditEvent:{additionalProperties:!1,description:"Append-only audit record. `target_commitment` is event-scoped and cannot be\njoined across audit events; a caller must be separately authorized before\nany canonical target is resolved by the store/application layer.",properties:{actor_id:{$ref:"#/$defs/ActorId"},base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},event_id:{$ref:"#/$defs/ConfigurationAuditEventId"},event_kind:{$ref:"#/$defs/ConfigurationAuditEventKindV1"},idempotency_key:{anyOf:[{$ref:"#/$defs/ConfigurationIdempotencyKey"},{type:"null"}]},occurred_at:{$ref:"#/$defs/UtcMicros"},operation_digest:{$ref:"#/$defs/ManifestDigest"},receipt_id:{anyOf:[{$ref:"#/$defs/ConfigurationReceiptId"},{type:"null"}]},result_revision_id:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},safe_reason_code:{type:["string","null"]},target_commitment:{$ref:"#/$defs/ManifestDigest"}},required:["event_id","event_kind","actor_id","base_revision_id","operation_digest","target_commitment","occurred_at"],type:"object"},ConfigurationAuditEventId:{description:"Strongly typed canonical identity: `ConfigurationAuditEventId`.",type:"string"},ConfigurationAuditEventKindV1:{enum:["dry_run_created","applied","rejected","expired","activation_failed","rollback_dry_run_created","rollback_applied","recovered"],type:"string"},ConfigurationIdempotencyKey:hE,ConfigurationReceiptId:hW,ConfigurationRevisionId:hM,ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{events:{items:{$ref:"#/$defs/ConfigurationAuditEvent"},type:"array"},next_cursor:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]}},required:["events"],title:"ConfigurationAuditPage",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AnalyzerEnvironmentVariable:fV,AnalyzerExecutableId:fR,AnalyzerExecutableReferenceV1:fq,AnalyzerLanguageId:fI,AnalyzerLanguageSelectionV1:fx,AnalyzerPrivacyClassV1:fj,AnalyzerResourceLimitsV1:fC,AnalyzerRestartPolicyV1:fT,AnalyzerSettingsV1:fO,AnalyzerStructuredValueV1:fE,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,AutomationBackendV1:fL,AutomationHostModeV1:fU,AutomationSettingsV1:fZ,AutomationTaskSetV1:fQ,AutomationTaskSettingsV1:fX,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CodeIndexWorkerSelectionV1:hw,ConfigurationDirectMutationRequestV1:{oneOf:[{properties:{key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},operation:{const:"set",type:"string"},value:{$ref:"#/$defs/ConfigurationValueV1"}},required:["operation","layer","key","value"],type:"object"},{properties:{key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},operation:{const:"unset",type:"string"}},required:["operation","layer","key"],type:"object"}]},ConfigurationIdempotencyKey:hE,ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ConfigurationValueV1:hz,ContextScoutConfigurationLimitsV1:hB,ContextScoutConfigurationModeV1:hK,ContextScoutConfigurationStateV1:hJ,ContextScoutConfiguredModelPathV1:hZ,ContextScoutIntentKindV1:h6,ContextScoutIntentSettingsV1:h3,ContextScoutSettingsV1:yn,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DecisionEngineSettingsV1:yb,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,IntentQuestionSettingsV1:gB,IntentWindowSettingsV1:gK,LcmSummarizerExecutableV1:g9,LcmSummarizerExecutablesV1:g5,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,QueryCollectionId:vd,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SettingKey:ba,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkContentLocationClassV1:$u,WorkEffortClassV1:$y,WorkEgressPolicy:$g,WorkExecutableBindingV1:$b,WorkExecutableCapabilityV1:$$,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExpertiseCategoryV1:$V,WorkExpertiseConsentV1:$R,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkOrdinalBandV1:$U,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteCandidateV1:Sg,WorkRouteExecutionProfileV1:Sv,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},mutations:{items:{$ref:"#/$defs/ConfigurationDirectMutationRequestV1"},type:"array"}},required:["mutations","expected_revision","idempotency_key"],title:"ConfigurationBatchRequestV1",type:"object"},{$defs:{AccessPolicyDigest:f_,ConfigurationReceiptId:hW,ConfigurationRevisionId:hM,ConfigurationSettlementAuthorityV1:{additionalProperties:!1,description:"Original authorization evidence pinned to a durable configuration effect.\nA retry reauthorizes access separately without replacing these fields.",properties:{policy_digest:{$ref:"#/$defs/AccessPolicyDigest"},policy_epoch:{format:"uint64",minimum:0,type:"integer"},revalidated_at:{$ref:"#/$defs/UtcMicros"}},required:["policy_epoch","policy_digest","revalidated_at"],type:"object"},ConfigurationSnapshotId:hN,ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},created_at:{$ref:"#/$defs/UtcMicros"},effective_deadline_at:{$ref:"#/$defs/UtcMicros"},operation_digest:{$ref:"#/$defs/ManifestDigest"},receipt_id:{$ref:"#/$defs/ConfigurationReceiptId"},result_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},settlement_authority:{$ref:"#/$defs/ConfigurationSettlementAuthorityV1"},snapshot_id:{$ref:"#/$defs/ConfigurationSnapshotId"}},required:["receipt_id","base_revision_id","result_revision_id","snapshot_id","operation_digest","settlement_authority","created_at","effective_deadline_at"],title:"ConfigurationMutationReceipt",type:"object"},{$defs:{SettingKey:ba},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{key:{$ref:"#/$defs/SettingKey"}},required:["key"],title:"ConfigurationGetRequestV1",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AnalyzerEnvironmentVariable:fV,AnalyzerExecutableId:fR,AnalyzerExecutableReferenceV1:fq,AnalyzerLanguageId:fI,AnalyzerLanguageSelectionV1:fx,AnalyzerPrivacyClassV1:fj,AnalyzerResourceLimitsV1:fC,AnalyzerRestartPolicyV1:fT,AnalyzerSettingsV1:fO,AnalyzerStructuredValueV1:fE,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,AutomationBackendV1:fL,AutomationHostModeV1:fU,AutomationSettingsV1:fZ,AutomationTaskSetV1:fQ,AutomationTaskSettingsV1:fX,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CandidateDispositionV1:{enum:["winning","overridden","rejected","defaulted"],type:"string"},CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CodeIndexWorkerSelectionV1:hw,ConfigurationCandidateV1:{additionalProperties:!1,description:"Resolution provenance is intentionally distinct from behavior. Moving the\nsame winner between layers can change this material without changing the\neffective behavior digest.",properties:{disposition:{$ref:"#/$defs/CandidateDispositionV1"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},safe_reason:{type:["string","null"]}},required:["layer","revision_id","disposition"],type:"object"},ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,ConfigurationValueV1:hz,ContextScoutConfigurationLimitsV1:hB,ContextScoutConfigurationModeV1:hK,ContextScoutConfigurationStateV1:hJ,ContextScoutConfiguredModelPathV1:hZ,ContextScoutIntentKindV1:h6,ContextScoutIntentSettingsV1:h3,ContextScoutSettingsV1:yn,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DecisionEngineSettingsV1:yb,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,IntentQuestionSettingsV1:gB,IntentWindowSettingsV1:gK,LcmSummarizerExecutableV1:g9,LcmSummarizerExecutablesV1:g5,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,QueryCollectionId:vd,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SettingKey:ba,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkContentLocationClassV1:$u,WorkEffortClassV1:$y,WorkEgressPolicy:$g,WorkExecutableBindingV1:$b,WorkExecutableCapabilityV1:$$,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExpertiseCategoryV1:$V,WorkExpertiseConsentV1:$R,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkOrdinalBandV1:$U,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteCandidateV1:Sg,WorkRouteExecutionProfileV1:Sv,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{candidates:{items:{$ref:"#/$defs/ConfigurationCandidateV1"},type:"array"},effective_behavior_digest:{$ref:"#/$defs/ManifestDigest"},effective_value:{$ref:"#/$defs/ConfigurationValueV1"},key:{$ref:"#/$defs/SettingKey"},resolution_provenance_digest:{$ref:"#/$defs/ManifestDigest"},revision_id:{$ref:"#/$defs/ConfigurationRevisionId",description:"Current configuration revision accepted by mutation `expected_revision` CAS."},snapshot_id:{$ref:"#/$defs/ConfigurationSnapshotId",description:"Content identity of the fully resolved configuration snapshot."}},required:["key","effective_value","revision_id","snapshot_id","effective_behavior_digest","resolution_provenance_digest","candidates"],title:"ResolvedSetting",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Typed input for the configuration list read through the daemon\ninvocation boundary.",title:"ConfigurationListRequestV1",type:"object"},{$defs:{RestartRequirementV1:{enum:["none","analyzer_restart","daemon_restart"],type:"string"},SettingKey:ba,SettingSensitivityV1:{enum:["public","sensitive"],type:"string"},SettingSummary:{properties:{key:{$ref:"#/$defs/SettingKey"},restart_requirement:{$ref:"#/$defs/RestartRequirementV1"},sensitivity:{$ref:"#/$defs/SettingSensitivityV1"}},required:["key","sensitivity","restart_requirement"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/SettingSummary"},title:"Array_of_SettingSummary",type:"array"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"ConfigurationObservedStateRequestV1",type:"object"},{$defs:{ActivationDriftV1:{enum:["current","never_activated","pending_restart","activation_failed"],type:"string"},ComponentConfigurationState:{properties:{activation_error_code:{type:["string","null"]},component:{type:"string"},desired_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},drift:{$ref:"#/$defs/ActivationDriftV1"},last_working_revision_id:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},observed_revision_id:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},restart_required:{type:"boolean"}},required:["component","desired_revision_id","restart_required","drift"],type:"object"},ConfigurationRevisionId:hM},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/ComponentConfigurationState"},title:"Array_of_ComponentConfigurationState",type:"array"},{$defs:{ChangePlanId:hu,ConfigurationIdempotencyKey:hE,ConfigurationRevisionId:hM,ManifestDigest:_l},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},operation_digest:{$ref:"#/$defs/ManifestDigest"},plan_id:{$ref:"#/$defs/ChangePlanId"}},required:["plan_id","expected_base_revision_id","operation_digest","idempotency_key"],title:"ConfigurationProtectedApplyRequestV1",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,ConfigurationRevisionId:hM,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedChange:{description:"The protected configuration operation set. Ordinary scalar mutations are\nintentionally absent; they activate directly after validation.",oneOf:[{properties:{kind:{const:"bind_source",type:"string"},value:{$ref:"#/$defs/ScopeSourceBinding"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"rebind_source",type:"string"},value:{$ref:"#/$defs/ScopeSourceBinding"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"unbind_source",type:"string"},value:{properties:{binding_id:{$ref:"#/$defs/SourceBindingId"}},required:["binding_id"],type:"object"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"upsert_access_rule",type:"string"},value:{$ref:"#/$defs/ScopeAccessRule"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"remove_access_rule",type:"string"},value:{properties:{rule_id:{$ref:"#/$defs/AccessRuleId"}},required:["rule_id"],type:"object"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"replace_work_topology_policy",type:"string"},value:{$ref:"#/$defs/WorkTopologyPolicyV1"}},required:["kind","value"],type:"object"}]},ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{change:{$ref:"#/$defs/ProtectedChange"},expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"}},required:["change","expected_revision"],title:"ConfigurationProtectedPreviewRequestV1",type:"object"},{$defs:{AccessPolicyDigest:f_,ActorId:fb,ChangePlanId:hu,ConfigurationRevisionId:hM,ManifestDigest:_l,RedactedConfigurationChangeV1:{additionalProperties:!1,properties:{after_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},before_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},operation:{$ref:"#/$defs/ScopeControlOperationV1"},setting_key:{$ref:"#/$defs/SettingKey"}},required:["setting_key","operation"],type:"object"},ScopeControlOperationV1:vK,SettingKey:ba,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Immutable dry-run result. It contains no raw locator, secret, target\nidentity, or plaintext configuration value.",properties:{actor_id:{$ref:"#/$defs/ActorId"},authorization_policy_digest:{$ref:"#/$defs/AccessPolicyDigest"},base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},created_at:{$ref:"#/$defs/UtcMicros"},expires_at:{$ref:"#/$defs/UtcMicros"},membership_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},operation_digest:{$ref:"#/$defs/ManifestDigest"},plan_id:{$ref:"#/$defs/ChangePlanId"},policy_epoch:{format:"uint64",minimum:0,type:"integer"},redacted_changes:{items:{$ref:"#/$defs/RedactedConfigurationChangeV1"},type:"array"},resolved_scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["plan_id","actor_id","base_revision_id","operation_digest","resolved_scope_digest","authorization_policy_digest","policy_epoch","expires_at","created_at","redacted_changes"],title:"ProtectedChangePlan",type:"object"},{$defs:{ConfigurationRevisionId:hM,RollbackModeV1:{enum:["all_or_nothing","partial"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{mode:{$ref:"#/$defs/RollbackModeV1"},target_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"}},required:["target_revision_id","mode"],title:"ConfigurationRollbackPreviewRequestV1",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AnalyzerEnvironmentVariable:fV,AnalyzerExecutableId:fR,AnalyzerExecutableReferenceV1:fq,AnalyzerLanguageId:fI,AnalyzerLanguageSelectionV1:fx,AnalyzerPrivacyClassV1:fj,AnalyzerResourceLimitsV1:fC,AnalyzerRestartPolicyV1:fT,AnalyzerSettingsV1:fO,AnalyzerStructuredValueV1:fE,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,AutomationBackendV1:fL,AutomationHostModeV1:fU,AutomationSettingsV1:fZ,AutomationTaskSetV1:fQ,AutomationTaskSettingsV1:fX,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CodeIndexWorkerSelectionV1:hw,ConfigurationIdempotencyKey:hE,ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ConfigurationValueV1:hz,ContextScoutConfigurationLimitsV1:hB,ContextScoutConfigurationModeV1:hK,ContextScoutConfigurationStateV1:hJ,ContextScoutConfiguredModelPathV1:hZ,ContextScoutIntentKindV1:h6,ContextScoutIntentSettingsV1:h3,ContextScoutSettingsV1:yn,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DecisionEngineSettingsV1:yb,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,IntentQuestionSettingsV1:gB,IntentWindowSettingsV1:gK,LcmSummarizerExecutableV1:g9,LcmSummarizerExecutablesV1:g5,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,QueryCollectionId:vd,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SettingKey:ba,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkContentLocationClassV1:$u,WorkEffortClassV1:$y,WorkEgressPolicy:$g,WorkExecutableBindingV1:$b,WorkExecutableCapabilityV1:$$,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExpertiseCategoryV1:$V,WorkExpertiseConsentV1:$R,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkOrdinalBandV1:$U,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteCandidateV1:Sg,WorkRouteExecutionProfileV1:Sv,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Typed revision-CAS input for a configuration write through the daemon\ninvocation boundary.",properties:{expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},value:{$ref:"#/$defs/ConfigurationValueV1"}},required:["layer","key","value","expected_revision","idempotency_key"],title:"ConfigurationSetRequestV1",type:"object"},{$defs:{ConfigurationIdempotencyKey:hE,ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ProjectId:_4,QueryCollectionId:vd,SettingKey:ba,UserProfileId:bJ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"}},required:["layer","key","expected_revision","idempotency_key"],title:"ConfigurationUnsetRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of literal sites to return (default: 100, max: 1000).",format:"uint32",minimum:0,type:["integer","null"]},struct:{description:"Struct name to search literal sites of (e.g. 'GraphStats', 'Config').",type:"string"}},required:["struct"],title:"ConstructorsSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ConstructorFieldCoverageV1:{description:"Whether a literal site's field lists are complete relative to the\nstruct's graph definition.",enum:["complete","unknown"],type:"string"},ConstructorResolutionReasonV1:{enum:["ambiguous_simple_name","syntax_only_simple_name"],type:"string"},ConstructorResolutionStatusV1:{description:"Syntax alone cannot link same-name types across modules, so every\nresolution is unverified.",enum:["unverified"],type:"string"},ConstructorSiteV1:{additionalProperties:!1,properties:{field_coverage:{$ref:"#/$defs/ConstructorFieldCoverageV1"},fields:{items:{type:"string"},type:"array"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},missing_fields:{items:{type:"string"},type:"array"},update_fields:{items:{type:"string"},type:"array"}},required:["file","line","fields","update_fields","missing_fields","field_coverage"],type:"object"},ConstructorsNotFoundV1:{additionalProperties:!1,properties:{found:{description:"Always `false`: no struct, class, or case class has the name.",type:"boolean"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},message:{type:"string"},sites:{items:{$ref:"#/$defs/ConstructorSiteV1"},type:"array"},struct:{type:"string"}},required:["found","struct","message","match_count","sites"],type:"object"},ConstructorsReportV1:{additionalProperties:!1,properties:{candidate_count:{format:"uint64",minimum:0,type:"integer"},expected_fields:{description:"`None` when the name resolves to more than one definition.",items:{type:"string"},type:["array","null"]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},resolution_reason:{$ref:"#/$defs/ConstructorResolutionReasonV1"},resolution_status:{$ref:"#/$defs/ConstructorResolutionStatusV1"},sites:{items:{$ref:"#/$defs/ConstructorSiteV1"},type:"array"},struct:{type:"string"}},required:["struct","candidate_count","resolution_status","resolution_reason","match_count","sites"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ConstructorsNotFoundV1"},{$ref:"#/$defs/ConstructorsReportV1"}],title:"ConstructorsResultV1"},{$defs:{ContextModeV1:hL},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{budget_tokens:{description:"Cap the ranked sections of the answer at about this many tokens.\nQuotas are fixed shares of the budget. The cut is reported on the result.",format:"uint32",minimum:0,type:["integer","null"]},include_code:{type:["boolean","null"]},include_memory:{type:["boolean","null"]},lexical_anchors:{description:"Exact identifiers or technical terms the answer must be about. Each\nruns as its own lexical route: hits carrying an anchor outrank hits\ncarrying none, exact hits included, every anchor with matches keeps at\nleast its best sites through the lane cap, and `lexical_anchors` in the\nresult reports each anchor's outcome: the sites this result returns\nand, by reason, the admitted sites it could not carry. Bounded and\nvalidated by the retrieval kernel; a\nviolation is a typed request rejection. Identifiers the task names\n(`snake_case`, `camelCase`, `a::b`) are anchored after these.",items:{type:"string"},type:["array","null"]},max_code_blocks:{format:"uint32",minimum:0,type:["integer","null"]},max_nodes:{format:"uint32",minimum:0,type:["integer","null"]},memory_limit:{format:"uint32",minimum:0,type:["integer","null"]},memory_min_trust:{format:"double",type:["number","null"]},mode:{anyOf:[{$ref:"#/$defs/ContextModeV1"},{type:"null"}]},prefer_symbol:{description:"Add a symbol-name lexical route for the identifier-shaped words of the\ntask text.",type:["boolean","null"]},task:{type:"string"}},required:["task"],title:"ContextSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ContextCodeBlockV1:{additionalProperties:!1,properties:{code:{type:"string"},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},node_id:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["node_id","file","start_line","end_line","code"],type:"object"},ContextExtensionPointV1:{additionalProperties:!1,description:"A public trait or interface among the context's selected symbols.",properties:{file:{type:"string"},implementor_count:{format:"uint",minimum:0,type:"integer"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line","implementor_count"],type:"object"},ContextLexicalAnchorV1:hF,ContextModeV1:hL,ContextPlanV1:{additionalProperties:!1,description:"Plan-mode enrichment: where the selected code can be extended and which\ntest files reach it.",properties:{extension_points:{items:{$ref:"#/$defs/ContextExtensionPointV1"},type:"array"},test_files:{description:"Test files calling the selected symbols within two hops; absent when\nno symbol was selected to trace from.",items:{type:"string"},type:["array","null"]}},required:["extension_points"],type:"object"},ContextRelatedOmissionV1:{additionalProperties:!1,description:"Related symbols `context` ranked but did not return.",properties:{omitted:{description:"Ranked related symbols the `max_nodes` cut dropped.",format:"uint",minimum:0,type:"integer"},total:{description:"Distinct related symbols the walk found and ranked.",format:"uint",minimum:0,type:"integer"},total_is_lower_bound:{description:"The neighbor walk stopped at its row limit, so `total` is a lower\nbound.",type:"boolean"}},required:["total","omitted","total_is_lower_bound"],type:"object"},ContextRetrievalPlanV1:{additionalProperties:!1,description:"The retrieval plan `context` executed: which stages ran, what each\nadmitted, and where a budget bounded the answer. Lane-level serving state\nstays in `coverage`.",properties:{code:{$ref:"#/$defs/ContextStageV1",description:"Source bodies for selected symbols, bounded by `max_code_blocks`."},graph:{$ref:"#/$defs/ContextStageV1",description:"Candidates resolved to verified graph symbols."},memory:{$ref:"#/$defs/ContextStageV1",description:"Project memory facts, bounded by `memory_limit`."},related:{$ref:"#/$defs/ContextStageV1",description:"Ranked neighbors of the selected symbols, bounded by `max_nodes`."},search:{$ref:"#/$defs/ContextStageV1",description:"Ranked code-index candidates, bounded by `max_nodes`."}},required:["search","graph","related","code","memory"],type:"object"},ContextRetrievalRouteV1:{description:"Which retrieval route `context` ran.\n\n`name` is the preferred-symbol route. `prose` is the ordinary task\nroute. A caller that omits `prefer_symbol` gets `name` only when the\ntask is one identifier or one `Type.method` / `path::name` token.",enum:["name","prose"],type:"string"},ContextSearchMatchV1:{additionalProperties:!1,properties:{anchor_id:{type:"string"},anchors:{description:"Lexical anchors, the caller's and then the task's identifiers, whose\nroute ranked this match; the anchor receipt counts it as returned.",items:{type:"string"},type:"array"},exact_class:{type:"string"},file:{type:"string"},kind:{type:"string"},name:{type:"string"},qualified_name:{type:"string"},rank:{format:"uint32",minimum:0,type:"integer"},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","name","qualified_name","kind","file","exact_class","rank","utility_micros"],type:"object"},ContextStageV1:{description:"What one `context` stage ran with and kept.",oneOf:[{description:"The request did not ask for this stage.",properties:{state:{const:"not_requested",type:"string"}},required:["state"],type:"object"},{description:"A stage this one reads from produced nothing to work on.",properties:{state:{const:"skipped",type:"string"}},required:["state"],type:"object"},{description:"The stage's authority could not answer.",properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"},{description:"The stage admitted `admitted` entries under `budget`. `truncated` is\ntrue when it stopped at that budget, so more entries may exist.",properties:{admitted:{format:"uint32",minimum:0,type:"integer"},budget:{format:"uint32",minimum:0,type:"integer"},state:{const:"ran",type:"string"},truncated:{type:"boolean"}},required:["state","budget","admitted","truncated"],type:"object"}]},FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LexicalAnchorDropReasonV1:_e,LexicalAnchorDropV1:_t,LocatorDigest:_r,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveLaneCompleteV1:_J,PrimitiveLaneStateV1:{enum:["stale","partial","unavailable"],type:"string"},PrimitiveLaneStatusV1:{anyOf:[{$ref:"#/$defs/PrimitiveLaneCompleteV1"},{properties:{generation:{type:["string","null"]},reason:{type:["string","null"]},status:{$ref:"#/$defs/PrimitiveLaneStateV1"}},required:["status"],type:"object"}]},PrimitiveRecallV1:_Q,PrimitiveSearchCoverageV1:{additionalProperties:!1,properties:{exact:{$ref:"#/$defs/PrimitiveLaneStatusV1"},graph:{$ref:"#/$defs/PrimitiveLaneStatusV1"},lexical:{$ref:"#/$defs/PrimitiveLaneStatusV1"},recall:{$ref:"#/$defs/PrimitiveRecallV1"}},required:["exact","lexical","graph","recall"],type:"object"},PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1,PrimitiveUnavailableEvidenceV1:_0,PrimitiveUnavailableStatusV1:_2,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,TokenBudgetCutV1:bD,TokenBudgetSectionV1:bF,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{code:{items:{$ref:"#/$defs/ContextCodeBlockV1"},type:"array"},code_generation:{type:["string","null"]},coverage:{$ref:"#/$defs/PrimitiveSearchCoverageV1"},freshness:{$ref:"#/$defs/PrimitiveSearchFreshnessV1",description:"Freshness of the served code generation, derived from the typed lane\ncoverage and the daemon scheduler's worktree state."},lexical_anchors:{description:"Outcome of every caller `lexical_anchors` entry, then of each\nidentifier the task names; empty when there are neither.",items:{$ref:"#/$defs/ContextLexicalAnchorV1"},type:"array"},memory_graph_coverage:{anyOf:[{$ref:"#/$defs/FactSearchGraphCoverageV1"},{type:"null"}]},memory_matches:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},memory_matches_error:{type:["string","null"]},mode:{$ref:"#/$defs/ContextModeV1"},oversized_symbols:{description:"Matched symbols whose declaration is larger than one code block.\nTheir code is withheld rather than served as a partial window.",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"},plan:{anyOf:[{$ref:"#/$defs/ContextPlanV1"},{type:"null"}],description:"Present in plan mode when the verified graph answered."},related_omission:{anyOf:[{$ref:"#/$defs/ContextRelatedOmissionV1"},{type:"null"}],description:"Present when related symbols were left out: by the `max_nodes` cut,\nor because the neighbor walk stopped at its row limit."},related_symbols:{description:"Neighbors of `symbols`, ranked before the `max_nodes` cut: best edge\nkind to a selected symbol (calls, implements, extends, `type_of`,\nreturns, receives, uses, annotates, contains), then total degree\ndescending, then qualified name.",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"},retrieval:{$ref:"#/$defs/ContextRetrievalPlanV1"},route:{$ref:"#/$defs/ContextRetrievalRouteV1"},search_matches:{items:{$ref:"#/$defs/ContextSearchMatchV1"},type:"array"},symbols:{items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"},task:{type:"string"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."},verified_graph_evidence:{anyOf:[{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"},{type:"null"}]}},required:["task","route","mode","freshness","symbols","related_symbols","code","coverage","memory_matches","retrieval"],title:"ContextResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"}},required:["address"],title:"ContextScoutExactAddressRequestV1",type:"object"},{$defs:{ContextScoutLimitsV1:h9,ContextScoutModelOutcomeV1:h8},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{exhausted:{type:"boolean"},last_estimated_cost_microusd:{format:"uint64",minimum:0,type:["integer","null"]},last_input_tokens:{format:"uint64",minimum:0,type:["integer","null"]},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},last_output_tokens:{format:"uint64",minimum:0,type:["integer","null"]},limits:{$ref:"#/$defs/ContextScoutLimitsV1"}},required:["limits","exhausted"],title:"ContextScoutBudgetResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU,ContextScoutWorkV1:yc},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},idempotency_key:{type:"string"},work:{$ref:"#/$defs/ContextScoutWorkV1"}},required:["address","work","idempotency_key"],title:"ContextScoutCancelRequestV1",type:"object"},{$defs:{ContextScoutStoreOutcomeV1:ya},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{outcome:{$ref:"#/$defs/ContextScoutStoreOutcomeV1"}},required:["outcome"],title:"ContextScoutMutationResultV1",type:"object"},{$defs:{ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutRuntimeModeV1:yr,ContextScoutServiceStateV1:yi},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{configured_model:{anyOf:[{$ref:"#/$defs/ContextScoutModelBackendV1"},{type:"null"}]},configured_model_available:{type:"boolean"},deterministic_available:{type:"boolean"},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},mode:{$ref:"#/$defs/ContextScoutRuntimeModeV1"},state:{$ref:"#/$defs/ContextScoutServiceStateV1"}},required:["state","mode","deterministic_available","configured_model_available"],title:"ContextScoutCapabilityResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU,ContextScoutClaimWindowV1:{enum:["idle_window","on_request"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},idempotency_key:{type:"string"},window:{$ref:"#/$defs/ContextScoutClaimWindowV1"}},required:["address","window","idempotency_key"],title:"ContextScoutClaimRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,ContextScoutAddressV1:hU,ContextScoutCategoryV1:hH,ContextScoutClaimHandleV1:hG,ContextScoutDeliveryWindowV1:hY,ContextScoutEvidenceAvailabilityV1:h1,ContextScoutEvidenceProjectionV1:h0,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRouteV1:yt,ContextScoutSessionWindowV1:yo,ContextScoutSuggestionProjectionV1:ys,ContextScoutWorkV1:yc,ManifestDigest:_l,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{claim:{$ref:"#/$defs/ContextScoutClaimHandleV1"},outcome:{const:"claimed",type:"string"},suggestion:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"}},required:["outcome","claim","suggestion"],type:"object"},{properties:{outcome:{const:"empty",type:"string"}},required:["outcome"],type:"object"}],title:"ContextScoutClaimResultV1"},{$defs:{ContextScoutAddressV1:hU,ContextScoutClaimHandleV1:hG,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutWorkV1:yc,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},claim:{$ref:"#/$defs/ContextScoutClaimHandleV1"},delivered_at:{$ref:"#/$defs/UtcMicros"},idempotency_key:{type:"string"},outcome:{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"}},required:["address","claim","delivered_at","outcome","idempotency_key"],title:"ContextScoutDeliveryRequestV1",type:"object"},{$defs:{ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutStoreOutcomeV1:ya,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{outcome:{$ref:"#/$defs/ContextScoutStoreOutcomeV1"},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"}},required:["outcome","receipt"],title:"ContextScoutDeliveryResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},limit:{default:8,format:"uint",minimum:0,type:"integer"}},required:["address"],title:"ContextScoutRecentRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,ContextScoutAddressV1:hU,ContextScoutCategoryV1:hH,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutDeliveryWindowV1:hY,ContextScoutEvidenceAvailabilityV1:h1,ContextScoutEvidenceProjectionV1:h0,ContextScoutFeedbackKindV1:h2,ContextScoutFeedbackV1:h4,ContextScoutLimitsV1:h9,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRecentDeliveryV1:ye,ContextScoutRecentResultV1:{additionalProperties:!1,properties:{configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},deliveries:{items:{$ref:"#/$defs/ContextScoutRecentDeliveryV1"},type:"array"},observed_at:{$ref:"#/$defs/UtcMicros"},omitted:{format:"uint",minimum:0,type:"integer"},pending:{items:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"},type:"array"}},required:["configuration_revision","observed_at","pending","deliveries","omitted"],type:"object"},ContextScoutRouteV1:yt,ContextScoutRuntimeModeV1:yr,ContextScoutServiceStateV1:yi,ContextScoutSessionWindowV1:yo,ContextScoutStatusResultV1:{additionalProperties:!1,properties:{active_suggestions:{format:"uint",minimum:0,type:"integer"},configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},last_delivery_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"},{type:"null"}]},last_feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackKindV1"},{type:"null"}]},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},last_model_receipt:{anyOf:[{$ref:"#/$defs/ContextScoutModelReceiptV1"},{type:"null"}]},last_route:{anyOf:[{$ref:"#/$defs/ContextScoutRouteV1"},{type:"null"}]},last_suppression:{anyOf:[{$ref:"#/$defs/ContextScoutSuppressionV1"},{type:"null"}]},limits:{$ref:"#/$defs/ContextScoutLimitsV1"},mode:{$ref:"#/$defs/ContextScoutRuntimeModeV1"},model_path:{anyOf:[{$ref:"#/$defs/ContextScoutModelBackendV1"},{type:"null"}]},state:{$ref:"#/$defs/ContextScoutServiceStateV1"}},required:["configuration_revision","state","mode","limits","active_suggestions"],type:"object"},ContextScoutSuggestionProjectionV1:ys,ContextScoutSuppressionV1:yd,ContextScoutWorkV1:yc,ManifestDigest:_l,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{recent:{$ref:"#/$defs/ContextScoutRecentResultV1"},status:{$ref:"#/$defs/ContextScoutStatusResultV1"}},required:["status","recent"],title:"ContextScoutExplanationResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutFeedbackKindV1:h2,ContextScoutFeedbackV1:h4,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},feedback:{$ref:"#/$defs/ContextScoutFeedbackV1"},idempotency_key:{type:"string"},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"}},required:["address","receipt","feedback","idempotency_key"],title:"ContextScoutFeedbackRequestV1",type:"object"},{$defs:{ConfigurationIdempotencyKey:hE,ConfigurationRevisionId:hM,ContextScoutAddressV1:hU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"}},required:["address","expected_revision","idempotency_key"],title:"ContextScoutControlRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,ContextScoutAddressV1:hU,ContextScoutCategoryV1:hH,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutDeliveryWindowV1:hY,ContextScoutEvidenceAvailabilityV1:h1,ContextScoutEvidenceProjectionV1:h0,ContextScoutFeedbackKindV1:h2,ContextScoutFeedbackV1:h4,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRecentDeliveryV1:ye,ContextScoutRouteV1:yt,ContextScoutSessionWindowV1:yo,ContextScoutSuggestionProjectionV1:ys,ContextScoutWorkV1:yc,ManifestDigest:_l,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},deliveries:{items:{$ref:"#/$defs/ContextScoutRecentDeliveryV1"},type:"array"},observed_at:{$ref:"#/$defs/UtcMicros"},omitted:{format:"uint",minimum:0,type:"integer"},pending:{items:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"},type:"array"}},required:["configuration_revision","observed_at","pending","deliveries","omitted"],title:"ContextScoutRecentResultV1",type:"object"},{$defs:{ContextScoutDeliveryOutcomeV1:hQ,ContextScoutFeedbackKindV1:h2,ContextScoutLimitsV1:h9,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRouteV1:yt,ContextScoutRuntimeModeV1:yr,ContextScoutServiceStateV1:yi,ContextScoutSuppressionV1:yd},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{active_suggestions:{format:"uint",minimum:0,type:"integer"},configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},last_delivery_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"},{type:"null"}]},last_feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackKindV1"},{type:"null"}]},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},last_model_receipt:{anyOf:[{$ref:"#/$defs/ContextScoutModelReceiptV1"},{type:"null"}]},last_route:{anyOf:[{$ref:"#/$defs/ContextScoutRouteV1"},{type:"null"}]},last_suppression:{anyOf:[{$ref:"#/$defs/ContextScoutSuppressionV1"},{type:"null"}]},limits:{$ref:"#/$defs/ContextScoutLimitsV1"},mode:{$ref:"#/$defs/ContextScoutRuntimeModeV1"},model_path:{anyOf:[{$ref:"#/$defs/ContextScoutModelBackendV1"},{type:"null"}]},state:{$ref:"#/$defs/ContextScoutServiceStateV1"}},required:["configuration_revision","state","mode","limits","active_suggestions"],title:"ContextScoutStatusResultV1",type:"object"},{$defs:{CouplingDirectionV1:yp},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{anyOf:[{$ref:"#/$defs/CouplingDirectionV1"},{type:"null"}],description:"fan_in: files depended on by the most others. fan_out: files that\ndepend on the most others (default: fan_in)."},limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"CouplingSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CouplingDirectionV1:yp,CouplingEntryV1:{additionalProperties:!1,properties:{coupled_files:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"}},required:["file","coupled_files"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{$ref:"#/$defs/CouplingDirectionV1"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranking:{items:{$ref:"#/$defs/CouplingEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["direction","result_count","ranking"],title:"CouplingResultV1",type:"object"},{$defs:{DashboardActionV1:{description:"What `tracedecay_dashboard` does.",enum:["start","stop"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{action:{anyOf:[{$ref:"#/$defs/DashboardActionV1"},{type:"null"}],description:'Action to perform (default: "start"). "stop" shuts down a previously\nstarted dashboard if any.'},host:{description:'Loopback host address to bind: 127.0.0.1, localhost, or ::1\n(default: "127.0.0.1"). Wildcard, LAN, public IPs, and other\nhostnames are rejected.',type:["string","null"]},port:{description:"Port to listen on; 0 picks an ephemeral port (default: 7341).",format:"uint16",maximum:65535,minimum:0,type:["integer","null"]}},title:"DashboardSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{host:{type:"string"},port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},status:{const:"started",type:"string"},url:{type:"string"}},required:["status","url","host","port"],type:"object"},{additionalProperties:!1,description:"A dashboard that was already bound when `start` was asked again.",properties:{host:{type:"string"},port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_host:{type:"string"},requested_port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_port_honored:{description:"Whether the bound port is the one asked for (always true for 0).",type:"boolean"},status:{const:"already_running",type:"string"},url:{type:"string"}},required:["status","url","host","port","requested_host","requested_port","requested_port_honored"],type:"object"},{additionalProperties:!1,description:"The bound server is shutting down.",properties:{host:{type:"string"},port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_host:{type:"string"},requested_port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_port_honored:{description:"Whether the bound port is the one asked for (always true for 0).",type:"boolean"},status:{const:"stopping",type:"string"},url:{type:"string"}},required:["status","url","host","port","requested_host","requested_port","requested_port_honored"],type:"object"},{additionalProperties:!1,properties:{previous_url:{type:"string"},status:{const:"stopped",type:"string"}},required:["status","previous_url"],type:"object"},{additionalProperties:!1,properties:{status:{const:"not_running",type:"string"}},required:["status"],type:"object"}],title:"DashboardResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_public:{description:"When true, do NOT exclude pub items. Default false.",type:["boolean","null"]},kinds:{description:'Node kinds to check (default: ["function", "method"]).',items:{type:"string"},type:["array","null"]},limit:{description:"Maximum symbols to return (default: 100, max: 1000).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter reported symbols to files under this directory path (e.g.\n'crates/tracedecay-mcp'). Omit for the entire codebase.",type:["string","null"]}},title:"DeadCodeSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DeadCodeSymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},signature:{type:["string","null"]}},required:["id","name","kind","file","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{dead_code_count:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},symbols:{items:{$ref:"#/$defs/DeadCodeSymbolV1"},type:"array"}},required:["dead_code_count","symbols"],title:"DeadCodeResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of chains to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]}},title:"DependencyDepthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DependencyDepthChainV1:{additionalProperties:!1,properties:{chain:{items:{type:"string"},type:"array"},depth:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"}},required:["file","depth","chain"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`ideal_depth` is `ceil(log2(file_count))`.",properties:{chains:{items:{$ref:"#/$defs/DependencyDepthChainV1"},type:"array"},depth_score:{format:"double",type:"number"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ideal_depth:{format:"uint64",minimum:0,type:"integer"},max_depth:{format:"uint64",minimum:0,type:"integer"}},required:["max_depth","ideal_depth","depth_score","chains"],title:"DependencyDepthResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Addresses indexed symbols by node id or by qualified name; the node id\nwins when both are present.",properties:{node_id:{description:"Look up a single node by its ID instead of qualified_name.",type:["string","null"]},qualified_name:{description:"The exact, case-sensitive qualified name to look up. A bare short name\ndoes not match; resolve it with find_exact_symbol first.",type:["string","null"]}},title:"SymbolSelectorSurfaceRequestV1",type:"object"},{$defs:{DeriveAnnotationV1:{additionalProperties:!1,properties:{evidence_class:{$ref:"#/$defs/DeriveEvidenceClassV1"},name:{type:"string"},unavailable_fields:{items:{type:"string"},type:"array"}},required:["name","evidence_class","unavailable_fields"],type:"object"},DeriveEvidenceClassV1:{description:"How a derive name is known: read from the declaration's attributes, not\nfrom macro expansion.",enum:["syntax_exact"],type:"string"},DerivesSymbolV1:{additionalProperties:!1,properties:{derives:{items:{$ref:"#/$defs/DeriveAnnotationV1"},type:"array"},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"}},required:["node_id","name","qualified_name","kind","file","line","derives"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Derive annotations of every addressed symbol; empty when no symbol matched.",items:{$ref:"#/$defs/DerivesSymbolV1"},title:"DerivesResultV1",type:"array"},{$defs:{DiagnoseSeverityFilterV1:{description:"Compiler severity the diagnose report keeps.",enum:["error","warning","all"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cargo_output:{description:"Raw stderr text from `cargo check` / `cargo clippy` / `rustc`.",type:"string"},include_callers:{description:"Attach up to 5 callers per diagnostic (default: true).",type:["boolean","null"]},max_diagnostics:{description:"Cap on diagnostics in the response (default: 50, at most 500).",format:"uint32",minimum:0,type:["integer","null"]},severity:{anyOf:[{$ref:"#/$defs/DiagnoseSeverityFilterV1"},{type:"null"}],description:"Filter by severity (default: all)."}},required:["cargo_output"],title:"DiagnoseSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DiagnoseItemV1:{additionalProperties:!1,properties:{callers:{description:"Absent when the request turned caller attachment off.",items:{$ref:"#/$defs/DiagnoseSymbolV1"},type:["array","null"]},code:{type:["string","null"]},column:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},message:{type:"string"},node:{anyOf:[{$ref:"#/$defs/DiagnoseSymbolV1"},{type:"null"}]},severity:{$ref:"#/$defs/DiagnoseSeverityV1"}},required:["severity","message","file","line","column"],type:"object"},DiagnosePublicationV1:{description:"Outcome of publishing the parsed diagnostics into the managed store.",oneOf:[{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"skipped",type:"string"},unresolved:{items:{type:"string"},type:["array","null"]}},required:["status","reason"],type:"object"},{additionalProperties:!1,properties:{cleared:{format:"uint64",minimum:0,type:"integer"},generation:{type:"string"},inserted:{format:"uint64",minimum:0,type:"integer"},publication_revision:{format:"uint64",minimum:0,type:"integer"},rejected:{items:{type:"string"},type:"array"},status:{const:"published",type:"string"},unresolved:{items:{type:"string"},type:"array"}},required:["status","generation","publication_revision","inserted","cleared","unresolved","rejected"],type:"object"},{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"failed",type:"string"}},required:["status","reason"],type:"object"}]},DiagnoseSeverityV1:{description:"Severity of one parsed compiler diagnostic.",enum:["error","warning","note","help"],type:"string"},DiagnoseSymbolV1:{additionalProperties:!1,description:"The graph symbol a diagnostic line falls in, or one of its callers.",properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},kind:{type:"string"},line:{description:"One-based display line.",format:"uint32",minimum:0,type:"integer"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["node_id","name","kind","qualified_name","file","line","start_line","end_line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{diagnostics:{items:{$ref:"#/$defs/DiagnoseItemV1"},type:"array"},diagnostics_parsed:{format:"uint64",minimum:0,type:"integer"},diagnostics_returned:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},mapped_to_node:{format:"uint64",minimum:0,type:"integer"},published:{$ref:"#/$defs/DiagnosePublicationV1"},truncated:{type:"boolean"},unmapped:{format:"uint64",minimum:0,type:"integer"}},required:["diagnostics_parsed","diagnostics_returned","mapped_to_node","unmapped","truncated","published","diagnostics"],title:"DiagnoseResultV1",type:"object"},{$defs:{DiagnosticsPrimitiveScope:{oneOf:[{enum:["workspace"],type:"string"},{additionalProperties:!1,properties:{package:{type:"string"}},required:["package"],type:"object"},{additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],type:"object"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{default:null,type:["string","null"]},maximum_diagnostics:{format:"uint32",minimum:0,type:"integer"},scope:{$ref:"#/$defs/DiagnosticsPrimitiveScope"}},required:["scope","maximum_diagnostics"],title:"DiagnosticsPrimitiveRequest",type:"object"},{$defs:{CodeGenerationId:hy,CommitId:hq,ComponentVersion:hC,ContentDigest:hD,DiagnosticEvidenceClassV1:{description:"Evidence class for one diagnostic record. Evidence class is part of\ncanonical diagnostic identity.",oneOf:[{const:"observed_current",description:"Directly observed against the exact clean generation it names.",type:"string"},{const:"producer_reported",description:"Reported by the cataloged producer for the exact clean generation.",type:"string"},{const:"derived_structural",description:"Derived from TraceDecay structural/graph analysis of the generation.",type:"string"},{const:"unknown_unsupported",description:"The evidence class cannot be established; the record is retained for\naudit but must not be treated as current truth.",type:"string"}]},DiagnosticPrimitiveRecord:{additionalProperties:!1,properties:{diagnostic:{$ref:"#/$defs/GenerationDiagnosticV1"},logical_path:{type:"string"}},required:["logical_path","diagnostic"],type:"object"},DiagnosticProducerKindV1:{description:"The cataloged producer kinds that may publish durable diagnostics.\nRuntime, storage, migration,\nconfiguration, session, or daemon-health findings without a truthful\nsource range are Doctor or application findings and never become\n`GenerationDiagnosticV1` records.",enum:["upstream_compiler","language_server","tracedecay_structural","tracedecay_graph_integrity","tracedecay_policy","tracedecay_code_health","generation_consistency","authorized_external_analyzer"],type:"string"},DiagnosticProvenanceV1:{additionalProperties:!1,description:"Producer provenance for one diagnostic. Diagnostic identity includes\nproducer provenance: identical findings from the same logical producer and\nrevision collapse; findings from distinct producers remain distinct.",properties:{analyzer_revision:{$ref:"#/$defs/ComponentVersion"},configuration_revision:{$ref:"#/$defs/ComponentVersion"},producer:{$ref:"#/$defs/ProviderId"},producer_kind:{$ref:"#/$defs/DiagnosticProducerKindV1"},sanitization_receipt:{anyOf:[{$ref:"#/$defs/SanitizationReceiptId"},{type:"null"}]}},required:["producer_kind","producer","analyzer_revision","configuration_revision"],type:"object"},DiagnosticRecordStateV1:{description:"Current-vs-stale typing for a durable diagnostic record. Publication is\nversion-monotone: a newer clean generation clears the prior publication\ndeterministically, and stale findings cannot cross snapshots.\nStale and historical records remain queryable through\napplication APIs but are excluded from active publication.",oneOf:[{description:"Current for exactly the clean generation named by the record.",properties:{kind:{const:"current",type:"string"}},required:["kind"],type:"object"},{description:"A clean generation completed and deterministically removed this\nfinding (resolution, deletion, source-revision drift, or content or\ngeneration change).",properties:{cleared_in_generation:{$ref:"#/$defs/CodeGenerationId"},kind:{const:"cleared",type:"string"}},required:["kind","cleared_in_generation"],type:"object"}]},DiagnosticSeverityV1:y$,FileOccurrenceId:gs,GenerationDiagnosticV1:{additionalProperties:!1,description:"One durable, generation-bound diagnostic record. Its diagnostic payload,\nscope, and producer provenance form observation identity; the display\nmessage remains sanitized product data.",properties:{code:{description:"Stable producer diagnostic code (for example `E0308`).",type:"string"},collected_at:{$ref:"#/$defs/UtcMicros",description:"Time the server first accepted this evidence observation. Compiler\noutput does not carry a trustworthy producer capture time, and an exact\nsemantic replay retains the first accepted value."},content_digest:{$ref:"#/$defs/ContentDigest",description:"Content digest of the attached file inside the generation."},diagnostic_anchor:{$ref:"#/$defs/RetrievalAnchorId",description:"Retrieval anchor addressing this record. The code index's\n`GenerationDiagnosticAttachmentV1::diagnostic_anchor` points here."},evidence_class:{$ref:"#/$defs/DiagnosticEvidenceClassV1"},file_occurrence_id:{$ref:"#/$defs/FileOccurrenceId",description:"Canonical file identity the diagnostic attaches to."},generation_id:{$ref:"#/$defs/CodeGenerationId",description:"The immutable clean code-intelligence generation this record is bound\nto. Findings never cross generations."},message:{description:"Sanitized display message; bounded by [`MAX_DIAGNOSTIC_MESSAGE_BYTES`].",type:"string"},message_digest:{$ref:"#/$defs/ManifestDigest",description:"Integrity digest over the sanitized message."},provenance:{$ref:"#/$defs/DiagnosticProvenanceV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository:{$ref:"#/$defs/RepositoryId"},severity:{$ref:"#/$defs/DiagnosticSeverityV1"},source_revision:{anyOf:[{$ref:"#/$defs/CommitId"},{type:"null"}]},span:{$ref:"#/$defs/SourceSpan",description:"Range encoding inside the sanitized file (byte range; mutable line\nnumbers are never identity)."},state:{$ref:"#/$defs/DiagnosticRecordStateV1",description:"Current-vs-stale typing; publication is version-monotone."},symbol_occurrence_id:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}],description:"Enclosing symbol occurrence, when exact attachment is possible."},worktree:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["diagnostic_anchor","generation_id","repository","file_occurrence_id","content_digest","span","code","severity","message","message_digest","provenance","evidence_class","collected_at","state"],type:"object"},ManifestDigest:_l,ProviderId:vo,RefId:vm,RepositoryId:vb,RetrievalAnchorId:vI,SanitizationReceiptId:{description:"Strongly typed canonical identity: `SanitizationReceiptId`.",type:"string"},SourceSpan:b$,SymbolOccurrenceId:bq,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{clean_generation:{type:"boolean"},diagnostics:{items:{$ref:"#/$defs/DiagnosticPrimitiveRecord"},type:"array"},findings_cleared:{type:"boolean"},generation_id:{$ref:"#/$defs/CodeGenerationId"},next_cursor:{type:["string","null"]}},required:["generation_id","clean_generation","findings_cleared","diagnostics"],title:"DiagnosticsPrimitiveResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{budget_tokens:{description:"Cap the symbol, test, and co-change sections at about this many tokens.",format:"uint32",minimum:0,type:["integer","null"]},depth:{description:"Maximum impact traversal depth (default: 2, at most 10).",format:"uint32",minimum:0,type:["integer","null"]},files:{description:"Files to inspect prospectively. All indexed declarations in these files\nare candidates; this does not select exact Git-changed declarations.",items:{type:"string"},type:"array"}},required:["files"],title:"DiffContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hf,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitContextComparisonV1:gg,GitContextSymbolV1:g_,GitOidV1:gq,IncompatibleCallSiteV1:{additionalProperties:!1,description:"A call site whose argument count cannot invoke the new parameter list.",properties:{arguments:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","file","line","arguments"],type:"object"},MissingCoChangePartnerV1:_w,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,SignatureEditStatusV1:{description:"How a modified function's parameter list compares with HEAD.",enum:["contract_change"],type:"string"},SignatureEditV1:{additionalProperties:!1,description:"A Rust free function whose parameter count differs from HEAD.",properties:{file:{type:"string"},incompatible:{items:{$ref:"#/$defs/IncompatibleCallSiteV1"},type:"array"},new_parameters:{format:"uint32",minimum:0,type:["integer","null"]},old_parameters:{format:"uint32",minimum:0,type:["integer","null"]},status:{$ref:"#/$defs/SignatureEditStatusV1"},symbol:{type:"string"}},required:["symbol","file","status","incompatible"],type:"object"},TestGateV1:{additionalProperties:!1,description:"Whether tests reach the symbols in a diff's blast radius.\n\n`pass` and exit 0 when every counted symbol is reached. `fail` and exit 4\nname the ones that are not. `incomplete` and exit 0 mean the caller walk\nstopped before that absence is known.",properties:{exit_code:{format:"uint8",maximum:255,minimum:0,type:"integer"},untested:{items:{type:"string"},type:"array"},verdict:{type:"string"}},required:["verdict","exit_code","untested"],type:"object"},TokenBudgetCutV1:bD,TokenBudgetSectionV1:bF},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{affected_tests:{items:{type:"string"},type:"array"},changed_files:{items:{type:"string"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},comparison:{anyOf:[{$ref:"#/$defs/GitContextComparisonV1"},{type:"null"}]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},impact_complete:{description:"False when the impact walk stopped at its depth or budget with callers\nstill unexplored.",type:"boolean"},impacted_symbols:{items:{$ref:"#/$defs/GitContextSymbolV1"},type:"array"},impacted_symbols_count:{format:"uint",minimum:0,type:"integer"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified_symbols:{items:{$ref:"#/$defs/GitContextSymbolV1"},type:"array"},signature_edits:{description:"Rust free functions whose parameter count changed since HEAD, with the\ncall sites that list cannot accept. Omitted when nothing changed.",items:{$ref:"#/$defs/SignatureEditV1"},type:"array"},test_gate:{$ref:"#/$defs/TestGateV1",description:"Symbols in this diff that no test reaches, and the verdict a CLI exits on."},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."}},required:["changed_files","modified_symbols","impacted_symbols_count","impacted_symbols","impact_complete","affected_tests","missing_co_change_partners","test_gate"],title:"DiffContextResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of files in the per-file breakdown, highest node count\nfirst (default: 100, max: 1000). Ignored when summary is true; the\nresponse states total_file_count and omitted_file_count.",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Directory or file path prefix to filter (e.g.\n'src/main/java/com/example'). Omit for entire codebase.",type:["string","null"]},summary:{description:"If true, aggregate counts across all matching files instead of\nper-file breakdown (default: false).",type:["boolean","null"]}},title:"DistributionSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DistributionFileV1:{additionalProperties:!1,properties:{file:{type:"string"},kinds:{items:{$ref:"#/$defs/DistributionKindCountV1"},type:"array"}},required:["file","kinds"],type:"object"},DistributionKindCountV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{type:"string"}},required:["kind","count"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Flattening the tagged view keeps `path_filter` ahead of `mode` on the\nwire; serde cannot deny unknown fields through a flattened member.",oneOf:[{properties:{distribution:{items:{$ref:"#/$defs/DistributionKindCountV1"},type:"array"},mode:{const:"summary",type:"string"},total_kinds:{format:"uint64",minimum:0,type:"integer"}},required:["mode","total_kinds","distribution"],type:"object"},{properties:{file_count:{format:"uint64",minimum:0,type:"integer"},files:{items:{$ref:"#/$defs/DistributionFileV1"},type:"array"},mode:{const:"per_file",type:"string"},omitted_file_count:{format:"uint64",minimum:0,type:"integer"},total_file_count:{format:"uint64",minimum:0,type:"integer"}},required:["mode","file_count","total_file_count","omitted_file_count","files"],type:"object"}],properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},path_filter:{type:["string","null"]}},title:"DistributionResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 50, at most 500).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Directory or file path prefix to filter (e.g. 'src/main'). Omit for\nentire codebase.",type:["string","null"]}},title:"DocCoverageSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DocCoverageFileV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},symbols:{items:{$ref:"#/$defs/DocCoverageSymbolV1"},type:"array"}},required:["file","count","symbols"],type:"object"},DocCoverageSymbolV1:{additionalProperties:!1,properties:{id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},signature:{type:["string","null"]}},required:["id","name","kind","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{complete:{type:"boolean"},file_count:{format:"uint64",minimum:0,type:"integer"},files:{items:{$ref:"#/$defs/DocCoverageFileV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint64",minimum:0,type:"integer"},omitted_count:{format:"uint64",minimum:0,type:"integer"},path_filter:{type:["string","null"]},returned_count:{format:"uint64",minimum:0,type:"integer"},total_undocumented:{format:"uint64",minimum:0,type:"integer"}},required:["total_undocumented","returned_count","omitted_count","complete","limit","file_count","files"],title:"DocCoverageResultV1",type:"object"},{$defs:{DsmShapeV1:yw},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{max_files:{description:"Maximum files in matrix format (default: 30, at most 200).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]},shape:{anyOf:[{$ref:"#/$defs/DsmShapeV1"},{type:"null"}],description:"DSM data shape: stats, clusters, or matrix (default: stats)."}},title:"DsmSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DsmClusterV1:{additionalProperties:!1,properties:{boundary_edges:{format:"uint64",minimum:0,type:"integer"},directory:{type:"string"},file_count:{format:"uint64",minimum:0,type:"integer"},incoming_edges:{format:"uint64",minimum:0,type:"integer"},internal_edges:{format:"uint64",minimum:0,type:"integer"},outgoing_edges:{format:"uint64",minimum:0,type:"integer"}},required:["directory","file_count","internal_edges","outgoing_edges","incoming_edges","boundary_edges"],type:"object"},DsmMatrixV1:{additionalProperties:!1,properties:{files:{items:{type:"string"},type:"array"},matrix:{items:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},type:"array"},note:{type:"string"}},required:["files","matrix","note"],type:"object"},DsmShapeV1:yw,DsmStatsV1:{additionalProperties:!1,properties:{clusters:{format:"uint64",minimum:0,type:"integer"},density:{format:"double",type:"number"},edges:{format:"uint64",minimum:0,type:"integer"},files:{format:"uint64",minimum:0,type:"integer"},largest_cluster:{format:"uint64",minimum:0,type:"integer"}},required:["files","edges","density","clusters","largest_cluster"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{clusters:{items:{$ref:"#/$defs/DsmClusterV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},matrix:{anyOf:[{$ref:"#/$defs/DsmMatrixV1"},{type:"null"}]},shape:{$ref:"#/$defs/DsmShapeV1"},stats:{$ref:"#/$defs/DsmStatsV1"}},required:["shape","stats","clusters"],title:"DsmResultV1",type:"object"},{$defs:{FactEventId:yz,FactFeedbackActionV1:yD,FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{action:{$ref:"#/$defs/FactFeedbackActionV1"},expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},reason:{type:["string","null"]},source_label:{type:["string","null"]}},required:["fact_id","action"],title:"FactFeedbackRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactFeedbackActionV1:yD,FactFeedbackV1:{additionalProperties:!1,properties:{action:{$ref:"#/$defs/FactFeedbackActionV1"},event_id:{$ref:"#/$defs/FactEventId"},fact_id:{$ref:"#/$defs/FactId"},helpful_count:{format:"uint64",minimum:0,type:"integer"},new_trust_millionths:{format:"uint32",minimum:0,type:"integer"},old_trust_millionths:{format:"uint32",minimum:0,type:"integer"},trust_delta_millionths:{format:"int32",type:"integer"},unhelpful_count:{format:"uint64",minimum:0,type:"integer"}},required:["event_id","fact_id","action","old_trust_millionths","new_trust_millionths","trust_delta_millionths","helpful_count","unhelpful_count"],type:"object"},FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact:{$ref:"#/$defs/FactProjectionV1"},feedback:{$ref:"#/$defs/FactFeedbackV1"}},required:["fact","feedback","commit"],title:"FactFeedbackResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},content:{type:"string"},entities:{default:[],items:{type:"string"},type:"array"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},metadata:{additionalProperties:!0,type:["object","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},source_label:{type:["string","null"]},tags:{default:[],items:{type:"string"},type:"array"},trust:{format:"double",type:["number","null"]}},required:["content"],title:"FactStoreAddRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactStoreAddCommitV1:{oneOf:[{additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},disposition:{const:"added",type:"string"},fact:{$ref:"#/$defs/FactProjectionV1"}},required:["disposition","fact","commit"],type:"object"},{additionalProperties:!1,properties:{closest_fact_id:{$ref:"#/$defs/FactId"},commit:{$ref:"#/$defs/FactCommitReceiptV1"},disposition:{const:"near_duplicate",type:"string"},fact:{$ref:"#/$defs/FactProjectionV1"},similarity_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["disposition","fact","closest_fact_id","similarity_millionths","commit"],type:"object"},{additionalProperties:!1,properties:{closest_fact_id:{$ref:"#/$defs/FactId"},commit:{$ref:"#/$defs/FactCommitReceiptV1"},disposition:{const:"possible_conflict",type:"string"},fact:{$ref:"#/$defs/FactProjectionV1"},similarity_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["disposition","fact","closest_fact_id","similarity_millionths","commit"],type:"object"}]},FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{outcome:{const:"secret_rejected",type:"string"}},required:["outcome"],type:"object"},{additionalProperties:!1,properties:{closest_fact_id:{$ref:"#/$defs/FactId"},fact:{$ref:"#/$defs/FactProjectionV1"},outcome:{const:"normalized_duplicate",type:"string"}},required:["outcome","fact","closest_fact_id"],type:"object"},{additionalProperties:!1,properties:{outcome:{const:"committed",type:"string"},result:{$ref:"#/$defs/FactStoreAddCommitV1"}},required:["outcome","result"],type:"object"}],title:"FactStoreAddResultV1"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},threshold_millionths:{format:"uint32",minimum:0,type:["integer","null"]}},title:"FactStoreContradictRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactContradictionV1:{additionalProperties:!1,properties:{existing_fact:{$ref:"#/$defs/FactV1"},new_content:{type:"string"},score_millionths:{format:"uint32",minimum:0,type:"integer"},why:{type:["string","null"]}},required:["existing_fact","new_content","score_millionths"],type:"object"},FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{contradictions:{items:{$ref:"#/$defs/FactContradictionV1"},type:"array"},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","contradictions"],title:"FactStoreContradictResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Closed public launcher for the automatic Memory Curator.\n\nRun identity, task selection, operations, proposals, approval, and apply\nauthority are deliberately absent and rejected by `deny_unknown_fields`.",properties:{fact_review_limit:{default:24,format:"uint32",maximum:1e3,minimum:1,type:"integer"},min_confidence_millionths:{default:72e4,format:"uint32",maximum:1e6,minimum:0,type:"integer"}},title:"FactStoreCurateRequestV1",type:"object"},{$defs:{AutomationTaskV1:{description:"Automation capability selected after one registered application admission.",enum:["memory_curator","session_reflector","skill_writer","combined_review","user_job"],type:"string"},FactStoreCurateStateV1:{description:"Lifecycle state a `fact_store_curate` receipt reports.",oneOf:[{const:"started",description:"The run was admitted and continues on the daemon.",type:"string"}]},ManifestDigest:_l,RunId:vF},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Receipt of one admitted automatic curation.\n\nThe curator runs on the daemon after this receipt is returned. Its terminal\nis the automation run ledger record for `run_id`, read with\n`automation_run_view`.",properties:{request_digest:{$ref:"#/$defs/ManifestDigest"},run_id:{$ref:"#/$defs/RunId"},state:{$ref:"#/$defs/FactStoreCurateStateV1"},task:{$ref:"#/$defs/AutomationTaskV1"}},required:["run_id","task","request_digest","state"],title:"FactStoreCurateResultV1",type:"object"},{$defs:{FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["fact_id"],title:"FactStoreGetRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactFeedbackActionV1:yD,FactFeedbackDetailsAvailabilityV1:{enum:["available","redacted","unknown"],type:"string"},FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,TrustHistoryEntryV1:{additionalProperties:!1,properties:{action:{$ref:"#/$defs/FactFeedbackActionV1"},details_availability:{$ref:"#/$defs/FactFeedbackDetailsAvailabilityV1"},event_id:{$ref:"#/$defs/FactEventId"},new_trust_millionths:{format:"uint32",minimum:0,type:"integer"},occurred_at:{$ref:"#/$defs/UtcMicros"},old_trust_millionths:{format:"uint32",minimum:0,type:"integer"},reason:{type:["string","null"]},source_label:{type:["string","null"]}},required:["event_id","occurred_at","action","old_trust_millionths","new_trust_millionths","details_availability"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactProjectionV1"},trust_history:{items:{$ref:"#/$defs/TrustHistoryEntryV1"},type:"array"}},required:["fact","trust_history"],title:"FactStoreGetResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},title:"FactStoreListRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{facts:{items:{$ref:"#/$defs/FactProjectionV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","facts"],title:"FactStoreListResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},entity:{type:"string"},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["entity"],title:"FactStoreProbeRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","hits","graph_coverage"],title:"FactStoreProbeResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},entities:{items:{type:"string"},minItems:1,type:"array"},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["entities"],title:"FactStoreReasonRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","hits","graph_coverage"],title:"FactStoreReasonResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},entity:{type:"string"},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["entity"],title:"FactStoreRelatedRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","hits","graph_coverage"],title:"FactStoreRelatedResultV1",type:"object"},{$defs:{FactEventId:yz,FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["fact_id"],title:"FactStoreRemoveRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact:{$ref:"#/$defs/FactProjectionV1"},outcome:{const:"removed",type:"string"},remaining_fact_count:{format:"uint64",minimum:0,type:"integer"}},required:["outcome","fact","remaining_fact_count","commit"],type:"object"},{additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactProjectionV1"},outcome:{const:"already_removed",type:"string"},remaining_fact_count:{format:"uint64",minimum:0,type:"integer"}},required:["outcome","fact","remaining_fact_count"],type:"object"}],title:"FactStoreRemoveResultV1"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},query:{type:"string"}},required:["query"],title:"FactStoreSearchRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactRetrievalTelemetryDegradationV1:{enum:["unavailable","saturated"],type:"string"},FactRetrievalTelemetryV1:{description:"Whether an explicit search recorded retrieval telemetry for its hits.\n\nThe telemetry write is recall bookkeeping, not part of the returned\nevidence: when only that lane is unavailable the search still delivers its\nresult and reports the degradation here instead of refusing the read.",oneOf:[{additionalProperties:!1,description:"The result had no hits, so there was nothing to record.",properties:{kind:{const:"not_applicable",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,description:"The selected store is mounted read-only; recording is never attempted.",properties:{kind:{const:"read_only",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{fact_count:{format:"uint",minimum:0,type:"integer"},kind:{const:"recorded",type:"string"}},required:["kind","fact_count"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"degraded",type:"string"},reason:{$ref:"#/$defs/FactRetrievalTelemetryDegradationV1"}},required:["kind","reason"],type:"object"}]},FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Explicit search additionally records retrieval telemetry for its returned\nhits; `retrieval_telemetry` reports whether that recall bookkeeping\nhappened, so a served result can truthfully carry a degraded write lane.",properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"},retrieval_telemetry:{$ref:"#/$defs/FactRetrievalTelemetryV1"}},required:["owner","hits","graph_coverage","retrieval_telemetry"],title:"FactStoreSearchResultV1",type:"object"},{$defs:{FactEventId:yz,FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Mark `fact_id` as superseded by `superseded_by`. The old fact leaves the\ndefault retrieval surfaces but stays readable by id through its history;\npayload and trust are never rewritten.",properties:{expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},superseded_by:{$ref:"#/$defs/FactId"}},required:["fact_id","superseded_by"],title:"FactStoreSupersedeRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Outcome of an explicit supersession. `superseded` carries the durable\ncommit receipt of the `Curated { SupersededBy }` lineage event;\n`already_superseded` reports the successor already recorded for the fact.",oneOf:[{additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact_id:{$ref:"#/$defs/FactId"},outcome:{const:"superseded",type:"string"},superseded_by:{$ref:"#/$defs/FactId"}},required:["outcome","fact_id","superseded_by","commit"],type:"object"},{additionalProperties:!1,properties:{fact_id:{$ref:"#/$defs/FactId"},outcome:{const:"already_superseded",type:"string"},superseded_by:{$ref:"#/$defs/FactId"}},required:["outcome","fact_id","superseded_by"],type:"object"}],title:"FactStoreSupersedeResultV1"},{$defs:{FactCategoryV1:yA,FactEventId:yz,FactId:yF,FactSourceLabelPatchV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"set",type:"string"},value:{type:"string"}},required:["kind","value"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"clear",type:"string"}},required:["kind"],type:"object"}]},MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},content:{type:["string","null"]},entities:{items:{type:"string"},type:["array","null"]},expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},metadata:{additionalProperties:!0,type:["object","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},source_label:{anyOf:[{$ref:"#/$defs/FactSourceLabelPatchV1"},{type:"null"}]},tags:{items:{type:"string"},type:["array","null"]},trust:{format:"double",type:["number","null"]}},required:["fact_id"],title:"FactStoreUpdateRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact:{$ref:"#/$defs/FactProjectionV1"},trust_delta_millionths:{format:"int32",type:"integer"}},required:["fact","trust_delta_millionths","commit"],title:"FactStoreUpdateResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Explicit advisory-cycle trigger for one document in the admitted project.",properties:{document_uri:{type:"string"}},required:["document_uri"],title:"FeedbackAdvisoryCycleSurfaceRequestV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,DiagnosticSeverityV1:y$,FeedbackAdvisoryCycleWireV1:{additionalProperties:!1,description:"One canonical cycle result plus whether its durable publication committed.\n\n`published` intentionally remains adjacent to the cycle fields on the\nwire: publication is a property of this exact cycle, not of a page or a\nlater lookup.",properties:{advisory_only:{type:"boolean"},advisory_provider_states:{items:{$ref:"#/$defs/FeedbackAdvisoryProviderStateV1"},type:"array"},affected_tests_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},baseline_states:{items:{$ref:"#/$defs/FeedbackBaselineStateV1"},type:"array"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},durability:{$ref:"#/$defs/FeedbackDurabilityV1"},findings:{items:{$ref:"#/$defs/FeedbackFindingV1"},type:"array"},impact:{anyOf:[{$ref:"#/$defs/FeedbackImpactV1"},{type:"null"}]},impact_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},omitted_findings:{format:"uint64",minimum:0,type:"integer"},policy_digest:{$ref:"#/$defs/ManifestDigest"},provider_states:{items:{$ref:"#/$defs/ProviderEvaluationStateV1"},type:"array"},published:{type:"boolean"},result_id:{$ref:"#/$defs/FeedbackResultId"},returned_findings:{format:"uint64",minimum:0,type:"integer"},scope:{$ref:"#/$defs/FeedbackScopeV1"},termination:{$ref:"#/$defs/FeedbackCycleTerminationV1"},total_findings:{format:"uint64",minimum:0,type:"integer"}},required:["result_id","cycle_id","scope","durability","policy_digest","configuration_digest","termination","provider_states","baseline_states","findings","total_findings","returned_findings","omitted_findings","advisory_only","published"],type:"object"},FeedbackAdvisoryFindingHandleV1:{additionalProperties:!1,description:"One daemon-minted read-handle pair for a finding in the published cycle.",properties:{expansion_handle:{type:["string","null"]},finding_id:{$ref:"#/$defs/FeedbackFindingId"},get_handle:{type:"string"},retrieval_anchor_id:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]}},required:["finding_id","get_handle"],type:"object"},FeedbackAdvisoryProviderStateV1:yY,FeedbackAdvisoryReadHandlesV1:{additionalProperties:!1,description:"Daemon-minted handles for reads over this exact publication.",properties:{affected_tests_handle:{type:"string"},diagnostics_handle:{type:"string"},impact_handle:{type:"string"},list_handle:{type:"string"}},required:["diagnostics_handle","impact_handle","affected_tests_handle","list_handle"],type:"object"},FeedbackBaselineStateV1:y1,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackCycleTerminationV1:y4,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackDurabilityV1:y5,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingV1:gt,FeedbackImpactStateV1:gr,FeedbackImpactV1:gi,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact advisory-cycle payload serialized by the mounted daemon route.",properties:{cycle:{$ref:"#/$defs/FeedbackAdvisoryCycleWireV1"},finding_handles:{items:{$ref:"#/$defs/FeedbackAdvisoryFindingHandleV1"},type:"array"},read_handles:{anyOf:[{$ref:"#/$defs/FeedbackAdvisoryReadHandlesV1"},{type:"null"}]}},required:["cycle","finding_handles"],title:"FeedbackAdvisoryCycleSurfaceResultV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,DiagnosticSeverityV1:y$,FeedbackAdvisoryProviderStateV1:yY,FeedbackBaselineStateV1:y1,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackCycleResultV1:{additionalProperties:!1,description:"One deterministic result for one trigger. The result represents a\nterminal advisory evaluation and contains no next-action execution hook.",properties:{advisory_only:{type:"boolean"},advisory_provider_states:{items:{$ref:"#/$defs/FeedbackAdvisoryProviderStateV1"},type:"array"},affected_tests_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},baseline_states:{items:{$ref:"#/$defs/FeedbackBaselineStateV1"},type:"array"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},durability:{$ref:"#/$defs/FeedbackDurabilityV1"},findings:{items:{$ref:"#/$defs/FeedbackFindingV1"},type:"array"},impact:{anyOf:[{$ref:"#/$defs/FeedbackImpactV1"},{type:"null"}]},impact_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},omitted_findings:{format:"uint64",minimum:0,type:"integer"},policy_digest:{$ref:"#/$defs/ManifestDigest"},provider_states:{items:{$ref:"#/$defs/ProviderEvaluationStateV1"},type:"array"},result_id:{$ref:"#/$defs/FeedbackResultId"},returned_findings:{format:"uint64",minimum:0,type:"integer"},scope:{$ref:"#/$defs/FeedbackScopeV1"},termination:{$ref:"#/$defs/FeedbackCycleTerminationV1"},total_findings:{format:"uint64",minimum:0,type:"integer"}},required:["result_id","cycle_id","scope","durability","policy_digest","configuration_digest","termination","provider_states","baseline_states","findings","total_findings","returned_findings","omitted_findings","advisory_only"],type:"object"},FeedbackCycleTerminationV1:y4,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackDurabilityV1:y5,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingV1:gt,FeedbackImpactStateV1:gr,FeedbackImpactV1:gi,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycle:{$ref:"#/$defs/FeedbackCycleResultV1"}},required:["cycle"],title:"FeedbackDiagnosticsReadResultV1",type:"object"},{$defs:{AnchorExpandResult:{additionalProperties:!1,properties:{anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"}},required:["anchors"],type:"object"},CommitId:hq,DiagnosticSeverityV1:y$,FeedbackCycleId:y2,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingReadV1:ge,FeedbackFindingV1:gt,FeedbackResultId:go,FeedbackScopeV1:gn,FileOccurrenceId:gs,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expansion:{$ref:"#/$defs/AnchorExpandResult"},finding:{$ref:"#/$defs/FeedbackFindingReadV1"}},required:["finding","expansion"],title:"FeedbackExpandResultV1",type:"object"},{$defs:{CommitId:hq,DiagnosticSeverityV1:y$,FeedbackCycleId:y2,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingReadV1:ge,FeedbackFindingV1:gt,FeedbackResultId:go,FeedbackScopeV1:gn,FileOccurrenceId:gs,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{finding:{$ref:"#/$defs/FeedbackFindingReadV1"}},required:["finding"],title:"FeedbackGetResultV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackImpactStateV1:gr,FeedbackImpactV1:gi,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical impact projection returned by `feedback_impact`.\n\nThe daemon-side projection owner (usecases) re-exports this type; it lives\nhere so the catalog contribution can register its schema body as the single\nRust-owned wire authority. Results project from an authorized completed\ncycle, and the canonical response wire remains consumable by typed SDKs.",properties:{content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},impact:{anyOf:[{$ref:"#/$defs/FeedbackImpactV1"},{type:"null"}]},result_id:{$ref:"#/$defs/FeedbackResultId"},scope:{$ref:"#/$defs/FeedbackScopeV1"},state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]}},required:["result_id","cycle_id","scope"],title:"CanonicalFeedbackImpactProjectionV1",type:"object"},{$defs:{CommitId:hq,DiagnosticSeverityV1:y$,FeedbackCycleId:y2,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingReadV1:ge,FeedbackFindingV1:gt,FeedbackResultId:go,FeedbackScopeV1:gn,FileOccurrenceId:gs,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{findings:{items:{$ref:"#/$defs/FeedbackFindingReadV1"},type:"array"}},required:["findings"],title:"FeedbackListResultV1",type:"object"},{$defs:{UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"}},required:["observed_at"],title:"FeedbackProximityReadRequestV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,FeedbackProximityAccessKindV1:{enum:["read","write"],type:"string"},FeedbackProximityCloneHandleV1:{additionalProperties:!1,properties:{retrieval_anchor_ids:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},source_generation:{$ref:"#/$defs/CodeGenerationId"},source_symbol:{$ref:"#/$defs/SymbolOccurrenceId"}},required:["source_generation","source_symbol","retrieval_anchor_ids"],type:"object"},FeedbackProximityConflictDifferenceV1:{additionalProperties:!1,properties:{difference_digest:{$ref:"#/$defs/ManifestDigest"},file:{$ref:"#/$defs/FileOccurrenceId"},span:{$ref:"#/$defs/SourceSpan"}},required:["file","span","difference_digest"],type:"object"},FeedbackProximityConflictHandleV1:{additionalProperties:!1,properties:{common_base_revision:{$ref:"#/$defs/CommitId"},differences:{items:{$ref:"#/$defs/FeedbackProximityConflictDifferenceV1"},type:"array"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},left_head_revision:{$ref:"#/$defs/CommitId"},right_head_revision:{$ref:"#/$defs/CommitId"}},required:["common_base_revision","left_head_revision","right_head_revision","evidence_digest","differences"],type:"object"},FeedbackProximityEncounterV1:{additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/ProximityCoverageV1"},encounter_id:{$ref:"#/$defs/ManifestDigest"},expires_at:{$ref:"#/$defs/UtcMicros"},interval:{$ref:"#/$defs/FeedbackProximityIntervalV1"},observed_at:{$ref:"#/$defs/UtcMicros"},participants:{items:{$ref:"#/$defs/FeedbackProximityParticipantV1"},type:"array"},relation:{$ref:"#/$defs/FeedbackProximityRelationV1"},scope:{$ref:"#/$defs/FeedbackScopeV1"}},required:["encounter_id","scope","interval","participants","relation","observed_at","expires_at","coverage"],type:"object"},FeedbackProximityIntervalV1:{additionalProperties:!1,properties:{end:{$ref:"#/$defs/UtcMicros"},start:{$ref:"#/$defs/UtcMicros"}},required:["start","end"],type:"object"},FeedbackProximityOmissionV1:{enum:["active_session_limit","session_activity_limit","recent_observation_limit","edited_path_limit","encounter_limit","missing_participant_observation","missing_participant_worktree","missing_participant_revision","missing_code_address","clone_coverage_partial","conflict_evidence_unavailable","code_index_revision_mismatch"],type:"string"},FeedbackProximityParticipantV1:{additionalProperties:!1,properties:{access:{$ref:"#/$defs/FeedbackProximityAccessKindV1"},activity:{$ref:"#/$defs/FeedbackProximityIntervalV1"},address:{$ref:"#/$defs/ProximityAddressV1"},agent_id:{$ref:"#/$defs/AgentInstanceId"},branch_ref:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},head_revision:{anyOf:[{$ref:"#/$defs/CommitId"},{type:"null"}]},source:{$ref:"#/$defs/ObservationSourceIdentityV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]},worktree_root:{type:"string"}},required:["source","agent_id","worktree_root","access","activity","address"],type:"object"},FeedbackProximityReadPageV1:{additionalProperties:!1,properties:{encounters:{items:{$ref:"#/$defs/FeedbackProximityEncounterV1"},type:"array"},expires_at:{$ref:"#/$defs/UtcMicros"},observed_at:{$ref:"#/$defs/UtcMicros"},scope:{$ref:"#/$defs/FeedbackScopeV1"},source_generation:{$ref:"#/$defs/CodeGenerationId"}},required:["scope","source_generation","observed_at","expires_at","encounters"],type:"object"},FeedbackProximityRelationV1:{oneOf:[{additionalProperties:!1,properties:{relation_kind:{const:"code_neighborhood_candidate",type:"string"},warning_class:{$ref:"#/$defs/ProximityWarningClassV1"}},required:["relation_kind","warning_class"],type:"object"},{additionalProperties:!1,properties:{clone_handle:{$ref:"#/$defs/FeedbackProximityCloneHandleV1"},relation_kind:{const:"shared_code_candidate",type:"string"},warning_class:{$ref:"#/$defs/ProximityWarningClassV1"}},required:["relation_kind","warning_class","clone_handle"],type:"object"},{additionalProperties:!1,properties:{relation_kind:{const:"overlapping_edit",type:"string"},warning_class:{$ref:"#/$defs/ProximityWarningClassV1"}},required:["relation_kind","warning_class"],type:"object"},{additionalProperties:!1,properties:{conflict_handle:{$ref:"#/$defs/FeedbackProximityConflictHandleV1"},relation_kind:{const:"confirmed_conflict",type:"string"}},required:["relation_kind","conflict_handle"],type:"object"}]},FeedbackScopeV1:gn,FileOccurrenceId:gs,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProjectId:_4,ProviderId:vo,ProximityAddressV1:{additionalProperties:!1,description:"A privacy-scoped code address. It identifies the coarse changed-code shape\nbut carries no other actor, session, or private-source content.",properties:{file:{$ref:"#/$defs/FileOccurrenceId"},scope:{$ref:"#/$defs/FeedbackScopeV1"},span:{anyOf:[{$ref:"#/$defs/SourceSpan"},{type:"null"}]},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["scope","file"],type:"object"},ProximityCoverageV1:{enum:["complete","partial","stale","unavailable","denied","private"],type:"string"},ProximityWarningClassV1:{enum:["same_file","overlapping_range","same_symbol","same_package","same_crate","neighborhood","shared_caller","shared_dependency","shared_test"],type:"string"},RefId:vm,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"complete",type:"string"}},required:["state","page"],type:"object"},{additionalProperties:!1,properties:{page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"complete_zero",type:"string"}},required:["state","page"],type:"object"},{additionalProperties:!1,properties:{omissions:{items:{$ref:"#/$defs/FeedbackProximityOmissionV1"},type:"array"},page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"partial",type:"string"}},required:["state","page","omissions"],type:"object"},{additionalProperties:!1,properties:{omissions:{items:{$ref:"#/$defs/FeedbackProximityOmissionV1"},type:"array"},page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"stale",type:"string"}},required:["state","page","omissions"],type:"object"},{additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"denied",type:"string"}},required:["state","observed_at"],type:"object"},{additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"unavailable",type:"string"}},required:["state","observed_at"],type:"object"}],title:"FeedbackProximityReadResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{field:{description:"Field name. Bare name ('last_sync_at') matches across structs;\nqualified form ('GraphStats::last_sync_at') narrows to one struct's\nfield.",type:"string"},limit:{description:"Maximum sites per kind (default: 200, max: 2000).",format:"uint32",minimum:0,type:["integer","null"]},writes_only:{description:"When true, returns only write_sites and omits reads. Default false.",type:["boolean","null"]}},required:["field"],title:"FieldSitesSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,FieldSiteV1:{additionalProperties:!1,properties:{enclosing:{type:["string","null"]},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},snippet:{type:"string"}},required:["file","line","snippet"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`read_count` and `read_sites` are absent when the request asked for\nwrites only.",properties:{field:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},qualifier:{type:["string","null"]},qualifier_applied:{type:"boolean"},read_count:{format:"uint64",minimum:0,type:["integer","null"]},read_sites:{items:{$ref:"#/$defs/FieldSiteV1"},type:["array","null"]},write_count:{format:"uint64",minimum:0,type:"integer"},write_sites:{items:{$ref:"#/$defs/FieldSiteV1"},type:"array"}},required:["field","qualifier_applied","write_count","write_sites"],title:"FieldSitesResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],title:"FileDependentsPrimitiveRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{dependent_files:{items:{type:"string"},type:"array"},file:{type:"string"}},required:["file","dependent_files"],title:"FileDependentsPrimitiveResult",type:"object"},{$defs:{FilesLayoutV1:gd},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{layout:{anyOf:[{$ref:"#/$defs/FilesLayoutV1"},{type:"null"}],description:"File listing layout: flat (one per line) or grouped by directory\n(default: grouped)."},path:{description:"Filter to files under this directory path.",type:["string","null"]},pattern:{description:"Filter files matching this glob pattern (e.g. '**/*.rs').",type:["string","null"]}},title:"FilesSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexOmittedSourceV1:hb,CodeIndexOmittedSourcesV1:h$,CodeIndexSourceOmissionReasonV1:hS,CodeIndexStalenessStateV1:hk,FilesLayoutV1:gd,IndexedFileV1:{additionalProperties:!1,properties:{bytes:{format:"uint64",minimum:0,type:"integer"},path:{type:"string"},symbols:{format:"uint64",minimum:0,type:"integer"}},required:["path","symbols","bytes"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},files:{items:{$ref:"#/$defs/IndexedFileV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},layout:{$ref:"#/$defs/FilesLayoutV1"},worktree_omitted_sources:{anyOf:[{$ref:"#/$defs/CodeIndexOmittedSourcesV1"},{type:"null"}],description:"Sources the serving snapshot captured for the whole worktree but does\nnot index, unfiltered by `path` or `pattern`."}},required:["count","layout","files"],title:"FilesResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{lazy_index_ignored_dependencies:{description:"Opt in to bounded indexing of ignored dependency entry files when an\nimport hint matches (default: false).",type:["boolean","null"]},limit:{description:"Maximum matches to return (default: 20, max: 200).",format:"uint32",minimum:0,type:["integer","null"]},name:{description:"Exact bare symbol name (no `::`, no glob).",type:"string"}},required:["name"],title:"FindExactSymbolSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,FindExactSymbolMatchV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},qualified_name:{type:"string"},signature:{type:["string","null"]}},required:["id","name","qualified_name","kind","file","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},matches:{items:{$ref:"#/$defs/FindExactSymbolMatchV1"},type:"array"},name:{type:"string"},suggestions:{description:"Nearest indexed bare names when `count` is 0. Empty when the query\nmatched, or when it is not itself a bare identifier.",items:{type:"string"},type:"array"}},required:["name","count","matches"],title:"FindExactSymbolResultV1",type:"object"},{$defs:{GiniMetricV1:gu,GiniScopeV1:gm},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Number of top outliers to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},metric:{anyOf:[{$ref:"#/$defs/GiniMetricV1"},{type:"null"}],description:"Metric to measure inequality for (default: complexity)."},path:{description:"Filter to files under this directory path.",type:["string","null"]},scope:{anyOf:[{$ref:"#/$defs/GiniScopeV1"},{type:"null"}],description:"Aggregate per file or per symbol (default: file)."}},title:"GiniSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GiniMetricV1:gu,GiniOutlierV1:{additionalProperties:!1,properties:{name:{type:"string"},pct_of_max:{format:"double",type:"number"},value:{format:"double",type:"number"}},required:["name","value","pct_of_max"],type:"object"},GiniScopeV1:gm,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},gini:{format:"double",type:"number"},incomplete_complexity_symbols:{description:"Symbols left out because their bounded complexity walk did not cover\nthe body; their counters are lower bounds and measure nothing here.",format:"uint64",minimum:0,type:"integer"},interpretation:{type:"string"},metric:{$ref:"#/$defs/GiniMetricV1"},outliers:{items:{$ref:"#/$defs/GiniOutlierV1"},type:"array"},scope:{$ref:"#/$defs/GiniScopeV1"},total_items:{format:"uint64",minimum:0,type:"integer"}},required:["gini","interpretation","total_items","metric","scope","incomplete_complexity_symbols","outliers"],title:"GiniResultV1",type:"object"},{$defs:{GitIndexPreviewId:gV,ManifestDigest:_l},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Public MCP/CLI request to apply one immutable Git index preview.",properties:{idempotency_key:{type:"string"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/GitIndexPreviewId"}},required:["preview_id","preview_digest","idempotency_key"],title:"GitApplySurfaceRequest",type:"object"},{$defs:{GitIndexPreviewId:gV,GitIndexReceiptId:{description:"Strongly typed canonical identity: `GitIndexReceiptId`.",type:"string"},GitIndexReceiptOutcomeV1:{description:"Terminal outcome a recovery record can prove without re-running a native\nmutation.",enum:["committed","aborted_no_change","needs_inspection"],type:"string"},GitIndexTransactionId:{description:"Strongly typed canonical identity: `GitIndexTransactionId`.",type:"string"},GitIndexTransactionOperationV1:gR,GitOidV1:gq,ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Durable, integrity-protected receipt for one Git index transaction.",properties:{committed_at:{$ref:"#/$defs/UtcMicros"},final_snapshot_captured:{description:"Whether `final_snapshot_digest`, `new_index_tree`, and `new_head` came\nfrom a post-outcome native observation. An unavailable observation is\nvalid only for a terminal outcome that does not claim a commit.",type:"boolean"},final_snapshot_digest:{$ref:"#/$defs/ManifestDigest",description:"Digest of a snapshot that was actually captured after the terminal\nobservation. When `final_snapshot_captured` is false this retains the\nexpected snapshot digest only as a stable schema placeholder; callers\nmust not treat it as an observation."},new_head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},new_index_tree:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_index_tree:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_snapshot_digest:{$ref:"#/$defs/ManifestDigest"},operation:{$ref:"#/$defs/GitIndexTransactionOperationV1"},outcome:{$ref:"#/$defs/GitIndexReceiptOutcomeV1"},preview_id:{$ref:"#/$defs/GitIndexPreviewId"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},receipt_id:{$ref:"#/$defs/GitIndexReceiptId"},selected_hunk_digests:{items:{$ref:"#/$defs/ManifestDigest"},type:"array"},transaction_id:{$ref:"#/$defs/GitIndexTransactionId"}},required:["receipt_id","transaction_id","preview_id","operation","old_snapshot_digest","final_snapshot_digest","final_snapshot_captured","selected_hunk_digests","outcome","committed_at","receipt_digest"],title:"GitIndexTransactionReceiptV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_blame` surface.",properties:{follow_renames:{default:!1,type:"boolean"},max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},path:{type:"string"}},required:["path"],title:"GitBlameSurfaceRequest",type:"object"},{$defs:{GitBlameAvailabilityV1:{description:"Why blame/line provenance is unavailable for a path.",enum:["available","path_not_tracked","unborn_branch","binary_file"],type:"string"},GitBlameLineV1:{additionalProperties:!1,description:"Line provenance for one final (current) line.",properties:{author:{$ref:"#/$defs/GitCommitIdentityV1"},boundary:{description:"True when the origin commit is a history boundary (e.g. shallow root).",type:"boolean"},commit:{$ref:"#/$defs/GitOidV1"},final_line:{description:"1-based line number in the blamed revision.",format:"uint32",minimum:0,type:"integer"},origin_line:{description:"1-based line number in the origin commit.",format:"uint32",minimum:0,type:"integer"},previous:{anyOf:[{$ref:"#/$defs/GitBlamePreviousV1"},{type:"null"}]}},required:["final_line","origin_line","commit","author","boundary"],type:"object"},GitBlamePreviousV1:{additionalProperties:!1,description:"Rename-following evidence for one blamed line (`previous` record).",properties:{commit:{$ref:"#/$defs/GitOidV1"},path:{type:"string"}},required:["commit","path"],type:"object"},GitBlameV1:{additionalProperties:!1,description:"Typed blame result: per-line provenance plus boundary, rename-following,\nand unavailable states.",properties:{availability:{$ref:"#/$defs/GitBlameAvailabilityV1"},coverage:{$ref:"#/$defs/GitCoverageV1"},lines:{items:{$ref:"#/$defs/GitBlameLineV1"},type:"array"},path:{type:"string"},repository:{$ref:"#/$defs/RepositoryId"}},required:["repository","path","lines","availability","coverage"],type:"object"},GitBlobExpectationV1:gf,GitChangeKindV1:gh,GitCommitIdentityV1:{additionalProperties:!1,description:"Author/committer identity and timestamp evidence for one commit.",properties:{at:{$ref:"#/$defs/UtcMicros"},email:{type:"string"},name:{type:"string"}},required:["name","email","at"],type:"object"},GitCommitMetadataV1:{additionalProperties:!1,description:"Bounded commit metadata. The full message is not retained;\n`message_digest` is its canonical digest evidence.",properties:{author:{$ref:"#/$defs/GitCommitIdentityV1"},commit:{$ref:"#/$defs/GitOidV1"},committer:{$ref:"#/$defs/GitCommitIdentityV1"},message_digest:{$ref:"#/$defs/ManifestDigest"},parents:{items:{$ref:"#/$defs/GitOidV1"},type:"array"},subject:{description:"First line of the commit message, bounded at capture.",type:"string"},tree:{$ref:"#/$defs/GitOidV1"}},required:["commit","tree","parents","author","committer","subject","message_digest"],type:"object"},GitCoverageV1:gv,GitDegradationV1:gb,GitDiffScopeV1:{description:"Diff scope: unstaged worktree changes, staged index changes, or an exact\ncommit range. Range diffs are read-only evidence and carry no index\nrelationship, so they cannot mint an applicable `HunkRefV1`.",oneOf:[{properties:{scope:{const:"working_tree",type:"string"}},required:["scope"],type:"object"},{properties:{scope:{const:"staged",type:"string"}},required:["scope"],type:"object"},{properties:{base:{$ref:"#/$defs/GitOidV1"},head:{$ref:"#/$defs/GitOidV1"},scope:{const:"commit_range",type:"string"}},required:["scope","base","head"],type:"object"}]},GitDiffV1:{additionalProperties:!1,description:"Typed diff result for one scope with explicit coverage.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},files:{items:{$ref:"#/$defs/GitFileDiffV1"},type:"array"},repository:{$ref:"#/$defs/RepositoryId"},scope:{$ref:"#/$defs/GitDiffScopeV1"}},required:["repository","scope","files","coverage"],type:"object"},GitFileDiffV1:{additionalProperties:!1,description:"One file's structured diff record: change kind, modes, blob identities,\nbinary/submodule classification, bounded line totals, and hunks.",properties:{binary:{type:"boolean"},change:{$ref:"#/$defs/GitChangeKindV1"},deletions:{format:"uint32",minimum:0,type:["integer","null"]},hunks:{items:{$ref:"#/$defs/GitHunkV1"},type:"array"},insertions:{description:"Inserted/deleted line totals; absent for binary and submodule records.",format:"uint32",minimum:0,type:["integer","null"]},new_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},new_mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},old_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},original_path:{description:"Source path for a rename or copy.",type:["string","null"]},path:{type:"string"},submodule:{description:"True when the entry is a gitlink (submodule) change.",type:"boolean"}},required:["path","change","binary","submodule","hunks"],type:"object"},GitFileModeV1:g$,GitHeadStateV1:gk,GitHistoryV1:{additionalProperties:!1,description:"Bounded commit history in native traversal order. `truncated` is true\nwhen the capture bound cut the walk; shallow/partial-clone boundaries are\ncoverage degradations, never silently clean.",properties:{commits:{items:{$ref:"#/$defs/GitCommitMetadataV1"},type:"array"},coverage:{$ref:"#/$defs/GitCoverageV1"},repository:{$ref:"#/$defs/RepositoryId"},truncated:{type:"boolean"}},required:["repository","commits","truncated","coverage"],type:"object"},GitHunkPreviewEntryV1:{additionalProperties:!1,description:"One minted hunk selection: the canonical selection digest plus the\n`HunkRef` identity evidence it selects.",properties:{digest:{$ref:"#/$defs/ManifestDigest"},hunk:{$ref:"#/$defs/HunkRefV1"}},required:["digest","hunk"],type:"object"},GitHunkPreviewInputV1:{additionalProperties:!1,description:"Bounded, expiring preview input minted by `git_hunks` from one exact\ndaemon-captured repository snapshot.",properties:{expires_at:{$ref:"#/$defs/UtcMicros"},hunks:{items:{$ref:"#/$defs/GitHunkPreviewEntryV1"},type:"array"},preview_input_id:{$ref:"#/$defs/GitIndexPreviewId"},repository_snapshot_digest:{$ref:"#/$defs/ManifestDigest"}},required:["preview_input_id","repository_snapshot_digest","expires_at","hunks"],type:"object"},GitHunkV1:{additionalProperties:!1,description:"One structured diff hunk. The hunk body is not retained; `patch_digest`\nis the canonical digest of the normalized header plus body lines, which\nis the stable hunk identity evidence.",properties:{new_lines:{format:"uint32",minimum:0,type:"integer"},new_start:{format:"uint32",minimum:0,type:"integer"},old_lines:{format:"uint32",minimum:0,type:"integer"},old_start:{format:"uint32",minimum:0,type:"integer"},patch_digest:{$ref:"#/$defs/ManifestDigest"},section:{description:"Function/section heading from the hunk header when Git emitted one.",type:["string","null"]}},required:["old_start","old_lines","new_start","new_lines","patch_digest"],type:"object"},GitIndexEntryExpectationV1:gP,GitIndexPreviewId:gV,GitOidV1:gq,GitOperationStateV1:gI,GitQueryEnvelopeV1:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitStatusSummaryV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV12:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitDiffV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV13:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitHistoryV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV14:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitBlameV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV15:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitHunkPreviewInputV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitStatusSummaryV1:{additionalProperties:!1,description:"Bounded status summary derived from the typed\n[`tracedecay_domain::git::GitStatusV1`]: HEAD and operation state,\nper-class counts, and a bounded sorted sample of changed paths.",properties:{changed_paths:{description:"Sorted, de-duplicated changed paths, truncated at the query entry bound.",items:{type:"string"},type:"array"},conflicted:{format:"uint32",minimum:0,type:"integer"},head:{$ref:"#/$defs/GitHeadStateV1"},ignored:{format:"uint32",minimum:0,type:"integer"},operation:{$ref:"#/$defs/GitOperationStateV1"},repository:{$ref:"#/$defs/RepositoryId"},schema_version:{type:"string"},staged:{format:"uint32",minimum:0,type:"integer"},unstaged:{format:"uint32",minimum:0,type:"integer"},untracked:{format:"uint32",minimum:0,type:"integer"}},required:["repository","head","operation","staged","unstaged","conflicted","untracked","ignored","changed_paths","schema_version"],type:"object"},HunkDirectionV1:gU,HunkRefV1:gH,ManifestDigest:_l,RepositoryId:vb,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Actual payload emitted by each public Git read operation.",oneOf:[{properties:{query:{const:"status",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV1"}},required:["query","result"],type:"object"},{properties:{query:{const:"diff",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV12"}},required:["query","result"],type:"object"},{properties:{query:{const:"history",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV13"}},required:["query","result"],type:"object"},{properties:{query:{const:"blame",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV14"}},required:["query","result"],type:"object"},{properties:{query:{const:"hunks",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV15"}},required:["query","result"],type:"object"}],title:"GitReadResultV1"},{$defs:{GitOidV1:gq,GitSurfaceDiffScopeV1:gA},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_diff` surface.",properties:{base:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},scope:{$ref:"#/$defs/GitSurfaceDiffScopeV1",default:"working_tree"}},title:"GitDiffSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_history` surface.",properties:{count:{format:"uint32",minimum:0,type:["integer","null"]},first_parent:{default:!1,type:"boolean"},follow:{default:!1,type:"boolean"},max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},path:{type:["string","null"]}},title:"GitHistorySurfaceRequest",type:"object"},{$defs:{GitSurfaceDiffScopeV1:gA},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_hunks` surface.\n\nThe daemon captures exact repository state itself and injects the private\npreview binding after capture, so the public wire carries only the diff\nscope (commit ranges cannot mint applicable hunks).",properties:{max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},scope:{$ref:"#/$defs/GitSurfaceDiffScopeV1",default:"working_tree"}},title:"GitHunksSurfaceRequest",type:"object"},{$defs:{GitIndexPreviewId:gV,GitIndexTransactionOperationV1:gR,ManifestDigest:_l},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Public MCP/CLI request for one daemon-owned Git index preview.",properties:{operation:{$ref:"#/$defs/GitIndexTransactionOperationV1"},preview_input_id:{anyOf:[{$ref:"#/$defs/GitIndexPreviewId"},{type:"null"}],default:null,description:"Hunk preview input minted by `git_hunks`; required for stage/unstage."},selected_hunk_digests:{default:[],description:"Selection digests drawn from the referenced preview input.",items:{$ref:"#/$defs/ManifestDigest"},type:"array"}},required:["operation"],title:"GitPreviewSurfaceRequest",type:"object"},{$defs:{GitBlobExpectationV1:gf,GitCoverageV1:gv,GitDegradationV1:gb,GitFileModeV1:g$,GitHeadStateV1:gk,GitIndexEntryExpectationV1:gP,GitIndexPreviewDispositionV1:{description:"Whether a captured preview may reach the daemon's native apply path.",oneOf:[{properties:{state:{const:"applicable",type:"string"}},required:["state"],type:"object"},{properties:{reason:{$ref:"#/$defs/GitIndexUnsupportedStateV1"},state:{const:"unsupported",type:"string"}},required:["state","reason"],type:"object"}]},GitIndexPreviewId:gV,GitIndexTransactionOperationV1:gR,GitIndexUnsupportedStateV1:{description:"Why a preview is intentionally read-only. A caller must re-preview after\nresolving the condition; no variant grants a relaxed or partial apply.",enum:["bare_repository","detached_head","unborn_branch","index_lock_present","external_git_driver","unmerged_index","intent_to_add","split_index","sparse_index","unreadable_index","conflicted_working_tree","unreadable_working_tree","in_progress_operation","unsupported_object_format","binary_hunk","submodule","symlink","file_mode_only","rename_or_copy","filters_or_end_of_line","partial_hunk_selection"],type:"string"},GitObjectFormatV1:{description:"Repository object format, derived from object-id length.",enum:["sha1","sha256"],type:"string"},GitOidV1:gq,GitOperationStateV1:gI,HunkDirectionV1:gU,HunkRefV1:gH,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RepositoryIndexSnapshotV1:{additionalProperties:!1,properties:{checksum:{$ref:"#/$defs/ManifestDigest"},state:{$ref:"#/$defs/RepositoryIndexStateV1"},tree_id:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},unmerged_stage_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]}},required:["checksum","state"],type:"object"},RepositoryIndexStateV1:{enum:["clean","staged","unmerged","intent_to_add","split","sparse","unreadable"],type:"string"},RepositoryStateSnapshotV1:{additionalProperties:!1,description:"Immutable content-addressed native repository state. Missing/partial\nevidence remains typed by fields and coverage instead of being upgraded to\na guessed clean snapshot.",properties:{adapter_revision:{description:"Revision of the fixed native adapter that interpreted this state.",type:["string","null"]},attributes_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},captured_at:{$ref:"#/$defs/UtcMicros"},configuration_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},coverage:{$ref:"#/$defs/GitCoverageV1"},filesystem_capabilities_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},git_version:{description:"Exact native Git implementation observed by the fixed adapter. A\nread-only partial snapshot may omit this, but omitted native evidence\nis never mutation eligible.",type:["string","null"]},head:{$ref:"#/$defs/GitHeadStateV1"},index:{$ref:"#/$defs/RepositoryIndexSnapshotV1"},object_format:{$ref:"#/$defs/GitObjectFormatV1"},observation_epoch:{format:"uint64",minimum:0,type:"integer"},operation_state:{$ref:"#/$defs/GitOperationStateV1"},project_id:{$ref:"#/$defs/ProjectId"},refs_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest of the complete native ref namespace at capture time."},repository_id:{$ref:"#/$defs/RepositoryId"},snapshot_id:{type:"string"},sparse_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},submodule_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},working_tree:{$ref:"#/$defs/RepositoryWorkingTreeSnapshotV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["snapshot_id","project_id","repository_id","observation_epoch","object_format","head","index","working_tree","operation_state","captured_at","coverage"],type:"object"},RepositoryWorkingTreeSnapshotV1:{additionalProperties:!1,properties:{ignored_collision_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},state:{$ref:"#/$defs/RepositoryWorkingTreeStateV1"},tracked_digest:{$ref:"#/$defs/ManifestDigest"},untracked_name_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]}},required:["state","tracked_digest"],type:"object"},RepositoryWorkingTreeStateV1:{enum:["clean","tracked_dirty","untracked_only","mixed","conflicted","unreadable"],type:"string"},UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Immutable, content-bound preview for one daemon-serialized index\ntransaction. Applicability is only a precondition: the daemon must capture\nand compare the entire snapshot and every contained `HunkRefV1` again\nimmediately before a native mutation.",properties:{candidate_index_tree:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},created_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/GitIndexPreviewDispositionV1"},expires_at:{$ref:"#/$defs/UtcMicros"},operation:{$ref:"#/$defs/GitIndexTransactionOperationV1"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/GitIndexPreviewId"},repository_snapshot:{$ref:"#/$defs/RepositoryStateSnapshotV1"},repository_snapshot_digest:{$ref:"#/$defs/ManifestDigest"},selected_hunks:{items:{$ref:"#/$defs/HunkRefV1"},type:"array"}},required:["preview_id","operation","repository_snapshot","repository_snapshot_digest","selected_hunks","disposition","created_at","expires_at","preview_digest"],title:"GitIndexPreviewV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_status` surface.",properties:{max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]}},title:"GitStatusSurfaceRequest",type:"object"},{$defs:{StackDeliveryWatermarkId:bk,StackSignalId:bP},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The public, transport-neutral request for one durable stack signal.",properties:{expected_watermark_id:{anyOf:[{$ref:"#/$defs/StackDeliveryWatermarkId"},{type:"null"}]},signal_id:{anyOf:[{$ref:"#/$defs/StackSignalId"},{type:"null"}]}},title:"GitHubStackSignalExpandSurfaceRequest",type:"object"},{$defs:{BranchStackRevisionId:f8,GitHubStackSignalEvidenceRefV1:{additionalProperties:!1,description:"Bounded evidence for the exact signal the coordinator authorized.\n\nProvider payloads, paths, commit bodies, and delivery recipients remain\nbehind the durable signal evidence rather than copied to this result.",properties:{github_stack_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},kind:{$ref:"#/$defs/StackSignalKindV1"},native_source:{$ref:"#/$defs/GitHubStackSignalNativeSourceV1"},observed_at:{$ref:"#/$defs/UtcMicros"},signal_id:{$ref:"#/$defs/StackSignalId"},stack_revision_digest:{$ref:"#/$defs/ManifestDigest"},stack_revision_id:{$ref:"#/$defs/BranchStackRevisionId"},state_digest:{$ref:"#/$defs/ManifestDigest"},watermark_id:{$ref:"#/$defs/StackDeliveryWatermarkId"}},required:["signal_id","watermark_id","kind","stack_revision_id","stack_revision_digest","state_digest","observed_at","native_source"],type:"object"},GitHubStackSignalExpandUnavailableV1:{description:"Truthful non-success outcomes for signal expansion.\n\n`Concealed` intentionally combines absent and unauthorized signal handles;\nexposing that distinction would turn this operation into a signal probe.",enum:["concealed","stale","native_evidence_unavailable","authority_unmounted","cancelled"],type:"string"},GitHubStackSignalNativePreviewV1:{additionalProperties:!1,description:"Exact branch pair and native preflight that produced the selected signal.",properties:{destination_ref:{$ref:"#/$defs/RefId"},destination_tip:{$ref:"#/$defs/GitOidV1"},direction:{$ref:"#/$defs/NativeIntegrationDirectionV1"},disposition:{$ref:"#/$defs/NativeIntegrationPreviewDispositionV1"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},source_ref:{$ref:"#/$defs/RefId"},source_tip:{$ref:"#/$defs/GitOidV1"}},required:["preview_id","preview_digest","direction","source_ref","destination_ref","source_tip","destination_tip","disposition"],type:"object"},GitHubStackSignalNativeSourceV1:{oneOf:[{properties:{preview:{$ref:"#/$defs/GitHubStackSignalNativePreviewV1"},source:{const:"preflight",type:"string"}},required:["source","preview"],type:"object"},{properties:{preview:{$ref:"#/$defs/GitHubStackSignalNativePreviewV1"},source:{const:"terminal",type:"string"},terminal:{$ref:"#/$defs/GitHubStackSignalNativeTerminalV1"}},required:["source","preview","terminal"],type:"object"}]},GitHubStackSignalNativeTerminalV1:{additionalProperties:!1,properties:{completed_at:{$ref:"#/$defs/UtcMicros"},final_ref_tip:{$ref:"#/$defs/GitOidV1"},outcome:{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["transaction_id","receipt_digest","outcome","final_ref_tip","completed_at"],type:"object"},GitOidV1:gq,ManifestDigest:_l,MechanicalIntegrationModeV1:_p,NativeIntegrationDirectionV1:_R,NativeIntegrationPreviewDispositionV1:_q,NativeIntegrationPreviewId:_I,NativeIntegrationTerminalOutcomeV1:_C,NativeIntegrationTransactionId:_T,NativeIntegrationUnavailabilityV1:_O,RefId:vm,StackDeliveryWatermarkId:bk,StackSignalId:bP,StackSignalKindV1:{description:"Durable classification of one GitHub stack transition.",enum:["dependency_ready","actual_conflict","stack_tip_drift","pull_request_drift","ci_evaluated_commit_drift","integration_committed","integration_needs_inspection"],type:"string"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{evidence:{$ref:"#/$defs/GitHubStackSignalEvidenceRefV1"},outcome:{const:"expanded",type:"string"}},required:["outcome","evidence"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},reason:{$ref:"#/$defs/GitHubStackSignalExpandUnavailableV1"}},required:["outcome","reason"],type:"object"}],title:"GitHubStackSignalExpandSurfaceResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"GodClassSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GodClassEntryV1:{additionalProperties:!1,properties:{fields:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},methods:{format:"uint64",minimum:0,type:"integer"},name:{type:"string"},total_members:{format:"uint64",minimum:0,type:"integer"}},required:["id","name","kind","file","line","methods","fields","total_members"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranking:{items:{$ref:"#/$defs/GodClassEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["result_count","ranking"],title:"GodClassResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{case_sensitive:{description:"Match case-sensitively (default: false = case-insensitive).",type:["boolean","null"]},context_lines:{description:"Lines of surrounding context to include per hit (default: 0, max: 3).",format:"uint32",minimum:0,type:["integer","null"]},fixed_strings:{description:"Treat pattern as a literal string instead of a regex (default: false).",type:["boolean","null"]},max_results:{description:"Maximum number of matching lines to return (default: 50, max: 200).",format:"uint32",minimum:0,type:["integer","null"]},path_glob:{description:"Optional glob restricting which files are searched, matched against\nproject-relative paths (e.g. 'src/**/*.rs').",type:["string","null"]},pattern:{description:"Content to search for. Treated as a regular expression unless\nfixed_strings is true.",type:"string"}},required:["pattern"],title:"GrepSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CoverageCompleteness:yu,CoverageDomainState:ym,EvidenceCoverage:yx,EvidenceDomain:yj,GrepGraphEnrichmentV1:{description:"Whether the verified graph resolved each hit's enclosing symbol. Hits are\nthe lexical answer either way.",oneOf:[{additionalProperties:!1,properties:{enriched:{format:"uint64",minimum:0,type:"integer"},returned:{format:"uint64",minimum:0,type:"integer"},status:{const:"complete",type:"string"}},required:["status","enriched","returned"],type:"object"},{additionalProperties:!1,properties:{detail:{type:"string"},reason_code:{type:"string"},retryable:{type:"boolean"},status:{const:"unavailable",type:"string"}},required:["status","reason_code","retryable","detail"],type:"object"}]},GrepMatchV1:{additionalProperties:!1,properties:{after:{items:{type:"string"},type:"array"},before:{items:{type:"string"},type:"array"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},node_id:{type:["string","null"]},symbol:{description:"The smallest verified graph symbol enclosing the hit.",type:["string","null"]},text:{type:"string"}},required:["file","line","text"],type:"object"},GrepScanOmissionsV1:{additionalProperties:!1,description:"What the bounded scan skipped, by cause; absent when it skipped nothing.",properties:{oversized_files:{description:"Files larger than the interactive scan byte limit.",format:"uint64",minimum:0,type:"integer"},oversized_lines:{description:"Lines longer than the scan line byte limit.",format:"uint64",minimum:0,type:"integer"},unavailable_sources:{description:"Source candidates that could not be read during the scan.",format:"uint64",minimum:0,type:"integer"}},required:["oversized_files","oversized_lines","unavailable_sources"],type:"object"},Omission:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},domain:{$ref:"#/$defs/EvidenceDomain"},reason:{$ref:"#/$defs/OmissionReason"}},required:["domain","count","reason"],type:"object"},OmissionReason:{description:"Safe reason why authorized requested evidence was omitted.",oneOf:[{enum:["budget","redacted","unavailable","unsupported","stale","failed","cancelled","timed_out","conflict"],type:"string"},{const:"macro_body_unparsed",description:"Evidence came from a macro body that was not expanded, so what the\nexpansion defines or calls is not covered.",type:"string"},{const:"import_unmodeled",description:"A caller sits under a `use` whose binding the index could not model\n(a glob in a block or inline module), so whether it calls the target\nis not covered.",type:"string"},{const:"cursor_expired",description:"The continuation cursor can no longer be redeemed (its lifetime ended\nor the snapshot it pages is gone); restart the request without it.",type:"string"},{const:"cursor_foreign",description:"The continuation cursor was issued for another project, worktree, or\nref; redeem it where it was issued.",type:"string"}]},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/EvidenceCoverage"},files_scanned:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_enrichment:{$ref:"#/$defs/GrepGraphEnrichmentV1"},match_count:{format:"uint64",minimum:0,type:"integer"},omissions:{items:{$ref:"#/$defs/Omission"},type:"array"},results:{items:{$ref:"#/$defs/GrepMatchV1"},type:"array"},scan_omissions:{$ref:"#/$defs/GrepScanOmissionsV1"},truncated:{type:"boolean"}},required:["results","match_count","files_scanned","truncated","coverage","omissions","graph_enrichment"],title:"GrepSearchResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{details:{description:"If true, include full dimension breakdown (default: false).",type:["boolean","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]}},title:"HealthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,HealthAcyclicityV1:{additionalProperties:!1,properties:{edges_in_cycles:{format:"uint64",minimum:0,type:"integer"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","edges_in_cycles","source"],type:"object"},HealthCoverageDisciplineV1:{additionalProperties:!1,properties:{score:{format:"double",type:"number"},skip_test_coverage_count:{format:"uint64",minimum:0,type:"integer"},source:{type:"string"},total_fns:{format:"uint64",minimum:0,type:"integer"}},required:["score","skip_test_coverage_count","total_fns","source"],type:"object"},HealthDepthV1:{additionalProperties:!1,properties:{ideal_chain:{format:"uint64",minimum:0,type:"integer"},max_chain:{format:"uint64",minimum:0,type:"integer"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","max_chain","ideal_chain","source"],type:"object"},HealthDimensionsV1:{additionalProperties:!1,properties:{acyclicity:{$ref:"#/$defs/HealthAcyclicityV1"},coverage_discipline:{$ref:"#/$defs/HealthCoverageDisciplineV1"},depth:{$ref:"#/$defs/HealthDepthV1"},equality:{$ref:"#/$defs/HealthEqualityV1"},modularity:{$ref:"#/$defs/HealthModularityV1"},redundancy:{$ref:"#/$defs/HealthRedundancyV1"}},required:["acyclicity","depth","equality","redundancy","modularity","coverage_discipline"],type:"object"},HealthEqualityV1:{additionalProperties:!1,properties:{gini:{format:"double",type:"number"},incomplete_complexity_symbols:{format:"uint64",minimum:0,type:"integer"},interpretation:{type:"string"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","gini","interpretation","incomplete_complexity_symbols","source"],type:"object"},HealthModularityV1:{additionalProperties:!1,properties:{components_after_hub_removal:{format:"uint64",minimum:0,type:"integer"},interpretation:{type:"string"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","interpretation","components_after_hub_removal","source"],type:"object"},HealthRedundancyV1:{additionalProperties:!1,properties:{dead_count:{format:"uint64",minimum:0,type:"integer"},score:{format:"double",type:"number"},source:{type:"string"},total_fns:{format:"uint64",minimum:0,type:"integer"}},required:["score","dead_count","total_fns","source"],type:"object"},HealthWeightsV1:{additionalProperties:!1,properties:{note:{type:"string"}},required:["note"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`dimensions` and `weights` are present exactly when the request asked for\n`details`.",properties:{dimensions:{anyOf:[{$ref:"#/$defs/HealthDimensionsV1"},{type:"null"}]},files_analyzed:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},panel:{description:"Measured dimension names, worst score first, then\n`no evidence: name (reason), ...` for the dimensions the scope gave\nnothing to measure. An empty scope reads\n`no evidence: 0 files in scope`.",type:"string"},quality_signal:{description:"Geometric mean of the dimensions, scaled to 0-10000. A breakdown of\n`panel`, not a number to maximize. Dimensions that `panel` lists under\n`no evidence:` enter it at their formula value for an empty\nmeasurement, so it does not summarize such a scope: an empty scope\nreads 10000 and one file reads 0.",format:"uint32",minimum:0,type:"integer"},weights:{anyOf:[{$ref:"#/$defs/HealthWeightsV1"},{type:"null"}]}},required:["quality_signal","files_analyzed"],title:"HealthResultV1",type:"object"},{$defs:{PageRequest:_U,ResultProjection:vP,RetrievalOrder:vx,RetrievalRequestMeta:vj,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{before_cursor:{description:"A prior result's after_cursor. A cursor recorded under another health\ndefinition, or before definitions were recorded, is refused with\n`application.health-delta.definition-mismatch` or\n`application.health-delta.definition-unrecorded`; omit it to record a\nnew baseline.",type:["string","null"]},meta:{$ref:"#/$defs/RetrievalRequestMeta"},path_prefix:{type:["string","null"]}},required:["meta"],title:"HealthDeltaRequest",type:"object"},{$defs:{HealthDeltaCoverageV1:{additionalProperties:!1,properties:{completeness:{description:"`complete` when both points analyzed files, otherwise `unknown`.",type:"string"},denominator:{format:"uint64",minimum:0,type:["integer","null"]},eligible:{description:"Files the `after` point analyzed.",format:"uint64",minimum:0,type:["integer","null"]},visited:{format:"uint64",minimum:0,type:["integer","null"]}},required:["completeness"],type:"object"},HealthDeltaCurrentnessV1:{additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},state:{type:"string"}},required:["state","observed_at"],type:"object"},HealthDeltaPointV1:{additionalProperties:!1,properties:{dimensions:{additionalProperties:{$ref:"#/$defs/HealthDimensionPointV1"},type:"object"},files_analyzed:{format:"uint64",minimum:0,type:"integer"},function_denominator:{format:"uint64",minimum:0,type:"integer"},observed_at:{$ref:"#/$defs/UtcMicros"},quality_signal:{format:"uint32",minimum:0,type:"integer"},watermark:{$ref:"#/$defs/ManifestDigest"}},required:["watermark","observed_at","quality_signal","files_analyzed","function_denominator","dimensions"],type:"object"},HealthDeltaScopeV1:{additionalProperties:!1,properties:{path_prefix:{type:["string","null"]},project_id:{type:["string","null"]},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest"],type:"object"},HealthDimensionDeltaV1:{additionalProperties:!1,properties:{after_denominator:{format:"uint64",minimum:0,type:["integer","null"]},after_ppm:{format:"uint64",minimum:0,type:"integer"},before_denominator:{format:"uint64",minimum:0,type:["integer","null"]},before_ppm:{format:"uint64",minimum:0,type:"integer"},delta_ppm:{format:"int64",type:"integer"},status:{description:"`improved` or `degraded` when the score moved more than 1000 ppm,\notherwise `unchanged`. `no_evidence` when either point's scope gave\nthe dimension nothing to measure, so its scores are formula values.",type:"string"}},required:["before_ppm","after_ppm","delta_ppm","status"],type:"object"},HealthDimensionPointV1:{additionalProperties:!1,properties:{denominator:{format:"uint64",minimum:0,type:["integer","null"]},score_ppm:{format:"uint64",minimum:0,type:"integer"}},required:["score_ppm"],type:"object"},ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{$ref:"#/$defs/HealthDeltaPointV1"},after_cursor:{type:"string"},before:{$ref:"#/$defs/HealthDeltaPointV1"},before_cursor:{type:"string"},coverage:{$ref:"#/$defs/HealthDeltaCoverageV1"},currentness:{$ref:"#/$defs/HealthDeltaCurrentnessV1"},delta:{format:"int64",type:"integer"},dimensions:{additionalProperties:{$ref:"#/$defs/HealthDimensionDeltaV1"},type:"object"},pass:{description:"True when both points analyzed files and quality_signal did not drop.",type:"boolean"},schema_version:{format:"uint32",minimum:0,type:"integer"},scope:{$ref:"#/$defs/HealthDeltaScopeV1"}},required:["schema_version","scope","before","after","before_cursor","after_cursor","pass","delta","dimensions","coverage","currentness"],title:"HealthDeltaResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The health read takes no parameters: it reports one serving status, with no\npage, projection, or temporal selection to make. The page and deadline\ncontrols every surface supplies travel in the dispatch envelope, not here.",title:"HealthReadRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{status:{type:"string"}},required:["status"],title:"HealthReadResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_pending_payloads:{default:!1,description:"Include staged Hermes skill-write payloads (default: false).",type:"boolean"},include_skill_bodies:{default:!1,description:"Include bounded SKILL.md contents (default: false).",type:"boolean"}},title:"HermesSkillBridgeSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,HermesPendingSkillWrite:{properties:{action:{type:["string","null"]},created_at:!0,id:{type:"string"},name:{type:["string","null"]},origin:{type:["string","null"]},payload:!0,source_path:{type:"string"},summary:{type:["string","null"]}},required:["id","source_path"],type:"object"},HermesSkillBridgeContracts:{properties:{discovery_policy:{type:"string"},lifecycle_owner:{type:"string"},mutation_policy:{type:"string"}},required:["lifecycle_owner","mutation_policy","discovery_policy"],type:"object"},HermesSkillBridgeSnapshot:{properties:{agent_home:{type:"string"},archive_count:{format:"uint",minimum:0,type:"integer"},contracts:{$ref:"#/$defs/HermesSkillBridgeContracts"},pending_skill_corrupt_count:{format:"uint",minimum:0,type:"integer"},pending_skill_count:{format:"uint",minimum:0,type:"integer"},pending_skills:{items:{$ref:"#/$defs/HermesPendingSkillWrite"},type:"array"},skill_count:{format:"uint",minimum:0,type:"integer"},skills:{items:{$ref:"#/$defs/HermesSkillSummary"},type:"array"},skills_dir:{type:"string"},usage_record_count:{format:"uint",minimum:0,type:"integer"},usage_records:{additionalProperties:!0,description:"Hermes-owned usage telemetry keyed by skill name, as Hermes wrote it.",type:"object"}},required:["agent_home","skills_dir","skill_count","pending_skill_count","pending_skill_corrupt_count","usage_record_count","archive_count","skills","pending_skills","usage_records","contracts"],type:"object"},HermesSkillSummary:{properties:{body_markdown:{type:["string","null"]},category:{type:["string","null"]},description:{type:["string","null"]},name:{type:"string"},path:{type:"string"},pending_write_ids:{items:{type:"string"},type:"array"},usage:!0},required:["name","path","pending_write_ids"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{bridge:{$ref:"#/$defs/HermesSkillBridgeSnapshot"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","bridge"],title:"HermesSkillBridgeResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,description:"Reset the project's local token counter.",properties:{action:{const:"reset_counter",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Admit one Hook V2 envelope for the bound project.",properties:{action:{const:"hook_v2_admit",type:"string"},envelope:!0,native_lifecycle:!0,native_session_id:{description:"The host's native session id; it binds only when it hashes to the\nenvelope's protected session.",type:["string","null"]}},required:["action","envelope"],type:"object"},{additionalProperties:!1,description:"Commit a Context Scout delivery receipt for guidance the last\nadmission handed out.",properties:{action:{const:"hook_v2_delivery_receipt",type:"string"},receipt:!0},required:["action","receipt"],type:"object"},{additionalProperties:!1,description:"Acknowledge delivery of an advisory feedback notice.",properties:{action:{const:"hook_v2_feedback_notice_delivery",type:"string"},envelope:!0,feedback_notice:!0},required:["action","envelope","feedback_notice"],type:"object"},{additionalProperties:!1,description:"Land a host transcript in the owning session store.",properties:{action:{const:"ingest_transcript",type:"string"},event_json:{description:"The host's raw hook event, for providers that locate the transcript\nfrom it.",type:["string","null"]},max_new_bytes:{description:"Byte budget for this pass across every scanned source.",format:"uint64",minimum:0,type:["integer","null"]},messages:{description:"One turn the host inlined instead of a source to scan.",items:!0,type:["array","null"]},provider:{type:"string"},session_id:{type:["string","null"]},user_scope:{description:"Land the transcript in the profile's user store instead of the\nproject's.",type:"boolean"}},required:["action","provider","user_scope"],type:"object"},{additionalProperties:!1,description:"Codex `PostCompact` pressure evidence.",properties:{action:{const:"codex_compact",type:"string"},event_json:{type:"string"}},required:["action","event_json"],type:"object"},{additionalProperties:!1,description:"Claude `PostCompact` pressure evidence; `user_scope` routes it to the\nprofile.",properties:{action:{const:"claude_compact",type:"string"},event_json:{type:"string"},user_scope:{type:"boolean"}},required:["action","event_json","user_scope"],type:"object"},{additionalProperties:!1,description:"Cursor `preCompact` pressure evidence.",properties:{action:{const:"cursor_compact",type:"string"},event_json:{type:"string"}},required:["action","event_json"],type:"object"},{additionalProperties:!1,description:"Record a Hermes terminal receipt without a project route.",properties:{action:{const:"hermes_receipt",type:"string"},event:!0},required:["action","event"],type:"object"},{additionalProperties:!1,description:"Admit a native event without a project route into the profile's\nHook V2 ledger.",properties:{action:{const:"hook_v2_profile_admit",type:"string"},admission:!0},required:["action","admission"],type:"object"}],title:"HookRuntimeSurfaceRequestV1"},{$defs:{ContextScoutAddressV1:hU,ContextScoutStoreStatusV1:{enum:["stored","duplicate","superseded","unavailable"],type:"string"},HermesReceiptStatusV1:{oneOf:[{const:"recorded",description:"A terminal receipt was recorded.",type:"string"},{const:"ingested",description:"The turn was marked ingested and no receipt awaits review.",type:"string"},{const:"awaiting_transcript",description:"A receipt awaits a transcript that has not landed yet.",type:"string"}]},HookIngestAdmissionV1:{additionalProperties:!1,description:"The admission authority's verdict on one transcript ingest.",properties:{reason_code:{type:["string","null"]},retryable:{type:"boolean"},status:{description:"The session host-admission status, in its wire spelling.",type:"string"}},required:["status","retryable"],type:"object"},HookOrchestrationAdmissionV1:{description:"Outcome of admitting one hook envelope into the registered orchestrator.",enum:["enqueued","backpressured","unsupported_trigger","unavailable"],type:"string"},HookRuntimeDispositionV1:{description:"How the hook transport should treat a Hook V2 envelope.",oneOf:[{enum:["accepted"],type:"string"},{const:"catchup_required",description:"The published binding no longer authorizes the envelope; the host\nmust catch up before sending again.",type:"string"}]},HookV2RejectionReasonV1:{oneOf:[{const:"admission_identity_conflict",description:"The same event identity previously carried different bytes.",type:"string"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{action:{const:"reset_counter",type:"string"},reset:{type:"boolean"}},required:["action","reset"],type:"object"},{oneOf:[{properties:{context_scout_address:{anyOf:[{$ref:"#/$defs/ContextScoutAddressV1"},{type:"null"}]},disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},feedback_notice:{description:"The advisory `AdvisoryHookLookupNoticeV1` waiting for this\nworktree."},github_stack_signal_available:{type:"boolean"},orchestration:{$ref:"#/$defs/HookOrchestrationAdmissionV1"},ready_guidance:{description:"The hook's `HookReadyGuidanceV1`, when admission claimed one."},status:{const:"accepted",type:"string"}},required:["status","disposition","orchestration","github_stack_signal_available"],type:"object"},{description:"This exact envelope was already admitted; a retry may still receive\nguidance retained before a lost host response.",properties:{context_scout_address:{anyOf:[{$ref:"#/$defs/ContextScoutAddressV1"},{type:"null"}]},disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},ready_guidance:!0,status:{const:"exact_duplicate",type:"string"}},required:["status","disposition"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},reason:{anyOf:[{$ref:"#/$defs/HookV2RejectionReasonV1"},{type:"null"}]},status:{const:"rejected",type:"string"}},required:["status","disposition"],type:"object"},{description:"Idempotency could not be recorded, so nothing was admitted.",properties:{status:{const:"backpressured",type:"string"}},required:["status"],type:"object"},{properties:{status:{const:"unavailable",type:"string"}},required:["status"],type:"object"}],properties:{action:{const:"hook_v2_admit",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"hook_v2_delivery_receipt",type:"string"},status:{$ref:"#/$defs/ContextScoutStoreStatusV1"}},required:["action","status"],type:"object"},{oneOf:[{properties:{status:{const:"stored",type:"string"}},required:["status"],type:"object"},{properties:{status:{const:"unavailable",type:"string"}},required:["status"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"rejected",type:"string"}},required:["status","disposition"],type:"object"}],properties:{action:{const:"hook_v2_feedback_notice_delivery",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"ingest_transcript",type:"string"},admission:{$ref:"#/$defs/HookIngestAdmissionV1"},bytes_consumed:{format:"uint64",minimum:0,type:["integer","null"]},completed:{description:"False when the byte budget left work for a later pass.",type:"boolean"},cursor_advances:{format:"uint64",minimum:0,type:["integer","null"]},cursor_duplicates:{format:"uint64",minimum:0,type:["integer","null"]},deferred_by_byte_cap:{type:["boolean","null"]},deferred_sources:{format:"uint64",minimum:0,type:["integer","null"]},hint_outcomes:{description:"How emitted hook hints settled against the new project activity."},messages_upserted:{format:"uint64",minimum:0,type:"integer"},observation_duplicates:{format:"uint64",minimum:0,type:["integer","null"]},observations_committed:{format:"uint64",minimum:0,type:["integer","null"]},projection_duplicates:{format:"uint64",minimum:0,type:["integer","null"]},projections_completed:{format:"uint64",minimum:0,type:["integer","null"]},projections_skipped:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:"string"},records_quarantined:{format:"uint64",minimum:0,type:["integer","null"]},records_rejected:{format:"uint64",minimum:0,type:["integer","null"]},source_bytes_scanned:{format:"uint64",minimum:0,type:["integer","null"]},status:{type:"string"},user_scope:{type:"boolean"}},required:["action","provider","user_scope","completed","status","admission","messages_upserted"],type:"object"},{anyOf:[{description:"The LCM authority settled the compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},relation_projection_status:!0,retry_status:{type:["string","null"]},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids","relation_projection_status","authority_outcome","committed_state","messages_upserted"],type:"object"},{description:"The LCM authority answered without a compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","authority_outcome","committed_state","summary_nodes_created","summary_node_ids","messages_upserted"],type:"object"},{description:"No compaction ran: the authority is absent, the host supplied nothing\nto compact, or its summaries have no provenance.",properties:{reason:{type:"string"},relation_projection_status:!0,status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids"],type:"object"},{description:"The host event named no session to compact.",properties:{messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"}},required:["status","reason","messages_upserted"],type:"object"}],description:"A compaction hook's outcome. Variants are distinguished by the fields\nthey carry.",properties:{action:{const:"codex_compact",type:"string"}},required:["action"],type:"object"},{anyOf:[{description:"The LCM authority settled the compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},relation_projection_status:!0,retry_status:{type:["string","null"]},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids","relation_projection_status","authority_outcome","committed_state","messages_upserted"],type:"object"},{description:"The LCM authority answered without a compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","authority_outcome","committed_state","summary_nodes_created","summary_node_ids","messages_upserted"],type:"object"},{description:"No compaction ran: the authority is absent, the host supplied nothing\nto compact, or its summaries have no provenance.",properties:{reason:{type:"string"},relation_projection_status:!0,status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids"],type:"object"},{description:"The host event named no session to compact.",properties:{messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"}},required:["status","reason","messages_upserted"],type:"object"}],description:"A compaction hook's outcome. Variants are distinguished by the fields\nthey carry.",properties:{action:{const:"claude_compact",type:"string"}},required:["action"],type:"object"},{anyOf:[{description:"The LCM authority settled the compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},relation_projection_status:!0,retry_status:{type:["string","null"]},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids","relation_projection_status","authority_outcome","committed_state","messages_upserted"],type:"object"},{description:"The LCM authority answered without a compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","authority_outcome","committed_state","summary_nodes_created","summary_node_ids","messages_upserted"],type:"object"},{description:"No compaction ran: the authority is absent, the host supplied nothing\nto compact, or its summaries have no provenance.",properties:{reason:{type:"string"},relation_projection_status:!0,status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids"],type:"object"},{description:"The host event named no session to compact.",properties:{messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"}},required:["status","reason","messages_upserted"],type:"object"}],description:"A compaction hook's outcome. Variants are distinguished by the fields\nthey carry.",properties:{action:{const:"cursor_compact",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"hermes_receipt",type:"string"},status:{$ref:"#/$defs/HermesReceiptStatusV1"}},required:["action","status"],type:"object"},{oneOf:[{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"accepted",type:"string"}},required:["status","disposition"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"exact_duplicate",type:"string"}},required:["status","disposition"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"rejected",type:"string"}},required:["status","disposition"],type:"object"},{properties:{status:{const:"unavailable",type:"string"}},required:["status"],type:"object"}],properties:{action:{const:"hook_v2_profile_admit",type:"string"}},required:["action"],type:"object"}],title:"HookRuntimeResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of hotspots to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]}},title:"HotspotsSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,HotspotV1:{additionalProperties:!1,properties:{churn:{description:"Commits touching `file` in the last 90 days. Absent when git history\ncould not be read; `0` means the file had no commits in that window.",format:"uint64",minimum:0,type:["integer","null"]},file:{type:"string"},id:{type:"string"},incoming:{format:"uint64",minimum:0,type:"integer"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},outgoing:{format:"uint64",minimum:0,type:"integer"},total:{format:"uint64",minimum:0,type:"integer"}},required:["id","name","kind","file","line","incoming","outgoing","total"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},hotspot_count:{format:"uint64",minimum:0,type:"integer"},hotspots:{items:{$ref:"#/$defs/HotspotV1"},type:"array"},unavailable_fields:{description:"Names a measurement this result could not make. `churn` means the\nranking is connectivity alone.",items:{type:"string"},type:"array"}},required:["hotspot_count","hotspots"],title:"HotspotsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{max_depth:{format:"uint32",minimum:0,type:["integer","null"]},node_id:{type:"string"}},required:["node_id"],title:"NodeDepthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ImpactNodeV1:{additionalProperties:!1,properties:{depth:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line","depth"],type:"object"},ImpactRadiusV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},node_count:{format:"uint",minimum:0,type:"integer"},nodes:{items:{$ref:"#/$defs/ImpactNodeV1"},type:"array"},unavailable_fields:{items:{type:"string"},type:"array"}},required:["node_count","complete","unavailable_fields","nodes"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveNotFoundV1:_Z,PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ImpactRadiusV1"},{$ref:"#/$defs/PrimitiveNotFoundV1"}],title:"ImpactResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"InheritanceDepthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,InheritanceDepthEntryV1:{additionalProperties:!1,properties:{depth:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line","depth"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranking:{items:{$ref:"#/$defs/InheritanceDepthEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["result_count","ranking"],title:"InheritanceDepthResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_insert_at`.",properties:{anchor:{type:"string"},before:{default:!1,type:"boolean"},content:{type:"string"},dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},path:{type:"string"},verify:{default:!1,type:"boolean"}},required:["path","anchor","content"],title:"InsertAtSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_insert_at_symbol`.",properties:{content:{type:"string"},dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},position:{default:"after",type:"string"},symbol:{type:"string"},verify:{default:!1,type:"boolean"}},required:["symbol","content"],title:"InsertAtSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},node_kind:{description:"Filter by node kind (e.g. 'class', 'method', 'function', 'interface',\n'enum', 'struct').",type:["string","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"LargestSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,LargestEntryV1:{additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},lines:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["id","name","kind","file","start_line","end_line","lines"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},node_kind_filter:{type:["string","null"]},ranking:{items:{$ref:"#/$defs/LargestEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["result_count","ranking"],title:"LargestResultV1",type:"object"},{$defs:{LcmDescribeTargetV1:{oneOf:[{properties:{kind:{const:"session",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"summary_node",type:"string"},node_id:{type:"string"}},required:["kind","node_id"],type:"object"},{properties:{kind:{const:"external_payload",type:"string"},payload_ref:{type:"string"}},required:["kind","payload_ref"],type:"object"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{provider:{type:"string"},session_id:{type:"string"},target:{anyOf:[{$ref:"#/$defs/LcmDescribeTargetV1"},{type:"null"}]}},required:["provider","session_id"],title:"LcmDescribeRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,CompactLineageEdgeV1:{additionalProperties:!1,properties:{authority:{type:"string"},authorized:{type:"boolean"},kind:{type:"string"},knowledge_at:{format:"int64",type:"integer"},object_anchor_id:{type:"string"},subject_anchor_id:{type:"string"},supporting_anchor_ids:{items:{type:"string"},type:"array"}},required:["kind","subject_anchor_id","object_anchor_id","knowledge_at","authority","authorized","supporting_anchor_ids"],type:"object"},HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmDescribeExternalPayloadV1:{additionalProperties:!1,properties:{byte_count:{format:"uint64",minimum:0,type:"integer"},char_count:{format:"uint64",minimum:0,type:"integer"},content_hash:{type:"string"},content_preview:{type:"string"},created_at:{format:"int64",type:"integer"},kind:{type:"string"},message_id:{type:"string"},metadata_json:{type:["string","null"]},payload_ref:{type:"string"},provider:{type:"string"},session_id:{type:"string"}},required:["payload_ref","provider","session_id","message_id","kind","content_hash","byte_count","char_count","created_at","content_preview"],type:"object"},LcmDescribeSourceOverviewV1:{additionalProperties:!1,properties:{expand_hint:{type:["string","null"]},node_id:{type:["string","null"]},role:{type:["string","null"]},source_kind:{type:"string"},source_ref:{$ref:"#/$defs/LcmSourceRefV1"},source_token_count:{format:"int64",type:["integer","null"]},storage_kind:{anyOf:[{$ref:"#/$defs/LcmStorageKindV1"},{type:"null"}]},store_id:{format:"int64",type:["integer","null"]},summary_token_count:{format:"int64",type:["integer","null"]}},required:["source_kind","source_ref"],type:"object"},LcmDescribeSummaryNodeV1:{additionalProperties:!1,properties:{children:{items:{$ref:"#/$defs/LcmDescribeSourceOverviewV1"},type:"array"},conversation_id:{type:"string"},created_at:{format:"int64",type:"integer"},depth:{format:"int64",type:"integer"},expand_hint:{type:["string","null"]},metadata_json:{type:["string","null"]},node_id:{type:"string"},source_count:{format:"uint",minimum:0,type:"integer"},source_time_end:{format:"int64",type:["integer","null"]},source_time_start:{format:"int64",type:["integer","null"]},source_token_count:{format:"int64",type:"integer"},summary_token_count:{format:"int64",type:"integer"}},required:["node_id","conversation_id","depth","summary_token_count","source_token_count","created_at","source_count","children"],type:"object"},LcmDescriptionV1:{additionalProperties:!1,properties:{external_payload:{anyOf:[{$ref:"#/$defs/LcmDescribeExternalPayloadV1"},{type:"null"}]},external_payload_count:{format:"int64",type:"integer"},first_store_id:{format:"int64",type:["integer","null"]},last_store_id:{format:"int64",type:["integer","null"]},provider:{type:"string"},raw_message_count:{format:"int64",type:"integer"},raw_messages:{items:{$ref:"#/$defs/LcmRawMessageOverviewV1"},type:"array"},session_id:{type:"string"},session_token_estimate:{format:"int64",type:["integer","null"]},summary_node:{anyOf:[{$ref:"#/$defs/LcmDescribeSummaryNodeV1"},{type:"null"}]},summary_node_count:{format:"int64",type:"integer"},summary_nodes:{items:{$ref:"#/$defs/LcmSummaryNodeOverviewV1"},type:"array"},target:{type:"string"},unpublished_message_count:{description:"Raw messages the session's active temporal generation has not\npublished; transcript reads cannot page them yet.",format:"int64",type:"integer"}},required:["target","provider","session_id","raw_message_count","unpublished_message_count","summary_node_count","external_payload_count","raw_messages","summary_nodes"],type:"object"},LcmRawMessageOverviewV1:{additionalProperties:!1,properties:{content_preview:{type:"string"},content_range:{$ref:"#/$defs/LcmContentRangeV1"},message_id:{type:"string"},payload_ref:{type:["string","null"]},role:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:"integer"}},required:["message_id","store_id","role","storage_kind","content_preview","content_range"],type:"object"},LcmRetrievalOutcomeV1:g4,LcmSourceRefV1:g6,LcmStorageKindV1:g3,LcmSummaryNodeOverviewV1:{additionalProperties:!1,properties:{conversation_id:{type:"string"},created_at:{format:"int64",type:"integer"},depth:{format:"int64",type:"integer"},node_id:{type:"string"},source_count:{format:"uint",minimum:0,type:"integer"},summary_preview:{type:"string"}},required:["node_id","conversation_id","depth","summary_preview","source_count","created_at"],type:"object"},LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalFreshnessV1:bA,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},description:{anyOf:[{$ref:"#/$defs/LcmDescriptionV1"},{type:"null"}]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},grain:{type:["string","null"]},lineage:{items:{$ref:"#/$defs/CompactLineageEdgeV1"},type:["array","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},retrieval:{anyOf:[{$ref:"#/$defs/LcmRetrievalOutcomeV1"},{type:"null"}]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},state:{anyOf:[{$ref:"#/$defs/HydrationStateResultV1"},{type:"null"}]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status"],title:"LcmDescribeResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"LcmDoctorRequestV1",type:"object"},{$defs:{LcmAuthorityOutcomeV1:gZ,LcmConvergenceStateV1:gX,LcmConvergenceV1:gY,LcmDoctorFindingKindV1:{enum:["trigger_audit_drift","occurrence_fts_corruption","summary_fts_corruption","missing_anchor","missing_receipt","invalid_generation","multi_active_generation","cursor_chain_absent","cursor_key_absent","ownership_drift","stuck_refresh","stuck_binding","stuck_progress","stuck_receipt","migration_gap","compatibility_drift","relation_graph_unavailable","relation_graph_corruption","relation_graph_cycle","stale_summary_closure"],type:"string"},LcmDoctorFindingV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{$ref:"#/$defs/LcmDoctorFindingKindV1"}},required:["kind","count"],type:"object"},LcmDoctorHealthStatusV1:{enum:["complete","partial","unavailable","locked"],type:"string"},LcmDoctorHealthV1:{additionalProperties:!1,properties:{findings:{items:{$ref:"#/$defs/LcmDoctorFindingV1"},type:"array"},reason:{type:["string","null"]},status:{$ref:"#/$defs/LcmDoctorHealthStatusV1"}},required:["status","findings"],type:"object"},LcmDoctorProjectionStateV1:g1,LcmDoctorProjectionV1:g0,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{authority_outcome:{$ref:"#/$defs/LcmAuthorityOutcomeV1"},health:{anyOf:[{$ref:"#/$defs/LcmDoctorHealthV1"},{type:"null"}]},projection:{anyOf:[{$ref:"#/$defs/LcmDoctorProjectionV1"},{type:"null"}],description:"Absent when the diagnosed store has no refresh worker (profile mounts)."},reason:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"}},required:["status","authority_outcome"],title:"LcmDoctorResultV1",type:"object"},{$defs:{LcmExpandTargetV1:{oneOf:[{properties:{kind:{const:"canonical_occurrence",type:"string"},message_id:{type:"string"}},required:["kind","message_id"],type:"object"},{properties:{kind:{const:"raw_message",type:"string"},store_id:{format:"uint64",minimum:0,type:"integer"}},required:["kind","store_id"],type:"object"},{properties:{kind:{const:"summary_node",type:"string"},node_id:{type:"string"}},required:["kind","node_id"],type:"object"},{properties:{kind:{const:"external_payload",type:"string"},payload_ref:{type:"string"}},required:["kind","payload_ref"],type:"object"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{content_limit:{format:"uint64",minimum:0,type:["integer","null"]},content_offset:{format:"uint64",minimum:0,type:["integer","null"]},cursor:{type:["string","null"]},provider:{type:"string"},session_id:{type:"string"},source_limit:{format:"uint64",minimum:0,type:["integer","null"]},target:{$ref:"#/$defs/LcmExpandTargetV1"}},required:["provider","session_id","target"],title:"LcmExpandRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmExpandedSourceV1:{additionalProperties:!1,properties:{content:{type:"string"},content_range:{anyOf:[{$ref:"#/$defs/LcmContentRangeV1"},{type:"null"}]},content_truncated:{type:"boolean"},raw_message:{anyOf:[{$ref:"#/$defs/LcmRawMessageV1"},{type:"null"}]},raw_message_metadata:{anyOf:[{$ref:"#/$defs/LcmRawMessageMetadataV1"},{type:"null"}]},source_ref:{$ref:"#/$defs/LcmSourceRefV1"},state:{$ref:"#/$defs/HydrationStateResultV1"},summary_node:{anyOf:[{$ref:"#/$defs/LcmSummaryNodeV1"},{type:"null"}]}},required:["source_ref","state","content","content_truncated"],type:"object"},LcmExpansionV1:{additionalProperties:!1,properties:{content:{type:"string"},content_range:{$ref:"#/$defs/LcmContentRangeV1"},from_current_session:{type:["boolean","null"]},kind:{type:"string"},payload_ref:{type:["string","null"]},raw_message:{anyOf:[{$ref:"#/$defs/LcmRawMessageV1"},{type:"null"}]},raw_message_metadata:{anyOf:[{$ref:"#/$defs/LcmRawMessageMetadataV1"},{type:"null"}]},source_pagination:{anyOf:[{$ref:"#/$defs/LcmSourcePaginationV1"},{type:"null"}]},summary_node:{anyOf:[{$ref:"#/$defs/LcmSummaryNodeV1"},{type:"null"}]},summary_sources:{items:{$ref:"#/$defs/LcmExpandedSourceV1"},type:"array"}},required:["kind","content","content_range","summary_sources"],type:"object"},LcmRawMessageMetadataV1:{additionalProperties:!1,properties:{content_hash:{type:"string"},message_id:{type:"string"},metadata_json:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},payload_ref:{type:["string","null"]},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:"integer"},timestamp:{format:"int64",type:["integer","null"]}},required:["provider","message_id","session_id","store_id","role","ordinal","content_hash","storage_kind"],type:"object"},LcmRawMessageV1:g2,LcmRetrievalOutcomeV1:g4,LcmSourcePaginationV1:{additionalProperties:!1,properties:{has_more:{type:"boolean"},remaining_sources:{format:"uint",minimum:0,type:"integer"},returned_sources:{format:"uint",minimum:0,type:"integer"},source_limit:{format:"uint",minimum:0,type:"integer"},total_sources:{format:"uint",minimum:0,type:"integer"}},required:["source_limit","returned_sources","total_sources","has_more","remaining_sources"],type:"object"},LcmSourceRefV1:g6,LcmStorageKindV1:g3,LcmSummaryNodeV1:g8,LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalFreshnessV1:bA,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},expansion:{anyOf:[{$ref:"#/$defs/LcmExpansionV1"},{type:"null"}]},grain:{type:["string","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},retrieval:{anyOf:[{$ref:"#/$defs/LcmRetrievalOutcomeV1"},{type:"null"}]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},state:{anyOf:[{$ref:"#/$defs/HydrationStateResultV1"},{type:"null"}]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status"],title:"LcmExpandResultV1",type:"object"},{$defs:{LcmNodeIdV1:{anyOf:[{type:"string"},{format:"uint64",minimum:0,type:"integer"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{context_max_tokens:{format:"uint64",minimum:0,type:["integer","null"]},cursor:{type:["string","null"]},max_results:{format:"uint64",minimum:0,type:["integer","null"]},max_tokens:{format:"uint64",minimum:0,type:["integer","null"]},node_ids:{items:{$ref:"#/$defs/LcmNodeIdV1"},type:["array","null"]},prompt:{type:"string"},provider:{type:"string"},query:{type:["string","null"]},session_id:{type:"string"}},required:["provider","session_id","prompt"],title:"LcmExpandQueryRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmExpandQueryBudgetV1:{additionalProperties:!1,properties:{requested_max_chars:{format:"uint",minimum:0,type:"integer"},used_chars:{format:"uint",minimum:0,type:"integer"}},required:["requested_max_chars","used_chars"],type:"object"},LcmExpandQueryContextBlockV1:{additionalProperties:!1,properties:{content:{type:"string"},content_range:{$ref:"#/$defs/LcmContentRangeV1"},kind:{type:"string"},node_id:{type:["string","null"]},raw_message:{anyOf:[{$ref:"#/$defs/LcmRawMessageV1"},{type:"null"}]},source_ref:{anyOf:[{$ref:"#/$defs/LcmSourceRefV1"},{type:"null"}]},summary_node:{anyOf:[{$ref:"#/$defs/LcmSummaryNodeV1"},{type:"null"}]}},required:["kind","content","content_range"],type:"object"},LcmExpandQueryMatchV1:{additionalProperties:!1,properties:{kind:{type:"string"},node_id:{type:["string","null"]},snippet:{type:"string"},store_id:{format:"int64",type:["integer","null"]}},required:["kind","snippet"],type:"object"},LcmExpandQueryPaginationV1:{additionalProperties:!1,properties:{has_more:{type:"boolean"},kind:{type:"string"},next_content_offset:{format:"uint64",minimum:0,type:["integer","null"]},node_id:{type:["string","null"]},source_ref:{anyOf:[{$ref:"#/$defs/LcmSourceRefV1"},{type:"null"}]},state:{anyOf:[{$ref:"#/$defs/HydrationStateResultV1"},{type:"null"}]}},required:["kind","has_more"],type:"object"},LcmExpandQuerySynthesisPromptV1:{additionalProperties:!1,properties:{system:{type:"string"},user:{type:"string"},user_prompt_truncated_for_mcp:{type:["boolean","null"]}},required:["system","user"],type:"object"},LcmRawMessageV1:g2,LcmSourceRefV1:g6,LcmStorageKindV1:g3,LcmSummaryNodeV1:g8,LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{answer:{type:["string","null"]},capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},context_blocks:{items:{$ref:"#/$defs/LcmExpandQueryContextBlockV1"},type:"array"},context_budget:{anyOf:[{$ref:"#/$defs/LcmExpandQueryBudgetV1"},{type:"null"}]},context_max_tokens:{format:"uint",minimum:0,type:["integer","null"]},context_pagination:{items:{$ref:"#/$defs/LcmExpandQueryPaginationV1"},type:["array","null"]},context_truncated:{type:["boolean","null"]},contract_truncated:{type:["boolean","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},matches:{items:{$ref:"#/$defs/LcmExpandQueryMatchV1"},type:["array","null"]},max_tokens:{format:"uint",minimum:0,type:["integer","null"]},mcp_response_truncated:{type:["boolean","null"]},mcp_truncation_reason:{type:["string","null"]},needs_synthesis:{type:["boolean","null"]},node_ids:{items:{type:"string"},type:["array","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},prompt:{type:["string","null"]},prompt_truncated_for_mcp:{type:["boolean","null"]},provider:{type:["string","null"]},query:{type:["string","null"]},query_truncated_for_mcp:{type:["boolean","null"]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},synthesis_prompt:{anyOf:[{$ref:"#/$defs/LcmExpandQuerySynthesisPromptV1"},{type:"null"}]},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status","context_blocks"],title:"LcmExpandQueryResultV1",type:"object"},{$defs:{LcmGrepSortV1:{enum:["recency","relevance","hybrid"],type:"string"},LcmRoleV1:{enum:["system","user","assistant","tool","unknown"],type:"string"},LcmSearchScopeV1:{enum:["current","session","all"],type:"string"},MessageRelationshipScopeV1:_m,MessageTypeFilterV1:_f,RetainedTimeFilterV1:vq,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},cursor:{type:["string","null"]},end_time:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},include_summaries:{type:["boolean","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},message_type:{anyOf:[{$ref:"#/$defs/MessageTypeFilterV1"},{type:"null"}]},provider:{type:["string","null"]},query:{type:"string"},relationship_scope:{anyOf:[{$ref:"#/$defs/MessageRelationshipScopeV1"},{type:"null"}]},role:{anyOf:[{$ref:"#/$defs/LcmRoleV1"},{type:"null"}]},scope:{anyOf:[{$ref:"#/$defs/LcmSearchScopeV1"},{type:"null"}]},session_id:{type:["string","null"]},sort:{anyOf:[{$ref:"#/$defs/LcmGrepSortV1"},{type:"null"}]},source:{type:["string","null"]},start_time:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},temporal_mode:{anyOf:[{$ref:"#/$defs/TemporalModeV1"},{type:"null"}]},worktree:{type:["string","null"]}},required:["query"],title:"LcmGrepRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmGrepHitV1:{additionalProperties:!1,properties:{kind:{type:"string"},message_id:{type:["string","null"]},node_id:{type:["string","null"]},provider:{type:"string"},role:{type:["string","null"]},score:{format:"double",type:"number"},session_id:{type:"string"},snippet:{type:"string"},store_id:{format:"int64",type:["integer","null"]}},required:["kind","provider","session_id","snippet","score"],type:"object"},LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},count:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},hits:{items:{$ref:"#/$defs/LcmGrepHitV1"},type:"array"},message_type:{type:["string","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},query:{type:["string","null"]},relationship_scope:{type:["string","null"]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},sort:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status","hits"],title:"LcmGrepResultV1",type:"object"},{$defs:{TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{content_limit:{format:"uint64",minimum:0,type:["integer","null"]},content_offset:{format:"uint64",minimum:0,type:["integer","null"]},cursor:{type:["string","null"]},end_time:{format:"uint64",minimum:0,type:["integer","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},role:{type:["string","null"]},roles:{items:{type:"string"},type:["array","null"]},session_id:{type:"string"},start_time:{format:"uint64",minimum:0,type:["integer","null"]},temporal_mode:{anyOf:[{$ref:"#/$defs/TemporalModeV1"},{type:"null"}]}},required:["session_id"],title:"LcmLoadSessionRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmMessageV1:{additionalProperties:!1,properties:{content:{type:"string"},content_hash:{type:["string","null"]},content_range:{$ref:"#/$defs/LcmContentRangeV1"},message_id:{type:"string"},metadata_json:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},payload_ref:{type:["string","null"]},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:["integer","null"]},timestamp:{format:"int64",type:["integer","null"]}},required:["provider","message_id","session_id","role","ordinal","content","content_range","storage_kind"],type:"object"},LcmStorageKindV1:g3,LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},content_limit:{format:"uint",minimum:0,type:["integer","null"]},content_limit_clamped_from:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},messages:{items:{$ref:"#/$defs/LcmMessageV1"},type:"array"},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status","messages"],title:"LcmLoadSessionResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{deep:{type:["boolean","null"]},provider:{type:["string","null"]},session_id:{type:["string","null"]}},title:"LcmStatusRequestV1",type:"object"},{$defs:{LcmAuthorityOutcomeV1:gZ,LcmConfigStatusV1:{additionalProperties:!1,properties:{compression_boundary_cooldown_seconds:{format:"int64",type:"integer"},fresh_tail_count:{format:"uint",minimum:0,type:"integer"},summary_fan_in:{format:"uint",minimum:0,type:"integer"}},required:["fresh_tail_count","summary_fan_in","compression_boundary_cooldown_seconds"],type:"object"},LcmConvergenceStateV1:gX,LcmConvergenceV1:gY,LcmDagDepthStatusV1:{additionalProperties:!1,properties:{count:{format:"int64",type:"integer"},source_tokens:{format:"int64",type:"integer"},tokens:{format:"int64",type:"integer"}},required:["count","tokens","source_tokens"],type:"object"},LcmDagStatusV1:{additionalProperties:!1,properties:{compression_ratio:{type:"string"},depths:{additionalProperties:{$ref:"#/$defs/LcmDagDepthStatusV1"},type:"object"},total_nodes:{format:"int64",type:"integer"},total_source_tokens:{format:"int64",type:"integer"},total_tokens:{format:"int64",type:"integer"}},required:["total_nodes","total_tokens","total_source_tokens","compression_ratio","depths"],type:"object"},LcmDoctorProjectionStateV1:g1,LcmDoctorProjectionV1:g0,LcmLifecycleStatusV1:{additionalProperties:!1,properties:{current_frontier_store_id:{format:"int64",type:["integer","null"]},current_session_id:{type:["string","null"]},frontier_count:{format:"int64",type:"integer"},last_finalized_frontier_store_id:{format:"int64",type:["integer","null"]},last_finalized_session_id:{type:["string","null"]},lifecycle_state_count:{format:"int64",type:"integer"},maintenance_debt_count:{format:"int64",type:"integer"}},required:["lifecycle_state_count","frontier_count","maintenance_debt_count"],type:"object"},LcmPayloadCoverageStateV1:{enum:["complete","partial"],type:"string"},LcmPayloadCoverageV1:{additionalProperties:!1,properties:{reason:{type:["string","null"]},scanned_files:{format:"int64",type:"integer"},scanned_metadata_refs:{format:"int64",type:"integer"},state:{$ref:"#/$defs/LcmPayloadCoverageStateV1"}},required:["state","scanned_metadata_refs","scanned_files"],type:"object"},LcmPayloadGcStatusV1:{additionalProperties:!1,properties:{grace_seconds:{format:"int64",type:"integer"},last_gc_at:{format:"int64",type:["integer","null"]},last_gc_duration_ms:{format:"uint64",minimum:0,type:["integer","null"]},last_gc_error:{type:["string","null"]},last_gc_status:{type:["string","null"]},last_reaped_bytes:{format:"uint64",minimum:0,type:["integer","null"]},last_reaped_refs:{format:"int64",type:["integer","null"]},next_run_eligible_at:{format:"int64",type:["integer","null"]},reap_missing_metadata_after_seconds:{format:"int64",type:"integer"}},required:["grace_seconds","reap_missing_metadata_after_seconds"],type:"object"},LcmPayloadStatusV1:{additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/LcmPayloadCoverageV1"},externalized_count:{format:"int64",type:"integer"},gc_candidate_count:{format:"int64",type:"integer"},integrity_mismatch_count:{format:"int64",type:["integer","null"]},missing_count:{format:"int64",type:"integer"},missing_placeholder_file_count:{format:"int64",type:"integer"},missing_placeholder_metadata_count:{format:"int64",type:"integer"},orphan_file_bytes:{format:"uint64",minimum:0,type:"integer"},orphan_file_count:{format:"int64",type:"integer"},placeholder_ref_count:{format:"int64",type:"integer"},reclaimable_bytes:{format:"uint64",minimum:0,type:"integer"},reclaimable_bytes_after_grace:{format:"uint64",minimum:0,type:"integer"},referenced_bytes:{format:"uint64",minimum:0,type:"integer"},referenced_count:{format:"int64",type:"integer"},root_contained:{type:"boolean"},tombstoned_count:{format:"int64",type:"integer"},total_bytes:{format:"uint64",minimum:0,type:"integer"},unreferenced_count:{format:"int64",type:"integer"}},required:["coverage","externalized_count","missing_count","unreferenced_count","placeholder_ref_count","missing_placeholder_metadata_count","missing_placeholder_file_count","gc_candidate_count","root_contained","orphan_file_count","tombstoned_count","referenced_count","total_bytes","referenced_bytes","orphan_file_bytes","reclaimable_bytes","reclaimable_bytes_after_grace"],type:"object"},LcmRedactionStatusV1:{additionalProperties:!1,properties:{enabled:{type:"boolean"},lossy_records:{format:"int64",type:"integer"}},required:["enabled","lossy_records"],type:"object"},LcmStatusV1:{additionalProperties:!1,properties:{config:{$ref:"#/$defs/LcmConfigStatusV1"},dag:{$ref:"#/$defs/LcmDagStatusV1"},external_payload_count:{format:"int64",type:"integer"},lifecycle:{$ref:"#/$defs/LcmLifecycleStatusV1"},maintenance_debt_count:{format:"int64",type:"integer"},missing_payload_count:{format:"int64",type:"integer"},payload:{$ref:"#/$defs/LcmPayloadStatusV1"},payload_gc:{$ref:"#/$defs/LcmPayloadGcStatusV1"},raw_message_count:{format:"int64",type:"integer"},redaction:{$ref:"#/$defs/LcmRedactionStatusV1"},schema_version:{format:"int64",type:"integer"},store:{$ref:"#/$defs/LcmStoreStatusV1"},summary_convergence:{$ref:"#/$defs/LcmSummaryConvergenceStatusV1"},summary_node_count:{format:"int64",type:"integer"},unreferenced_payload_count:{format:"int64",type:"integer"}},required:["schema_version","raw_message_count","summary_node_count","external_payload_count","missing_payload_count","unreferenced_payload_count","maintenance_debt_count","store","dag","config","payload","payload_gc","lifecycle","summary_convergence","redaction"],type:"object"},LcmStoreStatusV1:{additionalProperties:!1,properties:{estimated_tokens:{format:"int64",type:"integer"},messages:{format:"int64",type:"integer"},token_estimate:{$ref:"#/$defs/LcmStoreTokenCoverageV1"}},required:["messages","estimated_tokens","token_estimate"],type:"object"},LcmStoreTokenCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},next_after_store_id:{format:"int64",type:["integer","null"]},scanned_messages:{format:"int64",type:"integer"}},required:["complete","scanned_messages"],type:"object"},LcmSummaryConvergenceReasonV1:{additionalProperties:!1,properties:{reason:{type:"string"},session_count:{format:"int64",type:"integer"},state:{$ref:"#/$defs/LcmSummaryConvergenceStateV1"}},required:["state","reason","session_count"],type:"object"},LcmSummaryConvergenceStateV1:{enum:["pending","retryable","current","unavailable","permanent"],type:"string"},LcmSummaryConvergenceStatusV1:{additionalProperties:!1,description:"Retained-session summary convergence queue: disjoint per-state session\ncounts and the reasons parked or failed sessions record.",properties:{current_session_count:{format:"int64",type:"integer"},pending_session_count:{format:"int64",type:"integer"},permanent_session_count:{format:"int64",type:"integer"},reasons:{items:{$ref:"#/$defs/LcmSummaryConvergenceReasonV1"},type:"array"},retryable_session_count:{format:"int64",type:"integer"},unavailable_session_count:{format:"int64",type:"integer"}},required:["pending_session_count","retryable_session_count","current_session_count","unavailable_session_count","permanent_session_count","reasons"],type:"object"},RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{authority_outcome:{anyOf:[{$ref:"#/$defs/LcmAuthorityOutcomeV1"},{type:"null"}]},deep:{type:["boolean","null"]},lcm:{anyOf:[{$ref:"#/$defs/LcmStatusV1"},{type:"null"}]},message:{type:["string","null"]},projection:{anyOf:[{$ref:"#/$defs/LcmDoctorProjectionV1"},{type:"null"}],description:"The store's refresh-worker serving and convergence state. Absent when\nno refresh worker serves the store."},provider:{type:["string","null"]},reason:{type:["string","null"]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"}},required:["status"],title:"LcmStatusResultV1",type:"object"},{$defs:{MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},title:"MemoryStatusRequestV1",type:"object"},{$defs:{FactCommitOwnerV1:yM,MemoryAlgebraV1:{additionalProperties:!1,properties:{estimated_capacity:{description:"Heuristic D / ln(D) count of bound items one vector can superpose\nbefore cosine similarity degrades. Each fact has its own vector, so\nthis is neither a limit on stored facts nor a recall guarantee.",format:"uint64",minimum:0,type:"integer"},hrr_dim:{description:"Width of each encoded vector.",format:"uint64",minimum:0,type:"integer"},name:{description:"Vector algebra the fact encodings use. Current daemons report `map_c`;\nearlier releases reported `amari_fhrr` for the same encoding.",type:"string"}},required:["name","hrr_dim","estimated_capacity"],type:"object"},MemoryFeedbackFunnelV1:{additionalProperties:!1,properties:{access_count_total:{format:"uint64",minimum:0,type:"integer"},feedback_total:{format:"uint64",minimum:0,type:"integer"},rated_fact_count:{format:"uint64",minimum:0,type:"integer"},retrieval_count_total:{format:"uint64",minimum:0,type:"integer"},retrieved_fact_count:{format:"uint64",minimum:0,type:"integer"},seen_to_feedback_ratio:{format:"uint64",minimum:0,type:["integer","null"]}},required:["retrieval_count_total","access_count_total","retrieved_fact_count","rated_fact_count","feedback_total"],type:"object"},MemoryStatusV1:{additionalProperties:!1,properties:{algebra:{$ref:"#/$defs/MemoryAlgebraV1"},below_default_recall_threshold_count:{format:"uint64",minimum:0,type:"integer"},entity_count:{format:"uint64",minimum:0,type:"integer"},fact_count:{format:"uint64",minimum:0,type:"integer"},feedback_funnel:{$ref:"#/$defs/MemoryFeedbackFunnelV1"},helpful_count:{format:"uint64",minimum:0,type:"integer"},owner:{$ref:"#/$defs/FactCommitOwnerV1"},trust_025_050_count:{format:"uint64",minimum:0,type:"integer"},trust_050_075_count:{format:"uint64",minimum:0,type:"integer"},trust_075_100_count:{format:"uint64",minimum:0,type:"integer"},trust_0_025_count:{format:"uint64",minimum:0,type:"integer"},unhelpful_count:{format:"uint64",minimum:0,type:"integer"}},required:["owner","fact_count","entity_count","algebra","trust_0_025_count","trust_025_050_count","trust_050_075_count","trust_075_100_count","below_default_recall_threshold_count","helpful_count","unhelpful_count","feedback_funnel"],type:"object"},ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{memory:{$ref:"#/$defs/MemoryStatusV1"}},required:["memory"],title:"MemoryStatusResultV1",type:"object"},{$defs:{MessageRelationshipScopeV1:_m,MessageTypeFilterV1:_f,ProjectId:_4,RetainedTimeFilterV1:vq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_message_search`.",properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},cursor:{type:["string","null"]},goals:{default:!1,type:"boolean"},include_subagents:{type:["boolean","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},message_type:{anyOf:[{$ref:"#/$defs/MessageTypeFilterV1"},{type:"null"}]},parent_session_id:{type:["string","null"]},project_key:{type:["string","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},provider:{type:["string","null"]},query:{type:["string","null"]},require_fresh:{description:"Freshness precondition: stale or partial coverage returns\n`refresh_required` instead of stored evidence. The read never refreshes.",type:["boolean","null"]},scope:{anyOf:[{$ref:"#/$defs/MessageRelationshipScopeV1"},{type:"null"}]},since:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},until:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},workflow_agent:{type:["string","null"]},workflow_run:{type:["string","null"]},worktree:{type:["string","null"]}},title:"MessageSearchRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,GitScopeV1:gE,HydrationStateResultV1:gG,MessageSearchHitV1:{additionalProperties:!1,properties:{message:{$ref:"#/$defs/SessionMessageV1"},project_id:{type:["string","null"]},root:{type:["string","null"]},score:{format:"double",type:"number"},session:{$ref:"#/$defs/SessionRecordV1"}},required:["session","message","score"],type:"object"},RetainedErrorV1:vV,RetainedNextActionV1:{additionalProperties:!1,properties:{action:{type:"string"},kind:{type:"string"},reason:{type:"string"},tool:{type:"string"}},required:["kind","tool","action","reason"],type:"object"},RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionMessageV1:{additionalProperties:!1,properties:{kind:{type:["string","null"]},message_id:{type:"string"},metadata_json:{type:["string","null"]},model:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},source_offset:{format:"int64",type:["integer","null"]},source_path:{type:["string","null"]},text:{type:"string"},timestamp:{format:"int64",type:["integer","null"]},tool_names:{type:["string","null"]}},required:["provider","message_id","session_id","role","ordinal","text"],type:"object"},SessionRecordV1:{additionalProperties:!1,properties:{agent_id:{type:["string","null"]},ended_at:{format:"int64",type:["integer","null"]},is_subagent:{type:"boolean"},metadata_json:{type:["string","null"]},parent_session_id:{type:["string","null"]},parent_tool_use_id:{type:["string","null"]},project_key:{type:"string"},project_path:{type:"string"},provider:{type:"string"},session_id:{type:"string"},started_at:{format:"int64",type:["integer","null"]},title:{type:["string","null"]},transcript_path:{type:["string","null"]}},required:["provider","session_id","project_key","project_path","is_subagent"],type:"object"},SessionSourceCoverageV1:bn,TemporalCoverageOmissionV1:{oneOf:[{properties:{detail:{type:"string"},kind:{const:"root_continuation_unavailable",type:"string"},strict_population:{$ref:"#/$defs/TemporalPopulationCountV1"}},required:["kind","strict_population","detail"],type:"object"}]},TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalFreshnessV1:bA,TemporalMetadataV1:{additionalProperties:!1,properties:{anchors:{items:{type:"string"},type:"array"},coverage:{$ref:"#/$defs/TemporalCoverageV1"},coverage_omissions:{items:{$ref:"#/$defs/TemporalCoverageOmissionV1"},type:"array"},explanations:{items:{$ref:"#/$defs/TemporalExplanationV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/TemporalFreshnessV1"},{type:"null"}]},next_cursor:{type:["string","null"]},omissions:{items:{$ref:"#/$defs/TemporalOmissionV1"},type:"array"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},watermarks:{$ref:"#/$defs/TemporalWatermarksV1"}},required:["anchors","watermarks","coverage","explanations"],type:"object"},TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalPopulationCountV1:{oneOf:[{properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{const:"exact",type:"string"}},required:["kind","count"],type:"object"},{properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{const:"at_least",type:"string"}},required:["kind","count"],type:"object"}]},TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},git_filter:{anyOf:[{$ref:"#/$defs/GitScopeV1"},{type:"null"}]},git_filter_applied:{type:["boolean","null"]},goals:{type:"boolean"},include_subagents:{type:"boolean"},message:{type:["string","null"]},message_type:{type:"string"},next_action:{anyOf:[{$ref:"#/$defs/RetainedNextActionV1"},{type:"null"}]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},parent_session_id:{type:["string","null"]},project_key:{type:["string","null"]},provider:{type:"string"},query:{type:["string","null"]},refresh_required:{type:"boolean"},requested_provider:{type:["string","null"]},require_fresh:{type:"boolean"},results:{items:{$ref:"#/$defs/MessageSearchHitV1"},type:["array","null"]},scope:{type:"string"},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},since:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},store_scope:{type:["string","null"]},temporal:{anyOf:[{$ref:"#/$defs/TemporalMetadataV1"},{type:"null"}]},until:{format:"int64",type:["integer","null"]},workflow_agent:{type:["string","null"]},workflow_filter_applied:{type:["boolean","null"]},workflow_run:{type:["string","null"]},workflow_run_parent_session:{type:["string","null"]}},required:["require_fresh","goals","include_subagents","message_type","outcome","provider","refresh_required","scope","status"],title:"MessageSearchResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{path:{type:"string"}},required:["path"],title:"ModuleApiPrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{path:{type:"string"},symbols:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"}},required:["path","symbols"],title:"ModuleApiPrimitiveResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_move_symbol`.",properties:{dest_file:{type:"string"},dry_run:{default:!0,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},symbol:{type:"string"}},required:["symbol","dest_file"],title:"MoveSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_multi_str_replace`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},path:{type:"string"},replacements:{description:"Ordered `[old, new]` pairs, matching the existing MCP tool wire form.",items:{maxItems:2,minItems:2,prefixItems:[{type:"string"},{type:"string"}],type:"array"},type:"array"},verify:{default:!1,type:"boolean"}},required:["path","replacements"],title:"MultiStrReplaceSurfaceRequestV1",type:"object"},{$defs:{NativeIntegrationTransactionId:_T},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["transaction_id"],title:"NativeIntegrationStatusSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{node_id:{type:"string"}},required:["node_id"],title:"NodeSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComplexityAnalysisV1:hx,NodeDetailsV1:{additionalProperties:!1,properties:{branches:{description:"Exact counters; `None`, and listed in `unavailable_fields`, when\n`complexity_analysis` reports the bounded walk did not cover the body.",format:"uint32",minimum:0,type:["integer","null"]},complexity_analysis:{$ref:"#/$defs/ComplexityAnalysisV1"},cost_to_expand:{$ref:"#/$defs/NodeExpansionCostV1"},cyclomatic_complexity:{format:"uint32",minimum:0,type:["integer","null"]},derives:{items:{type:"string"},type:"array"},docstring:{type:["string","null"]},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},id:{type:"string"},is_async:{type:"boolean"},kind:{type:"string"},loops:{format:"uint32",minimum:0,type:["integer","null"]},max_nesting:{format:"uint32",minimum:0,type:["integer","null"]},name:{type:"string"},qualified_name:{type:"string"},signature:{type:["string","null"]},start_line:{format:"uint32",minimum:0,type:"integer"},unavailable_fields:{items:{type:"string"},type:"array"},visibility:{type:"string"}},required:["id","name","kind","qualified_name","file","start_line","end_line","is_async","derives","visibility","complexity_analysis","cost_to_expand","unavailable_fields"],type:"object"},NodeExpansionCostV1:_A,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveNotFoundV1:_Z,PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/NodeDetailsV1"},{$ref:"#/$defs/PrimitiveNotFoundV1"}],title:"NodeResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One project-scoped horizon for the canonical Observatory and Costs models.",properties:{window_days:{default:14,format:"uint16",maximum:365,minimum:1,type:"integer"}},title:"ObservatoryReadRequestV1",type:"object"},{$defs:{AnalyticsModeReadModelV1:fk,AnalyticsModeV1:fw,ComparisonDispositionV1:hI,CostsReadModelV1:yl,CoverageStateV1:yf,LatencyDistributionReadModelV1:gJ,MetricCalibrationV1:_h,MetricCohortV1:_y,MetricCoverageV1:_g,MetricEvidenceClassV1:__,MetricProvenanceV1:_v,MetricSourceV1:_b,MetricTemporalV1:_$,MetricUncertaintyV1:_S,MetricValueV1:_k,ObservabilityHorizonV1:_W,ObservatoryReadModelV1:_N,PerformanceComparisonReadModelV1:_H,ProviderLatencyReadModelV1:vn,RejectedArgumentAnalyticsV1:vh,RejectedArgumentErrorClassV1:vy,RejectedArgumentGroupV1:vg,RejectedArgumentNameV1:v_,RejectedArgumentSurfaceV1:vv},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical project-scoped observability and costs read models.",properties:{costs:{$ref:"#/$defs/CostsReadModelV1"},observatory:{$ref:"#/$defs/ObservatoryReadModelV1"}},required:["observatory","costs"],title:"ObservatoryReadResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kinds:{items:{type:"string"},type:["array","null"]},limit:{format:"uint32",minimum:0,type:["integer","null"]},source_dir:{type:"string"}},required:["source_dir"],title:"PortOrderSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PortCycleAnchorV1:{additionalProperties:!1,properties:{file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},rationale:{type:["string","null"]}},required:["name","file","line"],type:"object"},PortCycleFileV1:{additionalProperties:!1,properties:{file:{type:"string"},members_in_cycle:{format:"uint",minimum:0,type:"integer"}},required:["file","members_in_cycle"],type:"object"},PortCycleSymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},in_cycle_in_degree:{format:"uint",minimum:0,type:"integer"},in_cycle_out_degree:{format:"uint",minimum:0,type:"integer"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line","in_cycle_out_degree","in_cycle_in_degree"],type:"object"},PortCycleV1:{additionalProperties:!1,properties:{break_point_candidate:{anyOf:[{$ref:"#/$defs/PortCycleAnchorV1"},{type:"null"}]},entry_point:{anyOf:[{$ref:"#/$defs/PortCycleAnchorV1"},{type:"null"}]},files:{items:{$ref:"#/$defs/PortCycleFileV1"},type:"array"},note:{type:"string"},size:{format:"uint",minimum:0,type:"integer"},symbols:{items:{$ref:"#/$defs/PortCycleSymbolV1"},type:"array"}},required:["size","files","symbols","note"],type:"object"},PortOrderLevelV1:{additionalProperties:!1,properties:{description:{type:"string"},level:{format:"uint",minimum:0,type:"integer"},symbols:{items:{$ref:"#/$defs/PortOrderSymbolV1"},type:"array"}},required:["level","description","symbols"],type:"object"},PortOrderSymbolV1:{additionalProperties:!1,properties:{depends_on:{items:{type:"string"},type:["array","null"]},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycles:{items:{$ref:"#/$defs/PortCycleV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},levels:{items:{$ref:"#/$defs/PortOrderLevelV1"},type:"array"},returned:{format:"uint",minimum:0,type:"integer"},source_dir:{type:"string"},total_symbols:{format:"uint",minimum:0,type:"integer"}},required:["source_dir","total_symbols","returned","levels","cycles"],title:"PortOrderResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kinds:{items:{type:"string"},type:["array","null"]},source_dir:{type:"string"},target_dir:{type:"string"}},required:["source_dir","target_dir"],title:"PortStatusSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PortMatchedSymbolV1:{additionalProperties:!1,properties:{name:{type:"string"},source_file:{type:"string"},source_kind:{type:"string"},target_file:{type:"string"},target_kind:{type:"string"}},required:["name","source_kind","target_kind","source_file","target_file"],type:"object"},PortTargetOnlySymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line"],type:"object"},PortUnmatchedSymbolV1:{additionalProperties:!1,properties:{kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage_percent:{format:"double",type:"number"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},matched:{format:"uint",minimum:0,type:"integer"},matched_symbols:{items:{$ref:"#/$defs/PortMatchedSymbolV1"},type:"array"},source_count:{format:"uint",minimum:0,type:"integer"},source_dir:{type:"string"},target_count:{format:"uint",minimum:0,type:"integer"},target_dir:{type:"string"},target_only:{format:"uint",minimum:0,type:"integer"},target_only_symbols:{items:{$ref:"#/$defs/PortTargetOnlySymbolV1"},type:"array"},unmatched:{format:"uint",minimum:0,type:"integer"},unmatched_by_file:{additionalProperties:{items:{$ref:"#/$defs/PortUnmatchedSymbolV1"},type:"array"},type:"object"}},required:["source_dir","target_dir","source_count","target_count","matched","unmatched","target_only","coverage_percent","unmatched_by_file","matched_symbols","target_only_symbols"],title:"PortStatusResultV1",type:"object"},{$defs:{PrContextViewV1:_G},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{base_ref:{description:"Base branch or ref (default: the matching retained PR base, otherwise\nthe detected repository default branch). A short branch name selects the descendant of its\nlocal and origin tracking tips; use an explicit ref when they diverge.",type:["string","null"]},budget_tokens:{description:"Approximate whole-result JSON token budget for the brief (default: 4000).\nIn symbols view, budgets the existing symbol, test, and module sections.",format:"uint32",minimum:0,type:["integer","null"]},cursor:{description:"Authenticated continuation cursor; accepted only with view `symbols`.",type:["string","null"]},head_ref:{description:"Head branch or ref (default: 'HEAD'). Accepts local branches,\nremote-tracking refs such as origin/topic, full refs, and Git revision\nexpressions.",type:["string","null"]},maximum_symbols:{description:"Maximum symbols returned on a symbols-view page (default: 200, clamped to 1-500).",format:"uint32",minimum:0,type:["integer","null"]},pull_request:{description:"Select a retained PR number for this checkout when several are known.",format:"uint64",minimum:0,type:["integer","null"]},refresh_github:{default:!1,description:"Explicitly refresh the configured matching GitHub PR within the caller\ndeadline. By default, read retained authorized evidence. CI stays retained.",type:"boolean"},view:{$ref:"#/$defs/PrContextViewV1",default:"brief",description:"Compact PR briefing by default; `symbols` requests exact symbol pages."}},title:"PrContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hf,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ConfigSummaryKindV1:hT,ConfigSummaryV1:hO,GitCommitSubjectV1:{additionalProperties:!1,properties:{hash:{type:"string"},subject:{type:"string"}},required:["hash","subject"],type:"object"},GitComparedSymbolV1:gy,GitContextSymbolV1:g_,GitFileChangeStatusV1:{enum:["added","deleted","modified"],type:"string"},GitFileChangeV1:{additionalProperties:!1,properties:{path:{type:"string"},status:{$ref:"#/$defs/GitFileChangeStatusV1"}},required:["path","status"],type:"object"},GitFileRoleV1:gS,GitReadCompleteV1:gj,GitReadPartialV1:gC,GitReadUnavailableV1:gT,GitToolErrorKindV1:gW,GitToolErrorV1:gM,GitToolFailureV1:gN,GitToolOperationV1:gz,MissingCoChangePartnerV1:_w,PrAnalysisCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},direct_call_edges_admitted:{format:"uint",minimum:0,type:"integer"},impact_bytes_admitted:{format:"uint",minimum:0,type:"integer"},impact_nodes_admitted:{format:"uint",minimum:0,type:"integer"},impact_nodes_returned:{format:"uint",minimum:0,type:"integer"},impact_partial:{type:"boolean"},seed_symbols_analyzed:{format:"uint",minimum:0,type:"integer"},symbols_complete:{type:"boolean"},symbols_returned:{format:"uint",minimum:0,type:"integer"}},required:["seed_symbols_analyzed","symbols_returned","symbols_complete","impact_nodes_admitted","impact_nodes_returned","direct_call_edges_admitted","impact_bytes_admitted","impact_partial","complete"],type:"object"},PrContextAreaV1:{additionalProperties:!1,properties:{additions:{format:"uint64",minimum:0,type:"integer"},area:{type:"string"},deletions:{format:"uint64",minimum:0,type:"integer"},files:{format:"uint",minimum:0,type:"integer"}},required:["area","files","additions","deletions"],type:"object"},PrContextBriefBudgetV1:{additionalProperties:!1,properties:{areas_omitted:{format:"uint",minimum:0,type:"integer"},checks_omitted:{format:"uint",minimum:0,type:"integer"},commits_omitted:{format:"uint",minimum:0,type:"integer"},discussions_omitted:{format:"uint",minimum:0,type:"integer"},entry_points_omitted:{format:"uint",minimum:0,type:"integer"},estimated_tokens:{description:"Whole-result JSON byte estimate, divided by four; not a tokenizer count.",format:"uint32",minimum:0,type:"integer"},files_omitted:{format:"uint",minimum:0,type:"integer"},impact_omitted:{format:"uint",minimum:0,type:"integer"},over_budget:{type:"boolean"},quality_omitted:{format:"uint",minimum:0,type:"integer"},requested_tokens:{format:"uint32",minimum:0,type:"integer"}},required:["requested_tokens","estimated_tokens","over_budget","files_omitted","entry_points_omitted","discussions_omitted","checks_omitted","impact_omitted","commits_omitted","areas_omitted","quality_omitted"],type:"object"},PrContextBriefV1:{additionalProperties:!1,properties:{additions:{format:"uint64",minimum:0,type:"integer"},areas:{items:{$ref:"#/$defs/PrContextAreaV1"},type:"array"},base:{type:"string"},base_oid:{type:"string"},budget:{$ref:"#/$defs/PrContextBriefBudgetV1"},changes:{items:{$ref:"#/$defs/PrContextFileV1"},type:"array"},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},deletions:{format:"uint64",minimum:0,type:"integer"},entry_points:{description:"Prioritized places to begin reading the change, with exact revisions.",items:{$ref:"#/$defs/PrContextEntryPointV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}]},graph_analysis:{$ref:"#/$defs/PrContextSourceV1"},head:{type:"string"},head_oid:{type:"string"},hosted:{$ref:"#/$defs/PrContextHostedV1"},impact:{items:{$ref:"#/$defs/PrContextImpactV1"},type:"array"},merge_base:{type:"string"},next_steps:{items:{type:"string"},type:"array"},quality:{items:{$ref:"#/$defs/PrContextQualityV1"},type:"array"},source_analysis:{$ref:"#/$defs/PrContextSourceV1"},view:{$ref:"#/$defs/PrContextViewV1"}},required:["view","base","head","base_oid","head_oid","merge_base","files_changed","additions","deletions","commits","hosted","areas","changes","entry_points","impact","quality","source_analysis","graph_analysis","next_steps","budget"],type:"object"},PrContextCheckV1:{additionalProperties:!1,properties:{conclusion:{type:["string","null"]},evidence_anchor:{type:"string"},failed_step:{type:["string","null"]},head:{type:"string"},locations:{items:{$ref:"#/$defs/PrContextLocationV1"},type:"array"},matches_head:{type:"boolean"},name:{type:"string"},observed_at:{format:"int64",type:"integer"},status:{type:"string"},workflow:{type:"string"}},required:["name","workflow","status","head","matches_head","observed_at","evidence_anchor","locations"],type:"object"},PrContextCompleteV1:{additionalProperties:!1,properties:{added:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},affected_tests:{items:{type:"string"},type:"array"},affected_tests_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},analysis_coverage:{$ref:"#/$defs/PrAnalysisCoverageV1"},base:{type:"string"},base_oid:{type:"string"},changes:{items:{$ref:"#/$defs/GitFileChangeV1"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_generation:{type:"string"},head:{type:"string"},head_oid:{type:"string"},impacted_modules:{items:{type:"string"},type:"array"},impacted_modules_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},merge_base:{type:"string"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},next_cursor:{type:["string","null"]},removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},status:{$ref:"#/$defs/GitReadCompleteV1"},symbol_changes_coverage:{$ref:"#/$defs/PrSymbolChangesCompleteV1"},symbol_page:{$ref:"#/$defs/PrSymbolPageV1"},symbols_added:{format:"uint",minimum:0,type:"integer"},symbols_modified:{format:"uint",minimum:0,type:"integer"},symbols_removed:{format:"uint",minimum:0,type:"integer"},test_files_changed:{items:{type:"string"},type:"array"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."}},required:["status","base","head","base_oid","head_oid","merge_base","graph_generation","commits","files_changed","changes","missing_co_change_partners","symbols_added","symbols_removed","symbols_modified","added","removed","modified","symbol_changes_coverage","symbol_page","analysis_coverage","test_files_changed","affected_tests","affected_tests_coverage","impacted_modules","impacted_modules_coverage"],type:"object"},PrContextDiscussionV1:{additionalProperties:!1,properties:{author:{description:"Provider login when retained; an opaque author anchor is not a login.",type:["string","null"]},body_anchor:{type:["string","null"]},event_at:{description:"Provider activity time in UTC microseconds: comment update/creation or\nreview submission. Absent when not retained or not parseable.",format:"int64",type:["integer","null"]},file:{type:["string","null"]},id:{type:"string"},kind:{type:"string"},lifecycle:{type:"string"},line:{format:"uint64",minimum:0,type:["integer","null"]},matches_head:{type:"boolean"},observed_at:{format:"int64",type:"integer"},review_state:{type:"string"},text:{type:["string","null"]},text_truncated:{type:"boolean"},thread_id:{type:["string","null"]},url:{type:["string","null"]}},required:["id","kind","lifecycle","review_state","text_truncated","observed_at","matches_head"],type:"object"},PrContextEntryPointV1:{additionalProperties:!1,properties:{after_excerpt:{anyOf:[{$ref:"#/$defs/PrContextExcerptV1"},{type:"null"}]},after_signature:{type:["string","null"]},after_signature_truncated:{default:!1,type:"boolean"},before_excerpt:{anyOf:[{$ref:"#/$defs/PrContextExcerptV1"},{type:"null"}]},before_signature:{type:["string","null"]},before_signature_truncated:{default:!1,type:"boolean"},change:{type:"string"},location:{$ref:"#/$defs/PrContextLocationV1"},node_id:{description:"Exact-head graph occurrence accepted by source_body and impact.\nAbsent when graph provenance or declaration matching is unavailable.",type:["string","null"]},reason:{type:"string"},revision:{type:"string"},symbol:{type:"string"}},required:["location","revision","symbol","change","reason"],type:"object"},PrContextExcerptV1:{additionalProperties:!1,properties:{location:{$ref:"#/$defs/PrContextLocationV1"},revision:{type:"string"},text:{type:"string"},truncated:{description:"True when this is only an excerpt of the declaration.",type:"boolean"}},required:["revision","location","text","truncated"],type:"object"},PrContextFileV1:{additionalProperties:!1,properties:{additions:{format:"uint32",minimum:0,type:["integer","null"]},change:{type:"string"},deletions:{format:"uint32",minimum:0,type:["integer","null"]},file:{type:"string"},previous_file:{type:["string","null"]},role:{$ref:"#/$defs/GitFileRoleV1"}},required:["file","change","role"],type:"object"},PrContextGraphPendingV1:{additionalProperties:!1,description:"The git comparison while the verified graph generation is still warming.",properties:{added:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},affected_tests:{items:{type:"string"},type:"array"},affected_tests_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},analysis_coverage:{$ref:"#/$defs/PrAnalysisCoverageV1"},base:{type:"string"},base_oid:{type:"string"},changes:{items:{$ref:"#/$defs/GitFileChangeV1"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_generation:{description:"No verified generation was admitted.",type:["string","null"]},head:{type:"string"},head_oid:{type:"string"},impacted_modules:{items:{type:"string"},type:"array"},impacted_modules_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},merge_base:{type:"string"},message:{type:"string"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},next_cursor:{type:["string","null"]},status:{$ref:"#/$defs/GitReadPartialV1"},symbol_page:{$ref:"#/$defs/PrSymbolPageV1"},symbols_added:{format:"uint",minimum:0,type:"integer"},symbols_modified:{format:"uint",minimum:0,type:"integer"},test_files_changed:{items:{type:"string"},type:"array"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."},verified_graph_evidence:{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"}},required:["status","message","base","head","base_oid","head_oid","merge_base","commits","files_changed","changes","missing_co_change_partners","symbols_added","symbols_modified","added","modified","symbol_page","analysis_coverage","test_files_changed","affected_tests","affected_tests_coverage","impacted_modules","impacted_modules_coverage","verified_graph_evidence"],type:"object"},PrContextHostedV1:{additionalProperties:!1,properties:{checks:{items:{$ref:"#/$defs/PrContextCheckV1"},type:"array"},checks_total:{format:"uint",minimum:0,type:"integer"},ci_source:{$ref:"#/$defs/PrContextSourceV1"},discussions:{items:{$ref:"#/$defs/PrContextDiscussionV1"},type:"array"},discussions_total:{format:"uint",minimum:0,type:"integer"},pull_request:{anyOf:[{$ref:"#/$defs/PrContextPullRequestV1"},{type:"null"}]},required_checks_known:{description:"A retained CI inventory is not an enumeration of required checks.",type:"boolean"},source:{$ref:"#/$defs/PrContextSourceV1"}},required:["source","ci_source","discussions","checks","discussions_total","checks_total","required_checks_known"],type:"object"},PrContextImpactV1:{additionalProperties:!1,properties:{changed_symbol:{type:"string"},consumer:{type:"string"},consumer_changed:{description:"Whether the consumer's file is in the PR diff; this does not imply\nthat the consumer declaration itself changed.",type:"boolean"},location:{$ref:"#/$defs/PrContextLocationV1"},node_id:{description:"Exact-head consumer occurrence accepted by source_body and impact.",type:["string","null"]},relation:{type:"string"}},required:["changed_symbol","consumer","location","relation","consumer_changed"],type:"object"},PrContextLocationV1:{additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"}},required:["file","line","end_line"],type:"object"},PrContextPullRequestV1:{additionalProperties:!1,properties:{description:{description:"Sanitized retained description, when the provider supplied it.",type:["string","null"]},description_truncated:{type:"boolean"},draft:{type:"boolean"},matches_head:{type:"boolean"},number:{format:"uint64",minimum:0,type:"integer"},observed_at:{format:"int64",type:"integer"},observed_head:{type:"string"},state:{type:"string"},title:{type:"string"}},required:["number","title","state","draft","description_truncated","observed_head","observed_at","matches_head"],type:"object"},PrContextQualityV1:{additionalProperties:!1,properties:{observation:{type:"string"},signal:{type:"string"}},required:["signal","observation"],type:"object"},PrContextSourceStateV1:{enum:["ready","partial","stale","unavailable","not_published","denied","not_mounted","ambiguous","not_found"],type:"string"},PrContextSourceV1:{additionalProperties:!1,properties:{detail:{type:"string"},state:{$ref:"#/$defs/PrContextSourceStateV1"}},required:["state","detail"],type:"object"},PrContextSymbolsUnavailableV1:{additionalProperties:!1,description:"The git comparison while exact base/head symbol comparison is unavailable\nor does not describe the verified graph's head generation.",properties:{added:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},base:{type:"string"},base_oid:{type:"string"},changes:{items:{$ref:"#/$defs/GitFileChangeV1"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_generation:{type:"string"},head:{type:"string"},head_oid:{type:"string"},merge_base:{type:"string"},message:{type:"string"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},next_cursor:{type:["string","null"]},removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},status:{$ref:"#/$defs/GitReadPartialV1"},symbol_changes_coverage:{$ref:"#/$defs/SymbolChangesUnavailableV1"},symbols_added:{format:"uint",minimum:0,type:"integer"},symbols_modified:{format:"uint",minimum:0,type:"integer"},symbols_removed:{format:"uint",minimum:0,type:"integer"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."}},required:["status","message","base","head","base_oid","head_oid","merge_base","graph_generation","commits","files_changed","changes","missing_co_change_partners","symbols_added","symbols_removed","symbols_modified","added","removed","modified","symbol_changes_coverage"],type:"object"},PrContextViewV1:_G,PrCoverageSelectionV1:{enum:["unavailable","deterministic_bounded_prefix"],type:"string"},PrSelectionCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},selection:{$ref:"#/$defs/PrCoverageSelectionV1"}},required:["complete","selection"],type:"object"},PrSymbolChangesCompleteV1:{additionalProperties:!1,properties:{base_generation:{type:"string"},head_generation:{type:"string"},status:{$ref:"#/$defs/GitReadCompleteV1"}},required:["status","base_generation","head_generation"],type:"object"},PrSymbolEntryV1:{anyOf:[{$ref:"#/$defs/GitContextSymbolV1"},{$ref:"#/$defs/ConfigSummaryV1"}]},PrSymbolPageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},continuation_available:{type:"boolean"},has_more:{type:"boolean"},limit:{format:"uint",minimum:0,type:"integer"},returned:{format:"uint",minimum:0,type:"integer"},selection:{$ref:"#/$defs/PrSymbolSelectionV1"}},required:["limit","returned","has_more","complete","selection","continuation_available"],type:"object"},PrSymbolSelectionV1:{enum:["unavailable","stable_prefix"],type:"string"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,PrimitiveUnavailableEvidenceV1:_0,PrimitiveUnavailableStatusV1:_2,SymbolChangesUnavailableV1:bV,TokenBudgetCutV1:bD,TokenBudgetSectionV1:bF},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/PrContextBriefV1"},{$ref:"#/$defs/PrContextCompleteV1"},{$ref:"#/$defs/PrContextSymbolsUnavailableV1"},{$ref:"#/$defs/PrContextGraphPendingV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"PrContextResultV1"},{$defs:{BranchStackEdgeV1:f3,BranchStackId:f9,BranchStackNodeV1:f5,BranchStackRevisionId:f8,BranchStackRevisionV1:f7,BranchStackSourceV1:he,CommitId:hq,ManifestDigest:_l,MechanicalIntegrationModeV1:_p,NativeIntegrationDirectionV1:_R,NativeIntegrationSealedStackSnapshotV1:_x,NativeIntegrationSelectionBindingV1:_j,ProjectId:_4,RefId:vm,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,StackNodeId:bw,WorktreeId:SB,WorktreeInventoryEpoch:SK,WorktreeInventorySnapshotId:SJ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Read-only preflight over one frozen snapshot identity.\n\n`preferred_mode` selects only one of the three fixed mechanical encodings.\nIt cannot change topology, commit order, or the commit set.",properties:{preferred_mode:{anyOf:[{$ref:"#/$defs/MechanicalIntegrationModeV1"},{type:"null"}],default:null},snapshot:{$ref:"#/$defs/NativeIntegrationSealedStackSnapshotV1"}},required:["snapshot"],title:"NativeIntegrationPreflightSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{path:{description:"Project path or registered alias to resolve.",type:["string","null"]},project_selector:{additionalProperties:!1,default:null,description:"Registered project id to inspect. Omit to use path or the active\nproject.",properties:{project_id:{description:"Registered project id to query.",type:"string"}},required:["project_id"],type:"object"}},title:"ProjectContextSurfaceRequestV1",type:"object"},{$defs:{PublicCodeProject:va},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One registered project's context, or the registry's typed miss.",oneOf:[{additionalProperties:!1,properties:{aliases:{description:"Alias rows exactly as the registry serializes them.",items:!0,type:"array"},is_active:{type:"boolean"},project:{$ref:"#/$defs/PublicCodeProject"},registry_path:{type:"string"},status:{const:"ok",type:"string"},stores:{description:"Store rows exactly as the registry serializes them.",items:!0,type:"array"}},required:["status","is_active","registry_path","project","aliases","stores"],type:"object"},{additionalProperties:!1,description:"The registry answered and no registered project matches the selector.",properties:{aliases:{items:!0,type:"array"},project:{type:"null"},registry_path:{type:"string"},status:{const:"not_found",type:"string"},stores:{items:!0,type:"array"}},required:["status","registry_path","project","aliases","stores"],type:"object"}],title:"ProjectContextResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum projects to return (default: 25, max: 100).",format:"uint",minimum:0,type:["integer","null"]}},title:"ProjectListSurfaceRequestV1",type:"object"},{$defs:{ProjectRegistryEntry:_6,ProjectRegistrySummary:_3,ProjectRepoGroup:_9,PublicCodeProject:va},$schema:"https://json-schema.org/draft/2020-12/schema",description:"A bounded page of the profile's registered projects.",oneOf:[{additionalProperties:!1,properties:{limit:{format:"uint",minimum:0,type:"integer"},project_tree:{items:{$ref:"#/$defs/ProjectRepoGroup"},type:"array"},projects:{items:{$ref:"#/$defs/PublicCodeProject"},type:"array"},query:{type:["string","null"]},registry_path:{type:"string"},status:{const:"ok",type:"string"},summary:{$ref:"#/$defs/ProjectRegistrySummary"},title:{type:"string"},truncated:{type:"boolean"}},required:["status","title","registry_path","limit","truncated","summary","project_tree","projects"],type:"object"}],title:"ProjectRegistryListingResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum projects to return (default: 10, max: 50).",format:"uint",minimum:0,type:["integer","null"]},query:{description:"Case-insensitive substring query over registry project metadata.",type:"string"}},required:["query"],title:"ProjectSearchSurfaceRequestV1",type:"object"},{$defs:{PageRequest:_U},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{page:{$ref:"#/$defs/PageRequest"},qualified_name:{type:"string"}},required:["qualified_name","page"],title:"QualifiedNamePrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},symbols:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["symbols"],title:"QualifiedNamePrimitiveResult",type:"object"},{$defs:{RankDirectionV1:vc,RankEdgeKindV1:vl},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{anyOf:[{$ref:"#/$defs/RankDirectionV1"},{type:"null"}],description:"Edge direction: 'incoming' ranks targets (default, e.g.\nmost-implemented interface), 'outgoing' ranks sources (e.g. class that\nimplements the most interfaces)."},edge_kind:{$ref:"#/$defs/RankEdgeKindV1",description:"The relationship type to rank by (e.g. 'implements' to find\nmost-implemented interfaces)."},limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},node_kind:{description:"Optional filter for node kind (e.g. 'interface', 'class', 'trait',\n'function', 'method').",type:["string","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},required:["edge_kind"],title:"RankSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RankDirectionV1:vc,RankEdgeKindV1:vl,RankEntryV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line","count"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{$ref:"#/$defs/RankDirectionV1"},edge_kind:{$ref:"#/$defs/RankEdgeKindV1"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},node_kind_filter:{type:["string","null"]},ranking:{items:{$ref:"#/$defs/RankEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["edge_kind","direction","result_count","ranking"],title:"RankResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of cycles to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"RecursionSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RecursionCycleV1:{additionalProperties:!1,description:"One call cycle; `chain` repeats its first symbol at the end.",properties:{chain:{items:{$ref:"#/$defs/RecursionSymbolV1"},type:"array"},length:{format:"uint64",minimum:0,type:"integer"}},required:["length","chain"],type:"object"},RecursionSymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycle_count:{format:"uint64",minimum:0,type:"integer"},cycles:{items:{$ref:"#/$defs/RecursionCycleV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."}},required:["cycle_count","cycles"],title:"RecursionResultV1",type:"object"},{$defs:{CommitId:hq,ProjectId:_4,ProviderId:vo,RedundancyScopeV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"repository",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"path",type:"string"},path:{type:"string"}},required:["kind","path"],type:"object"},{additionalProperties:!1,properties:{changed_paths:{items:{type:"string"},type:"array"},head_commit_id:{$ref:"#/$defs/CommitId"},kind:{const:"pull_request",type:"string"},provider:{$ref:"#/$defs/ProviderId"},pull_request_id:{type:"string"}},required:["kind","provider","pull_request_id","head_commit_id","changed_paths"],type:"object"}]},RepositoryId:vb,SimilarMatchClassV1:bc},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{type:["string","null"]},family_limit:{description:"Preferred family page size, 1 through 100.",format:"uint32",maximum:100,minimum:1,type:"integer"},include_generated_paths:{type:"boolean"},match_classes:{items:{$ref:"#/$defs/SimilarMatchClassV1"},type:"array"},member_limit:{description:"Members listed per family, at least 2.",format:"uint32",minimum:2,type:"integer"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},scope:{$ref:"#/$defs/RedundancyScopeV1"},work_limit:{description:"Clone-index work budget for this page, 3 through 10000. A page that\nexhausts it reports partial coverage.",format:"uint32",maximum:1e4,minimum:3,type:"integer"}},required:["project_id","repository_id","match_classes","scope","include_generated_paths","family_limit","member_limit","work_limit"],title:"RedundancySurfaceRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ManifestDigest:_l,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,ProjectId:_4,RedundancyCoverageV1:{oneOf:[{additionalProperties:!1,properties:{examined_families:{format:"uint",minimum:0,type:"integer"},examined_members:{format:"uint",minimum:0,type:"integer"},status:{const:"complete",type:"string"}},required:["status","examined_families","examined_members"],type:"object"},{additionalProperties:!1,properties:{examined_families:{format:"uint",minimum:0,type:"integer"},examined_members:{format:"uint",minimum:0,type:"integer"},reason:{$ref:"#/$defs/RedundancyPartialReasonV1"},status:{const:"partial",type:"string"}},required:["status","reason","examined_families","examined_members"],type:"object"}]},RedundancyFamilyV1:{additionalProperties:!1,properties:{family:{$ref:"#/$defs/SimilarFamilyV1"},generated_members:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},reviewable_source_bytes:{format:"uint64",minimum:0,type:"integer"},total_member_count:{format:"uint",minimum:0,type:"integer"}},required:["family","total_member_count","reviewable_source_bytes","generated_members"],type:"object"},RedundancyPartialReasonV1:{enum:["family_limit","work_limit"],type:"string"},RedundancyRankingV1:{enum:["reviewable_source_bytes"],type:"string"},RepositoryId:vb,SimilarFamilyV1:bd,SimilarMatchClassV1:bc,SimilarOccurrenceV1:bl,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/RedundancyCoverageV1"},families:{items:{$ref:"#/$defs/RedundancyFamilyV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},next_cursor:{type:["string","null"]},ranked_by:{$ref:"#/$defs/RedundancyRankingV1"},source_generation:{$ref:"#/$defs/CodeGenerationId"}},required:["source_generation","ranked_by","families","coverage"],title:"RedundancyResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"RemoteStatusSurfaceRequestV1",type:"object"},{$defs:{AuthorityEpoch:{description:"Monotonic epoch of the writer authority for a shard.",format:"uint64",minimum:0,type:"integer"},BrainId:f1,BrainNodeId:{description:"Strongly typed canonical identity: `BrainNodeId`.",type:"string"},CurrentRemoteAuthorityStateV1:{description:"Truthful authority lookup state. Missing evidence is never represented as\nan available authority or a successful empty response.",oneOf:[{properties:{state:{const:"available",type:"string"},value:{$ref:"#/$defs/CurrentRemoteAuthorityV1"}},required:["state","value"],type:"object"},{properties:{state:{const:"partial",type:"string"},value:{properties:{known_fence:{anyOf:[{$ref:"#/$defs/RemoteWriterFenceV1"},{type:"null"}]},missing:{items:{$ref:"#/$defs/RemoteAuthorityUnavailableReasonV1"},type:"array",uniqueItems:!0},observed_at:{$ref:"#/$defs/UtcMicros"}},required:["missing","observed_at"],type:"object"}},required:["state","value"],type:"object"},{properties:{state:{const:"unavailable",type:"string"},value:{properties:{observed_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/RemoteAuthorityUnavailableReasonV1"}},required:["reason","observed_at"],type:"object"}},required:["state","value"],type:"object"}]},CurrentRemoteAuthorityV1:{additionalProperties:!1,description:"Authenticated current authority for a mutable shard.",properties:{credential_revision:{description:"Revision of the authority node's current enrollment credential.",format:"uint64",minimum:0,type:"integer"},fence:{$ref:"#/$defs/RemoteWriterFenceV1"},observed_at:{$ref:"#/$defs/UtcMicros"}},required:["fence","credential_revision","observed_at"],type:"object"},DoctorCoverageCompletenessV1:yk,ProjectionGenerationId:_5,RemoteAuthorityUnavailableReasonV1:{oneOf:[{enum:["registry_unavailable","placement_unknown","authority_unreachable","authority_authentication_failed","caller_authentication_failed","enrollment_expired","enrollment_revoked","insufficient_capability","scope_mismatch","fence_unverified","protocol_incompatible"],type:"string"},{const:"writer_authority_unpublished",description:"The RemoteNode store has never had a writer authority published for\nthis Brain, so no capture, replay, query, or failover can bind to one.",type:"string"}]},RemoteListenerReadV1:{enum:["serving","disabled","degraded"],type:"string"},RemoteOperationalReadinessV1:{enum:["unconfigured","partial","ready","recovery_required"],type:"string"},RemoteOperationalStatusV1:{additionalProperties:!1,properties:{authority:{$ref:"#/$defs/CurrentRemoteAuthorityStateV1"},enrollment_configured:{type:"boolean"},failover_in_progress:{type:"boolean"},observed_at:{$ref:"#/$defs/UtcMicros"},readiness:{$ref:"#/$defs/RemoteOperationalReadinessV1"},recovery_required:{type:"boolean"},replay_coverage_complete:{type:"boolean"},spool:{$ref:"#/$defs/RemoteSpoolOperationalStatusV1"}},required:["readiness","enrollment_configured","authority","spool","replay_coverage_complete","failover_in_progress","recovery_required","observed_at"],type:"object"},RemoteSpoolOperationalStatusV1:{additionalProperties:!1,properties:{has_sequence_gap:{type:"boolean"},pending_count:{format:"uint64",minimum:0,type:"integer"},quarantined_count:{format:"uint64",minimum:0,type:"integer"}},required:["pending_count","quarantined_count","has_sequence_gap"],type:"object"},RemoteWriterFenceV1:{additionalProperties:!1,description:"The complete single-writer identity for one mutable shard.",properties:{authority_epoch:{$ref:"#/$defs/AuthorityEpoch"},authority_node_id:{$ref:"#/$defs/BrainNodeId"},brain_id:{$ref:"#/$defs/BrainId"},generation_id:{$ref:"#/$defs/ProjectionGenerationId"},placement_revision:{format:"uint64",minimum:0,type:"integer"},shard_id:{$ref:"#/$defs/ShardId"}},required:["brain_id","shard_id","generation_id","placement_revision","authority_epoch","authority_node_id"],type:"object"},ShardId:{description:"Strongly typed canonical identity: `ShardId`.",type:"string"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Typed read of the Remote Brain operational plane as observed from the\nmounted daemon authorities. Every operator surface (Doctor, CLI, MCP,\ndashboard) reads this one shape; `Unavailable` is reserved for a genuinely\nunmounted or unreadable authority, never a rendering shortcut.",oneOf:[{properties:{coverage:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},kind:{const:"observed",type:"string"},listener:{$ref:"#/$defs/RemoteListenerReadV1"},status:{$ref:"#/$defs/RemoteOperationalStatusV1"}},required:["kind","listener","status","coverage"],type:"object"},{properties:{kind:{const:"unconfigured",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"unavailable",type:"string"}},required:["kind"],type:"object"}],title:"RemoteOperationalStatusReadV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{new_name:{type:["string","null"]},node_id:{type:"string"}},required:["node_id"],title:"RenamePreviewPrimitiveRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveNotFoundV1:_Z,PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1,RenamePreviewNodeV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},qualified_name:{type:"string"},snippet:{type:["string","null"]}},required:["id","name","qualified_name","kind","file","line"],type:"object"},RenamePreviewPrimitiveResultV1:{additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},new_name:{type:["string","null"]},node:{$ref:"#/$defs/RenamePreviewNodeV1"},note:{type:"string"},read_only:{type:"boolean"},reference_count:{format:"uint",minimum:0,type:"integer"},references:{items:{$ref:"#/$defs/RenamePreviewReferenceV1"},type:"array"},symbol:{type:"string"},text_only_matches:{items:{$ref:"#/$defs/RenamePreviewTextOnlyMatchV1"},type:"array"}},required:["read_only","note","symbol","node","reference_count","references","text_only_matches"],type:"object"},RenamePreviewReferenceV1:{additionalProperties:!1,properties:{edge_kind:{type:"string"},file:{type:"string"},from_kind:{type:"string"},from_name:{type:"string"},from_node_id:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},snippet:{type:["string","null"]}},required:["from_node_id","from_name","from_kind","edge_kind","file","line"],type:"object"},RenamePreviewTextOnlyMatchV1:{additionalProperties:!1,properties:{file:{type:"string"},note:{type:"string"},text_only_count:{format:"uint",minimum:0,type:"integer"}},required:["file","text_only_count","note"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/RenamePreviewPrimitiveResultV1"},{$ref:"#/$defs/PrimitiveNotFoundV1"}],title:"RenamePreviewPrimitiveOutcomeV1"},{$defs:{ManifestDigest:_l,RenamePreviewAcceptanceV1:{additionalProperties:!1,description:"Exact preview material an apply must echo. Preview calls omit this value;\napply rejects any mismatch before publishing a file.",properties:{graph_revision:{$ref:"#/$defs/ManifestDigest"},plan_digest:{$ref:"#/$defs/ManifestDigest"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/ManifestDigest"},repository_revision:{default:null,type:["string","null"]}},required:["preview_id","preview_digest","plan_digest","graph_revision"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_rename_symbol`.\n\nThe five identity fields consume the preview's exact symbol identity; the\nflattened control consumes its exact candidate-state digest.",properties:{accepted_preview:{anyOf:[{$ref:"#/$defs/RenamePreviewAcceptanceV1"},{type:"null"}],description:"Exact output identity from the accepted dry-run preview. Required when\n`dry_run=false` and omitted when computing a preview."},dry_run:{default:!0,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},file:{type:"string"},idempotency_key:{type:["string","null"]},kind:{type:"string"},new_name:{type:"string"},node_id:{description:"Canonical `SymbolOccurrenceId` returned by `tracedecay_rename_preview`.",type:"string"},old_name:{type:"string"},qualified_name:{type:"string"},verify:{default:!0,type:"boolean"}},required:["node_id","qualified_name","kind","file","old_name","new_name"],title:"RenameSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_replace_symbol`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},new_source:{type:"string"},symbol:{type:"string"},verify:{default:!1,type:"boolean"}},required:["symbol","new_source"],title:"ReplaceSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{handle:{description:"The required `handle` argument copied exactly from a truncated MCP\nresponse envelope.",type:"string"},max_chars:{description:"Maximum characters requested for this page. Values above the safe\nresponse-frame budget are clamped.",format:"uint64",minimum:1,type:["integer","null"]},offset:{default:0,description:"Character offset into the immutable stored response (default: 0). Use\nthe prior page's next_offset.",format:"uint64",minimum:0,type:["integer","null"]}},required:["handle"],title:"RetrieveSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RetrieveHandleExpiredV1:{additionalProperties:!1,description:"The record expired and was removed.",properties:{content:{description:"Always null: the expired content was removed.",type:["string","null"]},created_at:{format:"int64",type:"integer"},expired:{description:"Always `true`.",type:"boolean"},expires_at:{format:"int64",type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},handle:{type:"string"},message:{type:"string"},reason_code:{type:"string"},retry_instruction:{type:"string"},retryable:{type:"boolean"}},required:["handle","expired","reason_code","message","retryable","retry_instruction","created_at","expires_at"],type:"object"},RetrieveHandleMissingV1:{additionalProperties:!1,description:"No record exists under the handle in this project's store.",properties:{content:{description:"Always null: nothing is stored under the handle.",type:["string","null"]},expired:{description:"Always null: an absent record has no expiry to report.",type:["boolean","null"]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},handle:{type:"string"},message:{type:"string"},reason_code:{type:"string"},retry_instruction:{type:"string"},retryable:{type:"boolean"}},required:["handle","reason_code","message","retryable","retry_instruction"],type:"object"},RetrievedPageV1:{additionalProperties:!1,description:"One page of the stored response, sized so its response frame fits the\nresponse budget.",properties:{content:{type:"string"},created_at:{format:"int64",type:"integer"},expired:{description:"Always `false`: a page is only served from a live record.",type:"boolean"},expires_at:{format:"int64",type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},handle:{type:"string"},has_more:{type:"boolean"},next_offset:{description:"Where the next page starts; absent on the last page.",format:"uint64",minimum:0,type:["integer","null"]},offset:{format:"uint64",minimum:0,type:"integer"},original_chars:{format:"uint64",minimum:0,type:"integer"},total_chars:{format:"uint64",minimum:0,type:"integer"}},required:["handle","expired","original_chars","total_chars","offset","has_more","created_at","expires_at","content"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/RetrievedPageV1"},{$ref:"#/$defs/RetrieveHandleMissingV1"},{$ref:"#/$defs/RetrieveHandleExpiredV1"}],description:"What a retrieve found under the handle.",title:"RetrieveResultV1"},{$defs:{TestProfileV1:{description:"The cargo profile an affected-test run builds with.",enum:["debug","release"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{changed_paths:{description:"Explicit manifest of project-relative file paths used to compute\naffected tests.",items:{type:"string"},type:"array"},max_tests:{description:"Cap on tests dispatched in a single invocation, 1 through 500\n(default: 100).",format:"uint64",maximum:500,minimum:1,type:["integer","null"]},profile:{anyOf:[{$ref:"#/$defs/TestProfileV1"},{type:"null"}],description:"Cargo profile (default: debug)."},timeout_secs:{description:"Maximum wall time in seconds before the cargo subprocess is killed,\n1 through 300 (default: 300).",format:"uint64",maximum:300,minimum:1,type:["integer","null"]}},required:["changed_paths"],title:"RunAffectedTestsSurfaceRequestV1",type:"object"},{$defs:{AffectedTestErrorV1:{additionalProperties:!1,description:"Why a run failed or was refused.",properties:{kind:{type:"string"},message:{type:"string"},operation:{type:"string"}},required:["kind","operation","message"],type:"object"},AffectedTestOutcomeV1:{additionalProperties:!1,description:"One observed libtest outcome.",properties:{covers_source_ids:{description:"Graph symbols this test was selected to cover.",items:{type:"string"},type:"array"},passed:{type:"boolean"},test:{type:"string"}},required:["test","passed","covers_source_ids"],type:"object"},AffectedTestRunV1:{additionalProperties:!1,description:"A dispatched run, completed or failed, with what it observed.",properties:{dispatched_tests:{items:{type:"string"},type:"array"},error:{anyOf:[{$ref:"#/$defs/AffectedTestErrorV1"},{type:"null"}],description:"Present when the run did not complete."},exit_code:{format:"int32",type:["integer","null"]},failed:{format:"uint64",minimum:0,type:"integer"},ignored:{description:"Dispatched tests libtest reported as ignored.",format:"uint64",minimum:0,type:"integer"},passed:{format:"uint64",minimum:0,type:"integer"},results:{items:{$ref:"#/$defs/AffectedTestOutcomeV1"},type:"array"},stderr_tail:{type:"string"},stdout_tail:{type:"string"},terminal:{$ref:"#/$defs/ManagedTestTerminalV1"},total_observed:{format:"uint64",minimum:0,type:"integer"},truncated:{description:"More affected tests existed than `max_tests` admitted.",type:"boolean"}},required:["passed","failed","ignored","total_observed","dispatched_tests","truncated","results","stderr_tail","stdout_tail","terminal"],type:"object"},AffectedTestsNotRunV1:{additionalProperties:!1,description:"No test was dispatched: nothing covers the change, or the request was\nrefused before a run began.",properties:{error:{anyOf:[{$ref:"#/$defs/AffectedTestErrorV1"},{type:"null"}]},failed:{description:"Always 0.",format:"uint64",minimum:0,type:"integer"},note:{type:["string","null"]},passed:{description:"Always 0.",format:"uint64",minimum:0,type:"integer"},results:{description:"Always empty.",items:{$ref:"#/$defs/AffectedTestOutcomeV1"},type:"array"}},required:["passed","failed","results"],type:"object"},CancellationObservation:hn,CancellationStage:ha,Deadline:yv,ManagedTestTerminalV1:{additionalProperties:!1,description:"The managed test-run operation the run was recorded under.",properties:{operation_id:{type:"string"},receipt:{$ref:"#/$defs/OperationReceipt"},result_tool:{description:"The tool that reads the recorded results back.",type:"string"},session_id:{description:"The requesting session the run is recorded against; null when the\nrequest carried no session.",type:["string","null"]}},required:["operation_id","result_tool","receipt"],type:"object"},OperationBudgetUsage:_D,OperationReceipt:_F,OperationTermination:_L,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AffectedTestRunV1"},{$ref:"#/$defs/AffectedTestsNotRunV1"}],title:"RunAffectedTestsResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{authority_audit:{default:!1,description:"Run the exhaustive observation-authority audit and include\nauthority_audit_ok (true = audit ran and passed, false = audit ran and\nfailed, null = audit did not run or finish), authority_audit_reason\n(typed: authority_invariant_failed, authority_store_unavailable,\nauthority_store_missing, authority_audit_not_run,\nauthority_audit_budget_exceeded), and\nauthority_audit_error (observed detail) in database telemetry. Also\nincludes session-temporal health. Default false.",type:"boolean"},doctor_report:{default:!1,description:"Include the daemon-owned canonical Doctor report and typed per-table\ngrowth evidence. Default false.",type:"boolean"},session_ingest_health:{default:!1,description:"Include Cursor transcript-ingest health from the daemon-retained\nproject session authority. Default false.",type:"boolean"},session_temporal_health:{default:!1,description:"Include session-temporal health without the authority audit. Default\nfalse.",type:"boolean"},startup_health:{default:!1,description:"Ask a connection's first request for only the daemon-mounted database\nintegrity telemetry, for post-update startup validation; the daemon\ncore answers that probe before a project owner exists, and a project\nowner's snapshot already carries the same telemetry. Default false.",type:"boolean"}},title:"RuntimeSurfaceRequestV1",type:"object"},{$defs:{DoctorCoverageCompletenessV1:yk,DoctorCoverageStatementV1:{description:"A bounded, human-readable coverage statement plus its completeness.",properties:{completeness:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},statement:{type:"string"}},required:["completeness","statement"],type:"object"},DoctorEvidenceRefV1:{description:"A typed reference to one piece of evidence Doctor composed into a finding.\n\nThe `family` records which audited input surface produced the evidence, so\na finding may cross-cite evidence from more than one family without losing\nprovenance.",properties:{family:{$ref:"#/$defs/DoctorFindingFamilyV1"},reference:{$ref:"#/$defs/DoctorEvidenceReferenceV1"}},required:["family","reference"],type:"object"},DoctorEvidenceReferenceV1:{description:"Durable, non-disclosing reference to one owning-authority evidence\nrecord (for example a `FeedbackFindingId`, configuration revision, or\nruntime read coverage anchor). Doctor stores the reference only; the\nowning authority remains the single source of the record.",type:"string"},DoctorEvidenceStateV1:{description:"Exact Doctor evidence states.\n\nMissing, partial, or unknown truth never becomes healthy or clean. Only\n[`DoctorEvidenceStateV1::HealthyCompleteCoverage`] asserts a healthy result,\nand only when its finding carries complete coverage (see\n[`DoctorFindingV1::new`]).",oneOf:[{const:"unsupported",description:"The owning authority does not support this evidence on this platform.",type:"string"},{const:"absent",description:"The evidence source is supported but produced nothing.",type:"string"},{const:"stale",description:"The evidence exists but is behind the current generation/watermark.",type:"string"},{const:"degraded",description:"The evidence proves a degraded but observed condition.",type:"string"},{const:"partial",description:"Only part of the evidence was observed.",type:"string"},{const:"unknown",description:"The evidence state could not be determined.",type:"string"},{const:"denied",description:"Authorization to read the evidence was denied.",type:"string"},{const:"healthy_complete_coverage",description:"The evidence proves a healthy condition with complete coverage.",type:"string"}]},DoctorFamilyConsultationV1:{description:"Whether a family was consulted from an observed source or is unavailable.",oneOf:[{description:"A source produced observed evidence for this family.",properties:{status:{const:"consulted",type:"string"}},required:["status"],type:"object"},{description:"Complete family coverage was unavailable. Storage may still carry\nfindings from resolved producers when an independent producer failed.",properties:{reason:{$ref:"#/$defs/DoctorFamilyUnavailableReasonV1"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},DoctorFamilyCoverageV1:{description:"The consultation status of one finding family within a report.",properties:{consultation:{$ref:"#/$defs/DoctorFamilyConsultationV1"},family:{$ref:"#/$defs/DoctorFindingFamilyV1"}},required:["family","consultation"],type:"object"},DoctorFamilyUnavailableReasonV1:{description:"Why complete coverage of a finding family was unavailable.",oneOf:[{const:"unwired",description:"No source port is wired for this family in this composition.",type:"string"},{const:"unsupported",description:"The source is unsupported on this build/platform.",type:"string"},{const:"absent",description:"The source is supported but produced nothing.",type:"string"},{const:"denied",description:"The source read was denied.",type:"string"},{const:"unknown",description:"The source state could not be determined.",type:"string"},{const:"unavailable",description:"The source could not be reached. Named separately from `Unknown`: the\nsource is identified and its unreachability is an observation, not an\nundetermined state.",type:"string"},{const:"reset_required",description:"The source must be rebuilt before it can be read again.",type:"string"},{const:"corrupt",description:"The source was read and found corrupt.",type:"string"}]},DoctorFindingFamilyV1:{description:"Stable Doctor finding families.\n\nThe initial list covers advisory findings from\nBrain, Explorer, Loom, Code, and Observatory, plus the daemon\ncore doctor checks (graph quick-check, temporal health, configuration\ndrift, code-index mount state, session ingest).\nEach family maps to one audited typed input surface. The set is kept small\nand honest; new families are added through a future versioned enum rather\nthan by widening the meaning of an existing variant.",oneOf:[{const:"advisory",description:"advisory/scout findings (GitHub review, CI localization,\nproximity, context scout): `crate::advisory` / domain feedback.",type:"string"},{const:"configuration",description:"Desired-versus-effective configuration and compatibility drift from\n`ProjectConfigurationRuntime` / `ConfigurationControlPlane`.",type:"string"},{const:"storage_runtime",description:"Store, graph, and temporal runtime health plus migration coverage\n(`RuntimeReadOperationV1` health family, `StoreRuntimeClientLease`).",type:"string"},{const:"storage",description:"Storage retention, size, and efficiency over canonical observability\nread models. Distinct from [`Self::StorageRuntime`] health: this\nfamily surfaces over-budget stores, identity-drift orphans, incident\ndebris, and retention backlog. The typed\nsubclass vocabulary is [`DoctorStorageFindingKindV1`].",type:"string"},{const:"language_server",description:"Language-server / analyzer engine status from the LSP gateway's\n`AnalyzerState`.",type:"string"},{const:"code_index",description:"Code index mount state (mounted, indexing, stale, unmounted,\nincompatible, parked).",type:"string"},{const:"observability",description:"Denominator-safe measurement and telemetry health from analytics,\naccounting read models, and session ingest.",type:"string"},{const:"memory",description:"Retained daemon memory as the resident-memory inventory reports it:\nRSS against the admission limit and pressure line, and each retained\nowner's bytes.",type:"string"}]},DoctorFindingV1:{description:"One canonical Doctor finding.\n\nA finding pins its diagnosis `family`, its evidence `state`, the typed\nevidence it composed, and a coverage statement. Construction enforces the\ninvariants that keep unknown/partial evidence from collapsing into a\nhealthy or clean result.",properties:{coverage:{$ref:"#/$defs/DoctorCoverageStatementV1"},evidence:{items:{$ref:"#/$defs/DoctorEvidenceRefV1"},type:"array"},family:{$ref:"#/$defs/DoctorFindingFamilyV1"},state:{$ref:"#/$defs/DoctorEvidenceStateV1"}},required:["family","state","evidence","coverage"],type:"object"},DoctorReportCoverageV1:{description:"The report-wide coverage statement: which families were consulted versus\nunavailable, plus an overall completeness and a bounded human statement.",properties:{completeness:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},families:{items:{$ref:"#/$defs/DoctorFamilyCoverageV1"},type:"array"},statement:{$ref:"#/$defs/DoctorCoverageStatementV1"}},required:["families","completeness","statement"],type:"object"},DoctorReportEntryV1:{description:"One entry in a Doctor report: a canonical finding plus, for the storage\nfamily, its typed subclass. The subclass is present only for storage findings\n(a non-storage entry never carries one).",properties:{finding:{$ref:"#/$defs/DoctorFindingV1"},storage_kind:{anyOf:[{$ref:"#/$defs/DoctorStorageFindingKindV1"},{type:"null"}]}},required:["finding"],type:"object"},DoctorReportV1:{description:"One composed Doctor report.\n\nThe report carries one or more entries per family (findings are never merged\nby label) plus a coverage statement that enumerates every family consulted\nversus unavailable. Severity (the finding's evidence state) and evidence\nquality (coverage completeness) are kept as separate dimensions: a degraded\nfinding with complete coverage does not weaken report completeness, and only\ngenuinely complete coverage with every finding healthy makes the whole report\nassert health.",properties:{coverage:{$ref:"#/$defs/DoctorReportCoverageV1"},entries:{items:{$ref:"#/$defs/DoctorReportEntryV1"},type:"array"}},required:["entries","coverage"],type:"object"},DoctorStorageFindingKindV1:{description:"Typed subclasses of the [`DoctorFindingFamilyV1::Storage`] finding family.\n\nThe storage family never reports a silent overage: each subclass names one\nobservable retention/size condition Doctor surfaces over canonical size\nobservability read models. The set is closed and grows only through a future\nversioned enum, never by widening an existing subclass.",oneOf:[{const:"over_budget_store",description:"A store exceeds its owner-configured soft size budget.",type:"string"},{const:"orphan_store",description:"A store whose project identity no longer resolves to a live repository\nroot (identity-drift orphan), reported with age and size.",type:"string"},{const:"incident_debris_present",description:"Recovery/corruption artifacts are present beside a store and awaiting\ndeletion.",type:"string"},{const:"retention_backlog",description:"Retention-eligible rows or stores are past their window and awaiting\noffload/collection.",type:"string"},{const:"table_growth",description:"Per-table SQLite payload growth observed between two retained\nwatermarks, including baseline and unavailable measurement states.",type:"string"},{const:"schema_convergence_incomplete",description:"A store whose background schema convergence (the authority-invariant\naudit and projection retry re-arming that follow admission) has not\ncompleted: it is still pending, still running, or stopped on a failure.\nThe daemon serves meanwhile, so this is the surface that says which\nstore has not converged and why.",type:"string"},{const:"wal_checkpoint_pinned",description:"A store whose WAL checkpoint cannot restart the log because a reader\nstill holds a read slot past the checkpoint fence: a wedged reader of\nthis daemon or another process, named in the evidence. Writes run\nuntil the WAL reaches its ceiling, then wait.",type:"string"}]},LanguageServerAnalyzerStateV1:{description:"State of one analyzer as the daemon owner holds it.\n\n`Inactive` is the one state the aggregate never takes: the language has no\nfiles in the project, so Doctor does not grade it, but `lsp servers` still\nlists it from this same read so both surfaces share one authority.",enum:["ready","available","refreshing","disabled","unavailable","crashed","inactive"],type:"string"},LanguageServerAnalyzerV1:{description:"Live state of one analyzer the daemon resolved for the current project.\n\n`LanguageServerStateV1` is the aggregate the finding is graded on; this is\nthe per-analyzer evidence behind it, so an operator learns *which*\nexecutable is missing and how to install it, resolved by the daemon\nprocess (the only PATH that matters, since the daemon spawns analyzers)\nrather than by whichever shell ran the CLI.",properties:{command:{description:"The configured executable, after any operator command override.",type:"string"},detail:{description:"The owner's last recorded error for this analyzer, when one exists.",type:["string","null"]},executable_found:{description:"Whether the daemon process finds `command` on its own PATH. For an\nactive analyzer `state` is the finer verdict (a rustup proxy whose\ntoolchain lacks the component is found yet `Unavailable`); for an\ninactive one this is the only availability evidence.",type:"boolean"},install:{description:"The first install command the adapter advertises, when one exists.",type:["string","null"]},language:{description:"Adapter language (`typescript`, `rust`, …).",type:"string"},state:{$ref:"#/$defs/LanguageServerAnalyzerStateV1"}},required:["language","command","state","executable_found"],type:"object"},LanguageServerReadV1:{description:"One live read from the daemon language-server/analyzer owner.",oneOf:[{description:"The owner observed all project-active analyzer states.",properties:{analyzers:{default:[],description:"Every analyzer the owner resolved, active or not; the aggregate\n`state` covers the active ones only.",items:{$ref:"#/$defs/LanguageServerAnalyzerV1"},type:"array"},coverage:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},kind:{const:"observed",type:"string"},state:{$ref:"#/$defs/LanguageServerStateV1"}},required:["kind","state","coverage"],type:"object"},{description:"Language-server inspection is unsupported on this build/platform.",properties:{kind:{const:"unsupported",type:"string"}},required:["kind"],type:"object"},{description:"No project-active analyzer is configured. The owner's inactive\nanalyzers are still carried so `lsp servers` can list them.",properties:{analyzers:{default:[],items:{$ref:"#/$defs/LanguageServerAnalyzerV1"},type:"array"},kind:{const:"absent",type:"string"}},required:["kind"],type:"object"},{description:"Authorization to inspect analyzer state was denied.",properties:{kind:{const:"denied",type:"string"}},required:["kind"],type:"object"},{description:"Analyzer state could not be determined.",properties:{kind:{const:"unknown",type:"string"}},required:["kind"],type:"object"}]},LanguageServerStateV1:{description:"Aggregate state of the project-active language-server analyzers.",oneOf:[{const:"ready",description:"Every active analyzer is ready.",type:"string"},{const:"available",description:"At least one analyzer is installed but has not produced a ready snapshot.",type:"string"},{const:"refreshing",description:"At least one analyzer is currently refreshing/indexing.",type:"string"},{const:"disabled",description:"At least one project analyzer is disabled.",type:"string"},{const:"unavailable",description:"At least one project analyzer executable is unavailable.",type:"string"},{const:"crashed",description:"At least one analyzer process crashed.",type:"string"}]},RuntimeDoctorReportV1:{description:"The daemon's canonical Doctor report as this route could read it.",oneOf:[{additionalProperties:!1,properties:{kind:{const:"observed",type:"string"},language_servers:{$ref:"#/$defs/LanguageServerReadV1"},report:{$ref:"#/$defs/DoctorReportV1"},schema_convergences:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},table_growth_evidence:{items:{$ref:"#/$defs/TableGrowthDoctorEvidenceV1"},type:"array"}},required:["kind","report","table_growth_evidence","schema_convergences","language_servers"],type:"object"},{additionalProperties:!1,description:"The reader is mounted and the read failed.",properties:{kind:{const:"unknown",type:"string"},language_servers:{$ref:"#/$defs/LanguageServerReadV1"},schema_convergences:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},table_growth_evidence:{items:{$ref:"#/$defs/TableGrowthDoctorEvidenceV1"},type:"array"}},required:["kind","table_growth_evidence","schema_convergences","language_servers"],type:"object"},{additionalProperties:!1,description:"No Doctor reader is mounted on this route.",properties:{kind:{const:"unsupported",type:"string"},language_servers:{$ref:"#/$defs/LanguageServerReadV1"},schema_convergences:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},table_growth_evidence:{items:{$ref:"#/$defs/TableGrowthDoctorEvidenceV1"},type:"array"}},required:["kind","table_growth_evidence","schema_convergences","language_servers"],type:"object"}]},SchemaConvergenceFindingV1:vL,SchemaConvergenceStageV1:vU,SchemaConvergenceStateV1:vH,StorageByteSizeV1:{description:"A byte size measurement. A newtype keeps sizes from being confused with\ncounts, ratios, or timestamps in the read models and producers.",format:"uint64",minimum:0,type:"integer"},StoreKeyV1:{description:"Logical name of one owner-profile store (for example `sessions.db`,\n`graph.db`, or `projects/proj_x`). Never an absolute on-disk path.",type:"string"},TableGrowthDoctorEvidenceV1:{description:"Contract-independent evidence ready to wrap in a future `TableGrowth`\nStorage finding once that generated-contract variant is available.",oneOf:[{properties:{current_bytes:{$ref:"#/$defs/StorageByteSizeV1"},current_observed_at:{$ref:"#/$defs/UtcMicros"},growth_bytes:{$ref:"#/$defs/StorageByteSizeV1"},kind:{const:"significant_growth",type:"string"},previous_bytes:{$ref:"#/$defs/StorageByteSizeV1"},previous_observed_at:{$ref:"#/$defs/UtcMicros"},store:{$ref:"#/$defs/StoreKeyV1"},table:{$ref:"#/$defs/TableNameV1"}},required:["kind","store","table","previous_bytes","current_bytes","growth_bytes","previous_observed_at","current_observed_at"],type:"object"},{properties:{kind:{const:"baseline_established",type:"string"},observed_at:{$ref:"#/$defs/UtcMicros"},store:{$ref:"#/$defs/StoreKeyV1"},tables_observed:{format:"uint64",minimum:0,type:"integer"}},required:["kind","store","observed_at","tables_observed"],type:"object"},{properties:{current_bytes:{$ref:"#/$defs/StorageByteSizeV1"},kind:{const:"table_baseline_pending",type:"string"},observed_at:{$ref:"#/$defs/UtcMicros"},store:{$ref:"#/$defs/StoreKeyV1"},table:{$ref:"#/$defs/TableNameV1"}},required:["kind","store","table","current_bytes","observed_at"],type:"object"},{properties:{kind:{const:"unsupported",type:"string"},store:{$ref:"#/$defs/StoreKeyV1"}},required:["kind","store"],type:"object"},{properties:{kind:{const:"denied",type:"string"},store:{$ref:"#/$defs/StoreKeyV1"}},required:["kind","store"],type:"object"},{properties:{kind:{const:"unknown",type:"string"},reason:{$ref:"#/$defs/TableGrowthUnavailableReasonV1"},store:{$ref:"#/$defs/StoreKeyV1"}},required:["kind","store","reason"],type:"object"}]},TableGrowthUnavailableReasonV1:{description:"Why a per-table payload-growth measurement is unavailable.",oneOf:[{const:"not_yet_measured",description:"No maintenance pass has measured this store yet.",type:"string"},{const:"reader_unavailable",description:"No reader could be leased within the measurement's wait.",type:"string"},{const:"deadline_exceeded",description:"The `dbstat` walk was interrupted by its deadline.",type:"string"},{const:"cancelled",description:"The `dbstat` walk was cancelled.",type:"string"},{const:"storage_corrupt",description:"The store reported corruption.",type:"string"},{const:"storage_infrastructure",description:"The store failed with an infrastructure error.",type:"string"},{const:"storage_other",description:"The store failed for another reason.",type:"string"},{const:"invalid_table_name",description:"`dbstat` named a table that is not a valid table identifier.",type:"string"},{const:"clock_regressed",description:"The previous watermark is later than the current measurement.",type:"string"},{const:"exceeds_measurement_budget",description:"The store is larger than the `dbstat` walk can cover within its\ndeadline.",type:"string"}]},TableNameV1:{description:"A physical table name inside a store, used for per-table growth telemetry.",type:"string"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Process, database, and session-observation telemetry for the running\ndaemon, with the sections the request opted into.",properties:{captured_at:{description:"Unix epoch seconds.",format:"uint64",minimum:0,type:"integer"},cursor_session_ingest:!0,cursor_session_placeholder_paths:{items:{type:"string"},type:["array","null"]},database:{description:"Store telemetry, with the authority-audit verdict when it ran."},doctor_report:{anyOf:[{$ref:"#/$defs/RuntimeDoctorReportV1"},{type:"null"}]},host_os:{type:"string"},process:{description:"Cached process sample."},session_temporal_health:!0,tracedecay_version:{type:"string"}},required:["captured_at","tracedecay_version","host_os","process","database"],title:"RuntimeResultV1",type:"object"},{$defs:{SearchLexicalAliasV1:{additionalProperties:!1,description:"One named query-time vocabulary alias.",properties:{alternative:{maxLength:128,type:"string"},strict_query:{maxLength:128,type:"string"}},required:["strict_query","alternative"],type:"object"},SearchLexicalFieldFilterV1:{additionalProperties:!1,properties:{field:{$ref:"#/$defs/SearchLexicalFieldV1"},include:{type:"boolean"}},required:["field","include"],type:"object"},SearchLexicalFieldV1:{description:"A lexical posting field a search may include or exclude.",enum:["symbol_name","qualified_name","path","signature","documentation","body_text","preamble_text","exact_term","subtoken"],type:"string"},SearchLexicalProximityV1:{additionalProperties:!1,description:"Ordered terms that must occur in one field within `maximum_gap`\nintervening tokens of each other.",properties:{maximum_gap:{format:"uint32",maximum:8,minimum:0,type:"integer"},terms:{items:{type:"string"},maxItems:8,minItems:2,type:"array"}},required:["terms","maximum_gap"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{description:"Authenticated opaque continuation returned as next_cursor. Repeat the same query and lexical options with it.",type:["string","null"]},lazy_index_ignored_dependencies:{description:"Opt in to bounded indexing of ignored dependency entry files when an import hint matches (default: false).",type:["boolean","null"]},lexical_aliases:{description:"Named query-time vocabulary aliases. The strict query always ranks first. Alias-only hits follow it with the strict query, alternative, and configured-vocabulary reason disclosed.",items:{$ref:"#/$defs/SearchLexicalAliasV1"},maxItems:8,type:["array","null"]},lexical_anchors:{description:"Exact identifiers or technical terms (e.g. 'reserve_stock', 'Foo::bar', 'E0308') that the answer must be about. Each is ranked through the lexical lane as its own route: a hit carrying an anchor outranks every hit that carries none, exact hits included, every anchor with matches keeps at least its best sites through the lane cap, and `lexical_anchors` in the response reports each anchor's outcome (`matched` rows, `admitted` sites this response returns, `dropped` admitted sites it could not carry with the reason, `unmatched`, or `not_served`). Ranked retrieval, not exhaustive grep (use tracedecay_grep for that). Each result names the routes that ranked it. At most 8 anchors, each one whitespace-free term of at most 128 bytes, no repeats.",items:{type:"string"},maxItems:8,type:["array","null"]},lexical_field_filters:{description:"Include or exclude lexical symbol_name, qualified_name, path, signature, documentation, body_text, preamble_text, exact_term, or subtoken fields.",items:{$ref:"#/$defs/SearchLexicalFieldFilterV1"},maxItems:9,type:["array","null"]},lexical_phrases:{description:"Exact lexical phrases to rank through n-gram candidate pruning.",items:{type:"string"},maxItems:4,type:["array","null"]},lexical_proximities:{description:"Ordered lexical terms that must occur within the bounded intervening-token gap.",items:{$ref:"#/$defs/SearchLexicalProximityV1"},maxItems:4,type:["array","null"]},limit:{description:"Maximum number of results to return (default: 10)",format:"uint64",minimum:0,type:["integer","null"]},prefer_symbol:{description:"Add a lexical route restricted to symbol-name matches for the identifier-shaped words of the query. Omitted, it runs when the query is name-shaped (at least half its content words are identifiers such as 'getUserById' or 'Foo::bar'); true forces it, false suppresses it. `query_route` in the response reports the decision and its margin. Query words such as class/struct/function/find/explain are ignored; 'Foo::bar' and 'Foo.bar' contribute 'bar'.",type:["boolean","null"]},query:{description:"Search query string to match against symbol names",type:"string"}},required:["query"],title:"SearchSurfaceRequestV1",type:"object"},{$defs:{ApplicationProblemDetailV1:fA,CalibrationProfileId:hi,CandidateContribution:hs,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComponentRevision:hj,ContextLexicalAnchorV1:hF,DaemonServiceUnitObservationV1:y_,DiagnosticsSearchedTsconfigV1:yS,EvidenceRole:yC,ExactClass:yT,FileOccurrenceId:gs,FixedPointScore:gc,FreshnessCompatibilityV1:gl,FusedCandidate:gp,LexicalAnchorDropReasonV1:_e,LexicalAnchorDropV1:_t,LogicalCopyClusterId:_i,LogicalEvidenceId:_o,OccurrenceProvenance:_z,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveLaneCompleteV1:_J,PrimitiveRecallV1:_Q,PrimitiveSearchFreshnessV1:_X,PrimitiveUnavailableEvidenceV1:_0,PrimitiveUnavailableStatusV1:_2,RankingDecision:vp,RankingDecisionKind:vu,RepositoryId:vb,RetrievalAnchorId:vI,RetrievalSourceRoleV1:vC,RetrieverKind:vO,ScoreDomainId:v2,SearchCompleteV1:{additionalProperties:!1,properties:{code_generation:{type:"string"},coverage:{$ref:"#/$defs/SearchCoverageV1"},external_import_hint:{anyOf:[{$ref:"#/$defs/SearchExternalImportHintV1"},{type:"null"}]},freshness:{$ref:"#/$defs/PrimitiveSearchFreshnessV1",description:"Freshness of the served code generation, derived from the typed lane\ncoverage and the daemon scheduler's worktree state."},lexical_anchors:{description:"Outcome of every caller `lexical_anchors` entry, beside the routes.",items:{$ref:"#/$defs/ContextLexicalAnchorV1"},type:["array","null"]},lexical_routes:{description:"Every lexical route fused into this page; present only when a route\nbeyond the strict query ran or ranked a result.",items:{$ref:"#/$defs/SearchLexicalRouteV1"},type:["array","null"]},next_cursor:{description:"Authenticated continuation for the next page; null on the last page.",type:["string","null"]},query_fallback_digest:{type:"string"},query_route:{anyOf:[{$ref:"#/$defs/SearchQueryRouteV1"},{type:"null"}],description:"Which lane the query's shape selected, and its margin."},results:{items:{$ref:"#/$defs/SearchResultRowV1"},type:"array"},scope_prefix:{description:"The session's scope prefix. Ranked candidates carry no file path, so\nthe scope is reported and not applied.",type:["string","null"]},scope_prefix_applied:{type:["boolean","null"]},verified_graph_evidence:{anyOf:[{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"},{type:"null"}]}},required:["freshness","code_generation","query_fallback_digest","coverage","results"],type:"object"},SearchCoverageV1:{additionalProperties:!1,description:"Per-lane recall of one search, so a full-recall answer is told apart from\none produced while a lane was down.",properties:{exact:{$ref:"#/$defs/SearchLaneStatusV1"},graph:{$ref:"#/$defs/SearchLaneStatusV1"},lexical:{$ref:"#/$defs/SearchLaneStatusV1"},recall:{$ref:"#/$defs/PrimitiveRecallV1"}},required:["exact","lexical","graph","recall"],type:"object"},SearchDisplayUnavailableV1:{description:"Why a ranked candidate's display metadata was not hydrated: the answering\ngeneration no longer matches the request (`stale`), its record is\nincompatible or does not bind the candidate (`incompatible`, `invalid`),\nthe read failed (`internal`), the hydration budget was spent\n(`budget_exceeded`), or the request was cancelled (`cancelled`).",enum:["stale","incompatible","invalid","internal","budget_exceeded","cancelled"],type:"string"},SearchExternalImportCandidatesV1:{additionalProperties:!1,properties:{candidates:{items:{$ref:"#/$defs/SearchExternalImportV1"},type:"array"},evidence:{type:"string"},message:{type:"string"},resolution_status:{type:"string"},suggested_action:{type:"string"}},required:["message","evidence","resolution_status","candidates","suggested_action"],type:"object"},SearchExternalImportHintV1:{anyOf:[{$ref:"#/$defs/SearchExternalImportCandidatesV1"},{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"}],description:"Advisory evidence that a sparse search matched external-module imports,\nor why that evidence could not be read."},SearchExternalImportV1:{additionalProperties:!1,properties:{import_file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},module:{type:"string"},symbol:{description:"The imported name; null for a whole-module import.",type:["string","null"]}},required:["module","import_file","line"],type:"object"},SearchLaneStateV1:{description:"A lane that did not serve the current complete generation. A partial\nlane names its generation and reason when it has them, null otherwise.",oneOf:[{additionalProperties:!1,properties:{generation:{type:"string"},status:{const:"stale",type:"string"}},required:["status","generation"],type:"object"},{additionalProperties:!1,properties:{generation:{type:["string","null"]},reason:{type:["string","null"]},status:{const:"partial",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},SearchLaneStatusV1:{anyOf:[{$ref:"#/$defs/PrimitiveLaneCompleteV1"},{$ref:"#/$defs/SearchLaneStateV1"}]},SearchLexicalAlternativeReasonV1:{description:"Why the lexical lane tried a configured alternative.",enum:["configured_vocabulary_alias"],type:"string"},SearchLexicalRouteV1:{description:"One lexical route fused into the page, with its display label.",oneOf:[{additionalProperties:!1,description:"The caller's strict lexical query.",properties:{label:{type:"string"},route:{const:"query",type:"string"}},required:["route","label"],type:"object"},{additionalProperties:!1,description:"One caller-supplied exact identifier or term.",properties:{anchor:{type:"string"},label:{type:"string"},route:{const:"anchor",type:"string"}},required:["route","anchor","label"],type:"object"},{additionalProperties:!1,description:"Identifier-shaped tokens of the query, restricted to symbol names.",properties:{label:{type:"string"},route:{const:"preferred_symbol",type:"string"},tokens:{items:{type:"string"},type:"array"}},required:["route","tokens","label"],type:"object"},{additionalProperties:!1,description:"Identifier and path components recovered from the strict query.",properties:{label:{type:"string"},route:{const:"identifier_split",type:"string"},strict_query:{type:"string"},terms:{items:{type:"string"},type:"array"}},required:["route","strict_query","terms","label"],type:"object"},{additionalProperties:!1,description:"A configured query-time vocabulary alternative.",properties:{alternative:{type:"string"},label:{type:"string"},reason:{$ref:"#/$defs/SearchLexicalAlternativeReasonV1"},route:{const:"alias",type:"string"},strict_query:{type:"string"}},required:["route","strict_query","alternative","reason","label"],type:"object"}]},SearchQueryRouteDeciderV1:{description:"Who chose the query route: the query-shape gate or the caller's\n`prefer_symbol`.",enum:["query_shape","caller"],type:"string"},SearchQueryRouteKindV1:{description:"Which lexical lane the query's shape selected.",oneOf:[{const:"name",description:"The symbol-name route ran beside the strict query.",type:"string"},{const:"prose",description:"The strict query ran without the symbol-name route.",type:"string"}]},SearchQueryRouteV1:{additionalProperties:!1,description:"The query-shape routing decision behind a page.",properties:{decided_by:{$ref:"#/$defs/SearchQueryRouteDeciderV1"},margin:{description:"Distance from the name gate in [-0.5, 0.5]: the share of the query's\ncontent words that are identifier-shaped, minus one half. The gate\nselects `name` at or above 0. Reported when the caller decided too.\nIt describes query shape only and is not an answerability signal.",format:"double",type:"number"},route:{$ref:"#/$defs/SearchQueryRouteKindV1"}},required:["route","margin","decided_by"],type:"object"},SearchResultDisplayV1:{additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},qualified_name:{type:"string"}},required:["name","qualified_name","kind","path"],type:"object"},SearchResultRowV1:{additionalProperties:!1,description:"One ranked candidate with its generation-bound display metadata.",properties:{candidate:{$ref:"#/$defs/FusedCandidate"},display:{anyOf:[{$ref:"#/$defs/SearchResultDisplayV1"},{type:"null"}]},display_unavailable:{anyOf:[{$ref:"#/$defs/SearchDisplayUnavailableV1"},{type:"null"}],description:"Why `display` is absent from this ranked candidate."},final_ordinal:{format:"uint32",minimum:0,type:"integer"},lexical_routes:{description:"The lexical routes that ranked this candidate.",items:{$ref:"#/$defs/SearchRouteMatchV1"},type:["array","null"]},node_id:{description:"The graph symbol to read with `tracedecay_source_body`.",type:["string","null"]}},required:["candidate","final_ordinal"],type:"object"},SearchRouteMatchV1:{additionalProperties:!1,description:"One route that ranked a candidate, named by its route label.",properties:{matched_terms:{items:{type:"string"},type:"array"},route:{type:"string"},score_micros:{format:"uint64",minimum:0,type:"integer"},spelling_variants:{items:{$ref:"#/$defs/SearchSpellingVariantV1"},type:"array"}},required:["route","score_micros","matched_terms"],type:"object"},SearchSpellingVariantV1:{additionalProperties:!1,properties:{alternative:{type:"string"},query:{type:"string"}},required:["query","alternative"],type:"object"},SearchUnavailableV1:{additionalProperties:!1,properties:{code_generation:{type:["string","null"]},coverage:{$ref:"#/$defs/SearchCoverageV1"},detail:{anyOf:[{$ref:"#/$defs/ApplicationProblemDetailV1"},{type:"null"}],description:"Present when indexing is parked: its cause, remedy, and wake retry."},freshness:{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},query_fallback_digest:{description:"Always null: no fallback subpayload was produced.",type:["string","null"]},reason:{type:"string"},results:{description:"Always empty: no generation answered.",items:{$ref:"#/$defs/SearchResultRowV1"},type:"array"},status:{$ref:"#/$defs/PrimitiveUnavailableStatusV1"},verified_graph_evidence:{anyOf:[{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"},{type:"null"}]}},required:["freshness","results","status","reason","coverage"],type:"object"},SessionOrThreadId:v7,SourceFreshness:by,SourceInstanceKey:bg,SourceNamespace:bv,SourceOccurrenceId:bb,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/SearchCompleteV1"},{$ref:"#/$defs/SearchUnavailableV1"}],description:"What a search served: a ranked page, or the typed reason no generation\ncould answer.",title:"SearchResultV1"},{$defs:{PageRequest:_U,ResultProjection:vP,RetrievalOrder:vx,RetrievalRequestMeta:vj,SessionId:v8,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/RetrievalRequestMeta"},session_id:{$ref:"#/$defs/SessionId"}},required:["session_id","meta"],title:"SessionLookupRequest",type:"object"},{$defs:{RetrievalAnchorId:vI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"}},required:["anchors"],title:"SessionLookupResult",type:"object"},{$defs:{SessionRefreshFrontierV1:{additionalProperties:!1,properties:{committed_through:{format:"uint64",minimum:0,type:"integer"},observed_through:{format:"uint64",minimum:0,type:"integer"}},required:["observed_through","committed_through"],type:"object"},SessionRefreshGrainV1:{enum:["occurrence","logical_message","turn","session","thread","agent","summary"],type:"string"},SessionRefreshScopeV1:{description:"Session-store owner one refresh is bound to.\n\nThe caller selects the already-mounted project or profile authority. Exact\nprofile, project, repository, worktree, branch, store, and root identities\nstay daemon-owned and are resolved from that authority during admission.",oneOf:[{additionalProperties:!1,properties:{kind:{const:"project",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"profile",type:"string"}},required:["kind"],type:"object"}]},SessionRefreshSessionV1:{additionalProperties:!1,properties:{id:{type:"string"}},required:["id"],type:"object"},SessionRefreshSourceV1:{additionalProperties:!1,properties:{scope:{type:"string"}},required:["scope"],type:"object"},SessionRefreshTargetV1:{additionalProperties:!1,properties:{frontier:{$ref:"#/$defs/SessionRefreshFrontierV1"},grain:{$ref:"#/$defs/SessionRefreshGrainV1"},temporal_mode:{$ref:"#/$defs/TemporalModeV1"}},required:["temporal_mode","grain","frontier"],type:"object"},TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact route-selected session-refresh request body.\n\nEach current route selects the action itself; `scope` selects the mounted\nsession-store owner. Project-scoped requests are served under project-open\nadmission, profile-scoped requests by the authenticated profile authority.",properties:{handle:{type:["string","null"]},scope:{$ref:"#/$defs/SessionRefreshScopeV1"},session:{$ref:"#/$defs/SessionRefreshSessionV1"},source:{$ref:"#/$defs/SessionRefreshSourceV1"},target:{$ref:"#/$defs/SessionRefreshTargetV1"}},required:["scope","session","source","target"],title:"SessionRefreshActionRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionRefreshFrontierResultV1:be,SessionRefreshProgressV1:bt,SessionRefreshReceiptV1:br,SessionRefreshTerminalStateResultV1:bi,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalModeV1:bW,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{accepted_at:{format:"int64",type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},handle:{type:["string","null"]},operation_id:{type:["string","null"]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},progress:{anyOf:[{$ref:"#/$defs/SessionRefreshProgressV1"},{type:"null"}]},receipt:{anyOf:[{$ref:"#/$defs/SessionRefreshReceiptV1"},{type:"null"}]},scope:{type:"string"},tool:{type:"string"}},required:["outcome","scope","tool"],title:"SessionRefreshBeginResultV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionRefreshFrontierResultV1:be,SessionRefreshProgressV1:bt,SessionRefreshReceiptV1:br,SessionRefreshTerminalStateResultV1:bi,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalModeV1:bW,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{accepted_at:{format:"int64",type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},handle:{type:["string","null"]},operation_id:{type:["string","null"]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},progress:{anyOf:[{$ref:"#/$defs/SessionRefreshProgressV1"},{type:"null"}]},receipt:{anyOf:[{$ref:"#/$defs/SessionRefreshReceiptV1"},{type:"null"}]},scope:{type:"string"},tool:{type:"string"}},required:["outcome","scope","tool"],title:"SessionRefreshCancelResultV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionRefreshFrontierResultV1:be,SessionRefreshProgressV1:bt,SessionRefreshReceiptV1:br,SessionRefreshTerminalStateResultV1:bi,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalModeV1:bW,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},progress:{anyOf:[{$ref:"#/$defs/SessionRefreshProgressV1"},{type:"null"}]},receipt:{anyOf:[{$ref:"#/$defs/SessionRefreshReceiptV1"},{type:"null"}]},scope:{type:"string"},tool:{type:"string"}},required:["outcome","scope","tool"],title:"SessionRefreshStatusResultV1",type:"object"},{$defs:{RetainedTimeFilterV1:vq,SessionGitRefV1:{enum:["branch","worktree","commit"],type:"string"},SessionGitRelationV1:{enum:["produced","observed","all"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{git_ref:{$ref:"#/$defs/SessionGitRefV1"},limit:{format:"uint64",minimum:0,type:["integer","null"]},relation:{anyOf:[{$ref:"#/$defs/SessionGitRelationV1"},{type:"null"}]},since:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},until:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},value:{type:"string"}},required:["git_ref","value"],title:"SessionsForRequestV1",type:"object"},{$defs:{CorrelationIndexCountModeV1:{enum:["presence_only"],type:"string"},CorrelationIndexV1:{additionalProperties:!1,properties:{backfill_watermark:{format:"int64",type:["integer","null"]},commit_count:{format:"uint64",minimum:0,type:["integer","null"]},commits_present:{type:"boolean"},count_mode:{$ref:"#/$defs/CorrelationIndexCountModeV1"},generation:{type:["string","null"]},projection_available:{type:"boolean"},source_watermark:{type:["string","null"]},span_count:{format:"uint64",minimum:0,type:["integer","null"]},spans_present:{type:"boolean"}},required:["projection_available","spans_present","commits_present","count_mode"],type:"object"},RetainedOutcomeStatusV1:vR,SessionCorrelationHitV1:{additionalProperties:!1,properties:{branch:{type:["string","null"]},commit_sha:{type:["string","null"]},committed_at:{format:"int64",type:["integer","null"]},confidence:{format:"int64",type:["integer","null"]},event_count:{format:"int64",type:"integer"},evidence:{type:["string","null"]},evidence_message_id:{type:["string","null"]},first_ts:{format:"int64",type:["integer","null"]},last_ts:{format:"int64",type:["integer","null"]},provider:{type:"string"},relation:{type:["string","null"]},session_id:{type:"string"},sources:{items:{type:"string"},type:"array"},span_count:{format:"int64",type:"integer"},span_overlap_kind:{type:["string","null"]},worktree:{type:["string","null"]}},required:["provider","session_id","event_count","span_count","sources"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},git_ref:{type:["string","null"]},index:{anyOf:[{$ref:"#/$defs/CorrelationIndexV1"},{type:"null"}]},index_empty:{type:["boolean","null"]},message:{type:["string","null"]},observed_count:{format:"uint",minimum:0,type:["integer","null"]},observed_sessions:{items:{$ref:"#/$defs/SessionCorrelationHitV1"},type:["array","null"]},problem_code:{type:["string","null"]},relation:{type:["string","null"]},results:{items:{$ref:"#/$defs/SessionCorrelationHitV1"},type:"array"},since:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},until:{format:"int64",type:["integer","null"]},value:{type:["string","null"]}},required:["count","results","status"],title:"SessionsForResultV1",type:"object"},{$defs:{NodeExpansionCostV1:_A,SymbolSignatureV1:{additionalProperties:!1,properties:{cost_to_expand:{$ref:"#/$defs/NodeExpansionCostV1"},docstring:{type:["string","null"]},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},is_async:{type:"boolean"},kind:{type:"string"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},signature:{type:["string","null"]},start_line:{format:"uint32",minimum:0,type:"integer"},unavailable_fields:{items:{type:"string"},type:"array"},visibility:{type:"string"}},required:["node_id","name","qualified_name","kind","visibility","is_async","file","start_line","end_line","cost_to_expand","unavailable_fields"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/SymbolSignatureV1"},title:"Array_of_SymbolSignatureV1",type:"array"},{$defs:{ProjectId:_4,RepositoryId:vb,SimilarMatchClassV1:bc,SimilarTargetV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"symbol_occurrence",type:"string"},symbol_occurrence_id:{$ref:"#/$defs/SymbolOccurrenceId"}},required:["kind","symbol_occurrence_id"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"source_range",type:"string"},path:{type:"string"},span:{$ref:"#/$defs/SourceSpan"}},required:["kind","path","span"],type:"object"}]},SourceSpan:b$,SymbolOccurrenceId:bq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{type:["string","null"]},match_classes:{items:{$ref:"#/$defs/SimilarMatchClassV1"},type:"array"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},result_limit:{description:"Preferred result page size.",format:"uint32",minimum:0,type:"integer"},target:{$ref:"#/$defs/SimilarTargetV1"},work_limit:{format:"uint32",minimum:0,type:"integer"}},required:["project_id","repository_id","target","match_classes","result_limit","work_limit"],title:"SimilarSurfaceRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ManifestDigest:_l,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,ProjectId:_4,RepositoryId:vb,SimilarCoverageV1:{oneOf:[{additionalProperties:!1,properties:{status:{const:"complete",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{status:{const:"partial",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{minimum_tokens:{format:"uint32",minimum:0,type:"integer"},status:{const:"excluded_too_small",type:"string"}},required:["status","minimum_tokens"],type:"object"},{additionalProperties:!1,properties:{maximum_bytes:{format:"uint64",minimum:0,type:"integer"},maximum_tokens:{format:"uint32",minimum:0,type:"integer"},status:{const:"excluded_too_large",type:"string"}},required:["status","maximum_tokens","maximum_bytes"],type:"object"},{additionalProperties:!1,properties:{status:{const:"excluded_incomplete_tokenization",type:"string"}},required:["status"],type:"object"}]},SimilarFamilyV1:bd,SimilarMatchClassV1:bc,SimilarOccurrenceV1:bl,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/SimilarCoverageV1"},families:{items:{$ref:"#/$defs/SimilarFamilyV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},source:{$ref:"#/$defs/SimilarOccurrenceV1"},source_generation:{$ref:"#/$defs/CodeGenerationId"}},required:["source","families","source_generation","coverage"],title:"SimilarResultV1",type:"object"},{$defs:{ManagedSkillState:_c},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_body:{default:!1,description:"If true, include each skill's body_markdown in the list response\n(default: false).",type:"boolean"},state:{anyOf:[{$ref:"#/$defs/ManagedSkillState"},{type:"null"}],description:"Optional managed-skill lifecycle state filter."}},title:"SkillListSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,ManagedSkillMaterializationScope:_n,ManagedSkillMetadata:_a,ManagedSkillProvenance:_s,ManagedSkillSource:_d,ManagedSkillState:_c,SkillImprovementRecommendation:bp,SkillInstallTarget:bu,SkillListEntryV1:{additionalProperties:!1,properties:{body_markdown:{description:"Present only when the request asked for bodies.",type:["string","null"]},improvement_recommendation:{anyOf:[{$ref:"#/$defs/SkillImprovementRecommendation"},{type:"null"}]},metadata:{$ref:"#/$defs/ManagedSkillMetadata"},stale_recommendation:{anyOf:[{$ref:"#/$defs/SkillStaleRecommendation"},{type:"null"}]},support_file_count:{format:"uint",minimum:0,type:"integer"},support_file_paths:{items:{type:"string"},type:"array"},usage_summary:{$ref:"#/$defs/SkillUsageRecord"}},required:["metadata","support_file_count","support_file_paths","usage_summary"],type:"object"},SkillStaleRecommendation:bm,SkillUsageRecord:bf},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},profile_root:{type:"string"},skills:{items:{$ref:"#/$defs/SkillListEntryV1"},type:"array"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","profile_root","count","skills"],title:"SkillListResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{id:{description:"Managed skill id to read.",type:"string"},include_support_files:{default:!1,description:"Include support-file byte payloads. Default false; the response still\nlists each path and byte length.",type:"boolean"}},required:["id"],title:"SkillViewSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,ManagedSkill:{properties:{body_markdown:{type:"string"},metadata:{$ref:"#/$defs/ManagedSkillMetadata"},support_files:{items:{$ref:"#/$defs/ManagedSupportFile"},type:"array"}},required:["metadata","body_markdown","support_files"],type:"object"},ManagedSkillMaterializationScope:_n,ManagedSkillMetadata:_a,ManagedSkillProvenance:_s,ManagedSkillSource:_d,ManagedSkillState:_c,ManagedSupportFile:{properties:{bytes:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},path:{type:"string"}},required:["path","bytes"],type:"object"},SkillImprovementRecommendation:bp,SkillInstallTarget:bu,SkillStaleRecommendation:bm,SkillSupportFileSummaryV1:{additionalProperties:!1,properties:{byte_len:{format:"uint",minimum:0,type:"integer"},path:{type:"string"}},required:["path","byte_len"],type:"object"},SkillUsageRecord:bf},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{improvement_recommendation:{anyOf:[{$ref:"#/$defs/SkillImprovementRecommendation"},{type:"null"}]},profile_root:{type:"string"},skill:{$ref:"#/$defs/ManagedSkill",description:"The skill package; `support_files` is empty unless the request\nincluded them."},stale_recommendation:{anyOf:[{$ref:"#/$defs/SkillStaleRecommendation"},{type:"null"}]},status:{$ref:"#/$defs/AutomationReadStatusV1"},support_file_summaries:{items:{$ref:"#/$defs/SkillSupportFileSummaryV1"},type:"array"},support_files_included:{type:"boolean"},usage_summary:{$ref:"#/$defs/SkillUsageRecord"}},required:["status","profile_root","skill","usage_summary","support_files_included","support_file_summaries"],title:"SkillViewResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{node_id:{type:"string"}},required:["node_id"],title:"SourceBodyPrimitiveRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{body:{type:"string"},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},node_id:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["node_id","file","start_line","end_line","body"],title:"SourceBodyPrimitiveResult",type:"object"},{$defs:{ManifestDigest:_l,UseCaseId:bK},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",oneOf:[{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},confirm:{default:!1,type:"boolean"},disposition:{const:"inspect",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition"],type:"object"},{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},committed_state:{$ref:"#/$defs/ManifestDigest"},confirm:{default:!1,type:"boolean"},disposition:{const:"confirm_committed",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition","committed_state"],type:"object"},{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},confirm:{default:!1,type:"boolean"},disposition:{const:"confirm_unchanged",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition"],type:"object"},{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},confirm:{default:!1,type:"boolean"},disposition:{const:"acknowledge_partial",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},observed_state:{$ref:"#/$defs/ManifestDigest"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition","observed_state"],type:"object"}],title:"SourceEditReconcileSurfaceRequestV1",type:"object"},{$defs:{FileOccurrenceId:gs,GitOidV1:gq,PageRequest:_U,ResultProjection:vP,RetrievalOrder:vx,RetrievalRequestMeta:vj,SourceSpan:b$,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{additionalProperties:!1,description:"Read an exact byte span from the current indexed file occurrence.",properties:{file:{$ref:"#/$defs/FileOccurrenceId",description:"Canonical file occurrence from `code_exact_occurrence` at\n`items[].occurrence.file`; a logical path is not a file occurrence identity."},meta:{$ref:"#/$defs/RetrievalRequestMeta"},span:{$ref:"#/$defs/SourceSpan"}},required:["file","span","meta"],type:"object"},{additionalProperties:!1,description:"Read a bounded range of whole lines from an immutable Git revision.",properties:{end_line:{description:"One-based last line, inclusive. Large ranges are clipped with `next_line`.",format:"uint32",minimum:0,type:"integer"},file:{description:"Canonical repository-relative path in that revision.",type:"string"},revision:{$ref:"#/$defs/GitOidV1",description:"Full lowercase commit OID; mutable names and abbreviations are refused."},start_line:{description:"One-based first line, inclusive.",format:"uint32",minimum:0,type:"integer"}},required:["revision","file","start_line","end_line"],type:"object"}],title:"SourceLinesRequest"},{$defs:{GitOidV1:gq,RetrievalAnchorId:vI,SourceReference:{additionalProperties:!1,properties:{anchor:{$ref:"#/$defs/RetrievalAnchorId"},span:{$ref:"#/$defs/SourceSpan"}},required:["anchor","span"],type:"object"},SourceSpan:b$},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{additionalProperties:!1,properties:{body:{type:["string","null"]},file:{type:["string","null"]},references:{items:{$ref:"#/$defs/SourceReference"},type:"array"}},required:["references"],type:"object"},{additionalProperties:!1,properties:{blob_oid:{$ref:"#/$defs/GitOidV1"},body:{type:"string"},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},next_line:{description:"First unread line within the requested range. Keep the original\nrevision, file, and requested end line when continuing.",format:"uint32",minimum:0,type:["integer","null"]},revision:{$ref:"#/$defs/GitOidV1"},span:{$ref:"#/$defs/SourceSpan"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["file","revision","blob_oid","start_line","end_line","span","body"],type:"object"}],title:"SourceLinesResult"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],title:"SourceOutlinePrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"},symbols:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"}},required:["file","symbols"],title:"SourceOutlinePrimitiveResult",type:"object"},{$defs:{BranchStackEdgeV1:f3,BranchStackId:f9,BranchStackNodeV1:f5,BranchStackRevisionId:f8,CommitId:hq,ManifestDigest:_l,NativeIntegrationDirectionV1:_R,NativeIntegrationSelectionDeclarationV1:{description:"Explicit caller declaration for one native-integration selection.\n\nDeclared stacks contain the visible nodes and edges, while the daemon\nderives canonical order and the revision digest through the domain\nconstructor. Callers cannot submit either derived field.",oneOf:[{additionalProperties:!1,properties:{binding:{additionalProperties:!1,properties:{destination_node_id:{$ref:"#/$defs/StackNodeId"},direction:{$ref:"#/$defs/NativeIntegrationDirectionV1"},edges:{items:{$ref:"#/$defs/BranchStackEdgeV1"},type:"array"},nodes:{items:{$ref:"#/$defs/BranchStackNodeV1"},type:"array"},revision_id:{$ref:"#/$defs/BranchStackRevisionId"},source_node_id:{$ref:"#/$defs/StackNodeId"},stack_id:{$ref:"#/$defs/BranchStackId"}},required:["stack_id","revision_id","nodes","edges","source_node_id","destination_node_id","direction"],type:"object"},kind:{const:"declared_stack_edge",type:"string"}},required:["kind","binding"],type:"object"},{additionalProperties:!1,properties:{binding:{additionalProperties:!1,properties:{destination_ref:{$ref:"#/$defs/RefId"},proposal_digest:{$ref:"#/$defs/ManifestDigest"},source_ref:{$ref:"#/$defs/RefId"}},required:["proposal_digest","source_ref","destination_ref"],type:"object"},kind:{const:"independent_branch",type:"string"}},required:["kind","binding"],type:"object"}]},ProjectId:_4,RefId:vm,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,StackNodeId:bw,WorktreeId:SB,WorktreeInventoryEpoch:SK,WorktreeInventorySnapshotId:SJ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact caller-supplied identity frozen by `stack_snapshot`.\n\nThis proof binds the exact authorized `ProjectId`, `RepositoryId`, source\nand destination worktree/ref identity, frozen inventory, scope/grant/policy\nrevisions, and one declared-edge or independent-branch selection. Paths,\nfree-form SHA values, branch display names, and provider topology remain\nunrepresentable.",properties:{authorized_scope_set_digest:{$ref:"#/$defs/ManifestDigest"},authorized_scope_set_id:{$ref:"#/$defs/ScopeSetId"},authorized_scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},destination:{$ref:"#/$defs/ResolvedScope"},grant_digest:{$ref:"#/$defs/ManifestDigest"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},inventory_snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},policy_digest:{$ref:"#/$defs/ManifestDigest"},selection:{$ref:"#/$defs/NativeIntegrationSelectionDeclarationV1"},source:{$ref:"#/$defs/ResolvedScope"}},required:["source","destination","authorized_scope_set_id","authorized_scope_set_revision","authorized_scope_set_digest","inventory_snapshot_id","inventory_epoch","selection","grant_digest","policy_digest"],title:"NativeIntegrationStackSnapshotSurfaceRequest",type:"object"},{$defs:{CodeIndexReadinessTargetV1:{description:"The readiness a status caller can wait for.",oneOf:[{const:"fresh",description:"A sealed complete generation serves exact and lexical reads for the\ncurrent source: `code_index_freshness.status` is `current`.",type:"string"},{const:"ready",description:"`fresh`, and the generation's native code graph also serves.",type:"string"},{const:"graph_ready",description:"A published generation's native code graph serves and no convergence\npark is set, whatever the source freshness. Waiting for it never\nsweeps the source, so it cannot arm the reconcile it would observe.",type:"string"}]},CodeIndexReadinessWaitV1:{additionalProperties:!1,description:"`tracedecay_status` `wait_for`: hold the status read until the worktree\nreaches `state`, for at most the caller's `timeout_ms`.",properties:{state:{$ref:"#/$defs/CodeIndexReadinessTargetV1"},timeout_ms:{format:"uint64",minimum:0,type:"integer"}},required:["state","timeout_ms"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{admission_only:{default:!1,description:"Report only that the project route is admitted, reading no graph,\nindex, or session state. Default false.",type:"boolean"},include_branch_diagnostics:{default:!1,description:"Full tracked-branch diagnostic list. Default false.",type:"boolean"},include_session_ingest:{default:!1,description:"Session-ingest health. Default false.",type:"boolean"},include_staleness:{default:!1,description:"Git staleness object. Default false.",type:"boolean"},include_storage_health:{default:!1,description:"Storage-health snapshot. Default false.",type:"boolean"},wait_for:{anyOf:[{$ref:"#/$defs/CodeIndexReadinessWaitV1"},{type:"null"}],description:"Hold the status read until the code index reaches `state` (`fresh`:\nstatus `current`; `ready`: also native graph serving; `graph_ready`: a\npublished generation's native graph serves, whatever the freshness),\nfor at most `timeout_ms`. The payload's `wait` reports `reached`,\n`timed_out` with `last_state`, or `unavailable` with `reason`."}},title:"StatusSurfaceRequestV1",type:"object"},{$defs:{CodeCloneIndexBudgetsV1:{description:"Fixed automatic clone-discovery limits.",properties:{minimum_body_tokens:{format:"uint64",minimum:0,type:"integer"}},required:["minimum_body_tokens"],type:"object"},CodeCloneIndexCoverageV1:{description:"Coverage retained by one clone-index artifact or in-progress successor.\n\nCounts are `None` until the clone artifact has observed the corresponding\ndenominator. A complete empty repository reports `Some(0)`, which keeps a\ndesigned zero distinct from unavailable coverage.",properties:{conservative_normalized_bodies:{description:"Eligible bodies with a conservative exact posting.",format:"uint64",minimum:0,type:["integer","null"]},eligible_source_bodies:{description:"Source bodies admitted for automatic clone discovery.",format:"uint64",minimum:0,type:["integer","null"]},exact_postings:{description:"Conservative and rename-normalized exact posting rows.",format:"uint64",minimum:0,type:["integer","null"]},excluded_incomplete_tokenization_bodies:{description:"Bodies excluded because conservative tokenization was incomplete.",format:"uint64",minimum:0,type:["integer","null"]},excluded_too_large_bodies:{description:"Bodies excluded because they exceed the automatic-discovery token maximum.",format:"uint64",minimum:0,type:["integer","null"]},excluded_too_small_bodies:{description:"Bodies excluded because they are below the automatic-discovery minimum.",format:"uint64",minimum:0,type:["integer","null"]},payloads_reused:{description:"Current payload occurrences reused from the preceding generation.",format:"uint64",minimum:0,type:["integer","null"]},rename_normalized_bodies:{description:"Eligible bodies with a complete rename-normalized exact posting.",format:"uint64",minimum:0,type:["integer","null"]},rename_partial_bodies:{description:"Eligible bodies whose rename normalization is partial.",format:"uint64",minimum:0,type:["integer","null"]},rename_unsupported_bodies:{description:"Eligible bodies whose language has no rename normalization.",format:"uint64",minimum:0,type:["integer","null"]},source_bodies:{description:"Clone body occurrences observed in the sealed lexical source.",format:"uint64",minimum:0,type:["integer","null"]},unique_payloads:{description:"Distinct content-addressed payloads retained by the artifact.",format:"uint64",minimum:0,type:["integer","null"]}},type:"object"},CodeCloneIndexObservationV1:{description:"Generation-pinned clone-index evidence shared by non-error readiness states.",properties:{artifact_format_revision:{format:"uint32",minimum:0,type:["integer","null"]},budgets:{$ref:"#/$defs/CodeCloneIndexBudgetsV1"},conservative_normalization_revision:{format:"uint16",maximum:65535,minimum:0,type:"integer"},coverage:{$ref:"#/$defs/CodeCloneIndexCoverageV1"},generation_id:{type:"string"},rename_normalization_revision:{format:"uint16",maximum:65535,minimum:0,type:"integer"},resources:{$ref:"#/$defs/CodeCloneIndexResourcesV1"},source_revision:{type:["string","null"]}},required:["generation_id","conservative_normalization_revision","rename_normalization_revision","coverage","budgets","resources"],type:"object"},CodeCloneIndexResourcesV1:{description:"Measured resources and update accounting for one clone-index generation.",properties:{bytes_on_disk:{description:"Durable artifact bytes.",format:"uint64",minimum:0,type:["integer","null"]},changed_symbol_update_micros:{description:"Latest observed source-edit arrival through clone-ready publication.",format:"uint64",minimum:0,type:["integer","null"]},peak_scratch_memory_bytes:{description:"Largest measured clone-row serialization scratch during the build.",format:"uint64",minimum:0,type:["integer","null"]},stale_invalidations:{description:"Prior clone payload bindings invalidated by the latest publication.",format:"uint64",minimum:0,type:["integer","null"]}},type:"object"},CodeCloneIndexStatusV1:{description:"Clone readiness, independent from lexical and graph serving.",oneOf:[{description:"The sealed lexical artifact or its clone rows cannot be read.",properties:{reason:{type:"string"},state:{const:"unavailable",type:"string"}},required:["state","reason"],type:"object"},{description:"Some clone evidence is readable, but required postings are missing.",properties:{observation:{$ref:"#/$defs/CodeCloneIndexObservationV1"},omission_reasons:{items:{type:"string"},type:"array"},state:{const:"partial",type:"string"}},required:["state","observation","omission_reasons"],type:"object"},{description:"Required exact postings cover every eligible body.",properties:{observation:{$ref:"#/$defs/CodeCloneIndexObservationV1"},state:{const:"ready",type:"string"}},required:["state","observation"],type:"object"},{description:"The artifact is readable but belongs to a superseded source generation.",properties:{observation:{$ref:"#/$defs/CodeCloneIndexObservationV1"},reason:{type:"string"},state:{const:"stale",type:"string"}},required:["state","observation","reason"],type:"object"}]},CodeGraphServingReadinessV1:{description:"Interactive graph-serving state for the latest sealed generation.\n\nA sealed generation can expose truthful census statistics before its graph\nprojection is ready to serve queries, so readiness is reported separately.",oneOf:[{description:"No graph-serving authority exists for this worktree or generation.",properties:{reason:{type:"string"},state:{const:"unavailable",type:"string"}},required:["state","reason"],type:"object"},{description:"The sealed generation exists, but graph activation has not completed.",properties:{state:{const:"pending",type:"string"}},required:["state"],type:"object"},{description:"Graph activation completed without a serving projection.",properties:{reason:{type:"string"},state:{const:"refused",type:"string"}},required:["state","reason"],type:"object"},{description:"The verified graph projection is installed, but the engine or catalog\nits reads need is not resident: it is still being built, or it was\nreleased for memory. Graph reads answer the retryable warming state\nand restore it.",properties:{reason:{type:"string"},state:{const:"warming",type:"string"}},required:["state","reason"],type:"object"},{description:"The verified graph projection is installed for interactive reads.",properties:{state:{const:"ready",type:"string"}},required:["state"],type:"object"}]},CodeIndexBuildBlockedReasonV1:h_,CodeIndexBuildPhaseV1:{description:"The durable build phase whose committed boundary the dashboard is reading.\n\nA phase is not inferred from scheduler state. The mounted registry publishes\nthe exact phase that owns the active generation.",oneOf:[{enum:["source_scan","relational_preparation","bulk_commit","index_build","verification","ready"],type:"string"},{const:"graph_publication",description:"Text serving is built and the pass that sealed the generation is\nstill publishing its native graph.",type:"string"}]},CodeIndexBuildProgressV1:{description:"The latest committed progress boundary for one active code-index generation.\n\nEvery count is scoped to `generation_id`. The snapshot never includes a\nstaged page: work is reported only after the batch that owns it commits.",properties:{blocked_reason:{anyOf:[{$ref:"#/$defs/CodeIndexBuildBlockedReasonV1"},{type:"null"}],description:"Reason the active generation cannot currently advance, when known."},committed_chunks:{description:"Search chunks committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},committed_imports:{description:"Import evidence rows committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},committed_pages:{description:"Source pages committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},committed_payload_bytes:{description:"Payload bytes committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},completed_files:{description:"Authenticated sealed-source file boundary completed by committed work.",format:"uint64",minimum:0,type:"integer"},completed_lexical_units:{description:"Authenticated lexical-span boundary completed by committed work, in the\nsealed source's own advance unit.\n\nThe unit is the source's, not this surface's: a sealed-layout source\nadvances over the files-array byte span, while a published or\npartitioned source advances over file ordinals because its file records\nare not a contiguous byte range at all. Both are monotone and share the\ndenominator below, so completion and the derived estimate are truthful;\nnaming them bytes was not, and a consumer that multiplied this by an\naverage file size was wrong by orders of magnitude (issue #1205).",format:"uint64",minimum:0,type:"integer"},current_batch_pages:{description:"Source pages in the batch currently being processed.",format:"uint64",minimum:0,type:"integer"},current_batch_payload_bytes:{description:"Sealed payload bytes in the batch currently being processed.",format:"uint64",minimum:0,type:"integer"},daemon_incarnation:{description:"Durable daemon-authority epoch that produced this snapshot.\n\nThis orders snapshots across daemon restarts without relying on wall\nclock time.",format:"uint64",minimum:0,type:"integer"},elapsed_micros:{description:"Monotonic elapsed time for this process's active generation build.",format:"uint64",minimum:0,type:"integer"},estimated_remaining_seconds:{description:"Estimated remaining build duration, absent without a truthful rate.",format:"uint64",minimum:0,type:["integer","null"]},files_per_second:{description:"Rolling committed-file throughput, absent until it is established.",format:"double",type:["number","null"]},generation_id:{description:"Exact generation receiving the committed build work.",type:"string"},last_commit_latency_micros:{description:"Duration of the last committed SQLite batch, when one exists.",format:"uint64",minimum:0,type:["integer","null"]},last_progress_micros:{description:"Unix-epoch timestamp of the last durable progress publication.",format:"int64",type:"integer"},lexical_units_per_second:{description:"Rolling committed lexical-span throughput in units per second, absent\nuntil it is established. Not a byte rate; see\n[`Self::completed_lexical_units`].",format:"double",type:["number","null"]},phase:{$ref:"#/$defs/CodeIndexBuildPhaseV1",description:"Durable pipeline phase that published this snapshot."},producer_incarnation:{description:"Registry-minted scheduler incarnation within one daemon.\n\nA worktree retirement/remount creates a new value. `progress_epoch` is\ncomparable only when both incarnation fields match.",format:"uint64",minimum:0,type:"integer"},progress_epoch:{description:"Monotonic publication epoch for replacing delayed progress reads.",format:"uint64",minimum:0,type:"integer"},sealed_source_digest:{description:"Identity of the sealed source whose authenticated bounds define progress.",type:"string"},total_files:{description:"Authenticated sealed-source file bound for this generation.",format:"uint64",minimum:0,type:"integer"},total_lexical_units:{description:"Authenticated lexical-span bound for this generation, in the same unit\nas [`Self::completed_lexical_units`].",format:"uint64",minimum:0,type:"integer"}},required:["generation_id","daemon_incarnation","producer_incarnation","progress_epoch","sealed_source_digest","phase","committed_pages","committed_chunks","committed_imports","committed_payload_bytes","completed_files","total_files","completed_lexical_units","total_lexical_units","current_batch_pages","current_batch_payload_bytes","elapsed_micros","last_progress_micros"],type:"object"},CodeIndexConvergenceParkedV1:hv,CodeIndexFreshnessCoverageV1:{description:"Coverage of one freshness read. Distinct from [`CodeIndexStalenessStateV1`]:\na generation can be fresh and still omit hook-hint counts, or unverified\nwhile the ladder would otherwise say ready.\n\n`Unobserved` is only the constructed default. A projected read never emits\nit, so an absent observation cannot be mistaken for `complete`.",oneOf:[{enum:["unobserved","complete","partial_refresh_in_progress","partial_artifact_restore","partial_source_verification","partial_unverified_restore","partial_hook_hint_overflow"],type:"string"},{const:"partial_omitted_sources",description:"The sealed generation is fresh for every source it can index, and\n[`CodeIndexWorktreeFreshnessV1::omitted_sources`] names the sources it\ncannot. Waiting cannot change it.",type:"string"}]},CodeIndexGenerationRecoveryServingV1:{description:"Serving disposition of an incompatible generation during recovery.",enum:["preserved","refused"],type:"string"},CodeIndexGenerationRecoveryV1:{description:"Recovery state for a durable generation sealed under a different production\nowner configuration.",properties:{incompatibilities:{description:"Stable owner-input reason codes reported by the code-index authority.",items:{type:"string"},type:"array"},incompatible_generation_id:{description:"Generation retired from incremental reuse.",type:"string"},serving:{$ref:"#/$defs/CodeIndexGenerationRecoveryServingV1",description:"Whether the prior generation may continue serving while its replacement\nbuilds under the current configuration."}},required:["incompatible_generation_id","incompatibilities","serving"],type:"object"},CodeIndexOmittedSourceV1:hb,CodeIndexOmittedSourcesV1:h$,CodeIndexReadinessWaitOutcomeV1:{description:"How a `wait_for` status read ended. The status payload beside it is read\nafter the wait ends.",oneOf:[{properties:{outcome:{const:"reached",type:"string"}},required:["outcome"],type:"object"},{description:"The caller's budget elapsed; `last_state` is the last observed\n`code_index_freshness.status`.",properties:{last_state:{type:"string"},outcome:{const:"timed_out",type:"string"}},required:["outcome","last_state"],type:"object"},{description:"Waiting cannot reach the target: no scheduler is mounted, graph\nserving was refused, convergence is parked, or the request ended.",properties:{outcome:{const:"unavailable",type:"string"},reason:{type:"string"}},required:["outcome","reason"],type:"object"}]},CodeIndexRestoreProgressV1:{description:"Bounded authentication work required to restore one immutable lexical\nartifact as a serving reader.\n\nThe unit is a fixed restore check, not bytes or build work. Completed\nchecks are published only after they pass. `authenticated_remaining` is\nalways `authenticated_total - authenticated_completed`, so a caller can\ndistinguish bounded cold restore from an unbounded rebuild.",properties:{artifact_digest:{description:"Whole-file content address from the durable artifact descriptor.",type:"string"},authenticated_completed:{description:"Successfully completed authentication checks.",format:"uint64",minimum:0,type:"integer"},authenticated_remaining:{description:"Checks that have not completed yet.",format:"uint64",minimum:0,type:"integer"},authenticated_total:{description:"Fixed number of authentication checks for this restore.",format:"uint64",minimum:0,type:"integer"},generation_id:{description:"Generation whose lexical serving seat is being restored.",type:"string"}},required:["generation_id","artifact_digest","authenticated_completed","authenticated_total","authenticated_remaining"],type:"object"},CodeIndexSourceOmissionReasonV1:hS,CodeIndexStalenessStateV1:hk,CodeIndexWorktreeFreshnessV1:{description:"Freshness/generation state for one mounted worktree.\n\n`Deserialize` is part of the wire contract: the CLI status command decodes\nexactly this type back out of the daemon's `tracedecay_status` response,\nkeeping one authority for the freshness shape.",properties:{clone_index:{anyOf:[{$ref:"#/$defs/CodeCloneIndexStatusV1"},{type:"null"}],description:"Clone readiness from the same sealed lexical artifact."},code_graph_serving:{anyOf:[{$ref:"#/$defs/CodeGraphServingReadinessV1"},{type:"null"}],description:"Whether that generation's verified graph projection can serve reads."},coverage:{$ref:"#/$defs/CodeIndexFreshnessCoverageV1",description:"Whether this read covers the complete mounted scheduler state."},generation_recovery:{anyOf:[{$ref:"#/$defs/CodeIndexGenerationRecoveryV1"},{type:"null"}],description:"One-shot owner-configuration recovery currently replacing an\nincompatible durable generation."},hook_hint_count:{description:"Pending hook-hint count, when cheaply available.",format:"uint64",minimum:0,type:["integer","null"]},last_reconcile_micros:{description:"Last reconcile observation time (microseconds since the Unix epoch).",format:"int64",type:["integer","null"]},latest_generation_id:{description:"Latest sealed generation identity, when a complete generation exists.",type:["string","null"]},omitted_sources:{anyOf:[{$ref:"#/$defs/CodeIndexOmittedSourcesV1"},{type:"null"}],description:"Sources the serving snapshot captured but does not index, when any."},parked:{anyOf:[{$ref:"#/$defs/CodeIndexConvergenceParkedV1"},{type:"null"}],description:"Deterministic contract violation currently parking background\nconvergence, when one is observed. `staleness_state` reads `parked`\nwhile this is set and no generation serves."},progress:{anyOf:[{$ref:"#/$defs/CodeIndexBuildProgressV1"},{type:"null"}],description:"Latest committed progress for the active generation, if one is mounted."},rebuild_in_flight:{description:"Whether the exact scheduler route owns a reconcile pass or has a\npending wake. A stale seated generation with this false is stalled,\nnot in a routine rebuild window.",type:"boolean"},repository_id:{description:"Stable repository identity resolved by the scheduler.",type:["string","null"]},restore_progress:{anyOf:[{$ref:"#/$defs/CodeIndexRestoreProgressV1"},{type:"null"}],description:"Bounded immutable-artifact restore work currently in flight. This is\nseparate from build progress because restore commits no index data."},sealed_at_micros:{description:"Time the complete generation was durably sealed.",format:"int64",type:["integer","null"]},snapshot_content_identity:{description:"Content identity of the complete source snapshot.",type:["string","null"]},source_reference:{description:"Exact source reference captured by the sealed generation.",type:["string","null"]},source_revision:{description:"Exact source revision captured by the sealed generation.",type:["string","null"]},staleness_state:{anyOf:[{$ref:"#/$defs/CodeIndexStalenessStateV1"},{type:"null"}],description:"Staleness-ladder state from the last scheduler execution. `fresh` means\nthe scheduler most recently observed a fresh source; the status read\ndoes not probe the worktree to revalidate that observation."},worktree_id:{description:"Stable worktree identity resolved by the scheduler.",type:["string","null"]},worktree_root:{description:"Display path of the mounted worktree root.",type:"string"}},required:["worktree_root","rebuild_in_flight","coverage"],type:"object"},LcmConvergenceStateV1:gX,LcmConvergenceV1:gY,LcmDoctorProjectionStateV1:g1,LcmDoctorProjectionV1:g0,NativeHostIdentityV1:{enum:["claude_code","cursor_desktop","cursor_cloud","codex","hermes","kiro","cline","roo_code","kilo","kimi_code","open_code","pi","factory_droid"],type:"string"},ProjectStatusV1:{additionalProperties:!1,properties:{active_branch:{type:["string","null"]},branch_diagnostics:!0,branch_drifted:{type:["boolean","null"]},branch_mismatch:{anyOf:[{$ref:"#/$defs/StatusBranchMismatchV1"},{type:"null"}]},branch_resolution:{type:["string","null"]},branch_warnings:{items:{type:"string"},type:["array","null"]},code_index_freshness:{$ref:"#/$defs/StatusCodeIndexFreshnessV1"},code_index_freshness_warning:{type:["string","null"]},current_branch:{type:["string","null"]},git_staleness:{anyOf:[{$ref:"#/$defs/StatusGitStalenessV1"},{type:"null"}]},github_source:{description:"The checkout's GitHub source as its advisory owner observed it."},graph_statistics:{description:"The exact-scope sealed-generation census."},hook_replay:{$ref:"#/$defs/StatusHookReplayV1",description:"The daemon's drain of this project's hook spools, as its last sweep\nleft it."},live_branch:{type:["string","null"]},memory:{$ref:"#/$defs/StatusMemoryV1"},parent_branch:{type:["string","null"]},project_root:{type:"string"},reset_required_stores:{description:"Registered stores this binary serves only as a typed reset-required\nrefusal, each with the command that resets it.",items:{$ref:"#/$defs/StoreResetRequiredV1"},type:"array"},retrieval_serving:{anyOf:[{$ref:"#/$defs/StatusRetrievalServingV1"},{type:"null"}],description:"Whether exact-scope retrieval can serve, when the census authority is\nattached."},schema_convergence:{$ref:"#/$defs/StatusSchemaConvergenceV1"},scope_prefix:{type:["string","null"]},server:{description:"The serving MCP server's request counters."},serving_branch:{type:["string","null"]},session_git_evidence:{$ref:"#/$defs/StatusSessionGitEvidenceV1",description:"The session↔Git evidence `tracedecay_sessions_for` and the\nbranch/commit session filters read."},session_history_catch_up:!0,session_ingest:!0,session_projection:{$ref:"#/$defs/LcmDoctorProjectionV1",description:"The project session projection's serving state, the same reading\n`tracedecay_lcm_doctor` reports."},storage_health:!0,tracked_branch_count:{format:"uint",minimum:0,type:["integer","null"]},wait:{anyOf:[{$ref:"#/$defs/CodeIndexReadinessWaitOutcomeV1"},{type:"null"}]}},required:["project_root","graph_statistics","memory","schema_convergence","reset_required_stores","code_index_freshness","github_source","session_projection","session_git_evidence","hook_replay"],type:"object"},ResidentMemoryHolderReadV1:{description:"One worktree holding a retained owner's memory, and what it holds: a\ngeneration id, or an LSP session id.",properties:{holding:{type:"string"},worktree_id:{type:"string"}},required:["worktree_id","holding"],type:"object"},RetrievalWorkerStatusV1:vT,SchemaConvergenceFindingV1:vL,SchemaConvergenceStageV1:vU,SchemaConvergenceStateV1:vH,StatusAdmissionV1:{additionalProperties:!1,properties:{project_admitted:{type:"boolean"},project_root:{type:"string"},scope_prefix:{type:["string","null"]},server:{description:"The serving MCP server's request counters."}},required:["project_admitted","project_root"],type:"object"},StatusBranchMismatchV1:{additionalProperties:!1,properties:{git_branch:{type:["string","null"]},indexed_branch:{type:["string","null"]},serving_branch:{type:["string","null"]}},type:"object"},StatusCodeIndexFreshnessV1:{description:"The code-index freshness of the served worktree, labeled the way readiness\nwaits report their last state.",oneOf:[{additionalProperties:!1,properties:{status:{const:"current",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"stale",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"restoring",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"warming",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"parked",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,description:"The last code-index mount failed; explicit reconciliation can retry it.",properties:{message:{type:"string"},remediation:{type:"string"},status:{const:"mount_failed",type:"string"}},required:["status","message","remediation"],type:"object"},{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StatusGitStalenessUnavailableV1:{oneOf:[{const:"no_sealed_generation",description:"No complete generation has sealed for the worktree yet.",type:"string"},{const:"sealed_generation_has_no_commit",description:"The sealed generation captured no commit, as in an unborn repository.",type:"string"},{const:"git_head_unreadable",description:"The worktree's checked-out commit could not be read.",type:"string"}]},StatusGitStalenessV1:{description:"The sealed generation's Git watermark, the commit its source snapshot was\ncaptured from, against the worktree's checked-out commit.",oneOf:[{additionalProperties:!1,description:"HEAD is the commit the sealed generation was built from.",properties:{status:{const:"current",type:"string"},watermark:{type:"string"}},required:["status","watermark"],type:"object"},{additionalProperties:!1,description:"HEAD has moved off the commit the sealed generation was built from.",properties:{head:{type:"string"},status:{const:"stale",type:"string"},watermark:{type:"string"}},required:["status","watermark","head"],type:"object"},{additionalProperties:!1,description:"No watermark or no HEAD to compare it with.",properties:{reason:{$ref:"#/$defs/StatusGitStalenessUnavailableV1"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StatusHookReplayFailureV1:{additionalProperties:!1,description:"One hook spool the last replay sweep could not drain.",properties:{cause:{type:"string"},host:{$ref:"#/$defs/NativeHostIdentityV1"},spool:{$ref:"#/$defs/StatusHookReplaySpoolV1"}},required:["host","spool","cause"],type:"object"},StatusHookReplaySpoolV1:{oneOf:[{const:"records",description:"The host's spooled hook events.",type:"string"},{const:"delivery_receipts",description:"The host's hook delivery receipts.",type:"string"},{const:"pending_work",description:"The producer work the host's admission ledger still owes.",type:"string"}]},StatusHookReplayV1:{description:"The daemon's hook spool drain for one project.",oneOf:[{additionalProperties:!1,description:"No replay consumer drains this project's hook spools in this daemon.",properties:{status:{const:"unowned",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The replay consumer has not finished its first sweep.",properties:{status:{const:"starting",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The last sweep drained every hook spool it found.",properties:{status:{const:"drained",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The spools drained, but producer work they admitted waits for the\nproject's hook orchestrator to mount. The work stays owed and runs\nonce it does; nothing has failed.",properties:{status:{const:"waiting",type:"string"},waiting:{items:{$ref:"#/$defs/StatusHookReplayFailureV1"},type:"array"}},required:["status","waiting"],type:"object"},{additionalProperties:!1,description:"The last sweep could not drain these spools. Their records stay\ndurable and the next sweep retries them.",properties:{failures:{items:{$ref:"#/$defs/StatusHookReplayFailureV1"},type:"array"},status:{const:"failed",type:"string"}},required:["status","failures"],type:"object"}]},StatusMemoryOwnerV1:{additionalProperties:!1,properties:{bytes:{format:"uint64",minimum:0,type:["integer","null"]},content_digest:{type:["string","null"]},holders:{items:{$ref:"#/$defs/ResidentMemoryHolderReadV1"},type:"array"},idle_seconds:{format:"uint64",minimum:0,type:"integer"},kind:{type:"string"},measured:{type:"boolean"},project_id:{type:"string"},protected:{type:"boolean"}},required:["project_id","kind","holders","measured","idle_seconds","protected"],type:"object"},StatusMemoryPressureV1:{enum:["unobserved","nominal","over_budget"],type:"string"},StatusMemoryReservationV1:{additionalProperties:!1,properties:{bytes:{format:"uint64",minimum:0,type:"integer"},component:{type:"string"}},required:["component","bytes"],type:"object"},StatusMemoryV1:{additionalProperties:!1,description:"The daemon's memory admission and resident accounting as one project sees it.",properties:{high_watermark_bytes:{format:"uint64",minimum:0,type:"integer"},idle_window_seconds:{format:"uint64",minimum:0,type:"integer"},limit_bytes:{format:"uint64",minimum:0,type:"integer"},low_watermark_bytes:{format:"uint64",minimum:0,type:"integer"},owners:{description:"This project's retained owners; other projects' belong to the\ndaemon-wide Doctor inventory.",items:{$ref:"#/$defs/StatusMemoryOwnerV1"},type:"array"},psi_some_avg10:{format:"double",type:["number","null"]},reservations:{description:"`reserved_bytes` per component, largest first.",items:{$ref:"#/$defs/StatusMemoryReservationV1"},type:"array"},reserved_bytes:{description:"Bytes admitted work has reserved daemon-wide: the admission model of\nin-flight builds and decodes, not a measurement.",format:"uint64",minimum:0,type:"integer"},resident_bytes:{description:"Observed admission occupancy: anonymous/shared process pages plus swap,\nconstrained by shared cgroup headroom. This is not raw process RSS.",format:"uint64",minimum:0,type:["integer","null"]},retained_bytes:{format:"uint64",minimum:0,type:"integer"},shed_order:{items:{type:"string"},type:"array"},status:{$ref:"#/$defs/StatusMemoryPressureV1"},unattributed_bytes:{description:"Raw process RSS from the last successful canonical sample minus the\ndaemon-wide measured `retained_bytes`, saturating at zero. Unlike\n`resident_bytes`, this excludes swap and shared cgroup pressure. Work in\nflight, runtime allocations, SQLite page caches, and allocator-held pages\ncan contribute. `None` until a resident sample has been published.",format:"uint64",minimum:0,type:["integer","null"]},unmeasured_owners:{format:"uint",minimum:0,type:"integer"}},required:["status","limit_bytes","high_watermark_bytes","low_watermark_bytes","idle_window_seconds","shed_order","retained_bytes","unmeasured_owners","reserved_bytes","reservations","owners"],type:"object"},StatusRetrievalServingV1:{oneOf:[{additionalProperties:!1,description:"A sealed complete generation serves the exact worktree. The ages tell a\nroutine rebuild window from a wedged route.",properties:{condition:{anyOf:[{$ref:"#/$defs/StatusServingConditionV1"},{type:"null"}]},freshness:{$ref:"#/$defs/StatusServingFreshnessV1"},last_reconcile_age_seconds:{format:"int64",type:["integer","null"]},seated_generation_age_seconds:{format:"int64",type:["integer","null"]},status:{const:"serving",type:"string"}},required:["status","freshness"],type:"object"},{additionalProperties:!1,description:"The census answered and nothing is servable yet.",properties:{reason:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StatusSchemaConvergenceStateV1:{enum:["completed","in_progress","degraded"],type:"string"},StatusSchemaConvergenceV1:{additionalProperties:!1,properties:{findings:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},status:{$ref:"#/$defs/StatusSchemaConvergenceStateV1"}},required:["status","findings"],type:"object"},StatusServingConditionV1:{enum:["artifact_restore","source_verification","rebuilding","stalled"],type:"string"},StatusServingFreshnessV1:{enum:["current","restoring","last_complete_stale","unknown"],type:"string"},StatusSessionGitEvidenceUnavailableV1:{oneOf:[{const:"session_store_denied",description:"This request holds no project session store.",type:"string"},{const:"read_failed",description:"The session store refused the evidence read.",type:"string"}]},StatusSessionGitEvidenceV1:{description:"The project's session↔Git evidence generation.",oneOf:[{additionalProperties:!1,description:"A convergence pass installed this generation.",properties:{backfill_watermark:{format:"int64",type:["integer","null"]},commit_count:{format:"uint64",minimum:0,type:"integer"},generation:{type:"string"},source_watermark:{type:"string"},span_count:{format:"uint64",minimum:0,type:"integer"},status:{const:"recorded",type:"string"}},required:["status","generation","source_watermark","span_count","commit_count"],type:"object"},{additionalProperties:!1,description:"No convergence pass has written evidence for this project yet.",properties:{backfill_watermark:{format:"int64",type:["integer","null"]},status:{const:"unrecorded",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The evidence could not be read.",properties:{message:{type:["string","null"]},reason:{$ref:"#/$defs/StatusSessionGitEvidenceUnavailableV1"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StoreResetRequiredV1:{description:"A persisted store the daemon keeps mounted in a typed reset-required state\ninstead of refusing to serve: every read against it returns the typed\nrefusal, stores that admit keep serving, and `remedy` is the exact command\nthe operator runs to reset it.",properties:{authority:{type:"string"},found_version:{format:"int64",type:["integer","null"]},reason:{type:"string"},remedy:{type:"string"},required_version:{format:"int64",type:["integer","null"]},store:{type:"string"}},required:["store","authority","reason","remedy"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/StatusAdmissionV1"},{$ref:"#/$defs/ProjectStatusV1"}],description:"`tracedecay_status` for an `admission_only` read, or the project's status.",title:"StatusResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_details:{default:!1,type:"boolean"}},title:"StorageStatusPrimitiveRequest",type:"object"},{$defs:{StorageStatusHistoryPointV1:{additionalProperties:!1,properties:{database_bytes:{format:"uint64",minimum:0,type:"integer"},observed_at:{format:"int64",type:"integer"}},required:["observed_at","database_bytes"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{database_bytes:{format:"uint64",minimum:0,type:["integer","null"]},details:{items:{type:"string"},type:"array"},freelist_pages:{default:null,format:"uint64",minimum:0,type:["integer","null"]},history:{default:[],items:{$ref:"#/$defs/StorageStatusHistoryPointV1"},type:"array"},history_coverage:{default:null,type:["string","null"]},page_count:{default:null,format:"uint64",minimum:0,type:["integer","null"]},page_size_bytes:{default:null,format:"uint32",minimum:0,type:["integer","null"]},project_id:{default:null,type:["string","null"]},read_only:{type:"boolean"},status:{type:"string"},store_path:{default:null,type:["string","null"]}},required:["status","read_only","details"],title:"StorageStatusPrimitiveResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_str_replace`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},new_str:{type:"string"},old_str:{type:"string"},path:{type:"string"},verify:{default:!1,type:"boolean"}},required:["path","old_str","new_str"],title:"StrReplaceSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{description:"Source file path to find test coverage for.",type:["string","null"]},node_id:{description:"Specific node ID to find test coverage for (alternative to file).",type:["string","null"]}},title:"TestMapSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,TestMapSourceCoverageV1:{additionalProperties:!1,properties:{source_file:{type:"string"},source_id:{type:"string"},source_line:{format:"uint32",minimum:0,type:"integer"},source_name:{type:"string"},tests:{items:{$ref:"#/$defs/TestMapTestV1"},type:"array"}},required:["source_name","source_id","source_file","source_line","tests"],type:"object"},TestMapTestV1:{additionalProperties:!1,properties:{attribution_depth:{format:"uint32",minimum:0,type:"integer"},test_file:{type:"string"},test_line:{format:"uint32",minimum:0,type:"integer"},test_name:{type:"string"}},required:["test_name","test_file","test_line","attribution_depth"],type:"object"},TestMapUncoveredV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","file","line"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{items:{$ref:"#/$defs/TestMapSourceCoverageV1"},type:"array"},covered_symbols:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},test_files:{items:{type:"string"},type:"array"},uncovered:{items:{$ref:"#/$defs/TestMapUncoveredV1"},type:"array"},uncovered_symbols:{format:"uint64",minimum:0,type:"integer"}},required:["covered_symbols","uncovered_symbols","test_files","coverage","uncovered"],title:"TestMapResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The admitted project selects the retained managed test run, so this exact\nrequest intentionally carries no caller-selectable scope or identity.",title:"TestResultsSurfaceRequestV1",type:"object"},{$defs:{CancellationObservation:hn,CancellationStage:ha,CodeGenerationId:hy,CommitId:hq,Deadline:yv,OperationBudgetUsage:_D,OperationReceipt:_F,OperationTermination:_L,TestResultProjectionV1:{additionalProperties:!1,description:"One result emitted by the daemon-managed test-run authority.",properties:{passed:{type:"boolean"},test:{type:"string"}},required:["test","passed"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact retained managed-test-run projection returned by `test_results`.\n\nThe daemon resolves the admitted project, reads its newest durable managed\nrun, and verifies that the run's head and code generation are current\nbefore it serializes this payload. `result_offset` and `available_results`\nretain the authoritative page position. The outcome fields (`finished_at`,\n`exit_code`, the counts, `termination`, `receipt`) are present only after\nthe managed run terminates.",properties:{available_results:{format:"uint64",minimum:0,type:"integer"},code_generation_id:{anyOf:[{$ref:"#/$defs/CodeGenerationId"},{type:"null"}]},completed:{format:"uint64",minimum:0,type:"integer"},exit_code:{format:"int32",type:["integer","null"]},failed:{format:"uint64",minimum:0,type:["integer","null"]},finished_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},head_commit_id:{anyOf:[{$ref:"#/$defs/CommitId"},{type:"null"}]},ignored:{format:"uint64",minimum:0,type:["integer","null"]},operation_id:{type:"string"},passed:{format:"uint64",minimum:0,type:["integer","null"]},receipt:{anyOf:[{$ref:"#/$defs/OperationReceipt"},{type:"null"}]},result_offset:{format:"uint64",minimum:0,type:"integer"},results:{items:{$ref:"#/$defs/TestResultProjectionV1"},type:"array"},session_id:{description:"The session the run was requested by; null when the request named none.",type:["string","null"]},started_at:{$ref:"#/$defs/UtcMicros"},termination:{anyOf:[{$ref:"#/$defs/OperationTermination"},{type:"null"}]},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["operation_id","started_at","results","completed","result_offset","available_results"],title:"TestResultsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_tested:{description:"Include already-tested functions in results (default: false).",type:["boolean","null"]},limit:{description:"Maximum number of results to return (default: 20, at most 200).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]}},title:"TestRiskSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComplexityAnalysisV1:hx,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,TestAttributionMethodV1:{description:"How a source symbol's static test evidence was attributed.",enum:["none","direct_unit","closure"],type:"string"},TestRiskAttributionSummaryV1:{additionalProperties:!1,properties:{cli_entry_attributed:{format:"uint64",minimum:0,type:"integer"},closure_attributed:{format:"uint64",minimum:0,type:"integer"},depth:{format:"uint64",minimum:0,type:"integer"},direct_unit_attributed:{format:"uint64",minimum:0,type:"integer"},public_api_attributed:{format:"uint64",minimum:0,type:"integer"},total_attributed:{format:"uint64",minimum:0,type:"integer"},trait_resolved_attributed:{format:"uint64",minimum:0,type:"integer"}},required:["depth","direct_unit_attributed","closure_attributed","trait_resolved_attributed","public_api_attributed","cli_entry_attributed","total_attributed"],type:"object"},TestRiskBucketSummaryV1:{additionalProperties:!1,properties:{attributed:{format:"uint64",minimum:0,type:"integer"},excluded:{format:"uint64",minimum:0,type:"integer"},orphan_entry:{format:"uint64",minimum:0,type:"integer"},reachable_unattributed:{format:"uint64",minimum:0,type:"integer"}},required:["attributed","reachable_unattributed","orphan_entry","excluded"],type:"object"},TestRiskConfidenceV1:{description:"What the reported coverage percentage bounds.",enum:["static_lower_bound"],type:"string"},TestRiskEntryV1:{additionalProperties:!1,properties:{attribution_depth:{format:"uint64",minimum:0,type:["integer","null"]},attribution_method:{$ref:"#/$defs/TestAttributionMethodV1"},churn:{format:"uint64",minimum:0,type:"integer"},complexity:{description:"`None` when `complexity_analysis` reports the bounded walk did not\ncover the body; `risk` then weighs the lower-bound counters.",format:"uint32",minimum:0,type:["integer","null"]},complexity_analysis:{$ref:"#/$defs/ComplexityAnalysisV1"},fan_in:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},has_test:{type:"boolean"},id:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},risk:{format:"double",type:"number"}},required:["id","name","file","line","complexity_analysis","fan_in","has_test","attribution_method","risk","churn"],type:"object"},TestRiskSummaryV1:{additionalProperties:!1,properties:{attribution:{$ref:"#/$defs/TestRiskAttributionSummaryV1"},buckets:{$ref:"#/$defs/TestRiskBucketSummaryV1"},confidence:{$ref:"#/$defs/TestRiskConfidenceV1"},confidence_note:{type:"string"},coverage_pct:{format:"double",type:"number"},skipped:{format:"uint64",minimum:0,type:"integer"},tested:{format:"uint64",minimum:0,type:"integer"},top_risk_unattributed:{type:"string"},top_risk_untested:{type:"string"},total_functions:{format:"uint64",minimum:0,type:"integer"}},required:["total_functions","tested","skipped","coverage_pct","top_risk_untested","top_risk_unattributed","attribution","buckets","confidence","confidence_note"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},risks:{items:{$ref:"#/$defs/TestRiskEntryV1"},type:"array"},summary:{$ref:"#/$defs/TestRiskSummaryV1"}},required:["risks","summary"],title:"TestRiskResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kinds:{items:{type:"string"},type:["array","null"]},limit:{format:"uint32",minimum:0,type:["integer","null"]},path:{type:["string","null"]}},title:"TodosSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,TodoMarkerV1:{additionalProperties:!1,properties:{enclosing:{type:["string","null"]},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},text:{type:"string"}},required:["kind","file","line","text"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{by_kind:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},type:"object"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},markers:{items:{$ref:"#/$defs/TodoMarkerV1"},type:"array"},match_count:{format:"uint",minimum:0,type:"integer"}},required:["match_count","by_kind","markers"],title:"TodosResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{ecosystem:{description:"Filter findings to one ecosystem ('rust' or 'typescript'). Every\necosystem section is still reported, so the scope of the answer stays\nvisible.",type:["string","null"]},limit:{description:"Maximum unmounted files to return (default: 200, max: 2000). The\nresponse always states the true total and how many rows were omitted.",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter findings to files under this directory path (e.g. 'src/daemon').\nThe whole project is still walked, reachability is not a per-directory\nquestion.",type:["string","null"]}},title:"UnmountedFilesSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,UnmountedEcosystemStatusV1:{description:"Whether an ecosystem was audited, absent, or recognised but unmodelled.",enum:["audited","partial","not_present","unsupported"],type:"string"},UnmountedEcosystemV1:{additionalProperties:!1,properties:{blind_spots:{items:{type:"string"},type:"array"},ecosystem:{type:"string"},entry_point_count:{format:"uint64",minimum:0,type:"integer"},excluded_path_globs:{items:{type:"string"},type:"array"},mounted_file_count:{format:"uint64",minimum:0,type:"integer"},note:{type:["string","null"]},package_count:{format:"uint64",minimum:0,type:"integer"},scanned_file_count:{format:"uint64",minimum:0,type:"integer"},status:{$ref:"#/$defs/UnmountedEcosystemStatusV1"},unclaimed_file_count:{format:"uint64",minimum:0,type:"integer"},unmounted_file_count:{format:"uint64",minimum:0,type:"integer"},verdict:{type:"string"}},required:["ecosystem","status","package_count","entry_point_count","scanned_file_count","mounted_file_count","unclaimed_file_count","unmounted_file_count","verdict","blind_spots","excluded_path_globs"],type:"object"},UnmountedFileV1:{additionalProperties:!1,properties:{ecosystem:{type:"string"},file:{type:"string"},manifest:{type:"string"},nearest_mounted_parent:{type:["string","null"]},package:{type:"string"},suggested_declaration:{type:["string","null"]}},required:["file","ecosystem","package","manifest"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{complete:{type:"boolean"},ecosystem:{type:["string","null"]},ecosystems:{items:{$ref:"#/$defs/UnmountedEcosystemV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint64",minimum:0,type:"integer"},omitted_count:{format:"uint64",minimum:0,type:"integer"},path:{type:["string","null"]},returned_count:{format:"uint64",minimum:0,type:"integer"},unmounted:{items:{$ref:"#/$defs/UnmountedFileV1"},type:"array"},unmounted_file_count:{format:"uint64",minimum:0,type:"integer"}},required:["unmounted_file_count","returned_count","omitted_count","complete","ecosystems","limit","unmounted"],title:"UnmountedFilesResultV1",type:"object"},{$defs:{UnsafePatternKindV1:bB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{exclude_tests:{description:"When true, skips files whose path looks like a test (default: false).",type:["boolean","null"]},kinds:{description:"Subset of patterns to search. Default (or an empty list): every kind.",items:{$ref:"#/$defs/UnsafePatternKindV1"},type:["array","null"]},limit:{description:"Maximum number of matches to return (default: 200, max: 2000).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory (relative to project root).",type:["string","null"]}},title:"UnsafePatternsSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CoverageCompleteness:yu,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,UnsafePatternFileOmissionV1:{additionalProperties:!1,description:"One scanned file whose sites are not reported as verified matches.",properties:{cause:{$ref:"#/$defs/UnsafePatternOmissionCauseV1"},file:{type:"string"},reason:{$ref:"#/$defs/UnsafePatternOmissionReasonV1"},withheld_match_count:{description:"Sites of the requested kinds found in the file and withheld.",format:"uint64",minimum:0,type:"integer"}},required:["file","reason","cause","withheld_match_count"],type:"object"},UnsafePatternKindV1:bB,UnsafePatternMatchV1:{additionalProperties:!1,properties:{enclosing:{type:["string","null"]},file:{type:"string"},in_test:{type:"boolean"},kind:{$ref:"#/$defs/UnsafePatternKindV1"},line:{format:"uint32",minimum:0,type:"integer"},snippet:{type:"string"}},required:["kind","file","line","snippet","in_test"],type:"object"},UnsafePatternOmissionCauseV1:{description:"What prevented the file from being classified.",oneOf:[{const:"syntax_errors",description:"The Rust grammar parsed the file with error nodes. Valid Rust it only\npartly parses (heavy `macro_rules!`) lands here.",type:"string"}]},UnsafePatternOmissionReasonV1:{description:"Why a file's risky-pattern sites are withheld from the verified result.",oneOf:[{const:"test_scope_unclassified",description:"Whether a site is test-only cannot be decided for this file.",type:"string"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{by_kind:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},description:"Match count per pattern kind, keyed by its wire spelling.",type:"object"},coverage:{$ref:"#/$defs/CoverageCompleteness",description:"`partial` exactly when `omissions` names a file whose sites are withheld."},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},matches:{items:{$ref:"#/$defs/UnsafePatternMatchV1"},type:"array"},omissions:{items:{$ref:"#/$defs/UnsafePatternFileOmissionV1"},type:"array"}},required:["match_count","by_kind","matches","coverage","omissions"],title:"UnsafePatternsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{agent_label:{type:["string","null"]},branch:{type:["string","null"]},commit:{type:["string","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},run_id:{type:["string","null"]},session_id:{type:["string","null"]},worktree:{type:["string","null"]}},title:"WorkflowsRequestV1",type:"object"},{$defs:{GitScopeV1:gE,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,WorkflowAgentV1:{additionalProperties:!1,properties:{agent_id:{type:"string"},agent_label:{type:"string"},agent_session_id:{type:["string","null"]},ended_ts:{format:"int64",type:["integer","null"]},model:{type:["string","null"]},phase:{type:["string","null"]},run_id:{type:"string"},started_ts:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/WorkflowStatusV1"},tokens:{format:"int64",type:"integer"},transcript_path:{type:["string","null"]}},required:["run_id","agent_label","agent_id","status"],type:"object"},WorkflowCoverageV1:{enum:["complete","conclusive","bounded_prefix"],type:"string"},WorkflowQueryModeV1:{enum:["session","git_scope","run","agent"],type:"string"},WorkflowRunV1:{additionalProperties:!1,properties:{agent_count:{format:"int64",type:"integer"},description:{type:["string","null"]},ended_ts:{format:"int64",type:["integer","null"]},name:{type:["string","null"]},parent_session_id:{type:"string"},phase_json:{type:["string","null"]},result_summary:{type:["string","null"]},run_id:{type:"string"},started_ts:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/WorkflowStatusV1"}},required:["run_id","parent_session_id","status"],type:"object"},WorkflowStatusV1:{enum:["running","completed","failed","unknown"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{agent:{anyOf:[{$ref:"#/$defs/WorkflowAgentV1"},{type:"null"}]},agent_count:{format:"int64",type:["integer","null"]},agent_label:{type:["string","null"]},agents:{items:{$ref:"#/$defs/WorkflowAgentV1"},type:["array","null"]},agents_complete:{type:["boolean","null"]},agents_coverage:{anyOf:[{$ref:"#/$defs/WorkflowCoverageV1"},{type:"null"}]},agents_returned:{format:"uint",minimum:0,type:["integer","null"]},count:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},found:{type:["boolean","null"]},git_filter:{anyOf:[{$ref:"#/$defs/GitScopeV1"},{type:"null"}]},lookup_complete:{type:["boolean","null"]},lookup_coverage:{anyOf:[{$ref:"#/$defs/WorkflowCoverageV1"},{type:"null"}]},message:{type:["string","null"]},mode:{anyOf:[{$ref:"#/$defs/WorkflowQueryModeV1"},{type:"null"}]},run:{anyOf:[{$ref:"#/$defs/WorkflowRunV1"},{type:"null"}]},run_id:{type:["string","null"]},runs:{items:{$ref:"#/$defs/WorkflowRunV1"},type:["array","null"]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"}},required:["status"],title:"WorkflowsResultV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Confirmation names the exact inspection digest, not a worktree id alone.",properties:{inspection_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target","inspection_digest"],title:"WorktreeCleanupConfirmRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target"],title:"WorktreeCleanupInspectRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target","confirmation_digest"],title:"WorktreeCleanupReconcileRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Removal carries both proofs so a stale confirmation cannot be replayed\nagainst another inspection of the same opaque worktree identity.",properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},confirmed_at:{$ref:"#/$defs/UtcMicros"},inspection_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target","inspection_digest","confirmed_at","confirmation_digest"],title:"WorktreeCleanupRemoveRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target"],title:"WorktreeInventoryRequestV1",type:"object"},{$defs:{ActorId:fb,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Issues a short-lived, version-bound task-opening token.\n\nIdentity, scope, authority revisions, issuance time, and expiry are all\nsupplied by the admitted daemon request. The caller supplies only the\nbearer, destination session, exact task version, and enrolled recipient\nprincipal it intends to authorize.",properties:{recipient_actor_id:{$ref:"#/$defs/ActorId"},session_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"},token:{type:"string"},version:{format:"uint64",minimum:0,type:"integer"}},required:["token","session_id","task_id","version","recipient_actor_id"],title:"IssueTaskHandoffRequestV1",type:"object"},{$defs:{ManifestDigest:_l,TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Flat public receipt for a committed task-handoff issue.\n\nThe complete binding remains inside the daemon authority. Publishing only\nthese exact identifiers avoids turning mutable grant and policy internals\ninto a second public wire authority.",properties:{expires_at:{$ref:"#/$defs/UtcMicros"},issued_at:{$ref:"#/$defs/UtcMicros"},issued_request_id:{type:"string"},session_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"},token_digest:{$ref:"#/$defs/ManifestDigest"},version:{format:"uint64",minimum:0,type:"integer"}},required:["token_digest","issued_request_id","session_id","task_id","version","issued_at","expires_at"],title:"IssueTaskHandoffResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:'Enumerates the handoff tokens this caller could redeem in one session.\n\nThe two `open_*` operations redeem a bearer the caller already holds; they\ncannot answer "what has been handed to me and not yet taken up". This one\ncan, and it does so without any bearer: the request carries no token, and\nthe result carries only digests.',properties:{session_id:{type:"string"}},required:["session_id"],title:"ListTaskHandoffsRequestV1",type:"object"},{$defs:{FeedbackFindingId:y8,HandoffOpenKindV1:{enum:["investigation","task"],type:"string"},HandoffOpenTargetV1:{oneOf:[{properties:{finding_id:{$ref:"#/$defs/FeedbackFindingId"},kind:{const:"investigation",type:"string"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"}},required:["kind","finding_id","owner_version_digest"],type:"object"},{properties:{kind:{const:"task",type:"string"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"},task_id:{$ref:"#/$defs/TaskId"},version:{format:"uint64",minimum:0,type:"integer"}},required:["kind","task_id","version","owner_version_digest"],type:"object"}]},ListedTaskHandoffV1:{additionalProperties:!1,description:"One handoff token, projected for public reading.\n\nMirrors [`IssueTaskHandoffResultV1`]'s doctrine: the complete binding stays\ninside the daemon authority, and only these identifiers cross the wire. No\nbearer secret exists to leak here. The authority never stored one, and the\nissuer's grant identity and policy digests stay concealed.",properties:{consumed_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],description:"Set only when `state` is `consumed`."},expires_at:{$ref:"#/$defs/UtcMicros"},issued_at:{$ref:"#/$defs/UtcMicros"},issued_request_id:{type:"string"},kind:{$ref:"#/$defs/HandoffOpenKindV1"},session_id:{type:"string"},state:{$ref:"#/$defs/TaskHandoffTokenStateV1"},target:{$ref:"#/$defs/HandoffOpenTargetV1"},token_digest:{$ref:"#/$defs/ManifestDigest"}},required:["token_digest","issued_request_id","session_id","kind","target","issued_at","expires_at","state"],type:"object"},ManifestDigest:_l,TaskHandoffTokenStateV1:{description:"Where one enumerated token stands at the observed instant.",oneOf:[{const:"open",description:"Not yet redeemed, and not yet expired: the live frontier.",type:"string"},{const:"consumed",description:"Redeemed. Single-use, so it can never be redeemed again.",type:"string"},{const:"expired",description:"Its window closed with no redemption. A dropped handoff, which is\nexactly the fact a frontier exists to surface.",type:"string"}]},TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The handoff-token frontier for one session.",properties:{consumed_count:{format:"uint32",minimum:0,type:"integer"},expired_count:{format:"uint32",minimum:0,type:"integer"},handoffs:{items:{$ref:"#/$defs/ListedTaskHandoffV1"},type:"array"},observed_at:{$ref:"#/$defs/UtcMicros",description:"The instant the states below were decided at. Without it, `open` and\n`expired` are claims with no clock behind them."},open_count:{format:"uint32",minimum:0,type:"integer"},truncated:{description:"True when the enumeration ceiling was reached, so the counts describe a\nprefix of the frontier rather than all of it.",type:"boolean"}},required:["observed_at","handoffs","open_count","consumed_count","expired_count","truncated"],title:"ListTaskHandoffsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{session_id:{type:"string"},token:{type:"string"}},required:["token","session_id"],title:"OpenInvestigationHandoffRequestV1",type:"object"},{$defs:{FeedbackFindingId:y8,HandoffOpenReceiptV1:gD,InvestigationHandoffSurfaceV1:{additionalProperties:!1,properties:{finding_id:{$ref:"#/$defs/FeedbackFindingId"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"}},required:["finding_id","owner_version_digest"],type:"object"},ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{receipt:{$ref:"#/$defs/HandoffOpenReceiptV1"},surface:{$ref:"#/$defs/InvestigationHandoffSurfaceV1"}},required:["surface","receipt"],title:"OpenInvestigationHandoffResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{session_id:{type:"string"},token:{type:"string"}},required:["token","session_id"],title:"OpenTaskHandoffRequestV1",type:"object"},{$defs:{HandoffOpenReceiptV1:gD,ManifestDigest:_l,TaskHandoffSurfaceV1:{additionalProperties:!1,properties:{task_id:{$ref:"#/$defs/TaskId"},version:{format:"uint64",minimum:0,type:"integer"}},required:["task_id","version"],type:"object"},TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{receipt:{$ref:"#/$defs/HandoffOpenReceiptV1"},surface:{$ref:"#/$defs/TaskHandoffSurfaceV1"}},required:["surface","receipt"],title:"OpenTaskHandoffResultV1",type:"object"},{$defs:{ManifestDigest:_l,MultiRootContinuationV1:_P,MultiRootOperationV1:{description:"Closed federated read families. The family is typed while its existing\noperation-specific request remains the canonical JSON payload owned by that\napplication surface.",oneOf:[{properties:{kind:{const:"work",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"git",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"feedback",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"impact",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"query",type:"string"},request:!0},required:["kind","request"],type:"object"}]},RootGenerationV1:vM,RootScopeOutcomeV1_for_Nullable_RootGenerationV1:vN,RootScopeOutcomeV1_for_Nullable_string:vz,ScopeOutcome_for_Nullable_RootGenerationV1:vJ,ScopeOutcome_for_Nullable_string:vZ,ScopePartialReasonV1:vQ,ScopeSetId:vX,ScopeSetRevision:vY,ScopeUnavailableReasonV1:v0},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"External federated request bound to one persisted scope-set revision and\ndigest. Query/order digests and root generations are server-derived.",properties:{continuation:{anyOf:[{$ref:"#/$defs/MultiRootContinuationV1"},{type:"null"}]},operation:{$ref:"#/$defs/MultiRootOperationV1"},page:{format:"uint64",minimum:0,type:"integer"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"}},required:["scope_set_id","scope_set_revision","scope_set_digest","operation","page"],title:"MultiRootExecuteRequestV1",type:"object"},{$defs:{ManifestDigest:_l,MultiRootContinuationV1:_P,RootGenerationV1:vM,RootScopeOutcomeV1_for_Array_of_AnyValue:{additionalProperties:!1,description:"One typed outcome pinned to the digest of an exact resolved root.",properties:{outcome:{$ref:"#/$defs/ScopeOutcome_for_Array_of_AnyValue"},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","outcome"],type:"object"},RootScopeOutcomeV1_for_Nullable_RootGenerationV1:vN,RootScopeOutcomeV1_for_Nullable_string:vz,ScopeOutcome_for_Array_of_AnyValue:{description:"Truthful outcome for one authorized root or an aggregate over roots.\n\n`Denied` and `Unavailable` carry no value and therefore cannot be confused\nwith a successful empty result.",oneOf:[{properties:{outcome:{const:"exact",type:"string"},value:{items:!0,type:"array"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"partial",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopePartialReasonV1"},value:{items:!0,type:"array"}},required:["value","reason"],type:"object"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"denied",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopeUnavailableReasonV1"}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"}]},ScopeOutcome_for_Nullable_RootGenerationV1:vJ,ScopeOutcome_for_Nullable_string:vZ,ScopePartialReasonV1:vQ,ScopeSetId:vX,ScopeSetRevision:vY,ScopeUnavailableReasonV1:v0},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Federated page preserving each root outcome and aggregate partial truth.",properties:{aggregate:{$ref:"#/$defs/ScopeOutcome_for_Array_of_AnyValue"},continuation:{anyOf:[{$ref:"#/$defs/MultiRootContinuationV1"},{type:"null"}]},roots:{items:{$ref:"#/$defs/RootScopeOutcomeV1_for_Array_of_AnyValue"},type:"array"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"}},required:["scope_set_id","scope_set_revision","scope_set_digest","roots","aggregate"],title:"MultiRootQueryPageV1_for_AnyValue",type:"object"},{$defs:{ProjectId:_4,RegisteredRootSelectorV1:{additionalProperties:!1,description:"Exact registered-root selector accepted by scope-set CAS.",properties:{project_id:{$ref:"#/$defs/ProjectId"},root:{type:"string"}},required:["project_id","root"],type:"object"},ScopeSetId:vX,ScopeSetRevision:vY},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical external selector for creating or updating an authorized scope\nset. Every member names one exact registered root; project-only selection\ncannot silently widen to an active or first-mounted graph.",properties:{expected_revision:{anyOf:[{$ref:"#/$defs/ScopeSetRevision"},{type:"null"}]},roots:{items:{$ref:"#/$defs/RegisteredRootSelectorV1"},type:"array"},scope_set_id:{$ref:"#/$defs/ScopeSetId"}},required:["scope_set_id","roots"],title:"MultiRootScopeSetCasRequestV1",type:"object"},{$defs:{ActorId:fb,AuthorizedRoot:fN,AuthorizedScopeSet:fz,BrainId:f1,ManifestDigest:_l,MultiRootScopeSetCasStatusV1:{enum:["applied","conflict"],type:"string"},ProjectId:_4,RefId:vm,RegisteredRootLocatorV1:vf,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,SharedProfileStoreLocatorV1:bs,UserProfileId:bJ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set:{anyOf:[{$ref:"#/$defs/AuthorizedScopeSet"},{type:"null"}]},status:{$ref:"#/$defs/MultiRootScopeSetCasStatusV1"}},required:["status"],title:"MultiRootScopeSetCasResultV1",type:"object"},{$defs:{ScopeSetId:vX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set_id:{$ref:"#/$defs/ScopeSetId"}},required:["scope_set_id"],title:"MultiRootScopeSetReadRequestV1",type:"object"},{$defs:{ActorId:fb,AuthorizedRoot:fN,AuthorizedScopeSet:fz,BrainId:f1,ManifestDigest:_l,ProjectId:_4,RefId:vm,RegisteredRootLocatorV1:vf,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,SharedProfileStoreLocatorV1:bs,UserProfileId:bJ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AuthorizedScopeSet"},{type:"null"}],title:"Nullable_AuthorizedScopeSet"},{$defs:{AcceptWorkProposalDispositionV1:{description:"The accept-proposal operation can commit acceptance only.",enum:["accepted"],type:"string"},CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCommandId:$p,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/AcceptWorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],title:"AcceptWorkProposalRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,BrainId:f1,CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkGraphChangeV1:$j,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductEventPayloadV1:$1,WorkProductEventV1:$0,WorkProductGraphV1:$4,WorkProductProfileScopeV1:$9,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{event:{$ref:"#/$defs/WorkProductEventV1"},replayed:{type:"boolean"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["event","verified_graph_version","replayed"],title:"WorkProductMutationReceiptV1",type:"object"},{$defs:{AttemptId:fW,CoverageStateV1:yf,DuplicateEffectOutcomeV1:yP,DuplicateEffortKindV1:yV,ProjectionGenerationId:_5,QuantityEvidenceClassV1:vs,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkDuplicateAdjudicationEvidenceV1:$m,WorkDuplicateAdjudicationQuantitiesV1:$f,WorkTopologyGenerationRefV1:SE},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},evidence:{$ref:"#/$defs/WorkDuplicateAdjudicationEvidenceV1"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]},first_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},occurred_at:{$ref:"#/$defs/UtcMicros"},quantities:{$ref:"#/$defs/WorkDuplicateAdjudicationQuantitiesV1"},reason:{type:"string"},second_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},verdict:{$ref:"#/$defs/DuplicateEffortKindV1"}},required:["first_attempt","second_attempt","evidence","verdict","quantities","reason","command_id","occurred_at"],title:"WorkDuplicateAdjudicationCommandV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,CoverageStateV1:yf,DuplicateEffectOutcomeV1:yP,DuplicateEffortKindV1:yV,ManifestDigest:_l,ProjectionGenerationId:_5,QuantityEvidenceClassV1:vs,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkDuplicateAdjudicationCommandV1:{additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},evidence:{$ref:"#/$defs/WorkDuplicateAdjudicationEvidenceV1"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]},first_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},occurred_at:{$ref:"#/$defs/UtcMicros"},quantities:{$ref:"#/$defs/WorkDuplicateAdjudicationQuantitiesV1"},reason:{type:"string"},second_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},verdict:{$ref:"#/$defs/DuplicateEffortKindV1"}},required:["first_attempt","second_attempt","evidence","verdict","quantities","reason","command_id","occurred_at"],type:"object"},WorkDuplicateAdjudicationEvidenceV1:$m,WorkDuplicateAdjudicationQuantitiesV1:$f,WorkDuplicateAdjudicationReceiptV1:{additionalProperties:!1,properties:{actor_id:{$ref:"#/$defs/ActorId"},adjudication_ref:{$ref:"#/$defs/ManifestDigest"},canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},command:{$ref:"#/$defs/WorkDuplicateAdjudicationCommandV1"},revision:{format:"uint64",minimum:0,type:"integer"}},required:["command","revision","actor_id","canonical_input_digest","adjudication_ref"],type:"object"},WorkTopologyGenerationRefV1:SE},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{outcome:{const:"appended",type:"string"},receipt:{$ref:"#/$defs/WorkDuplicateAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"},{properties:{outcome:{const:"replayed",type:"string"},receipt:{$ref:"#/$defs/WorkDuplicateAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"}],title:"WorkDuplicateAdjudicationAppendOutcomeV1"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,WorkAttemptIdentityV1:b6,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{adjudication_id:{type:"string"},attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},command_id:{$ref:"#/$defs/WorkCommandId"},detection_horizon_micros:{format:"uint64",minimum:0,type:"integer"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]}},required:["adjudication_id","attempt","detection_horizon_micros","command_id"],title:"AdjudicateWorkLeakCommandV1",type:"object"},{$defs:{AdjudicateWorkLeakCommandV1:{additionalProperties:!1,properties:{adjudication_id:{type:"string"},attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},command_id:{$ref:"#/$defs/WorkCommandId"},detection_horizon_micros:{format:"uint64",minimum:0,type:"integer"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]}},required:["adjudication_id","attempt","detection_horizon_micros","command_id"],title:"AdjudicateWorkLeakCommandV1",type:"object"},AttemptId:fW,CoverageStateV1:yf,LeakOwnerClassV1:{enum:["work","workflow","git","delivery","unknown"],type:"string"},ManifestDigest:_l,RunId:vF,TaskId:bT,UtcMicros:bZ,VerifiedWorkLeakEvidenceV1:{additionalProperties:!1,description:"Exact result of one scan by the canonical lease/process/effect/placement/\ndelivery evidence owner. Evidence references are opaque local anchors;\ntheir owning records remain behind normal authorization.",properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},coverage:{$ref:"#/$defs/CoverageStateV1"},detection_horizon_micros:{format:"uint64",minimum:0,type:"integer"},evidence_refs:{items:{type:"string"},type:"array"},kind:{$ref:"#/$defs/WorkExecutionLeakKindV1"},owner_class:{$ref:"#/$defs/LeakOwnerClassV1"},recovery:{$ref:"#/$defs/WorkExecutionLeakRecoveryV1"},scan_completed_at:{$ref:"#/$defs/UtcMicros"},scan_started_at:{$ref:"#/$defs/UtcMicros"}},required:["attempt","kind","recovery","owner_class","coverage","detection_horizon_micros","scan_started_at","scan_completed_at","evidence_refs"],type:"object"},WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkExecutionLeakKindV1:{enum:["lease_after_terminal","attempt_without_live_owner","effect_unknown_past_deadline","missing_worktree_binding","unbounded_delivery","none","unknown"],type:"string"},WorkExecutionLeakRecoveryV1:{enum:["not_required","pending","recovered","failed","unknown"],type:"string"},WorkLeakAdjudicationReceiptV1:{additionalProperties:!1,properties:{canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},command:{$ref:"#/$defs/AdjudicateWorkLeakCommandV1"},evidence:{$ref:"#/$defs/VerifiedWorkLeakEvidenceV1"},revision:{format:"uint64",minimum:0,type:"integer"},scan_deadline:{$ref:"#/$defs/UtcMicros",description:"Daemon/request-owned deadline that bounded the source scan."}},required:["command","revision","evidence","scan_deadline","canonical_input_digest"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{outcome:{const:"appended",type:"string"},receipt:{$ref:"#/$defs/WorkLeakAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"},{properties:{outcome:{const:"replayed",type:"string"},receipt:{$ref:"#/$defs/WorkLeakAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"}],title:"WorkLeakAdjudicationOutcomeV1"},{$defs:{CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RetrievalAnchorId:vI,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCommandId:$p,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","based_on_version","mutation"],title:"AdmitWorkExecutionRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AutomaticWorktreeGcV1:fF,BrainId:f1,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CatalogGenerationId:hp,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,RetrievalAnchorId:vI,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkGraphChangeV1:$j,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductEventPayloadV1:$1,WorkProductEventV1:$0,WorkProductGraphV1:$4,WorkProductMutationReceiptV1:$3,WorkProductProfileScopeV1:$9,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Execution admission together with the immutable provider snapshot licensed\nby the accepted proposal and current configuration authority.",properties:{execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},mutation:{$ref:"#/$defs/WorkProductMutationReceiptV1"}},required:["mutation","execution_snapshot"],title:"AdmittedWorkExecutionV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementKindV1:$B,WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{occurred_at:{$ref:"#/$defs/UtcMicros"},retention_eligible_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],default:null,description:"When retention makes this placement eligible for a fresh cleanup\npreflight. Eligibility is not delete authority."},run_id:{$ref:"#/$defs/RunId"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","target","occurred_at"],title:"AdmitWorkPlacementCommand",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One run's durable placement relation.",properties:{authority_version:{format:"uint64",minimum:0,type:"integer"},blockers:{items:{$ref:"#/$defs/WorkPlacementBlockerV1"},type:"array",uniqueItems:!0},identity:{$ref:"#/$defs/WorkPlacementIdentityV1"},retention_eligible_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],description:"When retention makes this placement *eligible* for a fresh cleanup\npreflight. Eligibility is not delete authority."},state:{$ref:"#/$defs/WorkPlacementStateV1"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["identity","target","state","authority_version","transitioned_at","blockers"],title:"WorkPlacementV1",type:"object"},{$defs:{CommitId:hq,RefId:vm,WorkEffectStateV1:$h,WorkJobBaseV1:{additionalProperties:!1,description:"The source revision every attempt in the job starts from.",properties:{commit:{$ref:"#/$defs/CommitId"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]}},required:["commit"],type:"object"},WorkJobKeyV1:$z,WorkJobNameV1:{description:"A job name: `[a-z0-9-]`, 1 to 48 bytes. Identities derive from it.",type:"string"},WorkJobSynthesisV1:{additionalProperties:!1,properties:{instructions:{type:"string"},output_name:{$ref:"#/$defs/WorkflowOutputName"},task:{$ref:"#/$defs/WorkJobKeyV1",description:"The synthesis attempt runs under this task's run and execution snapshot."}},required:["task","output_name","instructions"],type:"object"},WorkJobTaskV1:{additionalProperties:!1,properties:{instructions:{type:"string"},key:{$ref:"#/$defs/WorkJobKeyV1"},placement:{$ref:"#/$defs/WorkPlacementTargetV1"},title:{type:"string"}},required:["key","title","instructions","placement"],type:"object"},WorkPlacementKindV1:$B,WorkPlacementTargetV1:$J,WorkflowOutputName:SD},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One guided job: the tasks to run in parallel, where each runs, and the\nsynthesis that reviews them.",properties:{base:{$ref:"#/$defs/WorkJobBaseV1"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},job:{$ref:"#/$defs/WorkJobNameV1"},synthesis:{$ref:"#/$defs/WorkJobSynthesisV1"},tasks:{items:{$ref:"#/$defs/WorkJobTaskV1"},type:"array"},title:{type:"string"}},required:["job","title","base","effect_state","tasks","synthesis"],title:"AdvanceWorkJobRequestV1",type:"object"},{$defs:{ActorId:fb,AdmittedWorkExecutionV1:{additionalProperties:!1,description:"Execution admission together with the immutable provider snapshot licensed\nby the accepted proposal and current configuration authority.",properties:{execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},mutation:{$ref:"#/$defs/WorkProductMutationReceiptV1"}},required:["mutation","execution_snapshot"],type:"object"},ApplicationExecutionFailureClassV1:{description:"Stable non-retryable class for an admitted execution failure.",enum:["denied","malformed_output","permanent"],type:"string"},ApplicationProblemDetailV1:fA,ApplicationProblemKind:{description:"Stable problem-code taxonomy for request failures and admitted terminals.",enum:["invalid_request","not_found_or_not_authorized","conflict","partial_effect","stale","unsupported","unavailable","execution_failed","reset_required","saturated","cancelled","timed_out"],type:"string"},ApplicationProblemRecord:{additionalProperties:!1,description:"Stable application problem record shared verbatim by every adapter.",properties:{cancellation_stage:{$ref:"#/$defs/RequiredNullable3"},code:{type:"string"},committed_receipt:{$ref:"#/$defs/RequiredNullable2",description:"A committed effect is present only for an admitted partial effect.\nThe nullable field is always serialized: omitting it would create a\ncompatibility/default path that could hide a missing receipt."},coverage:{anyOf:[{$ref:"#/$defs/EvidenceCoverage"},{type:"null"}]},detail:{$ref:"#/$defs/RequiredNullable",description:"The structured facts `message` is rendered from, when the problem has\nany. Always serialized so a client never mistakes an omitted detail\nfor a problem without one."},details:{items:{$ref:"#/$defs/SafeDiagnostic"},type:"array"},diagnostic:{anyOf:[{$ref:"#/$defs/SafeDiagnostic"},{type:"null"}]},execution_failure_classification:{$ref:"#/$defs/RequiredNullable5"},kind:{$ref:"#/$defs/ApplicationProblemKind"},legal_actions:{items:{$ref:"#/$defs/LegalAction"},type:"array"},message:{type:"string"},owning_layer:{$ref:"#/$defs/ProblemOwningLayer"},request_id:{type:"string"},retry:{$ref:"#/$defs/RetryDirective"},retry_after_millis:{format:"uint64",minimum:0,type:["integer","null"]},retry_scope:{anyOf:[{$ref:"#/$defs/RetryScope"},{type:"null"}]},retryable:{type:"boolean"},revision:{format:"uint32",minimum:0,type:"integer"},terminality:{$ref:"#/$defs/ProblemTerminality"},trace_id:{type:"string"},unavailable_classification:{$ref:"#/$defs/RequiredNullable4"}},required:["revision","kind","code","message","detail","committed_receipt","owning_layer","terminality","retryable","retry","cancellation_stage","unavailable_classification","execution_failure_classification","request_id","trace_id","details","legal_actions"],type:"object"},ApplicationUnavailableClassV1:{description:"Stable reason an application authority is unavailable.",enum:["authority","backend_unavailable","backend_disconnected","backend_retryable"],type:"string"},AttemptId:fW,AutomaticWorktreeGcV1:fF,BrainId:f1,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CancellationStage:ha,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CatalogGenerationId:hp,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CoverageCompleteness:yu,CoverageDomainState:ym,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DaemonServiceUnitObservationV1:y_,DiagnosticsSearchedTsconfigV1:yS,EffectClass:yR,EffectReceipt:yq,EffectTermination:yI,EvidenceCoverage:yx,EvidenceDomain:yj,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LegalAction:{description:"Bounded action an adapter may offer without inferring executable authority.",enum:["correct_request","reauthorize","refresh","retry","reconcile","reset","restart_without_cursor","contact_administrator"],type:"string"},LocatorDigest:_r,ManifestDigest:_l,ProblemOwningLayer:{description:"Layer that owns resolving the problem rather than merely presenting it.",enum:["adapter","application","runtime","port"],type:"string"},ProblemTerminality:{description:"Whether the problem occurred before admission or is an admitted terminal.",enum:["pre_admission","admitted_terminal"],type:"string"},ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,RequiredNullable:{anyOf:[{$ref:"#/$defs/ApplicationProblemDetailV1"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable2:{anyOf:[{$ref:"#/$defs/EffectReceipt"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable3:{anyOf:[{$ref:"#/$defs/CancellationStage"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable4:{anyOf:[{$ref:"#/$defs/ApplicationUnavailableClassV1"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable5:{anyOf:[{$ref:"#/$defs/ApplicationExecutionFailureClassV1"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},ResolvedScope:vw,RetrievalAnchorId:vI,RetryDirective:{description:"Safe adapter-independent retry instruction. Adapters preserve it verbatim.",enum:["never","same_request","after_delay","after_revalidate","after_reconcile"],type:"string"},RetryScope:{description:"Request identity boundary within which a retry remains valid.",enum:["same_request","same_operation","fresh_request"],type:"string"},ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SafeDiagnostic:{additionalProperties:!1,description:"Sanitized detail that may cross the application boundary.",properties:{code:{type:"string"},message:{type:"string"}},required:["code","message"],type:"object"},SensitiveFilesystemLocatorV1:v4,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UseCaseId:bK,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkGraphChangeV1:$j,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkJobIdentitiesV1:{additionalProperties:!1,properties:{operation:{$ref:"#/$defs/WorkflowOperationRef"},synthesis:{$ref:"#/$defs/WorkAttemptIdentityV1"},tasks:{items:{$ref:"#/$defs/WorkJobTaskIdentitiesV1"},type:"array"}},required:["operation","tasks","synthesis"],type:"object"},WorkJobKeyV1:$z,WorkJobStateV1:{oneOf:[{additionalProperties:!1,description:"The call's deadline floor arrived with work left; call again now.",properties:{state:{const:"advancing",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"Nothing can move until providers, routing, or capacity progress.",properties:{on:{items:{$ref:"#/$defs/WorkJobWaitV1"},type:"array"},state:{const:"waiting",type:"string"}},required:["state","on"],type:"object"},{additionalProperties:!1,description:"The chain stopped at `step`. `problem` is the record the step's own\noperation produced, or a guided refusal naming the job-level cause.",properties:{problem:{$ref:"#/$defs/ApplicationProblemRecord"},state:{const:"refused",type:"string"},step:{$ref:"#/$defs/WorkJobStepV1"}},required:["state","step","problem"],type:"object"},{additionalProperties:!1,properties:{sources:{items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"},state:{const:"completed",type:"string"},synthesis:{$ref:"#/$defs/WorkAttemptV1"}},required:["state","sources","synthesis"],type:"object"}]},WorkJobStepRecordV1:{additionalProperties:!1,description:"A step this call executed, with its operation's own effect receipt.",properties:{receipt:{$ref:"#/$defs/EffectReceipt"},request_id:{type:"string"},result:{$ref:"#/$defs/WorkJobStepResultV1"},step:{$ref:"#/$defs/WorkJobStepV1"}},required:["step","request_id","receipt","result"],type:"object"},WorkJobStepResultV1:{description:"Every arm is an existing Work operation's own output.",oneOf:[{properties:{result:{const:"graph",type:"string"},value:{$ref:"#/$defs/WorkProductMutationReceiptV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"execution",type:"string"},value:{$ref:"#/$defs/AdmittedWorkExecutionV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"placement",type:"string"},value:{$ref:"#/$defs/WorkPlacementV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"attempt",type:"string"},value:{$ref:"#/$defs/WorkAttemptV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"synthesis",type:"string"},value:{$ref:"#/$defs/WorkSynthesisAttemptV1"}},required:["result","value"],type:"object"}]},WorkJobStepV1:{description:"One existing Work operation the guided job runs. There is deliberately no\narm that advances a job, so a step can never recurse into the guided path.",oneOf:[{additionalProperties:!1,properties:{step:{const:"create_task",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"accept_proposal",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"admit_execution",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"admit_placement",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"start_source",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"await_sources",type:"string"}},required:["step"],type:"object"},{additionalProperties:!1,properties:{step:{const:"synthesize",type:"string"}},required:["step"],type:"object"},{additionalProperties:!1,properties:{step:{const:"await_synthesis",type:"string"}},required:["step"],type:"object"},{additionalProperties:!1,properties:{step:{const:"release_placement",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"}]},WorkJobTaskIdentitiesV1:{additionalProperties:!1,properties:{key:{$ref:"#/$defs/WorkJobKeyV1"},proposal_id:{$ref:"#/$defs/ProposalId"},source:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["key","proposal_id","source"],type:"object"},WorkJobWaitV1:{oneOf:[{additionalProperties:!1,description:"The proposal route abstained, as it does while routing warms.",properties:{reason:{type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"},wait:{const:"proposal_route",type:"string"}},required:["wait","task","reason"],type:"object"},{additionalProperties:!1,properties:{identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"},wait:{const:"attempt",type:"string"}},required:["wait","identity","state"],type:"object"},{additionalProperties:!1,description:"The registered topology has no free attempt slot for this task.",properties:{problem:{$ref:"#/$defs/ApplicationProblemRecord"},task:{$ref:"#/$defs/WorkJobKeyV1"},wait:{const:"capacity",type:"string"}},required:["wait","task","problem"],type:"object"}]},WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkMilestoneV1:$L,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J,WorkPlacementV1:$Z,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductEventPayloadV1:$1,WorkProductEventV1:$0,WorkProductGraphV1:$4,WorkProductMutationReceiptV1:$3,WorkProductProfileScopeV1:$9,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRestartReasonV1:Sm,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkSynthesisAttemptV1:{description:"The typed outcome of a synthesis request: an admitted attempt, or the\nsealed unsynthesized set when synthesis could not truthfully begin.",oneOf:[{additionalProperties:!1,description:"The admitted synthesis attempt and everything it is accountable to.",properties:{attempt:{$ref:"#/$defs/WorkAttemptV1",description:"The leased (or idempotently replayed) synthesis attempt."},draft:{$ref:"#/$defs/WorkflowSynthesisDraft",description:"The citation obligation, complete by construction: the draft cites\nevery citable source digest and is verified downstream by\n[`crate::workflow_synthesis::verify_workflow_synthesis_draft`]."},groups:{description:"Disagreement structure over the succeeded sources.",items:{$ref:"#/$defs/WorkSynthesisEvidenceGroupV1"},type:"array"},source_set:{$ref:"#/$defs/WorkSynthesisSourceSetV1",description:"The sealed source envelopes the attempt was admitted against."},synthesis:{const:"admitted",type:"string"},uncited:{description:"Sources preserved without citations: failures, unknowns, and\nartifact-less successes, in the caller's requested order.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["synthesis","attempt","source_set","groups","draft","uncited"],type:"object"},{properties:{refusal:{$ref:"#/$defs/WorkSynthesisRefusalV1"},sources:{$ref:"#/$defs/WorkSynthesisSourceSetV1"},synthesis:{const:"unsynthesized",type:"string"}},required:["synthesis","sources","refusal"],type:"object"}]},WorkSynthesisEvidenceGroupV1:Sq,WorkSynthesisRefusalV1:SI,WorkSynthesisSourceEnvelopeV1:Sx,WorkSynthesisSourceOutcomeV1:Sj,WorkSynthesisSourceSetV1:SC,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowSynthesisDraft:SH,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"What one call did and where the job now stands.",properties:{job:{$ref:"#/$defs/WorkJobIdentitiesV1",description:"The derived identities, so the advanced operations can target them."},performed:{description:"Only the steps this call executed, in order.",items:{$ref:"#/$defs/WorkJobStepRecordV1"},type:"array"},state:{$ref:"#/$defs/WorkJobStateV1"}},required:["job","performed","state"],title:"AdvanceWorkJobResultV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_id"],title:"WorkAttemptStatusRequestV1",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{actual_route:{anyOf:[{$ref:"#/$defs/WorkProviderRouteV1"},{type:"null"}]},artifacts:{items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},cancellation:{$ref:"#/$defs/WorkCancellationStateV1"},execution:{$ref:"#/$defs/WorkExecutionEnvelopeV1"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},lease:{$ref:"#/$defs/WorkLeaseFenceV1"},progress:{anyOf:[{$ref:"#/$defs/WorkAttemptProgressV1"},{type:"null"}]},projection_binding:{$ref:"#/$defs/WorkAttemptProjectionBindingV1"},recovery:{$ref:"#/$defs/WorkRecoveryStateV1"},requested_route:{$ref:"#/$defs/WorkProviderRouteV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"},terminal:{anyOf:[{$ref:"#/$defs/WorkTerminalEvidenceV1"},{type:"null"}]}},required:["identity","projection_binding","execution","lease","state","artifacts","cancellation","recovery","requested_route"],title:"WorkAttemptV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkCancellationRequestId:$d},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},occurred_at:{$ref:"#/$defs/UtcMicros"},request_id:{$ref:"#/$defs/WorkCancellationRequestId"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_id","request_id","occurred_at"],title:"CancelWorkAttemptCommand",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{new_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"},observed_at:{$ref:"#/$defs/UtcMicros"},old_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","old_version","new_version","observed_at"],title:"WorkProposalComparisonRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProposalId:_8,ProviderId:vo,RetrievalAnchorId:vI,RunId:vF,TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkEvidenceRootV1:{additionalProperties:!1,properties:{item:{$ref:"#/$defs/WorkItemV1"},links:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},proposal_decisions:{items:{$ref:"#/$defs/WorkProposalDecisionV1"},type:"array"},relation_replan_decisions:{items:{$ref:"#/$defs/WorkRelationReplanDecisionV1"},type:"array"},relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["verified_version","item","relations","proposal_decisions","relation_replan_decisions","links"],type:"object"},VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkItemInputV1:$M,WorkItemV1:$N,WorkProductRelationV1:$5,WorkProposalComparisonEffectV1:{oneOf:[{const:"advisory_only",description:"Comparison is evidence only. There is no apply edge from this result.",type:"string"}]},WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{added_evidence:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},added_relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},effect:{$ref:"#/$defs/WorkProposalComparisonEffectV1"},item_changed:{type:"boolean"},new:{$ref:"#/$defs/VerifiedWorkEvidenceRootV1"},old:{$ref:"#/$defs/VerifiedWorkEvidenceRootV1"},removed_evidence:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},removed_relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","old","new","added_relations","removed_relations","added_evidence","removed_evidence","item_changed","effect"],title:"WorkProposalComparisonV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},plan:{$ref:"#/$defs/WorkPlanV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","initiative","plan","milestone","item","mutation"],title:"CreateWorkTaskRequestV1",type:"object"},{$defs:{WorkAttemptListCursorV1:b9},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{anyOf:[{$ref:"#/$defs/WorkAttemptListCursorV1"},{type:"null"}],default:null},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],title:"WorkAttemptListRequestV1",type:"object"},{$defs:{AttemptId:fW,ManifestDigest:_l,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptStateV1:$t,WorkEffectStateV1:$h,WorkExecutionSpanV1:{additionalProperties:!1,properties:{admitted_projection_sequence:{description:"Durable Work projection sequence under which execution was admitted.",format:"uint64",minimum:0,type:"integer"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},ended_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},started_at:{$ref:"#/$defs/UtcMicros"},state:{$ref:"#/$defs/WorkAttemptStateV1"},terminal_evidence_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},wall_micros:{description:"Present only when both owner instants form a valid non-negative span.",format:"uint64",minimum:0,type:["integer","null"]}},required:["identity","admitted_projection_sequence","state","effect_state","started_at"],type:"object"},WorkExecutionTimingCoverageV1:{oneOf:[{additionalProperties:!1,properties:{coverage:{const:"complete",type:"string"}},required:["coverage"],type:"object"},{additionalProperties:!1,properties:{coverage:{const:"partial",type:"string"},invalid_terminal_span:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},missing_dispatch:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["coverage","missing_dispatch","invalid_terminal_span"],type:"object"}]},WorkObservedExecutionOrderBasisV1:{enum:["terminal_observed_at_then_admitted_projection_sequence_then_attempt_identity"],type:"string"},WorkObservedExecutionV1:{additionalProperties:!1,properties:{admitted_projection_sequence:{format:"uint64",minimum:0,type:"integer"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},observed_at:{$ref:"#/$defs/UtcMicros"},ordinal:{description:"One-based order assigned after sorting the durable terminal instants.",format:"uint32",minimum:0,type:"integer"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["ordinal","identity","admitted_projection_sequence","observed_at","state","evidence_digest"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,properties:{attempt_coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},observed_order:{items:{$ref:"#/$defs/WorkObservedExecutionV1"},type:"array"},order_basis:{$ref:"#/$defs/WorkObservedExecutionOrderBasisV1"},spans:{items:{$ref:"#/$defs/WorkExecutionSpanV1"},type:"array"},state:{const:"listed",type:"string"},timing_coverage:{$ref:"#/$defs/WorkExecutionTimingCoverageV1"}},required:["state","spans","observed_order","order_basis","attempt_coverage","timing_coverage"],type:"object"}],title:"WorkExecutionHistoryV1"},{$defs:{ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkExpertiseCategoryV1:$V,WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{evidence_not_before:{$ref:"#/$defs/UtcMicros",description:"Evidence before this owner-supplied horizon is excluded as stale."},expertise_categories:{description:"Categories for which the returned context will be used ephemerally.",items:{$ref:"#/$defs/WorkExpertiseCategoryV1"},type:"array",uniqueItems:!0},limit:{format:"uint32",minimum:0,type:"integer"},observed_at:{$ref:"#/$defs/UtcMicros"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["selection","task_id","verified_version","evidence_not_before","expertise_categories","limit","observed_at"],title:"WorkExperienceRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProposalId:_8,ProviderId:vo,RetrievalAnchorId:vI,RunId:vF,SessionId:v8,TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptEvidenceRecordV1:b4,WorkAttemptIdentityV1:b6,WorkAttemptProviderOutcomeV1:b7,WorkAttemptReceiptV1:$e,WorkAttemptStreamChannelV1:$r,WorkAttemptStreamSummaryV1:$i,WorkExperienceApplicabilityV1:{enum:["same_accepted_route","same_milestone"],type:"string"},WorkExperienceCandidateV1:{additionalProperties:!1,properties:{applicability:{description:"Separate declared applicability facts. This is intentionally not a\nscore and candidates remain in canonical TaskId order.",items:{$ref:"#/$defs/WorkExperienceApplicabilityV1"},type:"array",uniqueItems:!0},attempt_receipts:{description:"Exact receipts for accepted successful attempts whose sealed provider\nevidence and declared artifacts establish reusable observed work. The\nidentity is also the canonical `work_retrieve_evidence` drill target.",items:{$ref:"#/$defs/WorkAttemptReceiptV1"},type:"array"},evidence:{description:"Exact anchored evidence establishing that this is observed experience.",items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},item:{$ref:"#/$defs/WorkItemV1"}},required:["item","evidence","attempt_receipts","applicability"],type:"object"},WorkExperienceCoverageV1:{oneOf:[{additionalProperties:!1,properties:{coverage:{const:"unavailable",type:"string"}},required:["coverage"],type:"object"},{additionalProperties:!1,properties:{applicable:{format:"uint32",minimum:0,type:"integer"},coverage:{const:"complete",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"},stale_excluded:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","applicable","stale_excluded"],type:"object"},{additionalProperties:!1,properties:{applicable:{format:"uint32",minimum:0,type:"integer"},coverage:{const:"partial",type:"string"},omitted_by_limit:{format:"uint32",minimum:0,type:"integer"},returned:{format:"uint32",minimum:0,type:"integer"},stale_excluded:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","applicable","stale_excluded","omitted_by_limit"],type:"object"}]},WorkExpertiseAuthorizationV1:{oneOf:[{additionalProperties:!1,properties:{availability:{const:"available",type:"string"},categories:{items:{$ref:"#/$defs/WorkExpertiseCategoryV1"},type:"array",uniqueItems:!0},durability:{$ref:"#/$defs/WorkExpertiseContextDurabilityV1"},expires_at:{$ref:"#/$defs/UtcMicros"},pin:{$ref:"#/$defs/WorkExpertiseConsentPinV1"}},required:["availability","categories","expires_at","pin","durability"],type:"object"},{additionalProperties:!1,properties:{availability:{const:"unavailable",type:"string"},legal_actions:{items:{$ref:"#/$defs/WorkExpertiseLegalActionV1"},type:"array",uniqueItems:!0},pin:{$ref:"#/$defs/WorkExpertiseConsentPinV1"},reasons:{items:{$ref:"#/$defs/WorkExpertiseUnavailableReasonV1"},type:"array",uniqueItems:!0}},required:["availability","reasons","legal_actions","pin"],type:"object"}]},WorkExpertiseCategoryV1:$V,WorkExpertiseConsentPinV1:{additionalProperties:!1,properties:{configuration_digest:{$ref:"#/$defs/ManifestDigest"},configuration_revision:{$ref:"#/$defs/ConfigurationRevisionId"},configuration_snapshot:{$ref:"#/$defs/ConfigurationSnapshotId"},provenance_digest:{$ref:"#/$defs/ManifestDigest"}},required:["configuration_revision","configuration_snapshot","configuration_digest","provenance_digest"],type:"object"},WorkExpertiseContextDurabilityV1:{oneOf:[{const:"ephemeral_only",description:"Context is returned for this read only and cannot establish evidence,\nrouting, proposal acceptance, execution admission, or completion.",type:"string"}]},WorkExpertiseLegalActionV1:{enum:["grant_user_consent","grant_project_consent","renew_user_consent","renew_project_consent","allow_requested_categories"],type:"string"},WorkExpertiseUnavailableReasonV1:{enum:["user_consent_disabled","project_consent_disabled","user_consent_not_yet_effective","project_consent_not_yet_effective","user_consent_expired","project_consent_expired","requested_category_not_allowed"],type:"string"},WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkItemInputV1:$M,WorkItemV1:$N,WorkProviderAvailabilityV1:So,WorkProviderBackendV1:Sn,WorkProviderFallbackRecordV1:Sa,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{candidates:{items:{$ref:"#/$defs/WorkExperienceCandidateV1"},type:"array"},coverage:{$ref:"#/$defs/WorkExperienceCoverageV1"},evidence_not_before:{$ref:"#/$defs/UtcMicros"},expertise:{$ref:"#/$defs/WorkExpertiseAuthorizationV1"},observed_at:{$ref:"#/$defs/UtcMicros"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["task_id","verified_version","evidence_not_before","observed_at","expertise","candidates","coverage"],title:"WorkExperienceV1",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,ProposalId:_8,RepositoryId:vb,TaskId:bT,UtcMicros:bZ,WorkEvidenceFrontierV1:$v,WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Read-only proposal generation over one exact current product graph.",properties:{live_git_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}],default:null},occurred_at:{$ref:"#/$defs/UtcMicros"},proposal_id:{$ref:"#/$defs/ProposalId"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","proposal_id","occurred_at"],title:"GenerateProposalRequest",type:"object"},{$defs:{ConfigurationRevisionId:hM,ManifestDigest:_l,PolicyIdentifierV1:{description:"A bounded, canonical identifier owned by the policy input schema.\n\nIt represents immutable references only; it is never a path, display\nlabel, provider account, branch name, or native object identifier.",type:"string"},ProposalId:_8,ProviderId:vo,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCalibratedSizingV1:{additionalProperties:!1,description:"Calibrated sizing. Emitted ONLY when support >= floor. Every field is\nnamed separately (Plan 06); `support_floor` carries the governing floor\ninto the record.",properties:{band:{$ref:"#/$defs/WorkOrdinalBandV1",description:"The sizing band itself: the stronger of the route's declared effort and\nthe derived shape magnitude, widened when the cohort error is high."},cohort:{description:"Identity of the cohort the sizing was calibrated over: the top-ranked\nroute id. Sizing from one cohort is never reused for another.",type:"string"},drift_valid:{description:"False when the cohort contains incomparable or stale observations, so a\nconsumer can refuse a sizing that drifted rather than silently trust it.",type:"boolean"},error:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Observed adverse-outcome band over the cohort. An ordinal band, never a\nrate and never a probability."},horizon:{$ref:"#/$defs/UtcMicros",description:"Latest comparable observation in the cohort. Nothing after\n`evaluated_at` contributes, so the horizon never runs ahead of the input."},support:{description:"Count of comparable in-cohort outcomes backing this sizing.",format:"uint32",minimum:0,type:"integer"},support_floor:{description:"The floor that governed this emission, carried so replay shows which\nfloor applied rather than assuming the current constant.",format:"uint32",minimum:0,type:"integer"}},required:["cohort","horizon","support","support_floor","error","drift_valid","band"],type:"object"},WorkCalibrationEvidenceV1:{additionalProperties:!1,description:"Raw calibration values and their exact decision provenance.\n\nNo rate, probability, or composite score is derived here. Consumers see\nthe authority-supplied outcome rows, categorical uncertainty, and exact\ndenominator counts that produced the proposal's existing calibrated sizing.",properties:{cohort_route:{type:["string","null"]},comparable_outcomes:{format:"uint32",minimum:0,type:"integer"},eligible_route_count:{format:"uint32",minimum:0,type:"integer"},incomparable_outcomes:{format:"uint32",minimum:0,type:"integer"},provenance:{$ref:"#/$defs/WorkCalibrationProvenanceV1"},raw_outcomes:{items:{$ref:"#/$defs/WorkPriorOutcomeV1"},type:"array"},routes_with_outcomes:{format:"uint32",minimum:0,type:"integer"},uncertainty:{$ref:"#/$defs/WorkCalibrationUncertaintyV1"}},required:["raw_outcomes","eligible_route_count","routes_with_outcomes","comparable_outcomes","incomparable_outcomes","uncertainty","provenance"],type:"object"},WorkCalibrationProvenanceV1:{additionalProperties:!1,properties:{configuration_digest:{$ref:"#/$defs/ManifestDigest"},configuration_revision:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},evaluated_at:{$ref:"#/$defs/UtcMicros"},evaluator_id:{type:"string"},evaluator_revision:{format:"uint64",minimum:0,type:"integer"},input_digest:{$ref:"#/$defs/ManifestDigest"},local_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}]}},required:["evaluator_id","evaluator_revision","input_digest","configuration_digest","evaluated_at"],type:"object"},WorkCalibrationUncertaintyV1:{enum:["supported","sparse","stale","incomparable"],type:"string"},WorkDecompositionProposalV1:{additionalProperties:!1,description:"A one-level decomposition proposal. Never recursive: a deeper split is a\nseparate sequenced capability, not something this evaluator may invent.",properties:{candidates:{description:"The proposed sketches, ordinal ascending from 0.",items:{$ref:"#/$defs/WorkSubtaskSketchV1"},type:"array"},rationale:{description:"Why the proposal was emitted, in the same ordered reason vocabulary the\ndecision uses.",items:{$ref:"#/$defs/WorkProposalReasonV1"},type:"array"}},required:["candidates","rationale"],type:"object"},WorkEvidenceFrontierV1:$v,WorkFrontierComparisonV1:{description:"Recorded relation between the two supplied frontiers. `Incomparable` means\nat least one side was absent; it is not collapsed into agreement.",enum:["agree","disagree","incomparable"],type:"string"},WorkOrdinalBandV1:$U,WorkPriorOutcomeV1:{additionalProperties:!1,description:"Cohort denominator. APPLICATION-supplied, never worker-supplied.\n\nA worker cannot widen its own calibration cohort, so a route cannot earn\ncalibrated sizing by reporting its own successes.",properties:{accepted:{description:"Whether the produced work was accepted.",type:"boolean"},escaped_defect:{description:"Whether a defect escaped review.",type:"boolean"},observed_at:{$ref:"#/$defs/UtcMicros",description:"When the outcome was observed. Outcomes later than `evaluated_at` are\nINCOMPARABLE and are excluded from support rather than trusted."},rework:{description:"Whether the accepted work required rework.",type:"boolean"},route_id:{description:"The route this outcome belongs to. May name a retired route; only\noutcomes matching the top-ranked route form the sizing cohort.",type:"string"},terminal:{$ref:"#/$defs/WorkPriorTerminalV1",description:"How the attempt terminated."}},required:["route_id","accepted","rework","escaped_defect","terminal","observed_at"],type:"object"},WorkPriorTerminalV1:{description:"How a prior attempt on a route ended. Recorded, never inferred.",enum:["succeeded","failed","timed_out","cancelled"],type:"string"},WorkProposalActionV1:{description:"The explicit command the decision recommends next. A recommendation never\nexecutes; each action names a separate version-checked application command.",enum:["proceed_to_acceptance","hold_for_dependencies","admit_execution","replan"],type:"string"},WorkProposalDecisionV1:{additionalProperties:!1,description:"One explained, replayable work-loop decision.",properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},configuration_revision:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},decomposition:{anyOf:[{$ref:"#/$defs/WorkDecompositionProposalV1"},{type:"null"}],description:"One-level decomposition sketch, present only when more than one\ndependency is unresolved."},deterministic_fallback:{description:"True when the recommendation is the declared deterministic baseline\nselected because the evidence cannot support a stronger claim.",type:"boolean"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},evaluator_id:{$ref:"#/$defs/PolicyIdentifierV1"},evaluator_revision:{format:"uint64",minimum:0,type:"integer"},frontier_comparison:{$ref:"#/$defs/WorkFrontierComparisonV1"},input_digest:{$ref:"#/$defs/ManifestDigest"},live_git_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}],description:"The live Git frontier, returned exactly as supplied."},local_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}],description:"The local code/session frontier, returned exactly as supplied."},ordered_reason_codes:{items:{$ref:"#/$defs/WorkProposalReasonV1"},type:"array"},policy_digest:{$ref:"#/$defs/ManifestDigest"},policy_revision:{format:"uint64",minimum:0,type:"integer"},recommended_action:{anyOf:[{$ref:"#/$defs/WorkProposalActionV1"},{type:"null"}]},route_plan:{anyOf:[{$ref:"#/$defs/WorkRoutePlanV1"},{type:"null"}],description:"The explained route plan. Present on every evaluation that reached the\ngates, including the one that found no eligible route."},shape:{anyOf:[{$ref:"#/$defs/WorkTaskShapeV1"},{type:"null"}],description:"Derived task shape. Absent on the invalid, cancelled, and deadline\nshort-circuits, where no planner claim is licensed."},sizing:{anyOf:[{$ref:"#/$defs/WorkCalibratedSizingV1"},{type:"null"}],description:"Calibrated sizing, present only when in-cohort support reached the\ngoverning floor. Absence is a recorded fact, never a fabricated estimate."},task_id:{$ref:"#/$defs/TaskId"}},required:["evaluator_id","evaluator_revision","input_digest","task_id","based_on_version","policy_revision","policy_digest","configuration_digest","disposition","deterministic_fallback","ordered_reason_codes","frontier_comparison"],type:"object"},WorkProposalDispositionV1:{description:"Exactly one disposition per decision.",enum:["allow","deny","abstain","indeterminate"],type:"string"},WorkProposalReasonV1:{enum:["invalid_request","request_cancelled","deadline_exceeded","frontier_agreement","frontier_disagreement","frontier_incomparable","task_accepted","runtime_coverage_partial","runtime_coverage_unavailable","terminal_evidence_observed","execution_in_flight","proposal_accepted","dependencies_unresolved","ready","insufficient_calibration_support","route_budget_exceeded","route_content_location_refused","route_evidence_sparse","route_evidence_stale","human_override_applied","no_eligible_routes","deterministic_baseline_selected"],type:"string"},WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRankedRouteV1:{additionalProperties:!1,description:"Ranked route. Dimensions stay SEPARATE. No scalar score field is permitted here.",properties:{autonomy:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Autonomy fitness, echoed unmerged."},correctness:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Correctness fitness, echoed so the ranking can be audited without the input."},cost:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Cost fitness, oriented so `Highest` is best-fitting."},evidence_quality:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Evidence-quality fitness, echoed unmerged."},latency:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Latency fitness, oriented so `Highest` is best-fitting."},rank:{description:"Position in the ranking, ascending from 1.",format:"uint32",minimum:0,type:"integer"},route_id:{description:"The ranked route's identity.",type:"string"},sensitive_data_fitness:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Sensitive-data fitness, echoed unmerged."}},required:["rank","route_id","correctness","sensitive_data_fitness","latency","cost","autonomy","evidence_quality"],type:"object"},WorkRouteDecisionV1:S_,WorkRouteExclusionV1:{additionalProperties:!1,description:"One refused route and the single reason that refused it. Exclusion is\nrecorded rather than silent so a missing route is always explained.",properties:{reason:{$ref:"#/$defs/WorkProposalReasonV1",description:"The first limit the route failed, in the declared exclusion order."},route_id:{description:"The refused route's identity.",type:"string"}},required:["route_id","reason"],type:"object"},WorkRoutePlanV1:{additionalProperties:!1,description:"The explained route plan for one decision. Recommends; never dispatches.",properties:{coverage:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Fraction-free ordinal coverage of the cohort evidence over the ranked set."},deterministic_baseline:{description:"The declared deterministic baseline, selected when evidence cannot support a\nstronger claim. Always names a route that survived exclusion, or None when none did.",type:["string","null"]},exclusions:{description:"Every refused route with its reason, in supplied order.",items:{$ref:"#/$defs/WorkRouteExclusionV1"},type:"array"},human_override_applied:{description:"True only when a recorded human override named a route that survived\nexclusion. An excluded or unknown override leaves ranking untouched.",type:"boolean"},ranked:{description:"Surviving routes in total, deterministic order, rank ascending from 1.",items:{$ref:"#/$defs/WorkRankedRouteV1"},type:"array"},uncertainty:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Widens on sparse / stale / incomparable evidence."}},required:["ranked","exclusions","coverage","uncertainty","human_override_applied"],type:"object"},WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkSubtaskSketchV1:{additionalProperties:!1,description:"One level only (Q3). Read-only sketch; accepting it stays a separate version-checked command.",properties:{ordinal:{description:"Position in the proposal, ascending from 0. Stable across replays of the\nsame input.",format:"uint32",minimum:0,type:"integer"},shape:{$ref:"#/$defs/WorkTaskShapeKindV1",description:"Kind the sketch would carry if it were accepted as its own task."},summary:{description:"What the sketch covers, phrased from the declared counts alone.",type:"string"}},required:["ordinal","summary","shape"],type:"object"},WorkTaskShapeKindV1:{description:"Kind of work the snapshot facts describe. Derived only from facts already in\nthe input; `Unclassified` when those facts do not distinguish a kind.",enum:["investigation","change","synthesis","unclassified"],type:"string"},WorkTaskShapeV1:{additionalProperties:!1,description:"The derived shape of the task: what kind of work it is and how large the\ndeclared dependency and evidence counts make it.",properties:{band:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Magnitude band derived from the declared dependency and evidence counts."},kind:{$ref:"#/$defs/WorkTaskShapeKindV1",description:"Kind derived from the gate booleans and counts. No new discovery."}},required:["kind","band"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"A canonical product proposal and the exact verified graph that licensed it.\n\n`proposal` can be moved directly into a `DecideWorkProposalRequestV1`;\ncallers use `verified_graph_version` to construct that mutation's CAS pin.",properties:{calibration:{$ref:"#/$defs/WorkCalibrationEvidenceV1"},decision:{$ref:"#/$defs/WorkProposalDecisionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["proposal","verified_graph_version","decision","calibration"],title:"GeneratedWorkProposal",type:"object"},{$defs:{WorkAttemptListCursorV1:b9},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One authority-scoped artifact hydration request, paged like the attempt\nlist and pinned to the same verified topology generation.",properties:{cursor:{anyOf:[{$ref:"#/$defs/WorkAttemptListCursorV1"},{type:"null"}],default:null},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],title:"WorkArtifactHydrationRequestV1",type:"object"},{$defs:{AttemptId:fW,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProviderId:vo,RunId:vF,SessionId:v8,TaskId:bT,UtcMicros:bZ,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptArtifactsV1:{additionalProperties:!1,description:"The artifacts and evidence one attempt declared.",properties:{artifacts:{description:"Every artifact reference the attempt declared, in its canonical\nstored order. References carry digest and byte length; bytes are\nnever part of this read.",items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},evidence:{$ref:"#/$defs/WorkAttemptEvidenceStateV1"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["identity","artifacts","evidence"],type:"object"},WorkAttemptEvidenceRecordV1:b4,WorkAttemptEvidenceStateV1:{description:"Whether an attempt's terminal evidence has been sealed. An attempt that\nhas not reported an outcome yet is a typed state, not a missing record.",oneOf:[{additionalProperties:!1,description:"The attempt has not sealed terminal evidence yet.",properties:{state:{const:"pending",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The sealed terminal evidence record, exactly as it was written.",properties:{record:{$ref:"#/$defs/WorkAttemptEvidenceRecordV1"},state:{const:"sealed",type:"string"}},required:["state","record"],type:"object"}]},WorkAttemptIdentityV1:b6,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptProviderOutcomeV1:b7,WorkAttemptStreamChannelV1:$r,WorkAttemptStreamSummaryV1:$i,WorkAttemptTopologyBindingV1:$o,WorkProviderAvailabilityV1:So,WorkProviderBackendV1:Sn,WorkProviderFallbackRecordV1:Sa,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One authority-scoped artifact hydration read. Absence of any Work in\nscope is a typed state, distinct from an authorized-but-empty page.",oneOf:[{additionalProperties:!1,description:"No Work exists in this authority scope, so there is no attempt set to\nhydrate. Concealed scopes never reach this state: they are refused as\nnot-found-or-not-authorized before any read.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"One page of attempt artifact sets under the verified topology\nsnapshot.",properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptArtifactsV1"},type:"array"},coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},state:{const:"hydrated",type:"string"},topology:{$ref:"#/$defs/WorkAttemptTopologyBindingV1"}},required:["state","topology","attempts","coverage"],type:"object"}],title:"WorkArtifactHydrationV1"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptTopologyBindingV1:$o,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One authority-scoped attempt-list read. Absence of any Work in scope is a\ntyped state, distinct from an authorized-but-empty page.",oneOf:[{additionalProperties:!1,description:"No Work exists in this authority scope, so there is no attempt set to\npage. Concealed scopes never reach this state: they are refused as\nnot-found-or-not-authorized before any read.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"One page of durable attempts under the verified topology snapshot.",properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"},coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},state:{const:"listed",type:"string"},topology:{$ref:"#/$defs/WorkAttemptTopologyBindingV1"}},required:["state","topology","attempts","coverage"],type:"object"}],title:"WorkAttemptListV1"},{$defs:{AcceptWorkTaskRequestV1:{additionalProperties:!1,properties:{evidence_by_criterion:{additionalProperties:{type:"string"},type:"object"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","evidence_by_criterion","mutation"],type:"object"},ActorId:fb,AddWorkTaskRequestV1:{additionalProperties:!1,properties:{item:{$ref:"#/$defs/WorkItemV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","item","mutation"],type:"object"},AdmitWorkExecutionRequestV1:{additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","based_on_version","mutation"],type:"object"},ApplyWorkRelationReplanRequestV1:{additionalProperties:!1,properties:{mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal_id:{$ref:"#/$defs/ProposalId"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal_id","mutation"],type:"object"},AttemptId:fW,CatalogGenerationId:hp,ConfigurationRevisionId:hM,CreateWorkProductRequestV1:{additionalProperties:!1,properties:{initial_graph:{$ref:"#/$defs/WorkProductGraphV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","initial_graph","mutation"],type:"object"},CreateWorkTaskRequestV1:{additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},plan:{$ref:"#/$defs/WorkPlanV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","initiative","plan","milestone","item","mutation"],type:"object"},DecideWorkProposalRequestV1:{additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],type:"object"},DecideWorkRelationReplanRequestV1:{additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],type:"object"},LinkAcceptedWorkAttemptRequestV1:{additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","based_on_version","identity","mutation"],type:"object"},ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RecordWorkHandoffRequestV1:{additionalProperties:!1,properties:{handoff:{$ref:"#/$defs/WorkHandoffV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","handoff","mutation"],type:"object"},RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductGraphV1:$4,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Closed public mutation surface for the Work-product graph authority.",oneOf:[{properties:{mutation:{const:"create",type:"string"},request:{$ref:"#/$defs/CreateWorkProductRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"add_task",type:"string"},request:{$ref:"#/$defs/AddWorkTaskRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"create_task",type:"string"},request:{$ref:"#/$defs/CreateWorkTaskRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"decide_proposal",type:"string"},request:{$ref:"#/$defs/DecideWorkProposalRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"decide_relation_replan",type:"string"},request:{$ref:"#/$defs/DecideWorkRelationReplanRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"apply_relation_replan",type:"string"},request:{$ref:"#/$defs/ApplyWorkRelationReplanRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"accept_task",type:"string"},request:{$ref:"#/$defs/AcceptWorkTaskRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"admit_execution",type:"string"},request:{$ref:"#/$defs/AdmitWorkExecutionRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"link_accepted_attempt",type:"string"},request:{$ref:"#/$defs/LinkAcceptedWorkAttemptRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"record_handoff",type:"string"},request:{$ref:"#/$defs/RecordWorkHandoffRequestV1"}},required:["mutation","request"],type:"object"}],title:"WorkProductMutationRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlReasonV1:S$},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_authority_version:{default:null,description:'The authority version the caller read. Absent means "no control row was\npublished yet"; a mismatch is a conflict, never an overwrite.',format:"uint64",minimum:0,type:["integer","null"]},occurred_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/WorkRunControlReasonV1"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","reason","occurred_at"],title:"PauseWorkRunCommand",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlAuthorityV1:Sb,WorkRunControlReasonV1:S$,WorkRunControlStateV1:SS,WorkRunDeadlineCheckpointV1:Sk},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One run's durable control aggregate.",properties:{authority:{$ref:"#/$defs/WorkRunControlAuthorityV1"},deadline:{$ref:"#/$defs/WorkRunDeadlineCheckpointV1"},fenced_attempts:{description:'The exact attempts that were live when the current state published.\nEmpty means "none were live", never "we did not look".',items:{$ref:"#/$defs/AttemptId"},type:"array"},reason:{anyOf:[{$ref:"#/$defs/WorkRunControlReasonV1"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},state:{$ref:"#/$defs/WorkRunControlStateV1"},task_id:{$ref:"#/$defs/TaskId"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","run_id","state","authority","deadline","transitioned_at","fenced_attempts"],title:"WorkRunControlV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementKindV1:$B,WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{occurred_at:{$ref:"#/$defs/UtcMicros"},run_id:{$ref:"#/$defs/RunId"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","target","occurred_at"],title:"WorkPlacementPreflightRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementObservationV1:{additionalProperties:!1,description:'What was actually observed at the target, in counts rather than prose.\n\nCounts are measurements: a zero is "we looked and found none", and\n`readable: false` is the separate state for "we could not look". Collapsing\nthem would let an unreadable target read as a clean one.',properties:{active_holder:{description:"Whether another admitted placement already holds this target.",type:"boolean"},dirty_tracked_paths:{description:"Tracked paths that differ from the index or HEAD.",format:"uint32",minimum:0,type:"integer"},network_required:{description:"Whether the declared network-free placement would require network.",type:"boolean"},observed_at:{$ref:"#/$defs/UtcMicros"},readable:{description:"Whether the target could be read at all.",type:"boolean"},unique_commits:{description:'Commits in the target reachable from nowhere else.\n\n`None` means reachability was not measured, and it blocks removal\nexactly as a positive count does: an unmeasured target is "unknown"\nand is retained rather than assumed worthless. Only removal consults\nthis; admission does not.',format:"uint32",minimum:0,type:["integer","null"]},untracked_paths:{description:"Untracked paths present in the target.",format:"uint32",minimum:0,type:"integer"}},required:["dirty_tracked_paths","untracked_paths","readable","active_holder","network_required","observed_at"],title:"WorkPlacementObservationV1",type:"object"},WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One placement preflight reading: what was asked for, what was seen, and\nexactly what blocks it.",properties:{blockers:{items:{$ref:"#/$defs/WorkPlacementBlockerV1"},type:"array",uniqueItems:!0},identity:{$ref:"#/$defs/WorkPlacementIdentityV1"},observation:{$ref:"#/$defs/WorkPlacementObservationV1"},target:{$ref:"#/$defs/WorkPlacementTargetV1"}},required:["identity","target","observation","blockers"],title:"WorkPlacementPreflightV1",type:"object"},{$defs:{RunId:vF,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id"],title:"WorkPlacementStatusRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J,WorkPlacementV1:$Z},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One placement reading. Absence is a state, not an empty placement.",oneOf:[{additionalProperties:!1,description:"No placement was ever admitted for this run.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The durable placement relation.",properties:{placement:{$ref:"#/$defs/WorkPlacementV1"},state:{const:"placed",type:"string"}},required:["state","placement"],type:"object"}],title:"WorkPlacementReadingV1"},{$defs:{AttemptId:fW,CoverageStateV1:yf,DuplicateEffectOutcomeV1:yP,DuplicateEffortKindV1:yV,QuantityEvidenceClassV1:vs,RunId:vF,TaskId:bT,WorkAttemptIdentityV1:b6,WorkDuplicateAdjudicationQuantitiesV1:$f},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Operator judgment before the owning Work authority binds exact current\ngenerations, relation revision, command identity, and observation time.",properties:{first_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},quantities:{$ref:"#/$defs/WorkDuplicateAdjudicationQuantitiesV1"},reason:{type:"string"},second_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},verdict:{$ref:"#/$defs/DuplicateEffortKindV1"}},required:["first_attempt","second_attempt","verdict","quantities","reason"],title:"PrepareWorkDuplicateAdjudicationRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductChangeDraftV1:{description:"Operator-selected graph change before the owning Work authority binds the\ncurrent verified head and revision authorities.",oneOf:[{properties:{change:{const:"add_task",type:"string"},item:{$ref:"#/$defs/WorkItemV1"}},required:["change","item"],type:"object"},{properties:{change:{const:"create_task",type:"string"},initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"}},required:["change","initiative","plan","milestone","item"],type:"object"},{properties:{change:{const:"decide_proposal",type:"string"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["change","proposal","disposition"],type:"object"},{properties:{change:{const:"decide_relation_replan",type:"string"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["change","proposal","disposition"],type:"object"},{properties:{change:{const:"apply_relation_replan",type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"}},required:["change","proposal_id"],type:"object"},{properties:{change:{const:"accept_task",type:"string"},evidence_by_criterion:{additionalProperties:{type:"string"},type:"object"},task_id:{$ref:"#/$defs/TaskId"}},required:["change","task_id","evidence_by_criterion"],type:"object"},{properties:{change:{const:"admit_execution",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["change","task_id"],type:"object"},{properties:{change:{const:"link_accepted_attempt",type:"string"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["change","task_id","identity"],type:"object"},{properties:{change:{const:"record_handoff",type:"string"},handoff:{$ref:"#/$defs/WorkHandoffV1"}},required:["change","handoff"],type:"object"}]},WorkProductEventEvidenceV1:$Y,WorkProductSelectionScopeV1:$7,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Read-only preparation input. Authority identities, clocks, and revision\npins are deliberately absent because the backend owns them.",properties:{causation_event_id:{type:["string","null"]},change:{$ref:"#/$defs/WorkProductChangeDraftV1"},evidence:{items:{$ref:"#/$defs/WorkProductEventEvidenceV1"},type:"array"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","change","evidence"],title:"PrepareWorkProductMutationRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_authority_version:{format:"uint64",minimum:0,type:"integer"},occurred_at:{$ref:"#/$defs/UtcMicros"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","expected_authority_version","occurred_at"],title:"ReleaseWorkPlacementCommand",type:"object"},{$defs:{UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{occurred_at:{$ref:"#/$defs/UtcMicros"}},required:["occurred_at"],title:"ResumeWorkAttemptsCommand",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"What restart recovery did to each open attempt.\n\nThis report never claims that a provider resumed. An attempt in\n`recovery_required` remains fenced under its original identity. This report\ndoes not authorize another launch; an explicit `retry_attempt` must verify\nthe exact recovery fence and effect safety before it can atomically admit a\nnew identity.",properties:{cancelled:{description:"Attempts whose in-flight cancellation was completed during recovery.",items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"},recovery_required:{description:"Attempts fenced onto a new epoch and awaiting an explicit recovery\ndecision.",items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"}},required:["recovery_required","cancelled"],title:"WorkAttemptRecoveryReportV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlReasonV1:S$},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_authority_version:{format:"uint64",minimum:0,type:"integer"},occurred_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/WorkRunControlReasonV1"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","reason","expected_authority_version","occurred_at"],title:"ResumeWorkRunCommand",type:"object"},{$defs:{AttemptId:fW,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProjectId:_4,ProviderId:vo,RepositoryId:vb,RunId:vF,SessionId:v8,TaskId:bT,TemporalModeV1:bW,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAttemptIdentityV1:b6,WorkEvidenceContinuationV1:$_,WorkEvidenceExpansionSelectorV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"anchor",type:"string"},link_id:{type:"string"}},required:["kind","link_id"],type:"object"},{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},kind:{const:"task_session",type:"string"}},required:["kind","attempt"],type:"object"}]},WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7,WorkTaskSessionContinuationV1:ST},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One TaskId-rooted read. The exact Work graph identity remains mandatory on\ncontinuation and expansion requests, so neither an anchor nor a cursor is\nauthority by possession.",properties:{continuation:{anyOf:[{$ref:"#/$defs/WorkEvidenceContinuationV1"},{type:"null"}],default:null},expansion:{anyOf:[{$ref:"#/$defs/WorkEvidenceExpansionSelectorV1"},{type:"null"}],default:null},observed_at:{$ref:"#/$defs/UtcMicros"},page_size:{format:"uint32",minimum:0,type:"integer"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"},temporal:{$ref:"#/$defs/TemporalModeV1"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["selection","task_id","verified_version","temporal","page_size","observed_at"],title:"WorkEvidenceRetrieveRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProposalId:_8,ProviderId:vo,RetrievalAnchorId:vI,RunId:vF,SessionId:v8,SessionRetrievalBudgetAccountingV1:{additionalProperties:!1,description:"The ceiling and count behind a budget refusal.\n\n`stage` names which budget refused; this is what tells an oversized request\napart from a read whose cost was mis-sized for it. The ceiling value also\ndistinguishes the resources inside one stage: a record read that stopped at\n1024 hit the item count, one that stopped at 16 MiB hit the byte total, so\nthe kernel's resource spelling stays in the kernel instead of becoming a\nsecond wire vocabulary to keep in step.",properties:{limit:{format:"uint64",minimum:0,type:"integer"},observed:{$ref:"#/$defs/SessionRetrievalBudgetObservationV1"}},required:["limit","observed"],type:"object"},SessionRetrievalBudgetObservationV1:{description:"What a refusing budget boundary had counted.\n\nBoth variants are exact. A bounded read never counts the rows it declined to\nread, so an exhausted read reports what it consumed and that storage held\nmore, never a total it would have to run the refused scan to learn.",oneOf:[{additionalProperties:!1,description:"The request asked for more units than the admitted maximum.",properties:{observation:{const:"requested",type:"string"},units:{format:"uint64",minimum:0,type:"integer"}},required:["observation","units"],type:"object"},{additionalProperties:!1,description:"The read consumed its whole budget and storage still held more.",properties:{observation:{const:"consumed_with_more_available",type:"string"},units:{format:"uint64",minimum:0,type:"integer"}},required:["observation","units"],type:"object"}]},SessionRetrievalBudgetStageV1:bo,SessionRetrievalStructuralRefusalV1:{oneOf:[{additionalProperties:!1,properties:{kind:{type:"string"},maximum:{format:"uint",minimum:0,type:"integer"},observed:{format:"uint",minimum:0,type:"integer"},refusal:{const:"cursor_manifest_limit_exceeded",type:"string"}},required:["refusal","kind","observed","maximum"],type:"object"},{additionalProperties:!1,properties:{accounting:{anyOf:[{$ref:"#/$defs/SessionRetrievalBudgetAccountingV1"},{type:"null"}],description:"Present when the refusing boundary keeps a counter. A request-shape\ncheck has none and reports `None` rather than inventing numbers."},refusal:{const:"budget_exhausted",type:"string"},stage:{$ref:"#/$defs/SessionRetrievalBudgetStageV1"}},required:["refusal","stage"],type:"object"}]},TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAnchorHydrationV1:{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},content:{items:{type:"string"},type:"array"},continuation:{type:["string","null"]},coverage:{$ref:"#/$defs/WorkEvidenceCoverageStateV1"},exact_anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},freshness:{$ref:"#/$defs/WorkEvidenceFreshnessV1"},redacted:{type:"boolean"}},required:["anchor_id","exact_anchors","content","coverage","freshness","redacted"],type:"object"},WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptEvidenceRecordV1:b4,WorkAttemptIdentityV1:b6,WorkAttemptProviderOutcomeV1:b7,WorkAttemptReceiptV1:$e,WorkAttemptStreamChannelV1:$r,WorkAttemptStreamSummaryV1:$i,WorkEvidenceContinuationV1:$_,WorkEvidenceCoverageStateV1:{enum:["complete","partial","unknown"],type:"string"},WorkEvidenceCoverageV1:{additionalProperties:!1,properties:{hydrated:{format:"uint32",minimum:0,type:"integer"},omitted:{format:"uint32",minimum:0,type:"integer"},selected:{format:"uint32",minimum:0,type:"integer"},state:{$ref:"#/$defs/WorkEvidenceCoverageStateV1"}},required:["state","selected","hydrated","omitted"],type:"object"},WorkEvidenceFreshnessV1:{enum:["current","stale","unknown"],type:"string"},WorkEvidenceOmissionReasonV1:{oneOf:[{enum:["limit_reached","pending","not_found_or_not_authorized","unavailable","reset_required","stale","cancelled","timed_out","redacted"],type:"string"},{additionalProperties:!1,properties:{structural_refusal:{$ref:"#/$defs/SessionRetrievalStructuralRefusalV1"}},required:["structural_refusal"],type:"object"}]},WorkEvidenceOmissionV1:{additionalProperties:!1,properties:{reason:{$ref:"#/$defs/WorkEvidenceOmissionReasonV1"},relation:{type:"string"}},required:["relation","reason"],type:"object"},WorkEvidenceSourceV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"attempt_receipt",type:"string"},receipt:{$ref:"#/$defs/WorkAttemptReceiptV1"}},required:["kind","receipt"],type:"object"},{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},evidence:{$ref:"#/$defs/WorkTaskSessionEvidenceV1"},kind:{const:"task_session",type:"string"}},required:["kind","attempt","evidence"],type:"object"},{additionalProperties:!1,properties:{hydration:{$ref:"#/$defs/WorkAnchorHydrationV1"},kind:{const:"anchor",type:"string"},link:{$ref:"#/$defs/TaskEvidenceLinkV1"}},required:["kind","link","hydration"],type:"object"}]},WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkItemInputV1:$M,WorkItemV1:$N,WorkProductRelationV1:$5,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderAvailabilityV1:So,WorkProviderBackendV1:Sn,WorkProviderFallbackRecordV1:Sa,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTaskSessionContinuationV1:ST,WorkTaskSessionCoverageV1:{additionalProperties:!1,properties:{hidden:{format:"uint64",minimum:0,type:"integer"},redacted:{format:"uint64",minimum:0,type:"integer"},unknown:{format:"uint64",minimum:0,type:"integer"},visible:{format:"uint64",minimum:0,type:"integer"}},required:["visible","hidden","unknown","redacted"],type:"object"},WorkTaskSessionEvidenceV1:{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},continuation:{anyOf:[{$ref:"#/$defs/WorkTaskSessionContinuationV1"},{type:"null"}]},coverage:{$ref:"#/$defs/WorkEvidenceCoverageStateV1"},coverage_counts:{$ref:"#/$defs/WorkTaskSessionCoverageV1"},freshness:{$ref:"#/$defs/WorkEvidenceFreshnessV1"},hydrated:{items:{$ref:"#/$defs/WorkTaskSessionHydrationV1"},type:"array"},participant_epoch:{$ref:"#/$defs/ManifestDigest"},ranked_anchors:{items:{$ref:"#/$defs/WorkTaskSessionRankedAnchorV1"},type:"array"},redacted:{type:"boolean"},source:{$ref:"#/$defs/ObservationSourceIdentityV1"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["task_id","verified_version","attempt","source","participant_epoch","ranked_anchors","hydrated","coverage","coverage_counts","freshness","redacted"],type:"object"},WorkTaskSessionHydrationStateV1:{enum:["available","retained_but_unavailable","redacted","deleted","retention_expired","unauthorized","locked","unverifiable"],type:"string"},WorkTaskSessionHydrationV1:{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},content:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:["array","null"]},rank:{format:"uint32",minimum:0,type:"integer"},state:{$ref:"#/$defs/WorkTaskSessionHydrationStateV1"}},required:["rank","anchor_id","state"],type:"object"},WorkTaskSessionRankContributionV1:{additionalProperties:!1,properties:{calibrated_feature_micros:{format:"uint32",minimum:0,type:"integer"},calibration_profile:{type:"string"},ordinal_rank:{format:"uint32",minimum:0,type:"integer"},raw_score_micros:{format:"int64",type:"integer"},retriever:{type:"string"},retriever_revision:{type:"string"},score_domain:{type:"string"},source_occurrence:{type:"string"},weight_micros:{format:"uint32",minimum:0,type:"integer"},weighted_contribution_micros:{format:"uint64",minimum:0,type:"integer"}},required:["retriever","retriever_revision","source_occurrence","ordinal_rank","raw_score_micros","score_domain","calibration_profile","calibrated_feature_micros","weight_micros","weighted_contribution_micros"],type:"object"},WorkTaskSessionRankedAnchorV1:{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},contributions:{items:{$ref:"#/$defs/WorkTaskSessionRankContributionV1"},type:"array"},final_ordinal:{format:"uint32",minimum:0,type:"integer"},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","final_ordinal","utility_micros","contributions"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{continuations:{items:{$ref:"#/$defs/WorkEvidenceContinuationV1"},type:"array"},coverage:{$ref:"#/$defs/WorkEvidenceCoverageV1"},freshness:{$ref:"#/$defs/WorkEvidenceFreshnessV1"},item:{$ref:"#/$defs/WorkItemV1"},omissions:{items:{$ref:"#/$defs/WorkEvidenceOmissionV1"},type:"array"},proposal_decisions:{items:{$ref:"#/$defs/WorkProposalDecisionV1"},type:"array"},redacted:{type:"boolean"},relation_replan_decisions:{items:{$ref:"#/$defs/WorkRelationReplanDecisionV1"},type:"array"},relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},sources:{items:{$ref:"#/$defs/WorkEvidenceSourceV1"},type:"array"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["task_id","verified_version","item","relations","proposal_decisions","relation_replan_decisions","sources","coverage","omissions","freshness","redacted","continuations"],title:"WorkEvidenceRetrievalV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkRetryCauseV1:Sf,WorkRetryFailureSelectorV1:Sh,WorkRetrySourceV1:Sy},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},failure:{$ref:"#/$defs/WorkRetryFailureSelectorV1"},new_attempt_id:{$ref:"#/$defs/AttemptId"},original_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["original_attempt","new_attempt_id","failure","command_id"],title:"RetryWorkAttemptCommandV1",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,RetryWorkAttemptCommandV1:{additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},failure:{$ref:"#/$defs/WorkRetryFailureSelectorV1"},new_attempt_id:{$ref:"#/$defs/AttemptId"},original_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["original_attempt","new_attempt_id","failure","command_id"],title:"RetryWorkAttemptCommandV1",type:"object"},ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,VerifiedWorkRetryFailureV1:{additionalProperties:!1,description:"Failure fact returned by a canonical evidence authority.",properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},selector:{$ref:"#/$defs/WorkRetryFailureSelectorV1"}},required:["selector","evidence_digest","observed_at"],type:"object"},WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkRetryCauseV1:Sf,WorkRetryFailureSelectorV1:Sh,WorkRetryReceiptV1:{additionalProperties:!1,properties:{canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},command:{$ref:"#/$defs/RetryWorkAttemptCommandV1"},failure:{$ref:"#/$defs/VerifiedWorkRetryFailureV1"},new_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},owner_receipt_digest:{$ref:"#/$defs/ManifestDigest"},restarted_at:{$ref:"#/$defs/UtcMicros",description:"Daemon-owned admission time at which the new attempt was created."},retry_required_at:{$ref:"#/$defs/UtcMicros",description:"Exact source-owned time at which the failure made a retry necessary."}},required:["command","failure","new_attempt","retry_required_at","restarted_at","canonical_input_digest","owner_receipt_digest"],type:"object"},WorkRetrySourceV1:Sy,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptV1"},outcome:{const:"created",type:"string"},receipt:{$ref:"#/$defs/WorkRetryReceiptV1"}},required:["outcome","receipt","attempt"],type:"object"},{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptV1"},outcome:{const:"replayed",type:"string"},receipt:{$ref:"#/$defs/WorkRetryReceiptV1"}},required:["outcome","receipt","attempt"],type:"object"}],title:"WorkRetryAttemptOutcomeV1"},{$defs:{CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,ReviewWorkProposalDispositionV1:{description:"The only non-accepting dispositions the proposal-review operation can\ncommit. The broader decision request remains available to the graph\nmutation operation, which owns all decision forms.",enum:["rejected","superseded"],type:"string"},SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCommandId:$p,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/ReviewWorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],title:"ReviewWorkProposalRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id"],title:"WorkRunControlRequestV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlAuthorityV1:Sb,WorkRunControlReasonV1:S$,WorkRunControlStateV1:SS,WorkRunControlV1:{additionalProperties:!1,description:"One run's durable control aggregate.",properties:{authority:{$ref:"#/$defs/WorkRunControlAuthorityV1"},deadline:{$ref:"#/$defs/WorkRunDeadlineCheckpointV1"},fenced_attempts:{description:'The exact attempts that were live when the current state published.\nEmpty means "none were live", never "we did not look".',items:{$ref:"#/$defs/AttemptId"},type:"array"},reason:{anyOf:[{$ref:"#/$defs/WorkRunControlReasonV1"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},state:{$ref:"#/$defs/WorkRunControlStateV1"},task_id:{$ref:"#/$defs/TaskId"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","run_id","state","authority","deadline","transitioned_at","fenced_attempts"],title:"WorkRunControlV1",type:"object"},WorkRunDeadlineCheckpointV1:Sk},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One run's control reading.\n\n`Uncontrolled` is a distinct answer from `Controlled`: it says the run is\nadmitted and running under its admitted deadline with no control transition\never published, which is not the same as a control row that happens to say\n`Running`.",oneOf:[{additionalProperties:!1,description:"The run holds durable attempts but no control transition has ever been\npublished for it.",properties:{deadline:{$ref:"#/$defs/UtcMicros",description:"The admitted deadline the run is running against."},live_attempts:{description:"Attempts that have not reached a terminal state.",items:{$ref:"#/$defs/AttemptId"},type:"array"},state:{const:"uncontrolled",type:"string"},total_attempts:{format:"uint32",minimum:0,type:"integer"}},required:["state","deadline","live_attempts","total_attempts"],type:"object"},{additionalProperties:!1,description:"The published control aggregate, plus the live frontier as of this\nread (which may differ from the frontier the transition fenced).",properties:{control:{$ref:"#/$defs/WorkRunControlV1"},live_attempts:{items:{$ref:"#/$defs/AttemptId"},type:"array"},state:{const:"controlled",type:"string"},total_attempts:{format:"uint32",minimum:0,type:"integer"}},required:["state","control","live_attempts","total_attempts"],type:"object"}],title:"WorkRunControlReadingV1"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Starts one admitted provider attempt. Every field is a typed fact; there\nis no argv, environment entry, executable path, or shell string here. The\nprojection binding and admission facts are re-read from the canonical Work\nauthority, never trusted from the caller.",properties:{attempt_id:{$ref:"#/$defs/AttemptId"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},instructions:{type:"string"},occurred_at:{$ref:"#/$defs/UtcMicros"},operation:{$ref:"#/$defs/WorkflowOperationRef"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"},worktree_root:{type:"string"}},required:["task_id","run_id","attempt_id","operation","execution_snapshot","worktree_root","commit","instructions","effect_state","occurred_at"],title:"StartWorkAttemptCommand",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,StartWorkAttemptCommand:{additionalProperties:!1,description:"Starts one admitted provider attempt. Every field is a typed fact; there\nis no argv, environment entry, executable path, or shell string here. The\nprojection binding and admission facts are re-read from the canonical Work\nauthority, never trusted from the caller.",properties:{attempt_id:{$ref:"#/$defs/AttemptId"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},instructions:{type:"string"},occurred_at:{$ref:"#/$defs/UtcMicros"},operation:{$ref:"#/$defs/WorkflowOperationRef"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"},worktree_root:{type:"string"}},required:["task_id","run_id","attempt_id","operation","execution_snapshot","worktree_root","commit","instructions","effect_state","occurred_at"],type:"object"},TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkAttemptIdentityV1:b6,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Admits one synthesis attempt over an ordered set of sibling sources.",properties:{output_name:{$ref:"#/$defs/WorkflowOutputName",description:"The fan-out output the synthesis belongs to, carried into the draft\nthe workflow completion path verifies."},sources:{description:"The ordered sibling sources the synthesis consumes.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},start:{$ref:"#/$defs/StartWorkAttemptCommand",description:"The synthesis attempt's own admission facts; it is started through\nthe same admission machinery as any other attempt."}},required:["start","output_name","sources"],title:"AdmitWorkSynthesisCommand",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkSynthesisEvidenceGroupV1:Sq,WorkSynthesisRefusalV1:SI,WorkSynthesisSourceEnvelopeV1:Sx,WorkSynthesisSourceOutcomeV1:Sj,WorkSynthesisSourceSetV1:SC,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowSynthesisDraft:SH,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",description:"The typed outcome of a synthesis request: an admitted attempt, or the\nsealed unsynthesized set when synthesis could not truthfully begin.",oneOf:[{additionalProperties:!1,description:"The admitted synthesis attempt and everything it is accountable to.",properties:{attempt:{$ref:"#/$defs/WorkAttemptV1",description:"The leased (or idempotently replayed) synthesis attempt."},draft:{$ref:"#/$defs/WorkflowSynthesisDraft",description:"The citation obligation, complete by construction: the draft cites\nevery citable source digest and is verified downstream by\n[`crate::workflow_synthesis::verify_workflow_synthesis_draft`]."},groups:{description:"Disagreement structure over the succeeded sources.",items:{$ref:"#/$defs/WorkSynthesisEvidenceGroupV1"},type:"array"},source_set:{$ref:"#/$defs/WorkSynthesisSourceSetV1",description:"The sealed source envelopes the attempt was admitted against."},synthesis:{const:"admitted",type:"string"},uncited:{description:"Sources preserved without citations: failures, unknowns, and\nartifact-less successes, in the caller's requested order.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["synthesis","attempt","source_set","groups","draft","uncited"],type:"object"},{properties:{refusal:{$ref:"#/$defs/WorkSynthesisRefusalV1"},sources:{$ref:"#/$defs/WorkSynthesisSourceSetV1"},synthesis:{const:"unsynthesized",type:"string"}},required:["synthesis","sources","refusal"],type:"object"}],title:"WorkSynthesisAttemptV1"},{$defs:{WorkAttemptListCursorV1:b9},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One page-bounded topology view read. The cursor vocabulary is the attempt\nlist's: a cursor minted under a superseded topology generation is a typed\nstaleness refusal, never a silently different page.",properties:{cursor:{anyOf:[{$ref:"#/$defs/WorkAttemptListCursorV1"},{type:"null"}],default:null},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],title:"WorkTopologyViewRequestV1",type:"object"},{$defs:{BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,TaskId:bT,TopologyGatePolicyV1:bH,UtcMicros:bZ,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptTopologyBindingV1:$o,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementReadingV1:{description:"One placement reading. Absence is a state, not an empty placement.",oneOf:[{additionalProperties:!1,description:"No placement was ever admitted for this run.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The durable placement relation.",properties:{placement:{$ref:"#/$defs/WorkPlacementV1"},state:{const:"placed",type:"string"}},required:["state","placement"],type:"object"}],title:"WorkPlacementReadingV1"},WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J,WorkPlacementV1:$Z,WorkTopologyExecutionPlacementV1:{additionalProperties:!1,description:"The execution-placement dimension: the policy's placement mode plus one\nlane per distinct `(task, run)` pair in page order.",properties:{lanes:{items:{$ref:"#/$defs/WorkTopologyPlacementLaneV1"},type:"array"},mode:{$ref:"#/$defs/WorktreePlacementModeV1"}},required:["mode","lanes"],title:"WorkTopologyExecutionPlacementV1",type:"object"},WorkTopologyIntegrationStrategyV1:{additionalProperties:!1,description:"The integration-strategy dimension, read verbatim from the resolved work\ntopology policy the runs in scope are admitted against.",properties:{cross_merge:{$ref:"#/$defs/CrossMergePolicyV1"},gates:{$ref:"#/$defs/TopologyGatePolicyV1"},protected_refs:{items:{$ref:"#/$defs/ProtectedRefRuleV1"},type:"array"}},required:["cross_merge","gates","protected_refs"],title:"WorkTopologyIntegrationStrategyV1",type:"object"},WorkTopologyPlacementLaneV1:{additionalProperties:!1,description:"One execution-placement lane: a distinct `(task, run)` pair from the\nattempt page joined to its durable placement reading. Placement absence is\na state on the lane, not a dropped lane.",properties:{attempt_count:{description:"Attempts this lane carried within the requested page.",format:"uint32",minimum:0,type:"integer"},placement:{$ref:"#/$defs/WorkPlacementReadingV1"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_count","placement"],title:"WorkTopologyPlacementLaneV1",type:"object"},WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ},$schema:"https://json-schema.org/draft/2020-12/schema",description:"The application-owned execution-topology view. Absence of any Work in\nscope is a typed state, distinct from an authorized-but-empty page.",oneOf:[{additionalProperties:!1,description:"No Work exists in this authority scope, so there is no topology to\ndraw. Concealed scopes are refused before any read.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The four dimensions, pinned to one verified topology generation.",properties:{branch_topology:{$ref:"#/$defs/BranchTopologyPolicyV1"},coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},execution_placement:{$ref:"#/$defs/WorkTopologyExecutionPlacementV1"},integration_strategy:{$ref:"#/$defs/WorkTopologyIntegrationStrategyV1"},review_topology:{$ref:"#/$defs/ReviewTopologyPolicyV1"},state:{const:"view",type:"string"},topology:{$ref:"#/$defs/WorkAttemptTopologyBindingV1"}},required:["state","topology","coverage","execution_placement","branch_topology","review_topology","integration_strategy"],type:"object"}],title:"ExecutionTopologyViewV1"},{$defs:{ObservabilityHorizonV1:_W},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One horizon-bounded execution-topology metrics read. The authorized scope\nis taken from the request context, not from the request, so a caller can\nnever widen the population it reads.",properties:{horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},max_events:{description:"Event budget for this read, at most\n[`MAX_EXECUTION_TOPOLOGY_EVENTS_V1`].",format:"uint32",minimum:0,type:"integer"}},required:["horizon","max_events"],title:"ExecutionTopologyMetricsRequestV1",type:"object"},{$defs:{CoverageStateV1:yf,ExecutionBlockedCauseV1:{description:"Cause a work item was blocked for.",enum:["dependency","needs_input","capability","policy","scope","conflict","lease","backpressure","test","ci","review","effect_unknown","other","unknown"],type:"string"},ExecutionConcurrencyPhaseV1:{description:"Concurrency-width phase. `Useful` counts only distinct admitted\nattempts that advanced a committed progress frontier; heartbeats,\nqueued work, child processes, and transport fanout never reach it.",enum:["requested","accepted","admitted","active","useful"],type:"string"},ExecutionConflictKindV1:{description:"Conflict prediction kind. Mechanical and semantic keep separate\ndenominators because their adjudicators are not interchangeable.",enum:["mechanical","semantic","combined"],type:"string"},ExecutionConflictOutcomeV1:{description:"Independently observed conflict outcome. `Censored` and `Unknown`\nnever enter a confusion-matrix denominator.",enum:["conflict","no_conflict","censored","unknown"],type:"string"},ExecutionDeliveryOutcomeV1:{description:"Per-surface delivery outcome. A multi-surface delivery is never a\nduplicate of product work; only `Deduplicated` is.",enum:["delivered","deduplicated","dropped","unknown"],type:"string"},ExecutionDuplicateKindV1:{description:"Adjudicated duplicate-work relation. Similarity, proximity, shared\npaths, and concurrency never produce one of these.",enum:["exact_duplicate","superseded_overlap","repeated_investigation","duplicate_effect","not_duplicate","censored","unknown"],type:"string"},ExecutionDuplicateOutcomeV1:{description:"Whether a duplicate effect was prevented or actually committed. The\ntwo never collapse into one count.",enum:["prevented","committed","unknown","not_applicable"],type:"string"},ExecutionDurationBucketV1:{description:"Fixed duration buckets shared by stale stack age, blocked time, and\nrerun latency. Raw timestamps and exact durations stay authorized\nlocal detail.",enum:["under1m","from1m_to5m","from5m_to15m","from15m_to1h","from1h_to4h","from4h_to24h","from1d_to7d","over7d"],type:"string"},ExecutionFanoutPhaseV1:{description:"Fan-out width phase. `PeakActive` is the sampled active width; the\nfan-out distribution is unweighted so serialized and blocked samples,\nwhich carry no interval, are preserved rather than dropped.",enum:["requested","accepted","admitted","peak_active","useful"],type:"string"},ExecutionGitHubStackCapabilityReadingV1:{additionalProperties:!1,description:"Latest trustworthy GitHub stacked-PR capability observation in the\nhorizon. It is a typed operational state, not a metric or success claim.",properties:{capability:{anyOf:[{$ref:"#/$defs/ExecutionGitHubStackCapabilityV1"},{type:"null"}]},coverage:{$ref:"#/$defs/MetricCoverageV1"},other_forge_fallback_available:{type:["boolean","null"]},standard_git_fallback_available:{type:["boolean","null"]},unavailable:{anyOf:[{$ref:"#/$defs/ExecutionMetricUnavailableV1"},{type:"null"}]}},required:["coverage"],title:"ExecutionGitHubStackCapabilityReadingV1",type:"object"},ExecutionGitHubStackCapabilityV1:{description:"Last bounded GitHub stacked-PR capability state observed in the\nhorizon. This remains orthogonal to GitHub ingress and item lifecycle.",enum:["unavailable","private_preview_disabled","enabled","degraded"],type:"string"},ExecutionIntegrationKindV1:{description:"Integration operation kind. Rebase remains external observation only.",enum:["fast_forward","merge_commit","rebase","cherry_pick","stack_retarget","graph_only","external_observed","unknown"],type:"string"},ExecutionIntegrationOutcomeV1:{description:"Terminal result of an observed native integration.",enum:["succeeded","conflicted","rejected","denied","stale","locked","cancelled","timed_out","failed","partial","effect_unknown","unsupported","unknown"],type:"string"},ExecutionIntervalStateV1:{description:"Whether the owning drift interval is still open or exactly closed.",enum:["open","closed"],type:"string"},ExecutionLeakKindV1:{description:"Independently proved execution-leak class.",enum:["lease_after_terminal","attempt_without_live_owner","effect_unknown_past_deadline","missing_worktree_binding","unbounded_delivery","none","unknown"],type:"string"},ExecutionLeakOutcomeV1:{description:"Recovery state a proved leak reached.",enum:["not_required","pending","recovered","failed","unknown"],type:"string"},ExecutionMetricUnavailableV1:{description:"Why a measurement carries no value. Absence is always one of these typed\nreasons; it is never an empty string, a zero, or a silently dropped row.",oneOf:[{const:"store_unavailable",description:"The observation store could not be read at all for this horizon.",type:"string"},{const:"event_budget_exceeded",description:"The horizon holds more events than one read may draw, so every\ndenominator here would be a partial count presented as a total.",type:"string"},{const:"cell_budget_exceeded",description:"The bounded projection would exceed the Plan 26 result-cell ceiling.\nThe whole read refuses rather than returning a misleading subset.",type:"string"},{const:"no_eligible_evidence",description:"No recorded event in the family supplies this metric's numerator or\ndenominator.",type:"string"},{const:"support_floor_unmet",description:"Eligible cases exist but fall below the metric's support floor.",type:"string"},{const:"coverage_floor_unmet",description:"Observed cases cover less of the eligible population than the metric's\ncoverage floor allows.",type:"string"},{const:"censoring_ceiling_exceeded",description:"More of the eligible population is censored than the metric admits.",type:"string"},{const:"unbounded_interval",description:"The interval this metric integrates over has no proved upper bound, so\nits duration cannot be measured without inventing a terminal.",type:"string"}]},ExecutionQuantityUnitV1:{description:"Quantity unit for duplicate-effort accounting. Each unit is reported\nseparately: wall time, tokens, cost, tests, and effects are never\nsummed into one number.",enum:["wall_micros","tokens","cost_micros","tests","effects"],type:"string"},ExecutionRerunCauseV1:{description:"Typed rerun cause. Repeated logs and transport redelivery are not\nreruns and never carry one of these.",enum:["runtime_retry","runtime_fallback","test_rerun","ci_rerun","recovery","human_requested","unknown"],type:"string"},ExecutionRerunSourceV1:{description:"Which independent system observed the rerun.",enum:["runtime","test","ci"],type:"string"},ExecutionStackDriftKindV1:{description:"Exact reason a stack became stale. The enum is bounded and never\ncarries a branch, ref, worktree, repository, or provider identity.",enum:["head_advanced","base_advanced","merge_base_changed","retargeted","superseded"],type:"string"},ExecutionSurfaceFamilyV1:{description:"Delivery surface family. Addresses, payloads, principals, and\nrecipients are never observed, so the family is the whole label.",enum:["hook","mcp","lsp","dashboard","cli","other"],type:"string"},ExecutionTopologyDimensionV1:{description:"One allowed local grouping dimension. The set is closed by construction:\nevery value is produced by an exhaustive match over a bounded domain class,\nso no person, agent, task, project, repository, worktree, branch, ref,\ncommit, model version, or route can ever appear as a label.",oneOf:[{properties:{dimension:{const:"concurrency_phase",type:"string"},value:{$ref:"#/$defs/ExecutionConcurrencyPhaseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"fanout_phase",type:"string"},value:{$ref:"#/$defs/ExecutionFanoutPhaseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"width_bucket",type:"string"},value:{$ref:"#/$defs/ExecutionWidthBucketV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"duration_bucket",type:"string"},value:{$ref:"#/$defs/ExecutionDurationBucketV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"duplicate_kind",type:"string"},value:{$ref:"#/$defs/ExecutionDuplicateKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"unit",type:"string"},value:{$ref:"#/$defs/ExecutionQuantityUnitV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"duplicate_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionDuplicateOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"conflict_kind",type:"string"},value:{$ref:"#/$defs/ExecutionConflictKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"conflict_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionConflictOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"integration_kind",type:"string"},value:{$ref:"#/$defs/ExecutionIntegrationKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"integration_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionIntegrationOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"stack_drift_kind",type:"string"},value:{$ref:"#/$defs/ExecutionStackDriftKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"interval_state",type:"string"},value:{$ref:"#/$defs/ExecutionIntervalStateV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"blocked_cause",type:"string"},value:{$ref:"#/$defs/ExecutionBlockedCauseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"rerun_source",type:"string"},value:{$ref:"#/$defs/ExecutionRerunSourceV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"rerun_cause",type:"string"},value:{$ref:"#/$defs/ExecutionRerunCauseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"leak_kind",type:"string"},value:{$ref:"#/$defs/ExecutionLeakKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"leak_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionLeakOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"surface",type:"string"},value:{$ref:"#/$defs/ExecutionSurfaceFamilyV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"delivery_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionDeliveryOutcomeV1"}},required:["dimension","value"],type:"object"}]},ExecutionTopologyDrillAnchorV1:{additionalProperties:!1,description:"An opaque cursor minted by the registered observation authority. It can be\nresolved only through that same authorized local query boundary and is not\na metric dimension or exportable identity.",properties:{cursor:{type:"string"}},required:["cursor"],title:"ExecutionTopologyDrillAnchorV1",type:"object"},ExecutionTopologyEmissionCoverageV1:{additionalProperties:!1,description:"Envelope-level delivery evidence for this read. `None` means the store did\nnot answer, so no zero may be inferred. `dropped` is the proved lower bound\nfrom the bound producer scope, deduplicated across explicit loss receipts\nand their next-envelope carriers; it is not attributed to a topology\nfamily. Sampling stays a count of sampled topology envelopes and is never\nexpanded into a fabricated population estimate.",properties:{delayed:{format:"uint64",minimum:0,type:["integer","null"]},dropped:{format:"uint64",minimum:0,type:["integer","null"]},emitted:{format:"uint64",minimum:0,type:["integer","null"]},sampled_events:{format:"uint64",minimum:0,type:["integer","null"]}},title:"ExecutionTopologyEmissionCoverageV1",type:"object"},ExecutionTopologyMeasurementV1:{additionalProperties:!1,description:"One descriptor cell: the Plan 26 descriptor name, its grouping dimensions,\nand the landed metric envelope carrying value, denominator, coverage, and\nprovenance.",properties:{dimensions:{description:"Allowed local grouping dimensions, at most\n[`MAX_METRIC_DIMENSIONS_V1`], in a fixed order per descriptor.",items:{$ref:"#/$defs/ExecutionTopologyDimensionV1"},type:"array"},unavailable:{anyOf:[{$ref:"#/$defs/ExecutionMetricUnavailableV1"},{type:"null"}],description:"Typed absence reason. It is `Some` exactly when `value.value` is\n`None`, so a reader can never mistake a refused metric for a zero."},value:{$ref:"#/$defs/MetricValueV1"}},required:["dimensions","value"],title:"ExecutionTopologyMeasurementV1",type:"object"},ExecutionWidthBucketV1:{description:"Fixed width buckets. Raw widths stay authorized local detail; only\nbucket counts leave the projection.",enum:["zero","one","two","from3_to4","from5_to8","from9_to16","from17_to32","from33_to64","over64"],type:"string"},MetricCalibrationV1:_h,MetricCohortV1:_y,MetricCoverageV1:_g,MetricEvidenceClassV1:__,MetricProvenanceV1:_v,MetricSourceV1:_b,MetricTemporalV1:_$,MetricUncertaintyV1:_S,MetricValueV1:_k,ObservabilityHorizonV1:_W},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The canonical execution-topology read model. Observatory and Costs render\nthis without local formulas; CLI, MCP, and HTTP return the same bytes.",properties:{authorized_scope_ref:{description:"Local authorization anchor the read was admitted under. It is derived\nfrom the resolved scope, never from a caller-supplied string.",type:"string"},coverage:{$ref:"#/$defs/MetricCoverageV1",description:"Family-level coverage over the event population, independent of any\nsingle descriptor's denominator."},current:{description:"True only when the whole family was read with `Known` coverage. A\nfalse value means at least one descriptor below is a typed absence.",type:"boolean"},drill_anchors:{description:"Bounded registered source cursors for authorized local drill-down.\nPayload anchors, traces, and scope identifiers never enter this list.",items:{$ref:"#/$defs/ExecutionTopologyDrillAnchorV1"},type:"array"},emission_coverage:{$ref:"#/$defs/ExecutionTopologyEmissionCoverageV1"},github_stack_capability:{$ref:"#/$defs/ExecutionGitHubStackCapabilityReadingV1"},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},measurements:{items:{$ref:"#/$defs/ExecutionTopologyMeasurementV1"},type:"array"},observed_at_micros:{format:"int64",type:"integer"},watermark:{description:"Watermark of the last event this projection consumed. A rebuild at the\nsame watermark yields the same values.",type:"string"}},required:["authorized_scope_ref","horizon","watermark","observed_at_micros","current","coverage","emission_coverage","github_stack_capability","drill_anchors","measurements"],title:"ExecutionTopologyMetricsV1",type:"object"},{$defs:{ProjectId:_4,RepositoryId:vb,UtcMicros:bZ,WorkGraphReadModeV1:{oneOf:[{properties:{mode:{const:"current",type:"string"}},required:["mode"],type:"object"},{properties:{mode:{const:"as_of",type:"string"},valid_at:{$ref:"#/$defs/UtcMicros"}},required:["mode","valid_at"],type:"object"},{properties:{from_valid_at:{$ref:"#/$defs/UtcMicros"},mode:{const:"evolution",type:"string"},through_valid_at:{$ref:"#/$defs/UtcMicros"}},required:["mode","from_valid_at","through_valid_at"],type:"object"},{properties:{from_observed_at:{$ref:"#/$defs/UtcMicros"},mode:{const:"forensic",type:"string"},through_observed_at:{$ref:"#/$defs/UtcMicros"}},required:["mode","from_observed_at","through_observed_at"],type:"object"}]},WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{continuation:{type:["string","null"]},mode:{$ref:"#/$defs/WorkGraphReadModeV1"},observed_at:{$ref:"#/$defs/UtcMicros"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","mode","observed_at"],title:"WorkGraphReadRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AuthorizedWorkProductScopeV1:{additionalProperties:!1,description:"Owner identity resolved by the registered profile authority. It is never\naccepted from a Work request.",properties:{owner_brain_id:{$ref:"#/$defs/BrainId"},owner_profile_id:{$ref:"#/$defs/UserProfileId"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["owner_brain_id","owner_profile_id","selection"],type:"object"},BrainId:f1,ManifestDigest:_l,ProjectId:_4,ProjectionGenerationId:_5,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,TaskEvidenceLinkV1:bj,TaskId:bT,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkCausalProjectionV1:{additionalProperties:!1,properties:{candidate_edges:{items:{$ref:"#/$defs/WorkDagEdgeV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"}},required:["graph_version","candidate_edges"],type:"object"},WorkCriticalPathProjectionV1:{additionalProperties:!1,properties:{graph_version:{format:"uint64",minimum:0,type:"integer"},task_ids:{items:{$ref:"#/$defs/TaskId"},type:"array"},total_effort:{format:"uint32",minimum:0,type:"integer"}},required:["graph_version","task_ids","total_effort"],type:"object"},WorkDagEdgeV1:{additionalProperties:!1,properties:{dependency:{$ref:"#/$defs/TaskId"},dependent:{$ref:"#/$defs/TaskId"}},required:["dependency","dependent"],type:"object"},WorkDagProjectionV1:{additionalProperties:!1,properties:{gating_edges:{items:{$ref:"#/$defs/WorkDagEdgeV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"},task_ids:{items:{$ref:"#/$defs/TaskId"},type:"array"}},required:["graph_version","task_ids","gating_edges"],type:"object"},WorkGraphSelectionCoverageV1:{description:"How much of the owner's journal the read's selection actually covers.\n\nA selection names a slice of the owner's work, not the whole journal: an\nevent records the relation scopes it was admitted under, and a selection\nthat does not name them puts that event *outside* the slice. The events\noutside a selection do not poison the ones inside it, but they must never be\nconcealed either, a caller who is shown the covered slice with no way to\nlearn that more exists is reading a silently incomplete graph.\n\nSo the read answers over the covered slice and says so, in the same\n`Complete`/`Partial` vocabulary [`WorkGraphTimelineCoverageV1`] and\n[`WorkHistoryCoverageV1`](crate::WorkHistoryCoverageV1) already use.\n\nThe covered slice is always a *prefix* of the journal, and that is a\nproperty of folding rather than a simplification. A graph version is folded\nfrom every event up to its own sequence, so the first event a selection does\nnot cover ends the readable slice: every later version, whatever scopes its\nown event named, would have to be folded across that event to exist at all.\n`excluded_events` therefore counts every event from the first uncovered one\nonward.",oneOf:[{description:"The selection covers the owner's whole journal. Nothing was withheld.",properties:{coverage:{const:"complete",type:"string"},covered_events:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","covered_events"],type:"object"},{description:"The selection covers `covered_events` events and `excluded_events`\nevents lie outside it, starting at `first_excluded_sequence`. Every\nentry this read returned was folded from covered events alone.",properties:{coverage:{const:"partial",type:"string"},covered_events:{format:"uint32",minimum:0,type:"integer"},excluded_events:{format:"uint32",minimum:0,type:"integer"},first_excluded_sequence:{format:"uint64",minimum:0,type:"integer"}},required:["coverage","covered_events","excluded_events","first_excluded_sequence"],type:"object"}]},WorkGraphTimelineCoverageV1:{oneOf:[{properties:{coverage:{const:"complete",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned"],type:"object"},{properties:{continuation:{type:"string"},coverage:{const:"partial",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","continuation"],type:"object"}]},WorkGraphTimelineV1:{additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/WorkGraphTimelineCoverageV1"},entries:{items:{$ref:"#/$defs/WorkGraphVersionEntryV1"},type:"array"}},required:["entries","coverage"],type:"object"},WorkGraphVersionEntryV1:{additionalProperties:!1,description:"One immutable graph version and every Work projection derived from that\nsame version at the caller's explicit observation time.",properties:{graph:{$ref:"#/$defs/WorkProductGraphV1"},observed_at:{$ref:"#/$defs/UtcMicros"},projected_at:{$ref:"#/$defs/UtcMicros"},projections:{$ref:"#/$defs/WorkProductProjectionBundleV1"},runtime:{$ref:"#/$defs/WorkRuntimeProjectionV1"},valid_at:{$ref:"#/$defs/UtcMicros"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["valid_at","observed_at","projected_at","verified_version","graph","runtime","projections"],type:"object"},WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkKanbanCardV1:{additionalProperties:!1,properties:{effort:{format:"uint32",minimum:0,type:"integer"},lane:{$ref:"#/$defs/WorkTimelineLaneV1"},legal_actions:{items:{$ref:"#/$defs/WorkLegalActionV1"},type:"array",uniqueItems:!0},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","lane","effort","legal_actions"],type:"object"},WorkKanbanProjectionV1:{additionalProperties:!1,properties:{cards:{items:{$ref:"#/$defs/WorkKanbanCardV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"}},required:["graph_version","cards"],type:"object"},WorkLegalActionV1:{enum:["view_evidence","generate_proposal","accept_proposal","link_accepted_attempt","accept_task","handoff","archive"],type:"string"},WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductGraphV1:$4,WorkProductProjectionBundleV1:{additionalProperties:!1,properties:{causal:{$ref:"#/$defs/WorkCausalProjectionV1"},critical_path:{$ref:"#/$defs/WorkCriticalPathProjectionV1"},dag:{$ref:"#/$defs/WorkDagProjectionV1"},graph_version:{format:"uint64",minimum:0,type:"integer"},kanban:{$ref:"#/$defs/WorkKanbanProjectionV1"},runtime:{$ref:"#/$defs/WorkRuntimeProjectionV1"},timeline:{$ref:"#/$defs/WorkTimelineProjectionV1"},workload:{$ref:"#/$defs/WorkWorkloadProjectionV1"}},required:["graph_version","runtime","kanban","dag","timeline","causal","critical_path","workload"],type:"object"},WorkProductSelectionScopeV1:$7,WorkProjectionSequenceV1:{format:"uint64",minimum:0,title:"WorkProjectionSequenceV1",type:"integer"},WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkRuntimeAttemptProjectionV1:{additionalProperties:!1,properties:{identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["identity","state"],type:"object"},WorkRuntimeProjectionCoverageV1:{oneOf:[{additionalProperties:!1,properties:{coverage:{const:"complete",type:"string"}},required:["coverage"],type:"object"},{additionalProperties:!1,properties:{coverage:{const:"partial",type:"string"},unavailable_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array",uniqueItems:!0}},required:["coverage","unavailable_attempts"],type:"object"},{additionalProperties:!1,properties:{coverage:{const:"unavailable",type:"string"}},required:["coverage"],type:"object"}]},WorkRuntimeProjectionV1:{additionalProperties:!1,properties:{attempts:{items:{$ref:"#/$defs/WorkRuntimeAttemptProjectionV1"},type:"array"},coverage:{$ref:"#/$defs/WorkRuntimeProjectionCoverageV1"},generation_id:{$ref:"#/$defs/ProjectionGenerationId"},graph_version:{format:"uint64",minimum:0,type:"integer"},observed_at:{$ref:"#/$defs/UtcMicros"},sequence:{$ref:"#/$defs/WorkProjectionSequenceV1"}},required:["graph_version","generation_id","sequence","observed_at","attempts","coverage"],type:"object"},WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTimelineEntryV1:{additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},deadline:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},scheduled_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},task_id:{$ref:"#/$defs/TaskId"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","created_at","updated_at"],type:"object"},WorkTimelineLaneV1:{enum:["triage","todo","scheduled","ready","running","blocked","review","done","archived","cancelled","unavailable"],type:"string"},WorkTimelineProjectionV1:{additionalProperties:!1,properties:{entries:{items:{$ref:"#/$defs/WorkTimelineEntryV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"}},required:["graph_version","entries"],type:"object"},WorkWorkloadProjectionV1:{additionalProperties:!1,properties:{actual_concurrency:{format:"uint32",minimum:0,type:["integer","null"]},blocked_effort:{format:"uint32",minimum:0,type:["integer","null"]},graph_version:{format:"uint64",minimum:0,type:"integer"},ready_effort:{format:"uint32",minimum:0,type:["integer","null"]},requested_concurrency:{format:"uint32",minimum:0,type:["integer","null"]},running_effort:{format:"uint32",minimum:0,type:["integer","null"]},total_effort:{format:"uint32",minimum:0,type:"integer"}},required:["graph_version","total_effort"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"current",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},snapshot:{$ref:"#/$defs/WorkGraphVersionEntryV1"}},required:["mode","authorized_scope","selection_coverage","snapshot"],type:"object"},{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"as_of",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},snapshot:{$ref:"#/$defs/WorkGraphVersionEntryV1"}},required:["mode","authorized_scope","selection_coverage","snapshot"],type:"object"},{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"evolution",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},timeline:{$ref:"#/$defs/WorkGraphTimelineV1"}},required:["mode","authorized_scope","selection_coverage","timeline"],type:"object"},{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"forensic",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},timeline:{$ref:"#/$defs/WorkGraphTimelineV1"}},required:["mode","authorized_scope","selection_coverage","timeline"],type:"object"},{description:"A `Current` or `AsOf` point read under an authorized selection that has\nno published graph version at that point: no task has been created yet.\nThe caller was authorized; the legal next action is creating a task.",properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"absent",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"}},required:["mode","authorized_scope","selection_coverage"],type:"object"}],title:"WorkGraphReadV1"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::activate`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},expected_revision:{description:"Current candidate disposition revision. A newly registered candidate\nstarts at revision 1; activation reports expected and observed values\nwhen this compare-and-swap precondition is stale.",format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version","expected_revision"],title:"WorkflowDefinitionActivateRequest",type:"object"},{$defs:{UtcMicros:bZ,WorkflowDefinitionId:SM,WorkflowDefinitionLifecycleState:{description:'Durable lifecycle disposition of one immutable workflow definition version.\n\nPlan 32 ("Typed workflow definitions"): "Lifecycle retains candidate,\nvalidate, activate, retire, reject, list, get, diff, and history operations\nthrough the same application surfaces." The definition payload itself stays\nimmutable, "Editing creates a new version; admitted runs remain pinned",\nso the disposition is a separate revisioned aggregate keyed by the same\ndefinition identity.',enum:["candidate","validated","active","retired","rejected"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Revisioned lifecycle disposition of one definition version.",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},revision:{format:"uint64",minimum:1,type:"integer"},state:{$ref:"#/$defs/WorkflowDefinitionLifecycleState"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["definition_id","definition_version","state","revision","transitioned_at"],title:"WorkflowDefinitionDisposition",type:"object"},{$defs:{RunId:vF,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Requests cooperative cancellation as a durable typed transition; the run\nsettles to `Cancelled` when the runtime reconciles in-flight steps.",properties:{command_id:{$ref:"#/$defs/WorkCommandId"},expected_sequence:{format:"uint64",minimum:0,type:"integer"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","expected_sequence","command_id"],title:"WorkflowRunCancelRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAuthority:{additionalProperties:!1,properties:{actor_id:{$ref:"#/$defs/ActorId"},policy_digest:{$ref:"#/$defs/ManifestDigest"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","actor_id","policy_digest"],type:"object"},WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTopologyPolicyV1:SA,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowFanOutChildPlanV1:{additionalProperties:!1,properties:{admit_command_id:{$ref:"#/$defs/WorkCommandId"},attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},create_command_id:{$ref:"#/$defs/WorkCommandId"},initiative:{$ref:"#/$defs/WorkInitiativeV1"},instructions:{type:"string"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},proposal_command_id:{$ref:"#/$defs/WorkCommandId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","attempt_identity","create_command_id","proposal_command_id","admit_command_id","initiative","plan","milestone","item","proposal","instructions"],type:"object"},WorkflowFanOutFailurePolicyV1:{oneOf:[{properties:{policy:{const:"fail_fast",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"collect",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"require_at_least",type:"string"},successes:{format:"uint16",maximum:65535,minimum:1,type:"integer"}},required:["policy","successes"],type:"object"}]},WorkflowFanOutPlanV1:{additionalProperties:!1,properties:{admitted_at:{$ref:"#/$defs/UtcMicros"},authority:{$ref:"#/$defs/WorkAuthority",description:"Exact Work authority that admitted this plan. Recovery may execute the\nplan only from a runtime with this byte-identical authority."},children:{items:{$ref:"#/$defs/WorkflowFanOutChildPlanV1"},type:"array"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},failure_policy:{$ref:"#/$defs/WorkflowFanOutFailurePolicyV1"},maximum_parallel:{format:"uint16",maximum:65535,minimum:1,type:"integer"},operation:{$ref:"#/$defs/WorkflowOperationRef"},plan_digest:{$ref:"#/$defs/ManifestDigest"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["authority","step_id","operation","plan_digest","admitted_at","maximum_parallel","failure_policy","execution_snapshot","commit","effect_state","children"],type:"object"},WorkflowOperationRef:Sz,WorkflowOutputArtifact:{additionalProperties:!1,properties:{artifact:{$ref:"#/$defs/WorkArtifactRefV1"},attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["attempt_identity","artifact"],type:"object"},WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowPlacementReceipt:{additionalProperties:!1,properties:{backend:{$ref:"#/$defs/WorkProviderBackendV1"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},model:{type:"string"},placement_digest:{$ref:"#/$defs/ManifestDigest"},provider_registry_digest:{$ref:"#/$defs/ManifestDigest"},route:{$ref:"#/$defs/WorkProviderRouteV1"},run_id:{$ref:"#/$defs/RunId"},step_id:{$ref:"#/$defs/WorkflowStepId"},topology_digest:{$ref:"#/$defs/ManifestDigest"},worktree_placement:{$ref:"#/$defs/WorktreePlacementModeV1"}},required:["run_id","step_id","route","backend","model","configuration_digest","topology_digest","provider_registry_digest","worktree_placement","placement_digest"],type:"object"},WorkflowRunEvent:{additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},event:{$ref:"#/$defs/WorkflowRunEventKind"},input_digest:{$ref:"#/$defs/ManifestDigest"},occurred_at:{$ref:"#/$defs/UtcMicros"},run_id:{$ref:"#/$defs/RunId"},sequence:{format:"uint64",minimum:0,type:"integer"}},required:["run_id","sequence","command_id","input_digest","occurred_at","event"],type:"object"},WorkflowRunEventKind:{oneOf:[{properties:{definition:{$ref:"#/$defs/WorkflowDefinition"},fan_out_plans:{default:[],items:{$ref:"#/$defs/WorkflowFanOutPlanV1"},type:"array"},pinned_provider_registry_digest:{$ref:"#/$defs/ManifestDigest"},pinned_topology_digest:{$ref:"#/$defs/ManifestDigest"},type:{const:"admitted",type:"string"}},required:["type","definition","pinned_topology_digest","pinned_provider_registry_digest"],type:"object"},{properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"fan_out_children_released",type:"string"}},required:["type","step_id","attempts"],type:"object"},{properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"fan_out_children_settled",type:"string"}},required:["type","step_id","attempts"],type:"object"},{properties:{planned_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},prior_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},replacement_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},retry_receipt_digest:{$ref:"#/$defs/ManifestDigest"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"fan_out_child_retry_rebound",type:"string"}},required:["type","step_id","planned_attempt","prior_attempt","replacement_attempt","retry_receipt_digest"],type:"object"},{properties:{placement:{$ref:"#/$defs/WorkflowPlacementReceipt"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"step_started",type:"string"}},required:["type","step_id","placement"],type:"object"},{properties:{effect_receipt:{$ref:"#/$defs/WorkflowStepEffectReceipt"},outputs:{items:{$ref:"#/$defs/WorkflowStepOutput"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"step_completed",type:"string"}},required:["type","step_id","outputs","effect_receipt"],type:"object"},{properties:{effect_receipt:{$ref:"#/$defs/WorkflowStepEffectReceipt"},outputs:{items:{$ref:"#/$defs/WorkflowStepOutput"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"step_failed",type:"string"}},required:["type","step_id","outputs","effect_receipt"],type:"object"},{properties:{type:{const:"paused",type:"string"}},required:["type"],type:"object"},{properties:{type:{const:"resumed",type:"string"}},required:["type"],type:"object"},{properties:{type:{const:"cancellation_requested",type:"string"}},required:["type"],type:"object"},{properties:{type:{const:"cancelled",type:"string"}},required:["type"],type:"object"}]},WorkflowRunStatus:{enum:["running","paused","cancelling","completed","failed","cancelled"],type:"string"},WorkflowStep:SL,WorkflowStepEffectOutcome:{enum:["completed","failed","cancelled","timed_out","unknown"],type:"string"},WorkflowStepEffectReceipt:{additionalProperties:!1,properties:{effect_digest:{$ref:"#/$defs/ManifestDigest"},outcome:{$ref:"#/$defs/WorkflowStepEffectOutcome"},output_set_digest:{$ref:"#/$defs/ManifestDigest"},placement_digest:{$ref:"#/$defs/ManifestDigest"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},run_id:{$ref:"#/$defs/RunId"},step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["run_id","step_id","placement_digest","outcome","effect_digest","output_set_digest","receipt_digest"],type:"object"},WorkflowStepId:SU,WorkflowStepOutput:{additionalProperties:!1,properties:{artifacts:{items:{$ref:"#/$defs/WorkflowOutputArtifact"},type:"array"},output_name:{$ref:"#/$defs/WorkflowOutputName"}},required:["output_name","artifacts"],type:"object"},WorkflowStepRunProjection:{additionalProperties:!1,properties:{effect_receipt:{anyOf:[{$ref:"#/$defs/WorkflowStepEffectReceipt"},{type:"null"}]},outputs:{additionalProperties:{$ref:"#/$defs/WorkflowStepOutput"},type:"object"},placement_receipt:{anyOf:[{$ref:"#/$defs/WorkflowPlacementReceipt"},{type:"null"}]},status:{$ref:"#/$defs/WorkflowStepStatus"}},required:["status","outputs"],type:"object"},WorkflowStepStatus:{enum:["blocked","ready","running","succeeded","failed","cancelled"],type:"string"},WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{definition:{$ref:"#/$defs/WorkflowDefinition"},fan_out_plans:{additionalProperties:{$ref:"#/$defs/WorkflowFanOutPlanV1"},type:"object"},history:{items:{$ref:"#/$defs/WorkflowRunEvent"},type:"array"},pinned_provider_registry_digest:{$ref:"#/$defs/ManifestDigest"},pinned_topology_digest:{$ref:"#/$defs/ManifestDigest"},released_fan_out_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array",uniqueItems:!0},run_id:{$ref:"#/$defs/RunId"},sequence:{format:"uint64",minimum:0,type:"integer"},settled_fan_out_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array",uniqueItems:!0},status:{$ref:"#/$defs/WorkflowRunStatus"},steps:{additionalProperties:{$ref:"#/$defs/WorkflowStepRunProjection"},type:"object"}},required:["run_id","definition","pinned_topology_digest","pinned_provider_registry_digest","status","sequence","steps","fan_out_plans","released_fan_out_attempts","settled_fan_out_attempts","history"],title:"WorkflowRunProjection",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::history`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"}},required:["definition_id"],title:"WorkflowDefinitionHistoryRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/WorkflowDefinition"},title:"Array_of_WorkflowDefinition",type:"array"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::diff`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},from_version:{format:"uint64",minimum:1,type:"integer"},to_version:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","from_version","to_version"],title:"WorkflowDefinitionDiffRequest",type:"object"},{$defs:{WorkflowDefinitionId:SM,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{catalog_changed:{type:"boolean"},changed_steps:{items:{$ref:"#/$defs/WorkflowStepId"},type:"array",uniqueItems:!0},configuration_changed:{type:"boolean"},definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},from_version:{format:"uint64",minimum:0,type:"integer"},policy_changed:{type:"boolean"},to_version:{format:"uint64",minimum:0,type:"integer"}},required:["definition_id","from_version","to_version","changed_steps","policy_changed","configuration_changed","catalog_changed"],title:"WorkflowDefinitionDiff",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::get`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version"],title:"WorkflowDefinitionGetRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:0,type:"integer"},pinned_catalog_digest:{$ref:"#/$defs/ManifestDigest",description:"Must equal the live Work executable catalog digest. Validation and\nactivation report the current digest when this pin is stale."},pinned_configuration_digest:{$ref:"#/$defs/ManifestDigest"},pinned_policy_digest:{$ref:"#/$defs/ManifestDigest"},project_id:{$ref:"#/$defs/ProjectId"},steps:{items:{$ref:"#/$defs/WorkflowStep"},type:"array"}},required:["definition_id","definition_version","project_id","steps","pinned_policy_digest","pinned_configuration_digest","pinned_catalog_digest"],title:"WorkflowDefinition",type:"object"},{$defs:{RunId:vF},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{$ref:"#/$defs/RunId"}},required:["run_id"],title:"WorkflowRunGetRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkHandoffAttemptFrontierV1:$C,WorkHandoffFrontierV1:$T,WorkHandoffLineageV1:$O,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`TaskHandoffService::issue`].\n\n`secret` is the caller-supplied bearer token; the authority persists only\nits digest, never the secret itself. The scope must name a step the\nActive definition version declares and a run admitted from that version;\nany other scope is refused as not found and journals no grant.",properties:{frontier:{$ref:"#/$defs/WorkHandoffFrontierV1",description:"The exact work/evidence frontier this handoff records (Plan 24)."},scope:{$ref:"#/$defs/TaskHandoffScope"},secret:{type:"string"}},required:["scope","secret","frontier"],title:"TaskHandoffIssueRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkHandoffAttemptFrontierV1:$C,WorkHandoffFrontierV1:$T,WorkHandoffLineageV1:$O,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expires_at:{$ref:"#/$defs/UtcMicros"},frontier:{$ref:"#/$defs/WorkHandoffFrontierV1",description:"The exact work/evidence frontier this handoff records (Plan 24)."},frontier_digest:{$ref:"#/$defs/ManifestDigest",description:"The canonical digest of `frontier`; lineage chains hold this value."},issued_at:{$ref:"#/$defs/UtcMicros"},scope:{$ref:"#/$defs/TaskHandoffScope"},token_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope","token_digest","issued_at","expires_at","frontier","frontier_digest"],title:"TaskHandoffGrant",type:"object"},{$defs:{ActorId:fb,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`TaskHandoffService::redeem`].",properties:{expected_scope:{$ref:"#/$defs/TaskHandoffScope"},secret:{type:"string"}},required:["secret","expected_scope"],title:"TaskHandoffRedeemRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkHandoffAttemptFrontierV1:$C,WorkHandoffFrontierV1:$T,WorkHandoffLineageV1:$O,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire response for [`TaskHandoffService::redeem`]: the redemption receipt,\nonce and only once, for the caller that actually consumed the grant.\n\nThe receipt is checkpoint evidence only. It deliberately carries no\nlease, fence, or acceptance authority: redeeming a handoff cannot renew\na lease, establish task acceptance, or mutate graph or runtime state\n(Plan 24). The redeemer must earn runtime authority through the normal\nadmission and lease paths.",properties:{frontier:{$ref:"#/$defs/WorkHandoffFrontierV1",description:"The frontier exactly as the issuer recorded it."},frontier_digest:{$ref:"#/$defs/ManifestDigest",description:"The canonical digest of `frontier`, for lineage chaining."},redeemed_at:{$ref:"#/$defs/UtcMicros"},scope:{$ref:"#/$defs/TaskHandoffScope"}},required:["scope","frontier","frontier_digest","redeemed_at"],title:"TaskHandoffRedeemed",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::list`].",title:"WorkflowDefinitionListRequest",type:"object"},{$defs:{RunId:vF,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},expected_sequence:{format:"uint64",minimum:0,type:"integer"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","expected_sequence","command_id"],title:"WorkflowRunPauseRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::register`].",properties:{definition:{$ref:"#/$defs/WorkflowDefinition"}},required:["definition"],title:"WorkflowDefinitionRegisterRequest",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::reject`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},expected_revision:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version","expected_revision"],title:"WorkflowDefinitionRejectRequest",type:"object"},{$defs:{RunId:vF,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},expected_sequence:{format:"uint64",minimum:0,type:"integer"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","expected_sequence","command_id"],title:"WorkflowRunResumeRequest",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::retire`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},expected_revision:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version","expected_revision"],title:"WorkflowDefinitionRetireRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTopologyPolicyV1:SA,WorkflowDefinitionId:SM,WorkflowExecutionFence:{additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},lease:{$ref:"#/$defs/WorkLeaseFenceV1"}},required:["attempt_id","lease"],type:"object"},WorkflowFailurePolicy:{oneOf:[{properties:{policy:{const:"fail_fast",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"collect",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"require_at_least",type:"string"},successes:{format:"uint32",minimum:1,type:"integer"}},required:["policy","successes"],type:"object"}]},WorkflowFanOutInput:{additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},input_digest:{$ref:"#/$defs/ManifestDigest"},instructions:{type:"string"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["instructions","input_digest","initiative","plan","milestone","item","proposal"],type:"object"},WorkflowFanOutStartV1:{additionalProperties:!1,description:"Caller input required to durably plan the entry fan-out of a workflow run.\nDaemon-owned registration and topology digests are resolved at admission.",properties:{commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},failure_policy:{$ref:"#/$defs/WorkflowFailurePolicy"},fence:{$ref:"#/$defs/WorkflowExecutionFence"},inputs:{items:{$ref:"#/$defs/WorkflowFanOutInput"},type:"array"},max_parallel:{format:"uint32",minimum:1,type:"integer"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]}},required:["fence","max_parallel","failure_policy","execution_snapshot","commit","effect_state","inputs"],type:"object"},WorkflowProviderRegistration:{additionalProperties:!1,properties:{backend:{$ref:"#/$defs/WorkProviderBackendV1"},model:{type:"string"},priority:{format:"uint32",minimum:0,type:"integer"},route:{$ref:"#/$defs/WorkProviderRouteV1"}},required:["route","backend","model","priority"],type:"object"},WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Starts (admits) a journaled workflow run from an active definition.\n\nThe daemon derives every admission digest itself: the definition's own\npinned policy/configuration/catalog digests are checked against the live\nenvironment, the topology digest comes from the evaluated topology policy,\nand the provider registry digest is computed from this registration. The\ncaller never supplies a digest the runtime must trust.",properties:{command_id:{$ref:"#/$defs/WorkCommandId"},definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},fan_out:{anyOf:[{$ref:"#/$defs/WorkflowFanOutStartV1"},{type:"null"}]},provider:{$ref:"#/$defs/WorkflowProviderRegistration"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","definition_id","definition_version","provider","command_id"],title:"WorkflowRunStartRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::validate`].",properties:{definition:{$ref:"#/$defs/WorkflowDefinition"}},required:["definition"],title:"WorkflowDefinitionValidateRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{definition:{$ref:"#/$defs/WorkflowDefinition"}},required:["definition"],title:"WorkflowDefinitionValidation",type:"object"}].map(e=>t=>(!function e(t,r,i,o,n){var a;if("boolean"==typeof r){if(!r)throw TypeError(`${o} is rejected by the canonical schema`);return}let s=ft(r,o);if("string"==typeof s.$ref){if(n.has(s.$ref))throw TypeError(`cyclic canonical schema reference: ${s.$ref}`);n.add(s.$ref),e(t,function(e,t){if(!t.startsWith("#/"))throw TypeError(`unsupported canonical schema reference: ${t}`);let r=e;for(let e of t.slice(2).split("/")){let i=e.replaceAll("~1","/").replaceAll("~0","~");r=ft(r,t)[i]}return ft(r,t)}(i,s.$ref),i,o,n),n.delete(s.$ref);return}if("const"in s&&(a=s.const,fe(t)!==fe(a)))throw TypeError(`${o} does not match the canonical constant`);if(Array.isArray(s.enum)&&!s.enum.some(e=>fe(t)===fe(e)))throw TypeError(`${o} is not a canonical enum value`);if(Array.isArray(s.allOf))for(let r of s.allOf)e(t,r,i,o,new Set(n));if(Array.isArray(s.anyOf)&&!s.anyOf.some(r=>{try{return e(t,r,i,o,new Set(n)),!0}catch{return!1}}))throw TypeError(`${o} does not match any canonical variant`);if(Array.isArray(s.oneOf)&&1!==s.oneOf.filter(r=>{try{return e(t,r,i,o,new Set(n)),!0}catch{return!1}}).length)throw TypeError(`${o} must match exactly one canonical variant`);let d=s.type;if("string"==typeof d&&!fr(t,d))throw TypeError(`${o} must be ${d}`);if(Array.isArray(d)&&!d.some(e=>"string"==typeof e&&fr(t,e)))throw TypeError(`${o} has no canonical type`);if("string"==typeof t){if("number"==typeof s.minLength&&t.lengths.maxLength)throw TypeError(`${o} exceeds maxLength`);if("string"==typeof s.pattern&&!RegExp(s.pattern,"u").test(t))throw TypeError(`${o} does not match the canonical pattern`)}if("number"==typeof t){if("integer"===s.type){if("uint32"===s.format&&(t<0||t>0xffffffff))throw TypeError(`${o} is outside uint32`);if("uint64"===s.format&&(t<0||t>Number.MAX_SAFE_INTEGER))throw TypeError(`${o} is outside safely representable uint64`);if("int64"===s.format&&(tNumber.MAX_SAFE_INTEGER))throw TypeError(`${o} is outside safely representable int64`)}if("number"==typeof s.minimum&&ts.maximum)throw TypeError(`${o} exceeds maximum`)}if(Array.isArray(t)){if("number"==typeof s.minItems&&t.lengths.maxItems)throw TypeError(`${o} has too many items`);if(!0===s.uniqueItems){let e=new Set;for(let r of t){let t=fe(r);if(e.has(t))throw TypeError(`${o} contains duplicate items`);e.add(t)}}Array.isArray(s.prefixItems)&&s.prefixItems.forEach((r,n)=>{ne(t,s.items,i,`${o}[${r}]`,new Set))}if("object"==typeof t&&null!==t&&!Array.isArray(t)){let r=void 0===s.properties?{}:ft(s.properties,`${o}.properties`);if(Array.isArray(s.required)){for(let e of s.required)if("string"==typeof e&&!(e in t))throw TypeError(`${o}.${e} is required`)}for(let[n,a]of Object.entries(t))if(n in r)e(a,r[n],i,`${o}.${n}`,new Set);else if(!1===s.additionalProperties)throw TypeError(`${o}.${n} is not allowed`);else"object"==typeof s.additionalProperties&&e(a,s.additionalProperties,i,`${o}.${n}`,new Set)}}(t,e,e,"value",new Set),t));function S1(e){let t=SY[e];if(void 0===t)throw TypeError(`generated canonical schema ${e} is missing`);return t}let S0=[{operation:"active_project",operationId:"operation.application.active_project",transport:{kind:"mcp_tool",toolName:"tracedecay_active_project"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.active_project.v1",requestSchema:{schemaId:"schema.application.primitive.active-project.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.active-project.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(0),decodeResult:S1(1)},{operation:"admin_cli",operationId:"operation.application.admin_cli",transport:{kind:"mcp_tool",toolName:"tracedecay_admin_cli"},effect:"maintains_profile_state",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.admin_cli.v1",requestSchema:{schemaId:"schema.application.primitive.admin-cli.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.admin-cli.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","effect_in_flight"]},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(2),decodeResult:S1(3)},{operation:"admin_project",operationId:"operation.application.admin_project",transport:{kind:"mcp_tool",toolName:"tracedecay_admin_project"},effect:"maintains_owner_state",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.admin_project.v1",requestSchema:{schemaId:"schema.application.primitive.admin-project.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.admin-project.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(4),decodeResult:S1(5)},{operation:"admin_sync",operationId:"operation.application.admin_sync",transport:{kind:"mcp_tool",toolName:"tracedecay_admin_sync"},effect:"schedules_work",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.admin_sync.v1",requestSchema:{schemaId:"schema.application.primitive.admin-sync.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.admin-sync.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(6),decodeResult:S1(7)},{operation:"affected",operationId:"operation.application.affected",transport:{kind:"mcp_tool",toolName:"tracedecay_affected"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.affected.v1",requestSchema:{schemaId:"schema.application.primitive.affected.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.affected.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(8),decodeResult:S1(9)},{operation:"application_affected_tests",operationId:"operation.application.affected_tests",transport:{kind:"http",route:"/application/tests/affected",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.affected_tests.v1",requestSchema:{schemaId:"schema.application.feedback.affected-tests.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.affected-tests.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(11),decodeSuccess:e=>fp(e,"binding.http.affected_tests.v1","schema.application.feedback.affected-tests.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(11))},{operation:"analytics",operationId:"operation.application.analytics",transport:{kind:"mcp_tool",toolName:"tracedecay_analytics"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.analytics.v1",requestSchema:{schemaId:"schema.application.primitive.analytics.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.analytics.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(12),decodeResult:S1(13)},{operation:"apply_native_integration",operationId:"operation.application.apply_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_apply_native_integration"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.apply_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.apply.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.apply.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(14),decodeResult:S1(15)},{operation:"approve_native_integration",operationId:"operation.application.approve_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_approve_native_integration"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.approve_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.approve.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.approve.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(16),decodeResult:S1(15)},{operation:"ast_grep_rewrite",operationId:"operation.application.ast_grep_rewrite",transport:{kind:"mcp_tool",toolName:"tracedecay_ast_grep_rewrite"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.ast_grep_rewrite.v1",requestSchema:{schemaId:"schema.application.source-edit.ast-grep-rewrite.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.ast-grep-rewrite.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(17),decodeResult:S1(18)},{operation:"ast_grep_search",operationId:"operation.application.ast_grep_search",transport:{kind:"mcp_tool",toolName:"tracedecay_ast_grep_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.ast_grep_search.v1",requestSchema:{schemaId:"schema.application.primitive.ast-grep-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.ast-grep-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(19),decodeResult:S1(20)},{operation:"automation_run_artifact_view",operationId:"operation.application.automation_run_artifact_view",transport:{kind:"mcp_tool",toolName:"tracedecay_automation_run_artifact_view"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.automation_run_artifact_view.v1",requestSchema:{schemaId:"schema.application.primitive.automation-run-artifact-view.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.automation-run-artifact-view.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(21),decodeResult:S1(22)},{operation:"automation_run_list",operationId:"operation.application.automation_run_list",transport:{kind:"mcp_tool",toolName:"tracedecay_automation_run_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.automation_run_list.v1",requestSchema:{schemaId:"schema.application.primitive.automation-run-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.automation-run-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(23),decodeResult:S1(24)},{operation:"automation_run_view",operationId:"operation.application.automation_run_view",transport:{kind:"mcp_tool",toolName:"tracedecay_automation_run_view"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.automation_run_view.v1",requestSchema:{schemaId:"schema.application.primitive.automation-run-view.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.automation-run-view.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(25),decodeResult:S1(26)},{operation:"branch_diff",operationId:"operation.application.branch_diff",transport:{kind:"mcp_tool",toolName:"tracedecay_branch_diff"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.branch_diff.v1",requestSchema:{schemaId:"schema.application.primitive.branch-diff.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.branch-diff.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(27),decodeResult:S1(28)},{operation:"branch_list",operationId:"operation.application.branch_list",transport:{kind:"mcp_tool",toolName:"tracedecay_branch_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.branch_list.v1",requestSchema:{schemaId:"schema.application.primitive.branch-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.branch-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(29),decodeResult:S1(30)},{operation:"branch_search",operationId:"operation.application.branch_search",transport:{kind:"mcp_tool",toolName:"tracedecay_branch_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.branch_search.v1",requestSchema:{schemaId:"schema.application.primitive.branch-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.branch-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(31),decodeResult:S1(32)},{operation:"by_qualified_name",operationId:"operation.application.by_qualified_name",transport:{kind:"mcp_tool",toolName:"tracedecay_by_qualified_name"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.by_qualified_name.v1",requestSchema:{schemaId:"schema.application.primitive.by-qualified-name.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.by-qualified-name.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(33),decodeResult:S1(34)},{operation:"application_call_chain",operationId:"operation.application.call_chain",transport:{kind:"http",route:"/application/primitives/call_chain",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.call_chain.v1",requestSchema:{schemaId:"schema.application.primitive.call-chain.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.call-chain.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(35),decodeResult:S1(36),decodeSuccess:e=>fp(e,"binding.http.call_chain.v1","schema.application.primitive.call-chain.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(36))},{operation:"cancel_native_integration",operationId:"operation.application.cancel_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_cancel_native_integration"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.cancel_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.cancel.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.cancel.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(37),decodeResult:S1(15)},{operation:"changelog",operationId:"operation.application.changelog",transport:{kind:"mcp_tool",toolName:"tracedecay_changelog"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.changelog.v1",requestSchema:{schemaId:"schema.application.primitive.changelog.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.changelog.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(38),decodeResult:S1(39)},{operation:"circular",operationId:"operation.application.circular",transport:{kind:"mcp_tool",toolName:"tracedecay_circular"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.circular.v1",requestSchema:{schemaId:"schema.application.primitive.circular.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.circular.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(40),decodeResult:S1(41)},{operation:"code_callees",operationId:"operation.application.code_callees",transport:{kind:"http",route:"/application/code/code_callees",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_callees.v1",requestSchema:{schemaId:"schema.application.code-query.callees.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.callees.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(42),decodeResult:S1(43),decodeSuccess:e=>fp(e,"binding.http.code_callees.v1","schema.application.code-query.callees.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(43))},{operation:"code_callers",operationId:"operation.application.code_callers",transport:{kind:"http",route:"/application/code/code_callers",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_callers.v1",requestSchema:{schemaId:"schema.application.primitive.code-callers.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-callers.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(44),decodeResult:S1(45),decodeSuccess:e=>fp(e,"binding.http.code_callers.v1","schema.application.primitive.code-callers.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(45))},{operation:"code_declaration",operationId:"operation.application.code_declaration",transport:{kind:"http",route:"/application/code/code_declaration",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_declaration.v1",requestSchema:{schemaId:"schema.application.code-query.declaration.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.declaration.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(46),decodeResult:S1(47),decodeSuccess:e=>fp(e,"binding.http.code_declaration.v1","schema.application.code-query.declaration.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(47))},{operation:"code_exact_occurrence",operationId:"operation.application.code_exact_occurrence",transport:{kind:"http",route:"/application/code/code_exact_occurrence",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_exact_occurrence.v1",requestSchema:{schemaId:"schema.application.code-query.exact-occurrence.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.exact-occurrence.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(48),decodeResult:S1(49),decodeSuccess:e=>fp(e,"binding.http.code_exact_occurrence.v1","schema.application.code-query.exact-occurrence.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(49))},{operation:"code_facets",operationId:"operation.application.code_facets",transport:{kind:"http",route:"/application/code/code_facets",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_facets.v1",requestSchema:{schemaId:"schema.application.code-query.facets.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.facets.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(50),decodeResult:S1(51),decodeSuccess:e=>fp(e,"binding.http.code_facets.v1","schema.application.code-query.facets.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(51))},{operation:"code_implementations",operationId:"operation.application.code_implementations",transport:{kind:"http",route:"/application/code/code_implementations",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_implementations.v1",requestSchema:{schemaId:"schema.application.primitive.code-implementations.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-implementations.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(52),decodeResult:S1(53),decodeSuccess:e=>fp(e,"binding.http.code_implementations.v1","schema.application.primitive.code-implementations.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(53))},{operation:"code_phrase_search",operationId:"operation.application.code_phrase_search",transport:{kind:"http",route:"/application/code/code_phrase_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_phrase_search.v1",requestSchema:{schemaId:"schema.application.code-query.phrase-search.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.phrase-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(54),decodeResult:S1(55),decodeSuccess:e=>fp(e,"binding.http.code_phrase_search.v1","schema.application.code-query.phrase-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(55))},{operation:"code_references",operationId:"operation.application.code_references",transport:{kind:"http",route:"/application/code/code_references",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_references.v1",requestSchema:{schemaId:"schema.application.code-query.references.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.references.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(46),decodeResult:S1(43),decodeSuccess:e=>fp(e,"binding.http.code_references.v1","schema.application.code-query.references.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(43))},{operation:"code_signature_search",operationId:"operation.application.code_signature_search",transport:{kind:"http",route:"/application/code/code_signature_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_signature_search.v1",requestSchema:{schemaId:"schema.application.primitive.code-signature-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-signature-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(56),decodeResult:S1(57),decodeSuccess:e=>fp(e,"binding.http.code_signature_search.v1","schema.application.primitive.code-signature-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(57))},{operation:"code_symbol_search",operationId:"operation.application.code_symbol_search",transport:{kind:"http",route:"/application/code/code_symbol_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_symbol_search.v1",requestSchema:{schemaId:"schema.application.symbol-search.request",revision:1},resultSchema:{schemaId:"schema.application.symbol-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(58),decodeResult:S1(57),decodeSuccess:e=>fp(e,"binding.http.code_symbol_search.v1","schema.application.symbol-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(57))},{operation:"code_timeline",operationId:"operation.application.code_timeline",transport:{kind:"http",route:"/application/code/code_timeline",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_timeline.v1",requestSchema:{schemaId:"schema.application.code-query.timeline.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.timeline.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(59),decodeResult:S1(60),decodeSuccess:e=>fp(e,"binding.http.code_timeline.v1","schema.application.code-query.timeline.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(60))},{operation:"code_type_definition",operationId:"operation.application.code_type_definition",transport:{kind:"http",route:"/application/code/code_type_definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_type_definition.v1",requestSchema:{schemaId:"schema.application.code-query.type-definition.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.type-definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(46),decodeResult:S1(47),decodeSuccess:e=>fp(e,"binding.http.code_type_definition.v1","schema.application.code-query.type-definition.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(47))},{operation:"code_type_hierarchy",operationId:"operation.application.code_type_hierarchy",transport:{kind:"http",route:"/application/code/code_type_hierarchy",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_type_hierarchy.v1",requestSchema:{schemaId:"schema.application.primitive.code-type-hierarchy.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-type-hierarchy.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(61),decodeResult:S1(62),decodeSuccess:e=>fp(e,"binding.http.code_type_hierarchy.v1","schema.application.primitive.code-type-hierarchy.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(62))},{operation:"commit_context",operationId:"operation.application.commit_context",transport:{kind:"mcp_tool",toolName:"tracedecay_commit_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.commit_context.v1",requestSchema:{schemaId:"schema.application.primitive.commit-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.commit-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(63),decodeResult:S1(64)},{operation:"complexity",operationId:"operation.application.complexity",transport:{kind:"mcp_tool",toolName:"tracedecay_complexity"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.complexity.v1",requestSchema:{schemaId:"schema.application.primitive.complexity.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.complexity.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(65),decodeResult:S1(66)},{operation:"config",operationId:"operation.application.config",transport:{kind:"mcp_tool",toolName:"tracedecay_config"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.config.v1",requestSchema:{schemaId:"schema.application.primitive.config.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.config.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(67),decodeResult:S1(68)},{operation:"application_configuration_audit",operationId:"operation.application.configuration_audit",transport:{kind:"http",route:"/application/configuration/configuration_audit",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_audit.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_audit.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_audit.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(69),decodeResult:S1(70),decodeSuccess:e=>fp(e,"binding.http.configuration_audit.v1","schema.application.configuration.configuration_audit.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(70))},{operation:"application_configuration_batch",operationId:"operation.application.configuration_batch",transport:{kind:"http",route:"/application/configuration/configuration_batch",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_batch.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_batch.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_batch.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(71),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_batch.v1","schema.application.configuration.configuration_batch.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_get",operationId:"operation.application.configuration_get",transport:{kind:"http",route:"/application/configuration/configuration_get",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_get.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_get.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_get.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(73),decodeResult:S1(74),decodeSuccess:e=>fp(e,"binding.http.configuration_get.v1","schema.application.configuration.configuration_get.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(74))},{operation:"application_configuration_list",operationId:"operation.application.configuration_list",transport:{kind:"http",route:"/application/configuration/configuration_list",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_list.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_list.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(75),decodeResult:S1(76),decodeSuccess:e=>fp(e,"binding.http.configuration_list.v1","schema.application.configuration.configuration_list.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(76))},{operation:"application_configuration_observed_state",operationId:"operation.application.configuration_observed_state",transport:{kind:"http",route:"/application/configuration/configuration_observed_state",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_observed_state.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_observed_state.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_observed_state.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(77),decodeResult:S1(78),decodeSuccess:e=>fp(e,"binding.http.configuration_observed_state.v1","schema.application.configuration.configuration_observed_state.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(78))},{operation:"application_configuration_protected_apply",operationId:"operation.application.configuration_protected_apply",transport:{kind:"http",route:"/application/configuration/configuration_protected_apply",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_protected_apply.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_protected_apply.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_protected_apply.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(79),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_protected_apply.v1","schema.application.configuration.configuration_protected_apply.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_protected_preview",operationId:"operation.application.configuration_protected_preview",transport:{kind:"http",route:"/application/configuration/configuration_protected_preview",method:"POST"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_protected_preview.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_protected_preview.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_protected_preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(80),decodeResult:S1(81),decodeSuccess:e=>fp(e,"binding.http.configuration_protected_preview.v1","schema.application.configuration.configuration_protected_preview.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(81))},{operation:"application_configuration_rollback_apply",operationId:"operation.application.configuration_rollback_apply",transport:{kind:"http",route:"/application/configuration/configuration_rollback_apply",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_rollback_apply.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_rollback_apply.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_rollback_apply.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(79),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_rollback_apply.v1","schema.application.configuration.configuration_rollback_apply.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_rollback_preview",operationId:"operation.application.configuration_rollback_preview",transport:{kind:"http",route:"/application/configuration/configuration_rollback_preview",method:"POST"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_rollback_preview.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_rollback_preview.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_rollback_preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(82),decodeResult:S1(81),decodeSuccess:e=>fp(e,"binding.http.configuration_rollback_preview.v1","schema.application.configuration.configuration_rollback_preview.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(81))},{operation:"application_configuration_set",operationId:"operation.application.configuration_set",transport:{kind:"http",route:"/application/configuration/configuration_set",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_set.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_set.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_set.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(83),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_set.v1","schema.application.configuration.configuration_set.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_unset",operationId:"operation.application.configuration_unset",transport:{kind:"http",route:"/application/configuration/configuration_unset",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_unset.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_unset.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_unset.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(84),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_unset.v1","schema.application.configuration.configuration_unset.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"constructors",operationId:"operation.application.constructors",transport:{kind:"mcp_tool",toolName:"tracedecay_constructors"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.constructors.v1",requestSchema:{schemaId:"schema.application.primitive.constructors.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.constructors.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(85),decodeResult:S1(86)},{operation:"context",operationId:"operation.application.context",transport:{kind:"mcp_tool",toolName:"tracedecay_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.context.v1",requestSchema:{schemaId:"schema.application.primitive.context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(87),decodeResult:S1(88)},{operation:"application_context_scout_budget",operationId:"operation.application.context_scout_budget",transport:{kind:"http",route:"/application/context-scout/context_scout_budget",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_budget.v1",requestSchema:{schemaId:"schema.application.context-scout-budget.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-budget.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(89),decodeResult:S1(90),decodeSuccess:e=>fp(e,"binding.http.context_scout_budget.v1","schema.application.context-scout-budget.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(90))},{operation:"application_context_scout_cancel",operationId:"operation.application.context_scout_cancel",transport:{kind:"http",route:"/application/context-scout/context_scout_cancel",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_cancel.v1",requestSchema:{schemaId:"schema.application.context-scout-cancel.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-cancel.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(91),decodeResult:S1(92),decodeSuccess:e=>fp(e,"binding.http.context_scout_cancel.v1","schema.application.context-scout-cancel.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(92))},{operation:"application_context_scout_capability",operationId:"operation.application.context_scout_capability",transport:{kind:"http",route:"/application/context-scout/context_scout_capability",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_capability.v1",requestSchema:{schemaId:"schema.application.context-scout-capability.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-capability.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(89),decodeResult:S1(93),decodeSuccess:e=>fp(e,"binding.http.context_scout_capability.v1","schema.application.context-scout-capability.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(93))},{operation:"application_context_scout_claim",operationId:"operation.application.context_scout_claim",transport:{kind:"http",route:"/application/context-scout/context_scout_claim",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_claim.v1",requestSchema:{schemaId:"schema.application.context-scout-claim.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-claim.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(94),decodeResult:S1(95),decodeSuccess:e=>fp(e,"binding.http.context_scout_claim.v1","schema.application.context-scout-claim.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(95))},{operation:"application_context_scout_delivery",operationId:"operation.application.context_scout_delivery",transport:{kind:"http",route:"/application/context-scout/context_scout_delivery",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_delivery.v1",requestSchema:{schemaId:"schema.application.context-scout-delivery.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-delivery.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(96),decodeResult:S1(97),decodeSuccess:e=>fp(e,"binding.http.context_scout_delivery.v1","schema.application.context-scout-delivery.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(97))},{operation:"application_context_scout_explain",operationId:"operation.application.context_scout_explain",transport:{kind:"http",route:"/application/context-scout/context_scout_explain",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_explain.v1",requestSchema:{schemaId:"schema.application.context-scout-explain.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-explain.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(98),decodeResult:S1(99),decodeSuccess:e=>fp(e,"binding.http.context_scout_explain.v1","schema.application.context-scout-explain.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(99))},{operation:"application_context_scout_feedback",operationId:"operation.application.context_scout_feedback",transport:{kind:"http",route:"/application/context-scout/context_scout_feedback",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_feedback.v1",requestSchema:{schemaId:"schema.application.context-scout-feedback.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-feedback.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(100),decodeResult:S1(92),decodeSuccess:e=>fp(e,"binding.http.context_scout_feedback.v1","schema.application.context-scout-feedback.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(92))},{operation:"application_context_scout_pause",operationId:"operation.application.context_scout_pause",transport:{kind:"http",route:"/application/context-scout/context_scout_pause",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_pause.v1",requestSchema:{schemaId:"schema.application.context-scout-pause.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-pause.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(101),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.context_scout_pause.v1","schema.application.context-scout-pause.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_context_scout_recent",operationId:"operation.application.context_scout_recent",transport:{kind:"http",route:"/application/context-scout/context_scout_recent",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_recent.v1",requestSchema:{schemaId:"schema.application.context-scout-recent.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-recent.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(98),decodeResult:S1(102),decodeSuccess:e=>fp(e,"binding.http.context_scout_recent.v1","schema.application.context-scout-recent.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(102))},{operation:"application_context_scout_resume",operationId:"operation.application.context_scout_resume",transport:{kind:"http",route:"/application/context-scout/context_scout_resume",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_resume.v1",requestSchema:{schemaId:"schema.application.context-scout-resume.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-resume.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(101),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.context_scout_resume.v1","schema.application.context-scout-resume.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_context_scout_status",operationId:"operation.application.context_scout_status",transport:{kind:"http",route:"/application/context-scout/context_scout_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_status.v1",requestSchema:{schemaId:"schema.application.context-scout-status.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(89),decodeResult:S1(103),decodeSuccess:e=>fp(e,"binding.http.context_scout_status.v1","schema.application.context-scout-status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(103))},{operation:"coupling",operationId:"operation.application.coupling",transport:{kind:"mcp_tool",toolName:"tracedecay_coupling"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.coupling.v1",requestSchema:{schemaId:"schema.application.primitive.coupling.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.coupling.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(104),decodeResult:S1(105)},{operation:"dashboard",operationId:"operation.application.dashboard",transport:{kind:"mcp_tool",toolName:"tracedecay_dashboard"},effect:"binds_server",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dashboard.v1",requestSchema:{schemaId:"schema.application.primitive.dashboard.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dashboard.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(106),decodeResult:S1(107)},{operation:"dead_code",operationId:"operation.application.dead_code",transport:{kind:"mcp_tool",toolName:"tracedecay_dead_code"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dead_code.v1",requestSchema:{schemaId:"schema.application.primitive.dead-code.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dead-code.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(108),decodeResult:S1(109)},{operation:"dependency_depth",operationId:"operation.application.dependency_depth",transport:{kind:"mcp_tool",toolName:"tracedecay_dependency_depth"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dependency_depth.v1",requestSchema:{schemaId:"schema.application.primitive.dependency-depth.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dependency-depth.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(110),decodeResult:S1(111)},{operation:"derives",operationId:"operation.application.derives",transport:{kind:"mcp_tool",toolName:"tracedecay_derives"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.derives.v1",requestSchema:{schemaId:"schema.application.primitive.derives.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.derives.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(112),decodeResult:S1(113)},{operation:"diagnose",operationId:"operation.application.diagnose",transport:{kind:"mcp_tool",toolName:"tracedecay_diagnose"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.diagnose.v1",requestSchema:{schemaId:"schema.application.primitive.diagnose.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.diagnose.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(114),decodeResult:S1(115)},{operation:"application_diagnostics_read",operationId:"operation.application.diagnostics_read",transport:{kind:"http",route:"/application/primitives/diagnostics_read",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.diagnostics_read.v1",requestSchema:{schemaId:"schema.application.primitive.diagnostics-read.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.diagnostics-read.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(116),decodeResult:S1(117),decodeSuccess:e=>fp(e,"binding.http.diagnostics_read.v1","schema.application.primitive.diagnostics-read.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(117))},{operation:"diff_context",operationId:"operation.application.diff_context",transport:{kind:"mcp_tool",toolName:"tracedecay_diff_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.diff_context.v1",requestSchema:{schemaId:"schema.application.primitive.diff-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.diff-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(118),decodeResult:S1(119)},{operation:"distribution",operationId:"operation.application.distribution",transport:{kind:"mcp_tool",toolName:"tracedecay_distribution"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.distribution.v1",requestSchema:{schemaId:"schema.application.primitive.distribution.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.distribution.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(120),decodeResult:S1(121)},{operation:"doc_coverage",operationId:"operation.application.doc_coverage",transport:{kind:"mcp_tool",toolName:"tracedecay_doc_coverage"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.doc_coverage.v1",requestSchema:{schemaId:"schema.application.primitive.doc-coverage.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.doc-coverage.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(122),decodeResult:S1(123)},{operation:"dsm",operationId:"operation.application.dsm",transport:{kind:"mcp_tool",toolName:"tracedecay_dsm"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dsm.v1",requestSchema:{schemaId:"schema.application.primitive.dsm.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dsm.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(124),decodeResult:S1(125)},{operation:"application_fact_feedback",operationId:"operation.application.fact_feedback",transport:{kind:"http",route:"/application/retained/fact_feedback",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_feedback.v1",requestSchema:{schemaId:"schema.application.retained.fact-feedback.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-feedback.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(126),decodeResult:S1(127),decodeSuccess:e=>fp(e,"binding.http.fact_feedback.v1","schema.application.retained.fact-feedback.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(127))},{operation:"application_fact_store_add",operationId:"operation.application.fact_store_add",transport:{kind:"http",route:"/application/retained/fact_store_add",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_add.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-add.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-add.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(128),decodeResult:S1(129),decodeSuccess:e=>fp(e,"binding.http.fact_store_add.v1","schema.application.retained.fact-store-add.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(129))},{operation:"application_fact_store_contradict",operationId:"operation.application.fact_store_contradict",transport:{kind:"http",route:"/application/retained/fact_store_contradict",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_contradict.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-contradict.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-contradict.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(130),decodeResult:S1(131),decodeSuccess:e=>fp(e,"binding.http.fact_store_contradict.v1","schema.application.retained.fact-store-contradict.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(131))},{operation:"application_fact_store_curate",operationId:"operation.application.fact_store_curate",transport:{kind:"http",route:"/application/retained/fact_store_curate",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"required",resultSemantics:"fact_store_curate_receipt",bindingId:"binding.http.fact_store_curate.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-curate.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-curate.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:9e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(132),decodeResult:S1(133),decodeSuccess:e=>fp(e,"binding.http.fact_store_curate.v1","schema.application.retained.fact-store-curate.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(133))},{operation:"application_fact_store_get",operationId:"operation.application.fact_store_get",transport:{kind:"http",route:"/application/retained/fact_store_get",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_get.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-get.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-get.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(134),decodeResult:S1(135),decodeSuccess:e=>fp(e,"binding.http.fact_store_get.v1","schema.application.retained.fact-store-get.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(135))},{operation:"application_fact_store_list",operationId:"operation.application.fact_store_list",transport:{kind:"http",route:"/application/retained/fact_store_list",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_list.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-list.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(136),decodeResult:S1(137),decodeSuccess:e=>fp(e,"binding.http.fact_store_list.v1","schema.application.retained.fact-store-list.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(137))},{operation:"application_fact_store_probe",operationId:"operation.application.fact_store_probe",transport:{kind:"http",route:"/application/retained/fact_store_probe",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_probe.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-probe.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-probe.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(138),decodeResult:S1(139),decodeSuccess:e=>fp(e,"binding.http.fact_store_probe.v1","schema.application.retained.fact-store-probe.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(139))},{operation:"application_fact_store_reason",operationId:"operation.application.fact_store_reason",transport:{kind:"http",route:"/application/retained/fact_store_reason",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_reason.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-reason.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-reason.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(140),decodeResult:S1(141),decodeSuccess:e=>fp(e,"binding.http.fact_store_reason.v1","schema.application.retained.fact-store-reason.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(141))},{operation:"application_fact_store_related",operationId:"operation.application.fact_store_related",transport:{kind:"http",route:"/application/retained/fact_store_related",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_related.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-related.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-related.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(142),decodeResult:S1(143),decodeSuccess:e=>fp(e,"binding.http.fact_store_related.v1","schema.application.retained.fact-store-related.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(143))},{operation:"application_fact_store_remove",operationId:"operation.application.fact_store_remove",transport:{kind:"http",route:"/application/retained/fact_store_remove",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_remove.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-remove.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-remove.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(144),decodeResult:S1(145),decodeSuccess:e=>fp(e,"binding.http.fact_store_remove.v1","schema.application.retained.fact-store-remove.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(145))},{operation:"application_fact_store_search",operationId:"operation.application.fact_store_search",transport:{kind:"http",route:"/application/retained/fact_store_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_search.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-search.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(146),decodeResult:S1(147),decodeSuccess:e=>fp(e,"binding.http.fact_store_search.v1","schema.application.retained.fact-store-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(147))},{operation:"application_fact_store_supersede",operationId:"operation.application.fact_store_supersede",transport:{kind:"http",route:"/application/retained/fact_store_supersede",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_supersede.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-supersede.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-supersede.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(148),decodeResult:S1(149),decodeSuccess:e=>fp(e,"binding.http.fact_store_supersede.v1","schema.application.retained.fact-store-supersede.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(149))},{operation:"application_fact_store_update",operationId:"operation.application.fact_store_update",transport:{kind:"http",route:"/application/retained/fact_store_update",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_update.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-update.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-update.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(150),decodeResult:S1(151),decodeSuccess:e=>fp(e,"binding.http.fact_store_update.v1","schema.application.retained.fact-store-update.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(151))},{operation:"application_feedback_advisory_cycle",operationId:"operation.application.feedback_advisory_cycle",transport:{kind:"http",route:"/application/feedback/advisory_cycle",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_advisory_cycle.v1",requestSchema:{schemaId:"schema.application.feedback.advisory-cycle.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.advisory-cycle.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(152),decodeResult:S1(153),decodeSuccess:e=>fp(e,"binding.http.feedback_advisory_cycle.v1","schema.application.feedback.advisory-cycle.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(153))},{operation:"application_feedback_diagnostics",operationId:"operation.application.feedback_diagnostics",transport:{kind:"http",route:"/application/feedback/diagnostics",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_diagnostics.v1",requestSchema:{schemaId:"schema.application.feedback.diagnostics.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.diagnostics.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(154),decodeSuccess:e=>fp(e,"binding.http.feedback_diagnostics.v1","schema.application.feedback.diagnostics.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(154))},{operation:"application_feedback_expand",operationId:"operation.application.feedback_expand",transport:{kind:"http",route:"/application/feedback/expand",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_expand.v1",requestSchema:{schemaId:"schema.application.feedback.expand.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.expand.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(155),decodeSuccess:e=>fp(e,"binding.http.feedback_expand.v1","schema.application.feedback.expand.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(155))},{operation:"application_feedback_get",operationId:"operation.application.feedback_get",transport:{kind:"http",route:"/application/feedback/get",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_get.v1",requestSchema:{schemaId:"schema.application.feedback.get.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.get.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(156),decodeSuccess:e=>fp(e,"binding.http.feedback_get.v1","schema.application.feedback.get.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(156))},{operation:"application_feedback_impact",operationId:"operation.application.feedback_impact",transport:{kind:"http",route:"/application/feedback/impact",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_impact.v1",requestSchema:{schemaId:"schema.application.feedback.impact.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.impact.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(157),decodeSuccess:e=>fp(e,"binding.http.feedback_impact.v1","schema.application.feedback.impact.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(157))},{operation:"application_feedback_list",operationId:"operation.application.feedback_list",transport:{kind:"http",route:"/application/feedback/list",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_list.v1",requestSchema:{schemaId:"schema.application.feedback.list.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(158),decodeSuccess:e=>fp(e,"binding.http.feedback_list.v1","schema.application.feedback.list.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(158))},{operation:"application_feedback_proximity",operationId:"operation.application.feedback_proximity",transport:{kind:"http",route:"/application/feedback/proximity",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_proximity.v1",requestSchema:{schemaId:"schema.application.feedback.proximity.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.proximity.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(159),decodeResult:S1(160),decodeSuccess:e=>fp(e,"binding.http.feedback_proximity.v1","schema.application.feedback.proximity.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(160))},{operation:"field_sites",operationId:"operation.application.field_sites",transport:{kind:"mcp_tool",toolName:"tracedecay_field_sites"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.field_sites.v1",requestSchema:{schemaId:"schema.application.primitive.field-sites.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.field-sites.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(161),decodeResult:S1(162)},{operation:"application_file_dependents",operationId:"operation.application.file_dependents",transport:{kind:"http",route:"/application/primitives/file_dependents",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.file_dependents.v1",requestSchema:{schemaId:"schema.application.primitive.file-dependents.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.file-dependents.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(163),decodeResult:S1(164),decodeSuccess:e=>fp(e,"binding.http.file_dependents.v1","schema.application.primitive.file-dependents.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(164))},{operation:"files",operationId:"operation.application.files",transport:{kind:"mcp_tool",toolName:"tracedecay_files"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.files.v1",requestSchema:{schemaId:"schema.application.primitive.files.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.files.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(165),decodeResult:S1(166)},{operation:"find_exact_symbol",operationId:"operation.application.find_exact_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_find_exact_symbol"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.find_exact_symbol.v1",requestSchema:{schemaId:"schema.application.primitive.find-exact-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.find-exact-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(167),decodeResult:S1(168)},{operation:"gini",operationId:"operation.application.gini",transport:{kind:"mcp_tool",toolName:"tracedecay_gini"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.gini.v1",requestSchema:{schemaId:"schema.application.primitive.gini.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.gini.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(169),decodeResult:S1(170)},{operation:"git_apply",operationId:"operation.application.git_apply",transport:{kind:"mcp_tool",toolName:"tracedecay_git_apply"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.git_apply.v1",requestSchema:{schemaId:"schema.application.git.apply.request",revision:1},resultSchema:{schemaId:"schema.application.git.apply.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(171),decodeResult:S1(172)},{operation:"application_git_blame",operationId:"operation.application.git_blame",transport:{kind:"http",route:"/application/git/blame",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_blame.v1",requestSchema:{schemaId:"schema.application.git.blame.request",revision:1},resultSchema:{schemaId:"schema.application.git.blame.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(173),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_blame.v1","schema.application.git.blame.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_git_diff",operationId:"operation.application.git_diff",transport:{kind:"http",route:"/application/git/diff",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_diff.v1",requestSchema:{schemaId:"schema.application.git.diff.request",revision:1},resultSchema:{schemaId:"schema.application.git.diff.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(175),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_diff.v1","schema.application.git.diff.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_git_history",operationId:"operation.application.git_history",transport:{kind:"http",route:"/application/git/history",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_history.v1",requestSchema:{schemaId:"schema.application.git.history.request",revision:1},resultSchema:{schemaId:"schema.application.git.history.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(176),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_history.v1","schema.application.git.history.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_git_hunks",operationId:"operation.application.git_hunks",transport:{kind:"http",route:"/application/git/hunks",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_hunks.v1",requestSchema:{schemaId:"schema.application.git.hunks.request",revision:1},resultSchema:{schemaId:"schema.application.git.hunks.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(177),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_hunks.v1","schema.application.git.hunks.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"git_preview",operationId:"operation.application.git_preview",transport:{kind:"mcp_tool",toolName:"tracedecay_git_preview"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.git_preview.v1",requestSchema:{schemaId:"schema.application.git.preview.request",revision:1},resultSchema:{schemaId:"schema.application.git.preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(178),decodeResult:S1(179)},{operation:"application_git_status",operationId:"operation.application.git_status",transport:{kind:"http",route:"/application/git/status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_status.v1",requestSchema:{schemaId:"schema.application.git.status.request",revision:1},resultSchema:{schemaId:"schema.application.git.status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(180),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_status.v1","schema.application.git.status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_github_stack_signal_expand",operationId:"operation.application.github_stack_signal_expand",transport:{kind:"http",route:"/application/github-stack/signal-expand",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.github_stack_signal_expand.v1",requestSchema:{schemaId:"schema.application.github-stack.signal-expand.request",revision:1},resultSchema:{schemaId:"schema.application.github-stack.signal-expand.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(181),decodeResult:S1(182),decodeSuccess:e=>fp(e,"binding.http.github_stack_signal_expand.v1","schema.application.github-stack.signal-expand.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(182))},{operation:"god_class",operationId:"operation.application.god_class",transport:{kind:"mcp_tool",toolName:"tracedecay_god_class"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.god_class.v1",requestSchema:{schemaId:"schema.application.primitive.god-class.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.god-class.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(183),decodeResult:S1(184)},{operation:"grep",operationId:"operation.application.grep",transport:{kind:"mcp_tool",toolName:"tracedecay_grep"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.grep.v1",requestSchema:{schemaId:"schema.application.primitive.grep.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.grep.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(185),decodeResult:S1(186)},{operation:"health",operationId:"operation.application.health",transport:{kind:"mcp_tool",toolName:"tracedecay_health"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.health.v1",requestSchema:{schemaId:"schema.application.primitive.health.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.health.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(187),decodeResult:S1(188)},{operation:"application_health_delta",operationId:"operation.application.health_delta",transport:{kind:"http",route:"/application/primitives/health_delta",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.health_delta.v1",requestSchema:{schemaId:"schema.application.primitive.health-delta.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.health-delta.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(189),decodeResult:S1(190),decodeSuccess:e=>fp(e,"binding.http.health_delta.v1","schema.application.primitive.health-delta.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(190))},{operation:"application_health_read",operationId:"operation.application.health_read",transport:{kind:"http",route:"/application/primitives/health_read",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.health_read.v1",requestSchema:{schemaId:"schema.application.primitive.health-read.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.health-read.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(191),decodeResult:S1(192),decodeSuccess:e=>fp(e,"binding.http.health_read.v1","schema.application.primitive.health-read.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(192))},{operation:"hermes_skill_bridge",operationId:"operation.application.hermes_skill_bridge",transport:{kind:"mcp_tool",toolName:"tracedecay_hermes_skill_bridge"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.hermes_skill_bridge.v1",requestSchema:{schemaId:"schema.application.primitive.hermes-skill-bridge.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.hermes-skill-bridge.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(193),decodeResult:S1(194)},{operation:"hook_runtime",operationId:"operation.application.hook_runtime",transport:{kind:"mcp_tool",toolName:"tracedecay_hook_runtime"},effect:"records_host_evidence",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.hook_runtime.v1",requestSchema:{schemaId:"schema.application.primitive.hook-runtime.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.hook-runtime.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(195),decodeResult:S1(196)},{operation:"hotspots",operationId:"operation.application.hotspots",transport:{kind:"mcp_tool",toolName:"tracedecay_hotspots"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.hotspots.v1",requestSchema:{schemaId:"schema.application.primitive.hotspots.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.hotspots.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(197),decodeResult:S1(198)},{operation:"impact",operationId:"operation.application.impact",transport:{kind:"mcp_tool",toolName:"tracedecay_impact"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.impact.v1",requestSchema:{schemaId:"schema.application.primitive.impact.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.impact.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(199),decodeResult:S1(200)},{operation:"inheritance_depth",operationId:"operation.application.inheritance_depth",transport:{kind:"mcp_tool",toolName:"tracedecay_inheritance_depth"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.inheritance_depth.v1",requestSchema:{schemaId:"schema.application.primitive.inheritance-depth.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.inheritance-depth.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(201),decodeResult:S1(202)},{operation:"insert_at",operationId:"operation.application.insert_at",transport:{kind:"mcp_tool",toolName:"tracedecay_insert_at"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.insert_at.v1",requestSchema:{schemaId:"schema.application.source-edit.insert-at.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.insert-at.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(203),decodeResult:S1(18)},{operation:"insert_at_symbol",operationId:"operation.application.insert_at_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_insert_at_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.insert_at_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.insert-at-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.insert-at-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(204),decodeResult:S1(18)},{operation:"largest",operationId:"operation.application.largest",transport:{kind:"mcp_tool",toolName:"tracedecay_largest"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.largest.v1",requestSchema:{schemaId:"schema.application.primitive.largest.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.largest.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(205),decodeResult:S1(206)},{operation:"application_lcm_describe",operationId:"operation.application.lcm_describe",transport:{kind:"http",route:"/application/retained/lcm_describe",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_describe.v1",requestSchema:{schemaId:"schema.application.retained.lcm-describe.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-describe.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(207),decodeResult:S1(208),decodeSuccess:e=>fp(e,"binding.http.lcm_describe.v1","schema.application.retained.lcm-describe.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(208))},{operation:"application_lcm_doctor",operationId:"operation.application.lcm_doctor",transport:{kind:"http",route:"/application/retained/lcm_doctor",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_doctor.v1",requestSchema:{schemaId:"schema.application.retained.lcm-doctor.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-doctor.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(209),decodeResult:S1(210),decodeSuccess:e=>fp(e,"binding.http.lcm_doctor.v1","schema.application.retained.lcm-doctor.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(210))},{operation:"application_lcm_expand",operationId:"operation.application.lcm_expand",transport:{kind:"http",route:"/application/retained/lcm_expand",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_expand.v1",requestSchema:{schemaId:"schema.application.retained.lcm-expand.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-expand.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(211),decodeResult:S1(212),decodeSuccess:e=>fp(e,"binding.http.lcm_expand.v1","schema.application.retained.lcm-expand.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(212))},{operation:"application_lcm_expand_query",operationId:"operation.application.lcm_expand_query",transport:{kind:"http",route:"/application/retained/lcm_expand_query",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_expand_query.v1",requestSchema:{schemaId:"schema.application.retained.lcm-expand-query.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-expand-query.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(213),decodeResult:S1(214),decodeSuccess:e=>fp(e,"binding.http.lcm_expand_query.v1","schema.application.retained.lcm-expand-query.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(214))},{operation:"application_lcm_grep",operationId:"operation.application.lcm_grep",transport:{kind:"http",route:"/application/retained/lcm_grep",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_grep.v1",requestSchema:{schemaId:"schema.application.retained.lcm-grep.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-grep.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(215),decodeResult:S1(216),decodeSuccess:e=>fp(e,"binding.http.lcm_grep.v1","schema.application.retained.lcm-grep.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(216))},{operation:"application_lcm_load_session",operationId:"operation.application.lcm_load_session",transport:{kind:"http",route:"/application/retained/lcm_load_session",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_load_session.v1",requestSchema:{schemaId:"schema.application.retained.lcm-load-session.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-load-session.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(217),decodeResult:S1(218),decodeSuccess:e=>fp(e,"binding.http.lcm_load_session.v1","schema.application.retained.lcm-load-session.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(218))},{operation:"application_lcm_status",operationId:"operation.application.lcm_status",transport:{kind:"http",route:"/application/retained/lcm_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_status.v1",requestSchema:{schemaId:"schema.application.retained.lcm-status.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(219),decodeResult:S1(220),decodeSuccess:e=>fp(e,"binding.http.lcm_status.v1","schema.application.retained.lcm-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(220))},{operation:"application_memory_status",operationId:"operation.application.memory_status",transport:{kind:"http",route:"/application/retained/memory_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.memory_status.v1",requestSchema:{schemaId:"schema.application.retained.memory-status.request",revision:1},resultSchema:{schemaId:"schema.application.retained.memory-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(221),decodeResult:S1(222),decodeSuccess:e=>fp(e,"binding.http.memory_status.v1","schema.application.retained.memory-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(222))},{operation:"application_message_search",operationId:"operation.application.message_search",transport:{kind:"http",route:"/application/retained/message_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.message_search.v1",requestSchema:{schemaId:"schema.application.retained.message-search.request",revision:1},resultSchema:{schemaId:"schema.application.retained.message-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(223),decodeResult:S1(224),decodeSuccess:e=>fp(e,"binding.http.message_search.v1","schema.application.retained.message-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(224))},{operation:"application_module_api",operationId:"operation.application.module_api",transport:{kind:"http",route:"/application/primitives/module_api",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.module_api.v1",requestSchema:{schemaId:"schema.application.primitive.module-api.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.module-api.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(225),decodeResult:S1(226),decodeSuccess:e=>fp(e,"binding.http.module_api.v1","schema.application.primitive.module-api.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(226))},{operation:"move_symbol",operationId:"operation.application.move_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_move_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.move_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.move-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.move-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(227),decodeResult:S1(18)},{operation:"multi_str_replace",operationId:"operation.application.multi_str_replace",transport:{kind:"mcp_tool",toolName:"tracedecay_multi_str_replace"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.multi_str_replace.v1",requestSchema:{schemaId:"schema.application.source-edit.multi-str-replace.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.multi-str-replace.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(228),decodeResult:S1(18)},{operation:"native_integration_status",operationId:"operation.application.native_integration_status",transport:{kind:"mcp_tool",toolName:"tracedecay_native_integration_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.native_integration_status.v1",requestSchema:{schemaId:"schema.application.native-integration.status.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(229),decodeResult:S1(15)},{operation:"node",operationId:"operation.application.node",transport:{kind:"mcp_tool",toolName:"tracedecay_node"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.node.v1",requestSchema:{schemaId:"schema.application.primitive.node.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.node.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(230),decodeResult:S1(231)},{operation:"observatory_read",operationId:"operation.application.observatory_read",transport:{kind:"mcp_tool",toolName:"tracedecay_observatory_read"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.observatory_read.v1",requestSchema:{schemaId:"schema.application.observatory-read.request",revision:1},resultSchema:{schemaId:"schema.application.observatory-read.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(232),decodeResult:S1(233)},{operation:"port_order",operationId:"operation.application.port_order",transport:{kind:"mcp_tool",toolName:"tracedecay_port_order"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.port_order.v1",requestSchema:{schemaId:"schema.application.primitive.port-order.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.port-order.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(234),decodeResult:S1(235)},{operation:"port_status",operationId:"operation.application.port_status",transport:{kind:"mcp_tool",toolName:"tracedecay_port_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.port_status.v1",requestSchema:{schemaId:"schema.application.primitive.port-status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.port-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(236),decodeResult:S1(237)},{operation:"pr_context",operationId:"operation.application.pr_context",transport:{kind:"mcp_tool",toolName:"tracedecay_pr_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.pr_context.v1",requestSchema:{schemaId:"schema.application.primitive.pr-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.pr-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(238),decodeResult:S1(239)},{operation:"preflight_native_integration",operationId:"operation.application.preflight_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_preflight_native_integration"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.preflight_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.preflight.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.preflight.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(240),decodeResult:S1(15)},{operation:"project_context",operationId:"operation.application.project_context",transport:{kind:"mcp_tool",toolName:"tracedecay_project_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.project_context.v1",requestSchema:{schemaId:"schema.application.primitive.project-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.project-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(241),decodeResult:S1(242)},{operation:"project_list",operationId:"operation.application.project_list",transport:{kind:"mcp_tool",toolName:"tracedecay_project_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.project_list.v1",requestSchema:{schemaId:"schema.application.primitive.project-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.project-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(243),decodeResult:S1(244)},{operation:"project_search",operationId:"operation.application.project_search",transport:{kind:"mcp_tool",toolName:"tracedecay_project_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.project_search.v1",requestSchema:{schemaId:"schema.application.primitive.project-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.project-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(245),decodeResult:S1(244)},{operation:"application_qualified_name",operationId:"operation.application.qualified_name",transport:{kind:"http",route:"/application/primitives/qualified_name",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.qualified_name.v1",requestSchema:{schemaId:"schema.application.primitive.qualified-name.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.qualified-name.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(246),decodeResult:S1(247),decodeSuccess:e=>fp(e,"binding.http.qualified_name.v1","schema.application.primitive.qualified-name.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(247))},{operation:"rank",operationId:"operation.application.rank",transport:{kind:"mcp_tool",toolName:"tracedecay_rank"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.rank.v1",requestSchema:{schemaId:"schema.application.primitive.rank.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.rank.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(248),decodeResult:S1(249)},{operation:"recursion",operationId:"operation.application.recursion",transport:{kind:"mcp_tool",toolName:"tracedecay_recursion"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.recursion.v1",requestSchema:{schemaId:"schema.application.primitive.recursion.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.recursion.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(250),decodeResult:S1(251)},{operation:"redundancy",operationId:"operation.application.redundancy",transport:{kind:"mcp_tool",toolName:"tracedecay_redundancy"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.redundancy.v1",requestSchema:{schemaId:"schema.application.primitive.redundancy.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.redundancy.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(252),decodeResult:S1(253)},{operation:"remote_status",operationId:"operation.application.remote_status",transport:{kind:"mcp_tool",toolName:"tracedecay_remote_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.remote_status.v1",requestSchema:{schemaId:"schema.application.primitive.remote-status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.remote-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(254),decodeResult:S1(255)},{operation:"rename_preview",operationId:"operation.application.rename_preview",transport:{kind:"mcp_tool",toolName:"tracedecay_rename_preview"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.rename_preview.v1",requestSchema:{schemaId:"schema.application.primitive.rename-preview.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.rename-preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(256),decodeResult:S1(257)},{operation:"rename_symbol",operationId:"operation.application.rename_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_rename_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.rename_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.rename-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.rename-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(258),decodeResult:S1(18)},{operation:"replace_symbol",operationId:"operation.application.replace_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_replace_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.replace_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.replace-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.replace-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(259),decodeResult:S1(18)},{operation:"retrieve",operationId:"operation.application.retrieve",transport:{kind:"mcp_tool",toolName:"tracedecay_retrieve"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.retrieve.v1",requestSchema:{schemaId:"schema.application.primitive.retrieve.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.retrieve.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(260),decodeResult:S1(261)},{operation:"run_affected_tests",operationId:"operation.application.run_affected_tests",transport:{kind:"mcp_tool",toolName:"tracedecay_run_affected_tests"},effect:"spawns_process",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.run_affected_tests.v1",requestSchema:{schemaId:"schema.application.primitive.run-affected-tests.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.run-affected-tests.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","effect_in_flight"]},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(262),decodeResult:S1(263)},{operation:"runtime",operationId:"operation.application.runtime",transport:{kind:"mcp_tool",toolName:"tracedecay_runtime"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.runtime.v1",requestSchema:{schemaId:"schema.application.primitive.runtime.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.runtime.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(264),decodeResult:S1(265)},{operation:"search",operationId:"operation.application.search",transport:{kind:"mcp_tool",toolName:"tracedecay_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.search.v1",requestSchema:{schemaId:"schema.application.primitive.search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(266),decodeResult:S1(267)},{operation:"session_lookup",operationId:"operation.application.session_lookup",transport:{kind:"mcp_tool",toolName:"tracedecay_session_lookup"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.session_lookup.v1",requestSchema:{schemaId:"schema.application.primitive.session-lookup.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.session-lookup.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(268),decodeResult:S1(269)},{operation:"application_session_refresh_begin",operationId:"operation.application.session_refresh_begin",transport:{kind:"http",route:"/application/retained/session_refresh_begin",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.session_refresh_begin.v1",requestSchema:{schemaId:"schema.application.retained.session-refresh-begin.request",revision:1},resultSchema:{schemaId:"schema.application.retained.session-refresh-begin.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(270),decodeResult:S1(271),decodeSuccess:e=>fp(e,"binding.http.session_refresh_begin.v1","schema.application.retained.session-refresh-begin.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(271))},{operation:"application_session_refresh_cancel",operationId:"operation.application.session_refresh_cancel",transport:{kind:"http",route:"/application/retained/session_refresh_cancel",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.session_refresh_cancel.v1",requestSchema:{schemaId:"schema.application.retained.session-refresh-cancel.request",revision:1},resultSchema:{schemaId:"schema.application.retained.session-refresh-cancel.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(270),decodeResult:S1(272),decodeSuccess:e=>fp(e,"binding.http.session_refresh_cancel.v1","schema.application.retained.session-refresh-cancel.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(272))},{operation:"application_session_refresh_status",operationId:"operation.application.session_refresh_status",transport:{kind:"http",route:"/application/retained/session_refresh_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.session_refresh_status.v1",requestSchema:{schemaId:"schema.application.retained.session-refresh-status.request",revision:1},resultSchema:{schemaId:"schema.application.retained.session-refresh-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(270),decodeResult:S1(273),decodeSuccess:e=>fp(e,"binding.http.session_refresh_status.v1","schema.application.retained.session-refresh-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(273))},{operation:"application_sessions_for",operationId:"operation.application.sessions_for",transport:{kind:"http",route:"/application/retained/sessions_for",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.sessions_for.v1",requestSchema:{schemaId:"schema.application.retained.sessions-for.request",revision:1},resultSchema:{schemaId:"schema.application.retained.sessions-for.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(274),decodeResult:S1(275),decodeSuccess:e=>fp(e,"binding.http.sessions_for.v1","schema.application.retained.sessions-for.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(275))},{operation:"signature",operationId:"operation.application.signature",transport:{kind:"mcp_tool",toolName:"tracedecay_signature"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.signature.v1",requestSchema:{schemaId:"schema.application.primitive.signature.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.signature.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(112),decodeResult:S1(276)},{operation:"similar",operationId:"operation.application.similar",transport:{kind:"mcp_tool",toolName:"tracedecay_similar"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.similar.v1",requestSchema:{schemaId:"schema.application.primitive.similar.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.similar.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(277),decodeResult:S1(278)},{operation:"skill_list",operationId:"operation.application.skill_list",transport:{kind:"mcp_tool",toolName:"tracedecay_skill_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.skill_list.v1",requestSchema:{schemaId:"schema.application.primitive.skill-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.skill-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(279),decodeResult:S1(280)},{operation:"skill_view",operationId:"operation.application.skill_view",transport:{kind:"mcp_tool",toolName:"tracedecay_skill_view"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.skill_view.v1",requestSchema:{schemaId:"schema.application.primitive.skill-view.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.skill-view.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(281),decodeResult:S1(282)},{operation:"application_source_body",operationId:"operation.application.source_body",transport:{kind:"http",route:"/application/primitives/source_body",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.source_body.v1",requestSchema:{schemaId:"schema.application.primitive.source-body.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.source-body.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(283),decodeResult:S1(284),decodeSuccess:e=>fp(e,"binding.http.source_body.v1","schema.application.primitive.source-body.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(284))},{operation:"source_edit_reconcile",operationId:"operation.application.source_edit_reconcile",transport:{kind:"mcp_tool",toolName:"tracedecay_source_edit_reconcile"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.source_edit_reconcile.v1",requestSchema:{schemaId:"schema.application.source-edit.reconcile.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.reconcile.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(285),decodeResult:S1(18)},{operation:"application_source_lines",operationId:"operation.application.source_lines",transport:{kind:"http",route:"/application/primitives/source_lines",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.source_lines.v1",requestSchema:{schemaId:"schema.application.primitive.source-lines.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.source-lines.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(286),decodeResult:S1(287),decodeSuccess:e=>fp(e,"binding.http.source_lines.v1","schema.application.primitive.source-lines.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(287))},{operation:"application_source_outline",operationId:"operation.application.source_outline",transport:{kind:"http",route:"/application/primitives/source_outline",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.source_outline.v1",requestSchema:{schemaId:"schema.application.primitive.source-outline.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.source-outline.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(288),decodeResult:S1(289),decodeSuccess:e=>fp(e,"binding.http.source_outline.v1","schema.application.primitive.source-outline.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(289))},{operation:"stack_snapshot",operationId:"operation.application.stack_snapshot",transport:{kind:"mcp_tool",toolName:"tracedecay_stack_snapshot"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.stack_snapshot.v1",requestSchema:{schemaId:"schema.application.native-integration.stack-snapshot.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.stack-snapshot.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(290),decodeResult:S1(15)},{operation:"status",operationId:"operation.application.status",transport:{kind:"mcp_tool",toolName:"tracedecay_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.status.v1",requestSchema:{schemaId:"schema.application.primitive.status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(291),decodeResult:S1(292)},{operation:"application_storage_status",operationId:"operation.application.storage_status",transport:{kind:"http",route:"/application/primitives/storage_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.storage_status.v1",requestSchema:{schemaId:"schema.application.primitive.storage-status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.storage-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(293),decodeResult:S1(294),decodeSuccess:e=>fp(e,"binding.http.storage_status.v1","schema.application.primitive.storage-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(294))},{operation:"str_replace",operationId:"operation.application.str_replace",transport:{kind:"mcp_tool",toolName:"tracedecay_str_replace"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.str_replace.v1",requestSchema:{schemaId:"schema.application.source-edit.str-replace.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.str-replace.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(295),decodeResult:S1(18)},{operation:"test_map",operationId:"operation.application.test_map",transport:{kind:"mcp_tool",toolName:"tracedecay_test_map"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.test_map.v1",requestSchema:{schemaId:"schema.application.primitive.test-map.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.test-map.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(296),decodeResult:S1(297)},{operation:"application_test_results",operationId:"operation.application.test_results",transport:{kind:"http",route:"/application/tests/results",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.test_results.v1",requestSchema:{schemaId:"schema.application.feedback.test-results.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.test-results.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(298),decodeResult:S1(299),decodeSuccess:e=>fp(e,"binding.http.test_results.v1","schema.application.feedback.test-results.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(299))},{operation:"test_risk",operationId:"operation.application.test_risk",transport:{kind:"mcp_tool",toolName:"tracedecay_test_risk"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.test_risk.v1",requestSchema:{schemaId:"schema.application.primitive.test-risk.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.test-risk.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(300),decodeResult:S1(301)},{operation:"todos",operationId:"operation.application.todos",transport:{kind:"mcp_tool",toolName:"tracedecay_todos"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.todos.v1",requestSchema:{schemaId:"schema.application.primitive.todos.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.todos.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(302),decodeResult:S1(303)},{operation:"unmounted_files",operationId:"operation.application.unmounted_files",transport:{kind:"mcp_tool",toolName:"tracedecay_unmounted_files"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.unmounted_files.v1",requestSchema:{schemaId:"schema.application.primitive.unmounted-files.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.unmounted-files.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(304),decodeResult:S1(305)},{operation:"unsafe_patterns",operationId:"operation.application.unsafe_patterns",transport:{kind:"mcp_tool",toolName:"tracedecay_unsafe_patterns"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.unsafe_patterns.v1",requestSchema:{schemaId:"schema.application.primitive.unsafe-patterns.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.unsafe-patterns.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(306),decodeResult:S1(307)},{operation:"application_workflows",operationId:"operation.application.workflows",transport:{kind:"http",route:"/application/retained/workflows",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflows.v1",requestSchema:{schemaId:"schema.application.retained.workflows.request",revision:1},resultSchema:{schemaId:"schema.application.retained.workflows.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(308),decodeResult:S1(309),decodeSuccess:e=>fp(e,"binding.http.workflows.v1","schema.application.retained.workflows.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(309))},{operation:"application_worktree_cleanup_confirm",operationId:"operation.application.worktree_cleanup_confirm",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_confirm",method:"POST"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_confirm.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-confirm.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-confirm.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(310),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_confirm.v1","schema.application.native-integration.worktree-cleanup-confirm.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"application_worktree_cleanup_inspect",operationId:"operation.application.worktree_cleanup_inspect",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_inspect",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_inspect.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-inspect.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-inspect.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(311),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_inspect.v1","schema.application.native-integration.worktree-cleanup-inspect.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"application_worktree_cleanup_reconcile",operationId:"operation.application.worktree_cleanup_reconcile",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_reconcile",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_reconcile.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-reconcile.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-reconcile.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(312),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_reconcile.v1","schema.application.native-integration.worktree-cleanup-reconcile.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"application_worktree_cleanup_remove",operationId:"operation.application.worktree_cleanup_remove",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_remove",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_remove.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-remove.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-remove.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(313),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_remove.v1","schema.application.native-integration.worktree-cleanup-remove.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(15))},{operation:"application_worktree_inventory",operationId:"operation.application.worktree_inventory",transport:{kind:"http",route:"/application/native-integration/worktree_inventory",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_inventory.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-inventory.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-inventory.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(314),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_inventory.v1","schema.application.native-integration.worktree-inventory.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"handoff_issue_task_handoff",operationId:"operation.handoff.issue_task_handoff",transport:{kind:"http",route:"/application/handoff/issue-task",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.issue_task_handoff",requestSchema:{schemaId:"schema.handoff.issue_task_handoff.request",revision:1},resultSchema:{schemaId:"schema.handoff.issue_task_handoff.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(315),decodeResult:S1(316),decodeSuccess:e=>fp(e,"binding.http.handoff.issue_task_handoff","schema.handoff.issue_task_handoff.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(316))},{operation:"handoff_list_task_handoffs",operationId:"operation.handoff.list_task_handoffs",transport:{kind:"http",route:"/application/handoff/list-task",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.list_task_handoffs",requestSchema:{schemaId:"schema.handoff.list_task_handoffs.request",revision:1},resultSchema:{schemaId:"schema.handoff.list_task_handoffs.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","partial"],decodeRequest:S1(317),decodeResult:S1(318),decodeSuccess:e=>fp(e,"binding.http.handoff.list_task_handoffs","schema.handoff.list_task_handoffs.result",1,["completed","timed_out","failed","partial"],{mode:"not_cancellable"},"operation","not_required",S1(318))},{operation:"handoff_open_investigation_handoff",operationId:"operation.handoff.open_investigation_handoff",transport:{kind:"http",route:"/application/handoff/open-investigation",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.open_investigation_handoff",requestSchema:{schemaId:"schema.handoff.open_investigation_handoff.request",revision:1},resultSchema:{schemaId:"schema.handoff.open_investigation_handoff.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(319),decodeResult:S1(320),decodeSuccess:e=>fp(e,"binding.http.handoff.open_investigation_handoff","schema.handoff.open_investigation_handoff.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(320))},{operation:"handoff_open_task_handoff",operationId:"operation.handoff.open_task_handoff",transport:{kind:"http",route:"/application/handoff/open-task",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.open_task_handoff",requestSchema:{schemaId:"schema.handoff.open_task_handoff.request",revision:1},resultSchema:{schemaId:"schema.handoff.open_task_handoff.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(321),decodeResult:S1(322),decodeSuccess:e=>fp(e,"binding.http.handoff.open_task_handoff","schema.handoff.open_task_handoff.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(322))},{operation:"multi_root_execute",operationId:"operation.multi_root.execute",transport:{kind:"http",route:"/application/multi-root/execute",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.multi_root.execute.v1",requestSchema:{schemaId:"schema.tracedecay.multi-root.execute-request.v1",revision:1},resultSchema:{schemaId:"schema.tracedecay.multi-root.execute-result.v1",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(323),decodeResult:S1(324),decodeSuccess:e=>fp(e,"binding.http.multi_root.execute.v1","schema.tracedecay.multi-root.execute-result.v1",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(324))},{operation:"multi_root_scope_set_compare_and_swap",operationId:"operation.multi_root.scope_set_compare_and_swap",transport:{kind:"http",route:"/application/multi-root/scope-set/compare-and-swap",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.multi_root.scope_set_compare_and_swap.v1",requestSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-compare-and-swap-request.v1",revision:1},resultSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-compare-and-swap-result.v1",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(325),decodeResult:S1(326),decodeSuccess:e=>fp(e,"binding.http.multi_root.scope_set_compare_and_swap.v1","schema.tracedecay.multi-root.scope-set-compare-and-swap-result.v1",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(326))},{operation:"multi_root_scope_set_read",operationId:"operation.multi_root.scope_set_read",transport:{kind:"http",route:"/application/multi-root/scope-set/read",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.multi_root.scope_set_read.v1",requestSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-read-request.v1",revision:1},resultSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-read-result.v1",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(327),decodeResult:S1(328),decodeSuccess:e=>fp(e,"binding.http.multi_root.scope_set_read.v1","schema.tracedecay.multi-root.scope-set-read-result.v1",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(328))},{operation:"work_accept_proposal",operationId:"operation.work.accept_proposal",transport:{kind:"http",route:"/application/work/accept-proposal",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.accept_proposal",requestSchema:{schemaId:"schema.work.accept_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.accept_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(329),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.accept_proposal","schema.work.accept_proposal.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_adjudicate_duplicate",operationId:"operation.work.adjudicate_duplicate",transport:{kind:"http",route:"/application/work/adjudicate-duplicate",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.adjudicate_duplicate",requestSchema:{schemaId:"schema.work.adjudicate_duplicate.request",revision:1},resultSchema:{schemaId:"schema.work.adjudicate_duplicate.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(331),decodeResult:S1(332),decodeSuccess:e=>fp(e,"binding.http.work.adjudicate_duplicate","schema.work.adjudicate_duplicate.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(332))},{operation:"work_adjudicate_leak",operationId:"operation.work.adjudicate_leak",transport:{kind:"http",route:"/application/work/adjudicate-leak",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.adjudicate_leak",requestSchema:{schemaId:"schema.work.adjudicate_leak.request",revision:1},resultSchema:{schemaId:"schema.work.adjudicate_leak.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(333),decodeResult:S1(334),decodeSuccess:e=>fp(e,"binding.http.work.adjudicate_leak","schema.work.adjudicate_leak.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(334))},{operation:"work_admit_execution",operationId:"operation.work.admit_execution",transport:{kind:"http",route:"/application/work/admit-execution",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.admit_execution",requestSchema:{schemaId:"schema.work.admit_execution.request",revision:1},resultSchema:{schemaId:"schema.work.admit_execution.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(335),decodeResult:S1(336),decodeSuccess:e=>fp(e,"binding.http.work.admit_execution","schema.work.admit_execution.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(336))},{operation:"work_admit_placement",operationId:"operation.work.admit_placement",transport:{kind:"http",route:"/application/work/admit-placement",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.admit_placement",requestSchema:{schemaId:"schema.work.admit_placement.request",revision:1},resultSchema:{schemaId:"schema.work.admit_placement.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(337),decodeResult:S1(338),decodeSuccess:e=>fp(e,"binding.http.work.admit_placement","schema.work.admit_placement.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(338))},{operation:"work_advance_job",operationId:"operation.work.advance_job",transport:{kind:"http",route:"/application/work/advance-job",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.advance_job",requestSchema:{schemaId:"schema.work.advance_job.request",revision:1},resultSchema:{schemaId:"schema.work.advance_job.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(339),decodeResult:S1(340),decodeSuccess:e=>fp(e,"binding.http.work.advance_job","schema.work.advance_job.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(340))},{operation:"work_attempt_status",operationId:"operation.work.attempt_status",transport:{kind:"http",route:"/application/work/attempt-status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.attempt_status",requestSchema:{schemaId:"schema.work.attempt_status.request",revision:1},resultSchema:{schemaId:"schema.work.attempt_status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(341),decodeResult:S1(342),decodeSuccess:e=>fp(e,"binding.http.work.attempt_status","schema.work.attempt_status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(342))},{operation:"work_cancel_attempt",operationId:"operation.work.cancel_attempt",transport:{kind:"http",route:"/application/work/cancel-attempt",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.cancel_attempt",requestSchema:{schemaId:"schema.work.cancel_attempt.request",revision:1},resultSchema:{schemaId:"schema.work.cancel_attempt.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(343),decodeResult:S1(342),decodeSuccess:e=>fp(e,"binding.http.work.cancel_attempt","schema.work.cancel_attempt.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(342))},{operation:"work_compare_proposal",operationId:"operation.work.compare_proposal",transport:{kind:"http",route:"/application/work/compare-proposal",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.compare_proposal",requestSchema:{schemaId:"schema.work.compare_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.compare_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(344),decodeResult:S1(345),decodeSuccess:e=>fp(e,"binding.http.work.compare_proposal","schema.work.compare_proposal.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(345))},{operation:"work_create",operationId:"operation.work.create",transport:{kind:"http",route:"/application/work/create",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.create",requestSchema:{schemaId:"schema.work.create.request",revision:1},resultSchema:{schemaId:"schema.work.create.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(346),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.create","schema.work.create.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_execution_history",operationId:"operation.work.execution_history",transport:{kind:"http",route:"/application/work/execution-history",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.execution_history",requestSchema:{schemaId:"schema.work.execution_history.request",revision:1},resultSchema:{schemaId:"schema.work.execution_history.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(347),decodeResult:S1(348),decodeSuccess:e=>fp(e,"binding.http.work.execution_history","schema.work.execution_history.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(348))},{operation:"work_experience",operationId:"operation.work.experience",transport:{kind:"http",route:"/application/work/experience",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.experience",requestSchema:{schemaId:"schema.work.experience.request",revision:1},resultSchema:{schemaId:"schema.work.experience.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(349),decodeResult:S1(350),decodeSuccess:e=>fp(e,"binding.http.work.experience","schema.work.experience.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(350))},{operation:"work_generate_proposal",operationId:"operation.work.generate_proposal",transport:{kind:"http",route:"/application/work/generate-proposal",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.generate_proposal",requestSchema:{schemaId:"schema.work.generate_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.generate_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(351),decodeResult:S1(352),decodeSuccess:e=>fp(e,"binding.http.work.generate_proposal","schema.work.generate_proposal.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(352))},{operation:"work_hydrate_artifacts",operationId:"operation.work.hydrate_artifacts",transport:{kind:"http",route:"/application/work/hydrate-artifacts",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.hydrate_artifacts",requestSchema:{schemaId:"schema.work.hydrate_artifacts.request",revision:1},resultSchema:{schemaId:"schema.work.hydrate_artifacts.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(353),decodeResult:S1(354),decodeSuccess:e=>fp(e,"binding.http.work.hydrate_artifacts","schema.work.hydrate_artifacts.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(354))},{operation:"work_list_attempts",operationId:"operation.work.list_attempts",transport:{kind:"http",route:"/application/work/list-attempts",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.list_attempts",requestSchema:{schemaId:"schema.work.list_attempts.request",revision:1},resultSchema:{schemaId:"schema.work.list_attempts.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(347),decodeResult:S1(355),decodeSuccess:e=>fp(e,"binding.http.work.list_attempts","schema.work.list_attempts.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(355))},{operation:"work_mutate_graph",operationId:"operation.work.mutate_graph",transport:{kind:"http",route:"/application/work/mutate-graph",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.mutate_graph",requestSchema:{schemaId:"schema.work.mutate_graph.request",revision:1},resultSchema:{schemaId:"schema.work.mutate_graph.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(356),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.mutate_graph","schema.work.mutate_graph.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_pause_run",operationId:"operation.work.pause_run",transport:{kind:"http",route:"/application/work/pause-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.pause_run",requestSchema:{schemaId:"schema.work.pause_run.request",revision:1},resultSchema:{schemaId:"schema.work.pause_run.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(357),decodeResult:S1(358),decodeSuccess:e=>fp(e,"binding.http.work.pause_run","schema.work.pause_run.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(358))},{operation:"work_placement_preflight",operationId:"operation.work.placement_preflight",transport:{kind:"http",route:"/application/work/placement-preflight",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.placement_preflight",requestSchema:{schemaId:"schema.work.placement_preflight.request",revision:1},resultSchema:{schemaId:"schema.work.placement_preflight.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(359),decodeResult:S1(360),decodeSuccess:e=>fp(e,"binding.http.work.placement_preflight","schema.work.placement_preflight.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(360))},{operation:"work_placement_status",operationId:"operation.work.placement_status",transport:{kind:"http",route:"/application/work/placement-status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.placement_status",requestSchema:{schemaId:"schema.work.placement_status.request",revision:1},resultSchema:{schemaId:"schema.work.placement_status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(361),decodeResult:S1(362),decodeSuccess:e=>fp(e,"binding.http.work.placement_status","schema.work.placement_status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(362))},{operation:"work_prepare_duplicate_adjudication",operationId:"operation.work.prepare_duplicate_adjudication",transport:{kind:"http",route:"/application/work/prepare-duplicate-adjudication",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.prepare_duplicate_adjudication",requestSchema:{schemaId:"schema.work.prepare_duplicate_adjudication.request",revision:1},resultSchema:{schemaId:"schema.work.prepare_duplicate_adjudication.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(363),decodeResult:S1(331),decodeSuccess:e=>fp(e,"binding.http.work.prepare_duplicate_adjudication","schema.work.prepare_duplicate_adjudication.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(331))},{operation:"work_prepare_graph_mutation",operationId:"operation.work.prepare_graph_mutation",transport:{kind:"http",route:"/application/work/prepare-graph-mutation",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.prepare_graph_mutation",requestSchema:{schemaId:"schema.work.prepare_graph_mutation.request",revision:1},resultSchema:{schemaId:"schema.work.prepare_graph_mutation.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(364),decodeResult:S1(356),decodeSuccess:e=>fp(e,"binding.http.work.prepare_graph_mutation","schema.work.prepare_graph_mutation.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(356))},{operation:"work_release_placement",operationId:"operation.work.release_placement",transport:{kind:"http",route:"/application/work/release-placement",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.release_placement",requestSchema:{schemaId:"schema.work.release_placement.request",revision:1},resultSchema:{schemaId:"schema.work.release_placement.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(365),decodeResult:S1(338),decodeSuccess:e=>fp(e,"binding.http.work.release_placement","schema.work.release_placement.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(338))},{operation:"work_resume_attempts",operationId:"operation.work.resume_attempts",transport:{kind:"http",route:"/application/work/resume-attempts",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.resume_attempts",requestSchema:{schemaId:"schema.work.resume_attempts.request",revision:1},resultSchema:{schemaId:"schema.work.resume_attempts.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(366),decodeResult:S1(367),decodeSuccess:e=>fp(e,"binding.http.work.resume_attempts","schema.work.resume_attempts.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(367))},{operation:"work_resume_run",operationId:"operation.work.resume_run",transport:{kind:"http",route:"/application/work/resume-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.resume_run",requestSchema:{schemaId:"schema.work.resume_run.request",revision:1},resultSchema:{schemaId:"schema.work.resume_run.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(368),decodeResult:S1(358),decodeSuccess:e=>fp(e,"binding.http.work.resume_run","schema.work.resume_run.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(358))},{operation:"work_retrieve_evidence",operationId:"operation.work.retrieve_evidence",transport:{kind:"http",route:"/application/work/retrieve-evidence",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.retrieve_evidence",requestSchema:{schemaId:"schema.work.retrieve_evidence.request",revision:1},resultSchema:{schemaId:"schema.work.retrieve_evidence.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(369),decodeResult:S1(370),decodeSuccess:e=>fp(e,"binding.http.work.retrieve_evidence","schema.work.retrieve_evidence.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(370))},{operation:"work_retry_attempt",operationId:"operation.work.retry_attempt",transport:{kind:"http",route:"/application/work/retry-attempt",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.retry_attempt",requestSchema:{schemaId:"schema.work.retry_attempt.request",revision:1},resultSchema:{schemaId:"schema.work.retry_attempt.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(371),decodeResult:S1(372),decodeSuccess:e=>fp(e,"binding.http.work.retry_attempt","schema.work.retry_attempt.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(372))},{operation:"work_review_proposal",operationId:"operation.work.review_proposal",transport:{kind:"http",route:"/application/work/review-proposal",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.review_proposal",requestSchema:{schemaId:"schema.work.review_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.review_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(373),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.review_proposal","schema.work.review_proposal.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_run_control",operationId:"operation.work.run_control",transport:{kind:"http",route:"/application/work/run-control",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.run_control",requestSchema:{schemaId:"schema.work.run_control.request",revision:1},resultSchema:{schemaId:"schema.work.run_control.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(374),decodeResult:S1(375),decodeSuccess:e=>fp(e,"binding.http.work.run_control","schema.work.run_control.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(375))},{operation:"work_start_attempt",operationId:"operation.work.start_attempt",transport:{kind:"http",route:"/application/work/start-attempt",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.start_attempt",requestSchema:{schemaId:"schema.work.start_attempt.request",revision:1},resultSchema:{schemaId:"schema.work.start_attempt.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(376),decodeResult:S1(342),decodeSuccess:e=>fp(e,"binding.http.work.start_attempt","schema.work.start_attempt.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(342))},{operation:"work_synthesize",operationId:"operation.work.synthesize",transport:{kind:"http",route:"/application/work/synthesize",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.synthesize",requestSchema:{schemaId:"schema.work.synthesize.request",revision:1},resultSchema:{schemaId:"schema.work.synthesize.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(377),decodeResult:S1(378),decodeSuccess:e=>fp(e,"binding.http.work.synthesize","schema.work.synthesize.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(378))},{operation:"work_topology",operationId:"operation.work.topology",transport:{kind:"http",route:"/application/work/topology",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.topology",requestSchema:{schemaId:"schema.work.topology.request",revision:1},resultSchema:{schemaId:"schema.work.topology.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(379),decodeResult:S1(380),decodeSuccess:e=>fp(e,"binding.http.work.topology","schema.work.topology.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(380))},{operation:"work_topology_metrics",operationId:"operation.work.topology_metrics",transport:{kind:"http",route:"/application/work/topology-metrics",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.topology_metrics",requestSchema:{schemaId:"schema.work.topology_metrics.request",revision:1},resultSchema:{schemaId:"schema.work.topology_metrics.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(381),decodeResult:S1(382),decodeSuccess:e=>fp(e,"binding.http.work.topology_metrics","schema.work.topology_metrics.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(382))},{operation:"work_views",operationId:"operation.work.views",transport:{kind:"http",route:"/application/work/views",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.views",requestSchema:{schemaId:"schema.work.views.request",revision:1},resultSchema:{schemaId:"schema.work.views.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(383),decodeResult:S1(384),decodeSuccess:e=>fp(e,"binding.http.work.views","schema.work.views.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(384))},{operation:"workflow_activate_definition",operationId:"operation.workflow.activate_definition",transport:{kind:"http",route:"/application/workflow/activate-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.activate_definition",requestSchema:{schemaId:"schema.workflow.activate_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.activate_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(385),decodeResult:S1(386),decodeSuccess:e=>fp(e,"binding.http.workflow.activate_definition","schema.workflow.activate_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(386))},{operation:"workflow_cancel_run",operationId:"operation.workflow.cancel_run",transport:{kind:"http",route:"/application/workflow/cancel-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.cancel_run",requestSchema:{schemaId:"schema.workflow.cancel_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.cancel_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(387),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.cancel_run","schema.workflow.cancel_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_definition_history",operationId:"operation.workflow.definition_history",transport:{kind:"http",route:"/application/workflow/definition-history",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.definition_history",requestSchema:{schemaId:"schema.workflow.definition_history.request",revision:1},resultSchema:{schemaId:"schema.workflow.definition_history.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(389),decodeResult:S1(390),decodeSuccess:e=>fp(e,"binding.http.workflow.definition_history","schema.workflow.definition_history.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(390))},{operation:"workflow_diff_definition",operationId:"operation.workflow.diff_definition",transport:{kind:"http",route:"/application/workflow/diff-definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.diff_definition",requestSchema:{schemaId:"schema.workflow.diff_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.diff_definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(391),decodeResult:S1(392),decodeSuccess:e=>fp(e,"binding.http.workflow.diff_definition","schema.workflow.diff_definition.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(392))},{operation:"workflow_get_definition",operationId:"operation.workflow.get_definition",transport:{kind:"http",route:"/application/workflow/get-definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.get_definition",requestSchema:{schemaId:"schema.workflow.get_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.get_definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(393),decodeResult:S1(394),decodeSuccess:e=>fp(e,"binding.http.workflow.get_definition","schema.workflow.get_definition.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(394))},{operation:"workflow_get_run",operationId:"operation.workflow.get_run",transport:{kind:"http",route:"/application/workflow/get-run",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.get_run",requestSchema:{schemaId:"schema.workflow.get_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.get_run.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(395),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.get_run","schema.workflow.get_run.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(388))},{operation:"workflow_handoff_issue",operationId:"operation.workflow.handoff_issue",transport:{kind:"http",route:"/application/workflow/handoff-issue",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.handoff_issue",requestSchema:{schemaId:"schema.workflow.handoff_issue.request",revision:1},resultSchema:{schemaId:"schema.workflow.handoff_issue.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(396),decodeResult:S1(397),decodeSuccess:e=>fp(e,"binding.http.workflow.handoff_issue","schema.workflow.handoff_issue.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(397))},{operation:"workflow_handoff_redeem",operationId:"operation.workflow.handoff_redeem",transport:{kind:"http",route:"/application/workflow/handoff-redeem",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.handoff_redeem",requestSchema:{schemaId:"schema.workflow.handoff_redeem.request",revision:1},resultSchema:{schemaId:"schema.workflow.handoff_redeem.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(398),decodeResult:S1(399),decodeSuccess:e=>fp(e,"binding.http.workflow.handoff_redeem","schema.workflow.handoff_redeem.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(399))},{operation:"workflow_list_definitions",operationId:"operation.workflow.list_definitions",transport:{kind:"http",route:"/application/workflow/list-definitions",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.list_definitions",requestSchema:{schemaId:"schema.workflow.list_definitions.request",revision:1},resultSchema:{schemaId:"schema.workflow.list_definitions.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(400),decodeResult:S1(390),decodeSuccess:e=>fp(e,"binding.http.workflow.list_definitions","schema.workflow.list_definitions.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(390))},{operation:"workflow_pause_run",operationId:"operation.workflow.pause_run",transport:{kind:"http",route:"/application/workflow/pause-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.pause_run",requestSchema:{schemaId:"schema.workflow.pause_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.pause_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(401),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.pause_run","schema.workflow.pause_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_register_definition",operationId:"operation.workflow.register_definition",transport:{kind:"http",route:"/application/workflow/register-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.register_definition",requestSchema:{schemaId:"schema.workflow.register_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.register_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(402),decodeResult:S1(394),decodeSuccess:e=>fp(e,"binding.http.workflow.register_definition","schema.workflow.register_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(394))},{operation:"workflow_reject_definition",operationId:"operation.workflow.reject_definition",transport:{kind:"http",route:"/application/workflow/reject-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.reject_definition",requestSchema:{schemaId:"schema.workflow.reject_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.reject_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(403),decodeResult:S1(386),decodeSuccess:e=>fp(e,"binding.http.workflow.reject_definition","schema.workflow.reject_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(386))},{operation:"workflow_resume_run",operationId:"operation.workflow.resume_run",transport:{kind:"http",route:"/application/workflow/resume-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.resume_run",requestSchema:{schemaId:"schema.workflow.resume_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.resume_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(404),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.resume_run","schema.workflow.resume_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_retire_definition",operationId:"operation.workflow.retire_definition",transport:{kind:"http",route:"/application/workflow/retire-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.retire_definition",requestSchema:{schemaId:"schema.workflow.retire_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.retire_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(405),decodeResult:S1(386),decodeSuccess:e=>fp(e,"binding.http.workflow.retire_definition","schema.workflow.retire_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(386))},{operation:"workflow_start_run",operationId:"operation.workflow.start_run",transport:{kind:"http",route:"/application/workflow/start-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.start_run",requestSchema:{schemaId:"schema.workflow.start_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.start_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(406),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.start_run","schema.workflow.start_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_validate_definition",operationId:"operation.workflow.validate_definition",transport:{kind:"http",route:"/application/workflow/validate-definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.validate_definition",requestSchema:{schemaId:"schema.workflow.validate_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.validate_definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(407),decodeResult:S1(408),decodeSuccess:e=>fp(e,"binding.http.workflow.validate_definition","schema.workflow.validate_definition.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(408))}],S2=new TextEncoder;class S4 extends Error{cause;constructor(e,t){super(e),this.name=new.target.name,this.cause=t}}class S6 extends S4{constructor(e){super("the caller aborted the request",e)}}class S3 extends S4{}class S9 extends S4{status;constructor(e){super(401===e?"the daemon rejected HTTP authentication":"the daemon rejected the HTTP origin"),this.status=e}}class S5 extends Error{status;payload;constructor(e,t={}){super(e),this.name=new.target.name,this.status=t.status,this.payload=t.payload}}class S8 extends S5{}class S7 extends Error{status;envelope;problem;constructor(e,t){super(`${t.problem.kind}/${t.problem.code}: ${t.problem.message}`),this.name=new.target.name,this.status=e,this.envelope=t,this.problem=t.problem}}class ke extends S7{}class kt extends S7{}class kr extends S7{}class ki extends S7{}class ko extends S7{}class kn extends S7{}class ka extends S7{}class ks extends S7{}class kd extends S7{}class kc extends S7{}class kl extends S7{}let kp=new Set(["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"]),ku=new TextEncoder;function km(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function kf(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function kh(e){return"number"==typeof e&&Number.isSafeInteger(e)}function ky(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&ku.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}function kg(e,t){let r=e.headers.get("content-type");return null!==r&&r.split(";",1)[0]?.trim().toLowerCase()===t}function k_(e){return!!km(e)&&!!kh(e.started_at)&&!!kh(e.ended_at)&&!(e.ended_at{let o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e),n=()=>{clearTimeout(o),i(new S6(t?.reason))};t?.addEventListener("abort",n,{once:!0})})}async function*k$(e,t){let r,i=e.getReader(),o=new TextDecoder("utf-8",{fatal:!0}),n=new Uint8Array(65536),a=0,s=0,d=!1,c="",l=0,p=t??"",u=ku.encode(p).byteLength,m=[],f=0,h=!1,y=()=>new S8("the daemon returned an SSE line or frame exceeding 65536 bytes",{payload:{limitBytes:65536}}),g=(e,t)=>{try{return o.decode(e,{stream:t})}catch(e){throw new S8("the daemon returned malformed UTF-8 event-stream data",{payload:e})}},_=e=>{if(""===e){if(h=!1,l=0,0===m.length)return c="",null;let e={event:""===c?"message":c,id:""===p?null:p,data:m.join("\n"),...void 0===r?{}:{retryDelayMs:r}};return c="",m=[],f=0,e}if(e.startsWith(":"))return null;h=!0;let t=e.indexOf(":"),i=t<0?e:e.slice(0,t),o=t<0?"":e.slice(t+1);o.startsWith(" ")&&(o=o.slice(1));let n=ku.encode(o).byteLength;if(("event"===i||"id"===i||"data"===i)&&l+u+f+n+1>65536)throw y();switch(i){case"event":c=o,l=n;break;case"id":o.includes("\0")||(p=o,u=n);break;case"data":f+=n+ +(0!==m.length),m.push(o);break;case"retry":if(/^[0-9]+$/.test(o)){let e=BigInt(o);r=e>2147483647n?0x7fffffff:Number(e)}}return null};try{for(;;){let e=await i.read();if(e.done){g(n.subarray(0,a),!1);break}for(let t=0;t0||h||m.length>0)throw new S3("operation stream ended with an incomplete SSE event")}catch(e){if(e instanceof S5||e instanceof S4)throw e;throw new S3("operation stream transport was interrupted",e)}finally{i.releaseLock()}}class kS{operations;projectRoot;applicationRoot;token;origin;doFetch;mcp;constructor(e){let t=new URL(e.baseUrl);if("http:"!==t.protocol&&"https:"!==t.protocol||""!==t.username||""!==t.password||""!==t.search||""!==t.hash)throw new S5("baseUrl must be an absolute HTTP URL without credentials, query, or fragment");let r=t.toString().replace(/\/+$/u,"");this.projectRoot=`${r}/projects/${encodeURIComponent(e.projectId)}`,this.applicationRoot=`${this.projectRoot}/application`,this.token=e.token,this.origin=e.origin??t.origin,this.doFetch=e.fetch??globalThis.fetch.bind(globalThis),this.mcp=e.mcp;let i={};for(let e of S0)i[e.operation]=(t,r)=>this.#p(e,t,r);this.operations=Object.freeze(i)}headers(e){return new Headers({accept:e,authorization:`Bearer ${this.token}`,origin:this.origin})}operationUrl(e,t){if(t?.size!==void 0&&(!Number.isSafeInteger(t.size)||t.size<1||t.size>1e3))throw new S5("page size must be an integer between 1 and 1000");if(t?.cursor!==void 0&&!ky(t.cursor,4096))throw new S5("page cursor is not a canonical opaque cursor");let r=new URL(`${this.projectRoot}${e}`);return t?.size!==void 0&&r.searchParams.set("page_size",String(t.size)),t?.cursor!==void 0&&r.searchParams.set("cursor",t.cursor),r}lifecycleUrl(e,t){if(!ky(e,512))throw new S5("operationId is not a canonical request handle");return new URL(`${this.applicationRoot}/operations/${encodeURIComponent(e)}/${t}`)}async fetchResponse(e,t,r){try{return await this.doFetch(e,t)}catch(t){if(r?.aborted)throw new S6(r.reason);throw new S3(`transport failure requesting ${e.pathname}`,t)}}async readJson(e,t,r,i){let o,n,a=!1,s=()=>n??=o?.cancel(i?.reason)??e.body?.cancel(i?.reason)??Promise.resolve(),d=()=>{s().catch(()=>void 0)};try{if(i?.aborted)throw new S6(i.reason);if(401===e.status||403===e.status)throw new S9(e.status);if(!kg(e,"application/json"))throw new S8("the daemon returned JSON with an invalid media type",{status:e.status});let n="";try{if(o=e.body?.getReader(),i?.addEventListener("abort",d,{once:!0}),i?.aborted)throw new S6(i.reason);if(void 0!==o){let e=new TextDecoder;for(;;){let{done:t,value:r}=await o.read();if(i?.aborted)throw new S6(i.reason);if(t)break;n+=e.decode(r,{stream:!0})}n+=e.decode()}a=!0}catch(e){if(i?.aborted)throw new S6(i.reason);throw new S3("transport failure reading the daemon response body",e)}let s=kv(n,e.status);if(km(s)&&"problem"===s.kind){var c;let i=s.value;if(!function(e){var t,r,i;if(!fu(e)||void 0!==e.binding_id&&"string"!=typeof e.binding_id||!(fu(t=e.contract)&&fh(t.schema_id,512)&&fm(t.schema_revision)&&t.schema_revision>0)||!fh(e.request_id,512)||!fu(e.problem))return!1;let o=e.problem,n=Array.isArray(o.legal_actions)?o.legal_actions:null,a="never"===o.retry?null:"same_request"===o.retry||"after_delay"===o.retry?"same_request":"after_revalidate"===o.retry?"fresh_request":"after_reconcile"===o.retry?"same_operation":void 0;if(!(1===o.revision&&"string"==typeof o.kind&&["invalid_request","not_found_or_not_authorized","conflict","partial_effect","stale","unsupported","unavailable","execution_failed","reset_required","saturated","cancelled","timed_out"].includes(o.kind)&&"string"==typeof o.code&&"string"==typeof o.message&&(null===o.diagnostic||fg(o.diagnostic))&&"detail"in o&&(null===o.detail||function(e){if(!fu(e))return!1;switch(e.kind){case"parked":return"string"==typeof e.cause&&"string"==typeof e.remedy&&"boolean"==typeof e.retries_on_wake;case"stale_refresh_frontier":return fm(e.requested)&&fm(e.committed)&&fm(e.active);case"stale_precondition":return"string"==typeof e.field&&fm(e.requested)&&fm(e.current);case"lock_deadline":return"string"==typeof e.resource&&fm(e.deadline_ms);case"diagnostics_unsupported":return(null===e.file||"string"==typeof e.file)&&Array.isArray(e.searched)&&e.searched.every(e=>fu(e)&&"string"==typeof e.path&&"boolean"==typeof e.present);case"diagnostics_pending":return"string"==typeof e.producer&&(null===e.generation||"string"==typeof e.generation);case"code_graph_rewarming":return fm(e.retry_after_millis);case"reset_required":return"string"==typeof e.authority&&(null===e.found_version||ff(e.found_version))&&(null===e.required_version||ff(e.required_version))&&"string"==typeof e.reason&&"string"==typeof e.remedy;default:return!1}}(o.detail))&&"committed_receipt"in o&&"string"==typeof o.owning_layer&&"string"==typeof o.terminality&&"boolean"==typeof o.retryable&&"string"==typeof o.retry&&(null===o.retry_scope||"string"==typeof o.retry_scope)&&(null===o.retry_after_millis||fm(o.retry_after_millis))&&"cancellation_stage"in o&&(null===o.cancellation_stage||"string"==typeof o.cancellation_stage&&["before_admission","before_read","during_read","before_effect","effect_in_flight"].includes(o.cancellation_stage))&&"unavailable_classification"in o&&(null===o.unavailable_classification||"string"==typeof o.unavailable_classification&&["authority","backend_unavailable","backend_disconnected","backend_retryable"].includes(o.unavailable_classification))&&"execution_failure_classification"in o&&(null===o.execution_failure_classification||"string"==typeof o.execution_failure_classification&&["denied","malformed_output","permanent"].includes(o.execution_failure_classification))&&o.request_id===e.request_id&&fh(o.trace_id,512)&&Array.isArray(o.details)&&o.details.every(fg)&&null!==n&&n.every(e=>"string"==typeof e)&&"coverage"in o)||null===n)return!1;let s=null!==o.cancellation_stage&&"before_admission"!==o.cancellation_stage,d=null!==o.unavailable_classification&&"authority"!==o.unavailable_classification,c="partial_effect"===o.kind||"reset_required"===o.kind||"execution_failed"===o.kind||s||d;return o.terminality===(c?"admitted_terminal":"pre_admission")&&"unavailable"===o.kind==(null!==o.unavailable_classification)&&"execution_failed"===o.kind==(null!==o.execution_failure_classification)&&("cancelled"===o.kind||"timed_out"===o.kind)==(null!==o.cancellation_stage)&&null!==o.diagnostic===("string"==typeof o.kind&&["invalid_request","conflict","partial_effect","stale","unsupported","unavailable","execution_failed","reset_required","saturated"].includes(o.kind))&&(null===o.detail||!!("string"==typeof o.kind&&["stale","unsupported","unavailable","reset_required","saturated"].includes(o.kind)))&&o.retryable===("never"!==o.retry)&&void 0!==a&&o.retry_scope===a&&"after_delay"===o.retry==(null!==o.retry_after_millis)&&("partial_effect"===o.kind?"admitted_terminal"===o.terminality&&!1===o.retryable&&"never"===o.retry&&(r=o.committed_receipt,i=e.request_id,fu(r)&&r.request_id===i&&"partial"===r.outcome&&"string"==typeof r.operation&&"string"==typeof r.effect_class&&"string"==typeof r.idempotency_key&&"string"==typeof r.input_digest&&("string"==typeof r.committed_state||"string"==typeof r.external_proof))&&1===n.length&&"reconcile"===n[0]:"reset_required"===o.kind?"admitted_terminal"===o.terminality&&!1===o.retryable&&"never"===o.retry&&null===o.committed_receipt&&1===n.length&&"reset"===n[0]:"unavailable"===o.kind&&"authority"!==o.unavailable_classification?"admitted_terminal"===o.terminality&&!0===o.retryable&&"after_revalidate"===o.retry&&null===o.committed_receipt&&1===n.length&&"retry"===n[0]:"execution_failed"===o.kind?"admitted_terminal"===o.terminality&&!1===o.retryable&&"never"===o.retry&&null===o.committed_receipt&&1===n.length&&"contact_administrator"===n[0]:null===o.committed_receipt)}(i))throw new S8("the daemon returned a malformed problem envelope",{status:e.status,payload:i});let o=void 0===t||(c=[t],"not_found_or_not_authorized"===i.problem.kind?void 0===i.binding_id:c.some(e=>e===i.binding_id));if(e.ok||!o||void 0!==r&&i.request_id!==r||!function(e,t){switch(t){case"invalid_request":return 400===e;case"not_found_or_not_authorized":return 404===e;case"conflict":case"partial_effect":case"stale":return 409===e;case"unsupported":return 422===e;case"unavailable":case"reset_required":return 503===e;case"execution_failed":return 500===e;case"saturated":return 429===e;case"cancelled":return 408===e;case"timed_out":return 504===e;default:return!1}}(e.status,i.problem.kind))throw new S8("the daemon returned a malformed problem envelope",{status:e.status,payload:i});throw function(e,t){switch(t.problem.kind){case"not_found_or_not_authorized":return new ke(e,t);case"unavailable":return new kt(e,t);case"unsupported":return new kr(e,t);case"stale":return new ki(e,t);case"conflict":return new ko(e,t);case"partial_effect":return new kn(e,t);case"reset_required":return new ka(e,t);case"saturated":return new ks(e,t);case"cancelled":return new kd(e,t);case"timed_out":return new kc(e,t);case"invalid_request":return new kl(e,t);default:return new S7(e,t)}}(e.status,i)}return s}finally{i?.removeEventListener("abort",d);try{a||await s()}catch{}finally{o?.releaseLock()}}}async #p(e,t,r={}){var i,o,n,a;let s=e.decodeRequest(t);if("http"!==e.transport.kind){let t;if(void 0!==r.page||void 0!==r.deadlineMicros||void 0!==r.requestId)throw new S5(`${e.operation} does not accept HTTP transport options`);if(void 0===this.mcp)throw new S4(`${e.operation} requires an MCP tool adapter`);try{t=await this.mcp.callTool(e.transport.toolName,s,{signal:r.signal})}catch(t){if(r.signal?.aborted)throw new S6(r.signal.reason??t);throw new S4(`MCP tool ${e.transport.toolName} failed`,t)}try{return e.decodeResult(t)}catch(r){throw new S8(`MCP tool ${e.transport.toolName} returned an invalid ${e.operation} result`,{payload:{response:t,cause:r}})}}let d=this.operationUrl(e.transport.route,r.page),c=JSON.stringify(s);if(void 0===c)throw new S5(`${e.operation} request decoder returned a non-JSON value`);let l=this.headers("application/json");l.set("content-type","application/json");let p=(i=l,o=e,void 0!==(n=r).deadlineMicros&&(!Number.isSafeInteger(n.deadlineMicros)||n.deadlineMicros<=0)?"deadlineMicros must be a positive safe integer":"required"===o.requestIdControl&&void 0===n.requestId?`${o.operation} requires a stable requestId replay handle`:"server_minted"===o.requestIdControl&&void 0!==n.requestId?`${o.operation} uses a server-minted request ID`:void 0===n.requestId||(a=n.requestId).length>0&&a.trim()===a&&S2.encode(a).byteLength<=512&&!/\p{Cc}/u.test(a)?void(void 0!==n.deadlineMicros&&i.set("x-tracedecay-deadline-micros",String(n.deadlineMicros)),void 0!==n.requestId&&i.set("x-tracedecay-request-id",n.requestId)):"requestId is not a canonical request identity");if(void 0!==p)throw new S5(p);let u=await this.fetchResponse(d,{method:e.transport.method,headers:l,body:c,signal:r.signal},r.signal),m=await this.readJson(u,e.bindingId,r.requestId,r.signal);if(!km(m)||"success"!==m.kind)throw new S8("the daemon returned an unknown HTTP envelope",{status:u.status,payload:m});if(!u.ok)throw new S8("the daemon returned success with a failing HTTP status",{status:u.status,payload:m});try{let t=e.decodeSuccess(m.value);if(!(km(t)&&km(t.outcome)&&km(t.outcome.value)&&"payload"in t.outcome.value&&k_(t.outcome.value.execution))||("evidence"===t.outcome.outcome?"completed"===t.outcome.value.execution.termination&&null===t.outcome.value.payload:"preview"!==t.outcome.outcome&&"effect"!==t.outcome.outcome))throw TypeError("decoded application success invariants are invalid");if(void 0!==r.requestId&&t.request_id!==r.requestId)throw TypeError("daemon returned a different application request ID");if("fact_store_curate_receipt"===e.resultSemantics&&!await async function(e,t){if(!fu(e)||!fu(t)||!fu(t.outcome))return!1;let r=t.outcome,i=fu(r.value)?r.value.payload:void 0;if("effect"!==r.outcome||!fu(i)||!fh(t.request_id,512)||"request_digest,run_id,state,task"!==Object.keys(i).sort().join(",")||i.run_id!==t.request_id||"memory_curator"!==i.task||"started"!==i.state)return!1;let o=e.fact_review_limit??24,n=e.min_confidence_millionths??72e4;return!!fm(o)&&!(o<1)&&!(o>1e3)&&!!fm(n)&&!(n>1e6)&&!!await async function(e){return!!fu(e)&&"project_id,reference,repository_id,scope_digest,worktree_id"===Object.keys(e).sort().join(",")&&!!fh(e.project_id,512)&&!!fh(e.repository_id,512)&&!!fh(e.worktree_id,512)&&(null===e.reference||!!fh(e.reference,512))&&e.scope_digest===await fy(["tracedecay.application.scope.v1",e.project_id,e.repository_id,e.worktree_id,e.reference])}(t.scope)&&i.request_digest===await fy(["tracedecay.automation-run.request-identity.v1",{kind:"memory_curator",options:{fact_review_limit:o,min_confidence_millionths:n}}])}(s,t))throw TypeError("automatic curation receipt invariants are invalid");return t}catch(t){throw new S8(`the daemon returned an invalid ${e.operation} success envelope`,{status:u.status,payload:{envelope:m.value,cause:t}})}}async *streamOperation(e,t={}){let r=t.resume?.resumeToken,i=t.resume?.nextSequence===void 0?void 0:function(e,t){let r;if("number"==typeof e){if(!kf(e))throw new S5(`${t} must be an unsigned safe integer`);r=BigInt(e)}else if("bigint"==typeof e)r=e;else if(/^[0-9]+$/.test(e))r=BigInt(e);else throw new S5(`${t} must be unsigned decimal`);if(r<0n||r>0xffffffffffffffffn)throw new S5(`${t} exceeds the canonical u64 range`);return r.toString()}(t.resume.nextSequence,"resume nextSequence");if(void 0!==r&&!ky(r,4096))throw new S5("resumeToken is not a canonical stream resume token");let o=t.maxReconnects??0;if(!Number.isSafeInteger(o)||o<0)throw new S5("maxReconnects must be a non-negative integer");let n=0,a=0;for(;;){let d;if(t.signal?.aborted)throw new S6(t.signal.reason);let c=this.lifecycleUrl(e,"events");void 0!==i&&c.searchParams.set("next_sequence",i),void 0!==r&&c.searchParams.set("resume_token",r);try{d=await this.fetchResponse(c,{method:"GET",headers:this.headers("text/event-stream"),signal:t.signal},t.signal)}catch(e){if(0===n||n>=o||!(e instanceof S3))throw e;n+=1,await kb(a,t.signal);continue}let l=!1;try{if(!d.ok||null===d.body)throw await this.readJson(d,void 0,void 0,t.signal),new S8("the daemon did not open an SSE stream",{status:d.status});if(!kg(d,"text/event-stream"))throw new S8("the daemon opened an operation stream with an invalid media type",{status:d.status});try{for await(let t of k$(d.body)){void 0!==t.retryDelayMs&&(a=t.retryDelayMs);let o=function(e,t,r){let i=kv(e.data,t);if(!km(i)||"string"!=typeof i.event||i.event!==e.event||!km(i.data))throw new S8("the daemon returned a malformed SSE event",{status:t,payload:i});let o=i.event,n=i.data;if("open"===o){let e=n.frontier;if(n.correlation_id!==r||!km(e)||!kf(e.next_sequence)||!kf(e.retained_from_sequence)||e.retained_from_sequence>e.next_sequence||null!==e.resume_token&&"string"!=typeof e.resume_token)throw new S8("the daemon returned a malformed SSE open frontier",{status:t,payload:i});return{event:{...i,event:o,data:n},frontier:{..."string"==typeof e.resume_token?{resumeToken:e.resume_token}:{}}}}if(!kf(n.sequence)||null===e.id)throw new S8("the daemon returned an SSE event without a valid sequence",{status:t,payload:i});let a=String(n.sequence);if(e.id!==a)throw new S8("the SSE event ID does not match its canonical sequence",{status:t,payload:i});if("item"===o&&!("item"in n))throw new S8("the SSE item payload is missing",{status:t,payload:i});if("progress"===o&&(!kf(n.completed)||null!==n.total&&!kf(n.total)))throw new S8("the SSE progress payload is malformed",{status:t,payload:i});if("resume_gap"===o){let e=n.gap;if(!km(e)||!kf(e.first_missing_sequence)||!kf(e.last_missing_sequence)||e.first_missing_sequence!==n.sequence||e.first_missing_sequence>e.last_missing_sequence||!km(e.frontier)||!kf(e.frontier.next_sequence)||!kf(e.frontier.retained_from_sequence)||e.frontier.retained_from_sequence>e.frontier.next_sequence||e.last_missing_sequence>=e.frontier.next_sequence||null!==e.frontier.resume_token&&"string"!=typeof e.frontier.resume_token)throw new S8("the SSE resume gap is malformed",{status:t,payload:i})}if(kp.has(o)){let e=n.terminal;if(!km(e)||!k_(e.receipt))throw new S8("the SSE terminal event is malformed",{status:t,payload:i});if(e.termination!==o||e.receipt.termination!==o)throw new S8("the SSE terminal event is inconsistent",{status:t,payload:i})}let s={...i,event:o,data:n};if("resume_gap"===o){let e=n.gap,t=e.frontier;return{event:s,sequence:a,lastSequence:String(e.last_missing_sequence),frontier:{..."string"==typeof t.resume_token?{resumeToken:t.resume_token}:{}}}}return{event:s,sequence:a}}(t,d.status,e);if(void 0!==o.sequence){var s;let e=i??"0",r=(s=o.lastSequence??o.sequence,(BigInt(s)+1n).toString()),n=kp.has(t.event);if(!n&&BigInt(o.sequence)=o){if(e instanceof S3)throw e;throw new S3(`operation stream disconnected after ${n} reconnects`,e)}}}catch(e){throw l=!0,e}finally{try{await d.body?.cancel()}catch(e){if(!l)throw new S3("failed to close operation stream transport",e)}}if(n>=o)throw new S3(`operation stream ended before a terminal event after ${n} reconnects`);if(void 0===i||void 0===r)throw new S3("operation stream ended before exposing a resumable frontier");n+=1,await kb(a,t.signal)}}async cancelOperation(e,t={}){let r=await this.fetchResponse(this.lifecycleUrl(e,"cancel"),{method:"POST",headers:this.headers("application/json"),signal:t.signal},t.signal),i=await this.readJson(r,void 0,void 0,t.signal);if(!km(i))throw new S8("the daemon returned a malformed cancellation response",{status:r.status,payload:i});let o=i.status,n="requested"===o&&202===r.status||("already_requested"===o||"already_terminal"===o)&&200===r.status;if(!r.ok||"requested"!==o&&"already_requested"!==o&&"already_terminal"!==o||!n)throw new S8("the daemon returned a malformed cancellation response",{status:r.status,payload:i});return{...i,status:o}}}function kk(e){let t=S0.find(t=>t.operation===e);if(void 0===t||"mcp_tool"!==t.transport.kind)throw TypeError(`${e} is not an MCP-backed operation in the canonical catalog`);return t}let kw=kk("project_list"),kP=kk("project_search"),kV=kk("project_context");class kR{#u;constructor(e){this.#u=e}projectList(e,t){return this.#m(kw,e,t)}projectContext(e,t){return this.#m(kV,e,t)}projectSearch(e,t){return this.#m(kP,e,t)}async #m(e,t,r){let i,o=e.transport.toolName,n=e.decodeRequest(t);try{if(r?.aborted||(i=await this.#u(o,n,r),r?.aborted))throw new S6(r.reason)}catch(e){if(r?.aborted)throw new S6(r.reason);throw new S4(`MCP tool ${o} failed`,e)}try{return e.decodeResult(i)}catch(t){throw new S8(`MCP tool ${o} returned an invalid ${e.operation} result`,{payload:{response:i,cause:t}})}}}var kq=Object.create,kI=Object.defineProperty,kx=Object.getOwnPropertyDescriptor,kj=Object.getOwnPropertyNames,kC=Object.getPrototypeOf,kT=Object.prototype.hasOwnProperty,kO=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let kE=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),kA=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),kW=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),kM=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),kN=Symbol.for("mcp.sdk.errorBrands");function kz(e,t){let r=new Set,i=t;for(;"function"==typeof i;){let e=i.mcpBrand;Object.prototype.hasOwnProperty.call(i,"mcpBrand")&&"string"==typeof e&&r.add(e),i=Object.getPrototypeOf(i)}0!==r.size&&Object.defineProperty(e,kN,{value:r,enumerable:!1,configurable:!0})}function kD(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,kN)){let r=t[kN];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return kD(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kD(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",kz(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});let kF=((X={}).NotConnected="NOT_CONNECTED",X.AlreadyConnected="ALREADY_CONNECTED",X.NotInitialized="NOT_INITIALIZED",X.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",X.RequestTimeout="REQUEST_TIMEOUT",X.ConnectionClosed="CONNECTION_CLOSED",X.SendFailed="SEND_FAILED",X.InvalidResult="INVALID_RESULT",X.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",X.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",X.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",X.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",X.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",X.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",X.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",X.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",X.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",X.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",X.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",X);var kL=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return kD(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kD(this,e)}constructor(e,t,r,i){super(t,i),this.code=e,this.data=r,this.name="SdkError",kz(this,new.target)}},kU=class extends kL{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,i){super(e,t,r,i),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};let kH="2026-07-28",kG=[kH];function kB(e){return e.filter(e=>!(e>=kH))}function kK(e){return e.filter(e=>e>=kH)}function kJ(e){let t=e.structuredContent;return void 0===t||!("object"!=typeof t||null===t||Array.isArray(t))||e.content?.some(e=>"text"===e.type)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}let kZ=["task","inputRequests","requestState"];function kQ(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||kZ.some(t=>t in e)?e:{...e,content:[]}}function kX(){let e,t,r,i,o,n,a,s,c,l,p,u,m,f,h,y,g,_,v,b,$,S,k,w,P,V,R,q,I,x,j,C,T,O,E,A,W,M,N,z,D,F,L,U,H,G,B,K,J,Z,Q,X,Y,ee,et,er,ei,eo,en,ea,es,ed,ec,el,ep,eu,em,ef,eh,ey,eg,e_,ev,eb,e$,eS,ek,ew,eP,eV,eR,eq,eI,ex,ej,eC,eT,eO,eE,eA,eW,eM,eN,ez,eD,eF,eL,eU,eH,eG,eB,eK,eJ,eZ,eQ,eX,eY,e1,e0,e2,e4,e6,e3,e9,e5,e8,e7,te,tt,tr,ti,to,tn,ta,ts,td,tc,tl,tp,tu,tm,tf,th,ty,tg,t_,tv,tb,t$,tS;return d??=(e=ao(()=>nD([o5(),nk(),nR(),nI(),nB(o5(),e),nA(e)])),t=nB(o5(),e),r=nD([o5(),nk().int()]),i=o5(),o=nM({ttl:nk().optional()}),n=nM({taskId:o5()}),c=(s=nM({_meta:(a=nN({progressToken:r.optional(),"io.modelcontextprotocol/related-task":n.optional()})).optional()})).extend({task:o.optional()}),l=nM({method:o5(),params:s.loose().optional()}),p=nM({_meta:a.optional()}),u=nM({method:o5(),params:p.loose().optional()}),m=nN({_meta:a.optional()}),f=nD([o5(),nk().int()]),h=m.strict(),y=p.extend({requestId:f.optional(),reason:o5().optional()}),g=u.extend({method:nQ("notifications/cancelled"),params:y}),_=nM({src:o5(),mimeType:o5().optional(),sizes:nA(o5()).optional(),theme:nJ(["light","dark"]).optional()}),v=nM({icons:nA(_).optional()}),$=(b=nM({name:o5(),title:o5().optional()})).extend({...b.shape,...v.shape,version:o5(),websiteUrl:o5().optional(),description:o5().optional()}),S=nH(nM({applyDefaults:nR().optional()}),t),k=aa(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nH(nM({form:S.optional(),url:t.optional()}),t.optional())),w=nN({list:t.optional(),cancel:t.optional(),requests:nN({sampling:nN({createMessage:t.optional()}).optional(),elicitation:nN({create:t.optional()}).optional()}).optional()}),P=nN({list:t.optional(),cancel:t.optional(),requests:nN({tools:nN({call:t.optional()}).optional()}).optional()}),V=nM({experimental:nB(o5(),t).optional(),sampling:nM({context:t.optional(),tools:t.optional()}).optional(),elicitation:k.optional(),roots:nM({listChanged:nR().optional()}).optional(),tasks:w.optional(),extensions:nB(o5(),t).optional()}),R=s.extend({protocolVersion:o5(),capabilities:V,clientInfo:$}),q=l.extend({method:nQ("initialize"),params:R}),I=nM({experimental:nB(o5(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nM({listChanged:nR().optional()}).optional(),resources:nM({subscribe:nR().optional(),listChanged:nR().optional()}).optional(),tools:nM({listChanged:nR().optional()}).optional(),tasks:P.optional(),extensions:nB(o5(),t).optional()}),x=m.extend({protocolVersion:o5(),capabilities:I,serverInfo:$,instructions:o5().optional()}),j=u.extend({method:nQ("notifications/initialized"),params:p.optional()}),C=l.extend({method:nQ("ping"),params:s.optional()}),T=nM({progress:nk(),total:n0(nk()),message:n0(o5())}),O=nM({...p.shape,...T.shape,progressToken:r}),E=u.extend({method:nQ("notifications/progress"),params:O}),A=s.extend({cursor:i.optional()}),W=l.extend({params:A.optional()}),M=m.extend({nextCursor:i.optional()}),z=(N=nM({uri:o5(),mimeType:n0(o5()),_meta:nB(o5(),nT()).optional()})).extend({text:o5()}),D=o5().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),F=N.extend({blob:D}),U=nM({audience:nA(L=nJ(["user","assistant"])).optional(),priority:nk().min(0).max(1).optional(),lastModified:as({offset:!0}).optional()}),H=nM({...b.shape,...v.shape,uri:o5(),description:n0(o5()),mimeType:n0(o5()),size:n0(nk()),annotations:U.optional(),_meta:n0(nN({}))}),G=nM({...b.shape,...v.shape,uriTemplate:o5(),description:n0(o5()),mimeType:n0(o5()),annotations:U.optional(),_meta:n0(nN({}))}),B=W.extend({method:nQ("resources/list")}),K=M.extend({resources:nA(H)}),J=W.extend({method:nQ("resources/templates/list")}),Z=M.extend({resourceTemplates:nA(G)}),Q=s.extend({uri:o5()}),X=l.extend({method:nQ("resources/read"),params:Q}),Y=m.extend({contents:nA(nD([z,F]))}),ee=u.extend({method:nQ("notifications/resources/list_changed"),params:p.optional()}),et=l.extend({method:nQ("resources/subscribe"),params:Q}),er=l.extend({method:nQ("resources/unsubscribe"),params:Q}),ei=p.extend({uri:o5()}),eo=u.extend({method:nQ("notifications/resources/updated"),params:ei}),en=nM({name:o5(),description:n0(o5()),required:n0(nR())}),ea=nM({...b.shape,...v.shape,description:n0(o5()),arguments:n0(nA(en)),_meta:n0(nN({}))}),es=W.extend({method:nQ("prompts/list")}),ed=M.extend({prompts:nA(ea)}),ec=s.extend({name:o5(),arguments:nB(o5(),o5()).optional()}),el=l.extend({method:nQ("prompts/get"),params:ec}),ep=nM({type:nQ("text"),text:o5(),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),eu=nM({type:nQ("image"),data:D,mimeType:o5(),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),em=nM({type:nQ("audio"),data:D,mimeType:o5(),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),ef=nM({type:nQ("tool_use"),name:o5(),id:o5(),input:nB(o5(),nT()),_meta:nB(o5(),nT()).optional()}),eh=nM({type:nQ("resource"),resource:nD([z,F]),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),e_=nM({role:L,content:eg=nD([ep,eu,em,ey=H.extend({type:nQ("resource_link")}),eh])}),ev=m.extend({description:o5().optional(),messages:nA(e_)}),eb=u.extend({method:nQ("notifications/prompts/list_changed"),params:p.optional()}),e$=nM({title:o5().optional(),readOnlyHint:nR().optional(),destructiveHint:nR().optional(),idempotentHint:nR().optional(),openWorldHint:nR().optional()}),eS=nM({taskSupport:nJ(["required","optional","forbidden"]).optional()}),ek=nM({...b.shape,...v.shape,description:o5().optional(),inputSchema:nM({type:nQ("object"),properties:nB(o5(),e).optional(),required:nA(o5()).optional()}).catchall(nT()),outputSchema:nM({type:nQ("object"),properties:nB(o5(),e).optional(),required:nA(o5()).optional()}).catchall(nT()).optional(),annotations:e$.optional(),execution:eS.optional(),_meta:nB(o5(),nT()).optional()}),ew=W.extend({method:nQ("tools/list")}),eP=M.extend({tools:nA(ek)}),eV=m.extend({content:nA(eg),structuredContent:nB(o5(),nT()).optional(),isError:nR().optional()}),eR=c.extend({name:o5(),arguments:nB(o5(),nT()).optional()}),eq=l.extend({method:nQ("tools/call"),params:eR}),eI=u.extend({method:nQ("notifications/tools/list_changed"),params:p.optional()}),ex=nJ(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=s.extend({level:ex}),eC=l.extend({method:nQ("logging/setLevel"),params:ej}),eT=p.extend({level:ex,logger:o5().optional(),data:nT()}),eO=u.extend({method:nQ("notifications/message"),params:eT}),eE=nM({name:o5().optional()}),eA=nM({hints:nA(eE).optional(),costPriority:nk().min(0).max(1).optional(),speedPriority:nk().min(0).max(1).optional(),intelligencePriority:nk().min(0).max(1).optional()}),eW=nM({mode:nJ(["auto","required","none"]).optional()}),eM=nM({type:nQ("tool_result"),toolUseId:o5().describe("The unique identifier for the corresponding tool call."),content:nA(eg),structuredContent:nM({}).loose().optional(),isError:nR().optional(),_meta:nB(o5(),nT()).optional()}),eN=nL("type",[ep,eu,em]),eD=nM({role:L,content:nD([ez=nL("type",[ep,eu,em,ef,eM]),nA(ez)]),_meta:nB(o5(),nT()).optional()}),eF=c.extend({messages:nA(eD),modelPreferences:eA.optional(),systemPrompt:o5().optional(),includeContext:nJ(["none","thisServer","allServers"]).optional(),temperature:nk().optional(),maxTokens:nk().int(),stopSequences:nA(o5()).optional(),metadata:t.optional(),tools:nA(ek).optional(),toolChoice:eW.optional()}),eL=l.extend({method:nQ("sampling/createMessage"),params:eF}),eU=m.extend({model:o5(),stopReason:n0(nJ(["endTurn","stopSequence","maxTokens"]).or(o5())),role:L,content:eN}),eH=m.extend({model:o5(),stopReason:n0(nJ(["endTurn","stopSequence","maxTokens","toolUse"]).or(o5())),role:L,content:nD([ez,nA(ez)])}),eG=nM({type:nQ("boolean"),title:o5().optional(),description:o5().optional(),default:nR().optional()}),eB=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),minLength:nk().optional(),maxLength:nk().optional(),format:nJ(["email","uri","date","date-time"]).optional(),default:o5().optional()}),eK=nM({type:nJ(["number","integer"]),title:o5().optional(),description:o5().optional(),minimum:nk().optional(),maximum:nk().optional(),default:nk().optional()}),eJ=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),default:o5().optional()}),eZ=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),oneOf:nA(nM({const:o5(),title:o5()})),default:o5().optional()}),eQ=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),enumNames:nA(o5()).optional(),default:o5().optional()}),eX=nD([eJ,eZ]),eY=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({type:nQ("string"),enum:nA(o5())}),default:nA(o5()).optional()}),e0=nD([eY,e1=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({anyOf:nA(nM({const:o5(),title:o5()}))}),default:nA(o5()).optional()})]),e2=nD([eQ,eX,e0]),e4=nD([e2,eG,eB,eK]),e6=c.extend({mode:nQ("form").optional(),message:o5(),requestedSchema:nM({type:nQ("object"),properties:nB(o5(),e4),required:nA(o5()).optional()}).catchall(nT())}),e9=nD([e6,e3=c.extend({mode:nQ("url"),message:o5(),elicitationId:o5(),url:o5().url()})]),e5=l.extend({method:nQ("elicitation/create"),params:e9}),e8=p.extend({elicitationId:o5()}),e7=u.extend({method:nQ("notifications/elicitation/complete"),params:e8}),te=m.extend({action:nJ(["accept","decline","cancel"]),content:aa(e=>null===e?void 0:e,nB(o5(),nD([o5(),nk(),nR(),nA(o5())])).optional())}),tt=nM({type:nQ("ref/resource"),uri:o5()}),tr=nM({type:nQ("ref/prompt"),name:o5()}),ti=s.extend({ref:nD([tr,tt]),argument:nM({name:o5(),value:o5()}),context:nM({arguments:nB(o5(),o5()).optional()}).optional()}),to=l.extend({method:nQ("completion/complete"),params:ti}),tn=m.extend({completion:nN({values:nA(o5()).max(100),total:n0(nk().int()),hasMore:n0(nR())})}),ta=nM({uri:o5().startsWith("file://"),name:o5().optional(),_meta:nB(o5(),nT()).optional()}),ts=l.extend({method:nQ("roots/list"),params:s.optional()}),td=m.extend({roots:nA(ta)}),tc=u.extend({method:nQ("notifications/roots/list_changed"),params:p.optional()}),tl=nN({ttl:nk().optional(),pollInterval:nk().optional()}),tp=nJ(["working","input_required","completed","failed","cancelled"]),tu=nM({taskId:o5(),status:tp,ttl:nD([nk(),nI()]),createdAt:o5(),lastUpdatedAt:o5(),pollInterval:n0(nk()),statusMessage:n0(o5())}),tm=m.extend({task:tu}),tf=p.merge(tu),th=u.extend({method:nQ("notifications/tasks/status"),params:tf}),ty=l.extend({method:nQ("tasks/get"),params:s.extend({taskId:o5()})}),tg=m.merge(tu),t_=l.extend({method:nQ("tasks/result"),params:s.extend({taskId:o5()})}),tv=m.loose(),tb=W.extend({method:nQ("tasks/list")}),t$=M.extend({tasks:nA(tu)}),tS=l.extend({method:nQ("tasks/cancel"),params:s.extend({taskId:o5()})}),{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:i,TaskMetadataSchema:o,RelatedTaskMetadataSchema:n,RequestMetaSchema:a,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:p,NotificationSchema:u,ResultSchema:m,RequestIdSchema:f,EmptyResultSchema:h,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:b,ImplementationSchema:$,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:P,ClientCapabilitiesSchema:V,InitializeRequestParamsSchema:R,InitializeRequestSchema:q,ServerCapabilitiesSchema:I,InitializeResultSchema:x,InitializedNotificationSchema:j,PingRequestSchema:C,ProgressSchema:T,ProgressNotificationParamsSchema:O,ProgressNotificationSchema:E,PaginatedRequestParamsSchema:A,PaginatedRequestSchema:W,PaginatedResultSchema:M,ResourceContentsSchema:N,TextResourceContentsSchema:z,BlobResourceContentsSchema:F,RoleSchema:L,AnnotationsSchema:U,ResourceSchema:H,ResourceTemplateSchema:G,ListResourcesRequestSchema:B,ListResourcesResultSchema:K,ListResourceTemplatesRequestSchema:J,ListResourceTemplatesResultSchema:Z,ResourceRequestParamsSchema:Q,ReadResourceRequestParamsSchema:Q,ReadResourceRequestSchema:X,ReadResourceResultSchema:Y,ResourceListChangedNotificationSchema:ee,SubscribeRequestParamsSchema:Q,SubscribeRequestSchema:et,UnsubscribeRequestParamsSchema:Q,UnsubscribeRequestSchema:er,ResourceUpdatedNotificationParamsSchema:ei,ResourceUpdatedNotificationSchema:eo,PromptArgumentSchema:en,PromptSchema:ea,ListPromptsRequestSchema:es,ListPromptsResultSchema:ed,GetPromptRequestParamsSchema:ec,GetPromptRequestSchema:el,TextContentSchema:ep,ImageContentSchema:eu,AudioContentSchema:em,ToolUseContentSchema:ef,EmbeddedResourceSchema:eh,ResourceLinkSchema:ey,ContentBlockSchema:eg,PromptMessageSchema:e_,GetPromptResultSchema:ev,PromptListChangedNotificationSchema:eb,ToolAnnotationsSchema:e$,ToolExecutionSchema:eS,ToolSchema:ek,ListToolsRequestSchema:ew,ListToolsResultSchema:eP,CallToolResultSchema:eV,CallToolRequestParamsSchema:eR,CallToolRequestSchema:eq,ToolListChangedNotificationSchema:eI,LoggingLevelSchema:ex,SetLevelRequestParamsSchema:ej,SetLevelRequestSchema:eC,LoggingMessageNotificationParamsSchema:eT,LoggingMessageNotificationSchema:eO,ModelHintSchema:eE,ModelPreferencesSchema:eA,ToolChoiceSchema:eW,ToolResultContentSchema:eM,SamplingContentSchema:eN,SamplingMessageContentBlockSchema:ez,SamplingMessageSchema:eD,CreateMessageRequestParamsSchema:eF,CreateMessageRequestSchema:eL,CreateMessageResultSchema:eU,CreateMessageResultWithToolsSchema:eH,BooleanSchemaSchema:eG,StringSchemaSchema:eB,NumberSchemaSchema:eK,UntitledSingleSelectEnumSchemaSchema:eJ,TitledSingleSelectEnumSchemaSchema:eZ,LegacyTitledEnumSchemaSchema:eQ,SingleSelectEnumSchemaSchema:eX,UntitledMultiSelectEnumSchemaSchema:eY,TitledMultiSelectEnumSchemaSchema:e1,MultiSelectEnumSchemaSchema:e0,EnumSchemaSchema:e2,PrimitiveSchemaDefinitionSchema:e4,ElicitRequestFormParamsSchema:e6,ElicitRequestURLParamsSchema:e3,ElicitRequestParamsSchema:e9,ElicitRequestSchema:e5,ElicitationCompleteNotificationParamsSchema:e8,ElicitationCompleteNotificationSchema:e7,ElicitResultSchema:te,ResourceTemplateReferenceSchema:tt,PromptReferenceSchema:tr,CompleteRequestParamsSchema:ti,CompleteRequestSchema:to,CompleteResultSchema:tn,RootSchema:ta,ListRootsRequestSchema:ts,ListRootsResultSchema:td,RootsListChangedNotificationSchema:tc,TaskCreationParamsSchema:tl,TaskStatusSchema:tp,TaskSchema:tu,CreateTaskResultSchema:tm,TaskStatusNotificationParamsSchema:tf,TaskStatusNotificationSchema:th,GetTaskRequestSchema:ty,GetTaskResultSchema:tg,GetTaskPayloadRequestSchema:t_,GetTaskPayloadResultSchema:tv,ListTasksRequestSchema:tb,ListTasksResultSchema:t$,CancelTaskRequestSchema:tS,CancelTaskResultSchema:m.merge(tu),ClientRequestSchema:nD([C,q,to,eC,el,es,B,J,X,et,er,eq,ew,ty,t_,tb,tS]),ClientNotificationSchema:nD([g,E,j,tc,th]),ClientResultSchema:nD([h,eU,eH,te,td,tg,t$,tm]),ServerRequestSchema:nD([C,eL,e5,ts,ty,t_,tb,tS]),ServerNotificationSchema:nD([g,E,eO,eo,ee,eI,eb,th,e7]),ServerResultSchema:nD([h,x,tn,ev,ed,K,Z,Y,eV,eP,tg,t$,tm]),CallToolResultWireSchema:nT().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of kZ)if(r in e)return void t.addIssue({code:"custom",message:`content is required when the body carries '${r}' — another result family cannot default into an empty tools/call success`})}}).transform(kQ).pipe(eV)})}function kY(e){return"object"!==e.type}let k1=new Set(["const","enum","default","examples"]),k0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function k2(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let k4={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},k6={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},k3={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function k9(){if(c)return c;let e=kX();return c={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}}}function k5(e){return Object.prototype.hasOwnProperty.call(k4,e)}function k8(e){return Object.prototype.hasOwnProperty.call(k6,e)}function k7(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function we(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(k4),Object.keys(k6);let wt={ok:!1,reason:"not-in-era"};function wr(e){return k7(e)&&k7(e.outputSchema)&&kY(e.outputSchema)}let wi={era:"2025-11-25",hasRequestMethod:k5,hasNotificationMethod:k8,validateRequest:(e,t)=>we(k5(e)?k9().requestSchemas[e]:void 0,t),validateResult:(e,t)=>we(Object.prototype.hasOwnProperty.call(k3,e)?k9().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>we(k8(e)?k9().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>wt,validateInputResponse:()=>wt,samplingResultVariant:(e,t)=>{let r=kX();return we(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=kJ(e),i=r.structuredContent;if(void 0===i)return r;let o="object"!=typeof i||null===i||Array.isArray(i),n=void 0!==t&&kY(t);return o||n?{...r,structuredContent:{result:i}}:r},decodeResult(e,t){if(k7(t)&&"resultType"in t){let e={...t};return delete e.resultType,{kind:"complete",result:e}}return{kind:"complete",result:t}},encodeResult(e,t){if("tools/list"!==e)return t;let r=t.tools;return Array.isArray(r)&&r.some(e=>wr(e))?{...t,tools:r.map(e=>wr(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(k2(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let i="string"==typeof(t=e.$schema)&&kA.has(t.replace(/#$/,""))&&!0!==e.$recursiveAnchor,o=(e,t)=>{if(Array.isArray(e))return e.map(e=>o(e,!1));if(null===e||"object"!=typeof e||!t&&k2(e.$id))return e;let r={},n=!1;for(let[a,s]of Object.entries(e))t?r[a]=o(s,!1):("$ref"===a||"$dynamicRef"===a)&&"string"==typeof s?r[a]="#"===s?"#/properties/result":s.startsWith("#/")?`#/properties/result${s.slice(1)}`:s:"$recursiveRef"===a&&"#"===s&&i?n=!0:k1.has(a)?r[a]=s:k0.has(a)?r[a]=o(s,!0):r[a]=o(s,!1);return n&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...void 0!==r&&{$schema:r},type:"object",properties:{result:o(e,!1)},required:["result"]}}(e.outputSchema)}:e)}:t},encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope:e=>void 0};function wo(){return l??=function(){let e=ao(()=>nD([o5(),nk(),nR(),nI(),nB(o5(),e),nA(e)])),t=nB(o5(),e),r=nD([o5(),nk().int()]),i=o5(),o=nD([o5(),nk().int()]),n=nJ(["user","assistant"]),a=nJ(["debug","info","notice","warning","error","critical","alert","emergency"]),s=o5().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),d=nM({ttl:nk().optional()}),c=nM({taskId:o5()}),l=nN({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),p=nM({_meta:l.optional()}),u=p.extend({task:d.optional()}),m=nM({_meta:l.optional()}),f=nM({method:o5(),params:m.loose().optional()}),h=nM({src:o5(),mimeType:o5().optional(),sizes:nA(o5()).optional(),theme:nJ(["light","dark"]).optional()}),y=nM({icons:nA(h).optional()}),g=nM({name:o5(),title:o5().optional()}),_=g.extend({...g.shape,...y.shape,version:o5(),websiteUrl:o5().optional(),description:o5().optional()}),v=nH(nM({applyDefaults:nR().optional()}),t),b=aa(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nH(nM({form:v.optional(),url:t.optional()}),t.optional())),$=nN({list:t.optional(),cancel:t.optional(),requests:nN({sampling:nN({createMessage:t.optional()}).optional(),elicitation:nN({create:t.optional()}).optional()}).optional()}),S=nN({list:t.optional(),cancel:t.optional(),requests:nN({tools:nN({call:t.optional()}).optional()}).optional()}),k=nM({experimental:nB(o5(),t).optional(),sampling:nM({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:nM({listChanged:nR().optional()}).optional(),tasks:$.optional(),extensions:nB(o5(),t).optional()}),w=nM({experimental:nB(o5(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nM({listChanged:nR().optional()}).optional(),resources:nM({subscribe:nR().optional(),listChanged:nR().optional()}).optional(),tools:nM({listChanged:nR().optional()}).optional(),tasks:S.optional(),extensions:nB(o5(),t).optional()}),P=nM({progress:nk(),total:n0(nk()),message:n0(o5())}),V=nM({...m.shape,...P.shape,progressToken:r}),R=f.extend({method:nQ("notifications/progress"),params:V}),q=m.extend({level:a,logger:o5().optional(),data:nT()}),I=f.extend({method:nQ("notifications/message"),params:q}),x=nM({uri:o5(),mimeType:n0(o5()),_meta:nB(o5(),nT()).optional()}),j=x.extend({text:o5()}),C=x.extend({blob:s}),T=nM({audience:nA(n).optional(),priority:nk().min(0).max(1).optional(),lastModified:as({offset:!0}).optional()}),O=nM({...g.shape,...y.shape,uri:o5(),description:n0(o5()),mimeType:n0(o5()),size:n0(nk()),annotations:T.optional(),_meta:n0(nN({}))}),E=nM({...g.shape,...y.shape,uriTemplate:o5(),description:n0(o5()),mimeType:n0(o5()),annotations:T.optional(),_meta:n0(nN({}))}),A=f.extend({method:nQ("notifications/resources/list_changed"),params:m.optional()}),W=m.extend({uri:o5()}),M=f.extend({method:nQ("notifications/resources/updated"),params:W}),N=nM({name:o5(),description:n0(o5()),required:n0(nR())}),z=nM({...g.shape,...y.shape,description:n0(o5()),arguments:n0(nA(N)),_meta:n0(nN({}))}),D=f.extend({method:nQ("notifications/prompts/list_changed"),params:m.optional()}),F=nM({type:nQ("text"),text:o5(),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),L=nM({type:nQ("image"),data:s,mimeType:o5(),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),U=nM({type:nQ("audio"),data:s,mimeType:o5(),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),H=nM({type:nQ("tool_use"),name:o5(),id:o5(),input:nB(o5(),nT()),_meta:nB(o5(),nT()).optional()}),G=nM({type:nQ("resource"),resource:nD([j,C]),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),B=O.extend({type:nQ("resource_link")}),K=nD([F,L,U,B,G]),J=nM({role:n,content:K}),Z=nM({title:o5().optional(),readOnlyHint:nR().optional(),destructiveHint:nR().optional(),idempotentHint:nR().optional(),openWorldHint:nR().optional()}),Q=f.extend({method:nQ("notifications/tools/list_changed"),params:m.optional()}),X=nM({name:o5().optional()}),Y=nM({hints:nA(X).optional(),costPriority:nk().min(0).max(1).optional(),speedPriority:nk().min(0).max(1).optional(),intelligencePriority:nk().min(0).max(1).optional()}),ee=nM({mode:nJ(["auto","required","none"]).optional()}),et=nM({type:nQ("boolean"),title:o5().optional(),description:o5().optional(),default:nR().optional()}),er=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),minLength:nk().optional(),maxLength:nk().optional(),format:nJ(["email","uri","date","date-time"]).optional(),default:o5().optional()}),ei=nM({type:nJ(["number","integer"]),title:o5().optional(),description:o5().optional(),minimum:nk().optional(),maximum:nk().optional(),default:nk().optional()}),eo=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),default:o5().optional()}),en=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),oneOf:nA(nM({const:o5(),title:o5()})),default:o5().optional()}),ea=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),enumNames:nA(o5()).optional(),default:o5().optional()}),es=nD([eo,en]),ed=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({type:nQ("string"),enum:nA(o5())}),default:nA(o5()).optional()}),ec=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({anyOf:nA(nM({const:o5(),title:o5()}))}),default:nA(o5()).optional()}),el=nD([ed,ec]),ep=nD([ea,es,el]),eu=nD([ep,et,er,ei]),em=u.extend({mode:nQ("form").optional(),message:o5(),requestedSchema:nM({type:nQ("object"),properties:nB(o5(),eu),required:nA(o5()).optional()}).catchall(nT())}),ef=nM({type:nQ("ref/resource"),uri:o5()}),eh=nM({type:nQ("ref/prompt"),name:o5()}),ey=nM({uri:o5().startsWith("file://"),name:o5().optional(),_meta:nB(o5(),nT()).optional()}),eg=k.shape,e_=nM({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),ev=w.shape,eb=nM({experimental:ev.experimental,logging:ev.logging,completions:ev.completions,prompts:ev.prompts,resources:ev.resources,tools:ev.tools,extensions:ev.extensions}),e$=nN({progressToken:r.optional(),[al]:o5(),[ap]:_.optional(),[am]:e_,[ah]:a.optional()}),eS=nM({...g.shape,...y.shape,description:o5().optional(),inputSchema:nN({$schema:o5().optional(),type:nQ("object")}),outputSchema:nN({$schema:o5().optional()}).optional(),annotations:Z.optional(),_meta:nB(o5(),nT()).optional()}),ek=nM({type:nQ("tool_result"),toolUseId:o5(),content:nA(K),structuredContent:nT().optional(),isError:nR().optional(),_meta:nB(o5(),nT()).optional()}),ew=nD([F,L,U,H,ek]),eP=nM({role:n,content:nD([ew,nA(ew)]),_meta:nB(o5(),nT()).optional()}),eV=o5(),eR=nN({[au]:_.optional().catch(void 0)}),eq=eR.optional();function eI(e){return nN({_meta:eq,resultType:eV.default("complete"),...e})}let ex=eI({}),ej=eI({nextCursor:i.optional()}),eC=eI({content:nA(K),structuredContent:nT().optional(),isError:nR().optional()}),eT=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),tools:nA(eS),nextCursor:i.optional()}),eO=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),prompts:nA(z),nextCursor:i.optional()}),eE=eI({description:o5().optional(),messages:nA(J)}),eA=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resources:nA(O),nextCursor:i.optional()}),eW=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resourceTemplates:nA(E),nextCursor:i.optional()}),eM=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),contents:nA(nD([j,C]))}),eN=eI({completion:nM({values:nA(o5()).max(100),total:nk().int().optional(),hasMore:nR().optional()}).loose()}),ez=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"])}),eD=eI({ttlMs:nk().int().min(0).catch(0),cacheScope:nJ(["public","private"]).catch("private"),supportedVersions:nA(o5()),capabilities:eb,instructions:o5().optional()}),eF=nM({messages:nA(eP),modelPreferences:Y.optional(),systemPrompt:o5().optional(),includeContext:nJ(["none","thisServer","allServers"]).optional(),temperature:nk().optional(),maxTokens:nk().int(),stopSequences:nA(o5()).optional(),metadata:t.optional(),tools:nA(eS).optional(),toolChoice:ee.optional()}),eL=nM({method:nQ("sampling/createMessage"),params:eF}),eU=nM({method:nQ("roots/list"),params:nM({_meta:nB(o5(),nT()).optional()}).optional()}),eH=nM({...eP.shape,model:o5(),stopReason:o5().optional()}),eG=nM({roots:nA(ey)}),eB=nM({action:nJ(["accept","decline","cancel"]),content:nB(o5(),nD([o5(),nk(),nR(),nA(o5())])).optional()}),eK=nM({mode:nQ("url"),message:o5(),url:o5().url()}),eJ=nD([em,eK]),eZ=nM({method:nQ("elicitation/create"),params:eJ}),eQ=nD([eL,eU,eZ]),eX=nD([eH,eG,eB]),eY=nB(o5(),eQ),e1=nB(o5(),eX),e0=eI({inputRequests:eY.optional(),requestState:o5().optional()}),e2={inputResponses:e1.optional(),requestState:o5().optional()},e4=nM({_meta:e$,...e2}),e6=nN({progressToken:r.optional()});function e3(e,t){return nM({method:nQ(e),params:nM({_meta:e$,...t})})}function e9(e,t){return nM({method:nQ(e),params:nM({_meta:e6.optional(),...t}).optional()})}let e5={name:o5(),arguments:nB(o5(),nT()).optional(),...e2},e8={cursor:i.optional()},e7=e3("tools/call",e5),te=e3("tools/list",e8),tt=e3("prompts/list",e8),tr=e3("prompts/get",{name:o5(),arguments:nB(o5(),o5()).optional(),...e2}),ti=e3("resources/list",e8),to=e3("resources/templates/list",e8),tn=e3("resources/read",{uri:o5(),...e2}),ta={ref:nD([eh,ef]),argument:nM({name:o5(),value:o5()}),context:nM({arguments:nB(o5(),o5()).optional()}).optional()},ts=e3("completion/complete",ta),td=e3("server/discover",{}),tc=nM({toolsListChanged:nR().optional(),promptsListChanged:nR().optional(),resourcesListChanged:nR().optional(),resourceSubscriptions:nA(o5()).optional()}),tl={notifications:tc},tp=e3("subscriptions/listen",tl),tu=eR.extend({"io.modelcontextprotocol/subscriptionId":o}),tm=nN({_meta:tu,resultType:eV.default("complete")}),tf={"tools/call":e9("tools/call",e5),"tools/list":e9("tools/list",e8),"prompts/get":e9("prompts/get",{name:o5(),arguments:nB(o5(),o5()).optional()}),"prompts/list":e9("prompts/list",e8),"resources/list":e9("resources/list",e8),"resources/templates/list":e9("resources/templates/list",e8),"resources/read":e9("resources/read",{uri:o5()}),"completion/complete":e9("completion/complete",ta),"server/discover":e9("server/discover",{}),"subscriptions/listen":e9("subscriptions/listen",tl)};function th(e){return nN({_meta:eq,...e})}let ty={"tools/call":th({content:nA(K),structuredContent:nT().optional(),isError:nR().optional()}),"tools/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),tools:nA(eS),nextCursor:i.optional()}),"prompts/get":th({description:o5().optional(),messages:nA(J)}),"prompts/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),prompts:nA(z),nextCursor:i.optional()}),"resources/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resources:nA(O),nextCursor:i.optional()}),"resources/templates/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resourceTemplates:nA(E),nextCursor:i.optional()}),"resources/read":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),contents:nA(nD([j,C]))}),"completion/complete":th({completion:nM({values:nA(o5()).max(100),total:nk().int().optional(),hasMore:nR().optional()}).loose()}),"server/discover":th({ttlMs:nk().int().min(0).catch(0),cacheScope:nJ(["public","private"]).catch("private"),supportedVersions:nA(o5()),capabilities:eb,instructions:o5().optional()}),"subscriptions/listen":th({})},tg=nN({"io.modelcontextprotocol/subscriptionId":o.optional()}),t_=nM({method:nQ("notifications/subscriptions/acknowledged"),params:nM({_meta:tg.optional(),notifications:tc})}),tv=nM({_meta:tg.optional(),requestId:o,reason:o5().optional()}),tb=nM({method:nQ("notifications/cancelled"),params:tv}),t$=e=>nM({jsonrpc:nQ("2.0"),id:nD([o5(),nk().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:i,RequestIdSchema:o,RoleSchema:n,LoggingLevelSchema:a,TaskMetadataSchema:d,RelatedTaskMetadataSchema:c,RequestMetaSchema:l,BaseRequestParamsSchema:p,TaskAugmentedRequestParamsSchema:u,NotificationsParamsSchema:m,NotificationSchema:f,IconSchema:h,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:_,ClientTasksCapabilitySchema:$,ServerTasksCapabilitySchema:S,ClientCapabilitiesSchema:k,ServerCapabilitiesSchema:w,ProgressSchema:P,ProgressNotificationParamsSchema:V,ProgressNotificationSchema:R,LoggingMessageNotificationParamsSchema:q,LoggingMessageNotificationSchema:I,ResourceContentsSchema:x,TextResourceContentsSchema:j,BlobResourceContentsSchema:C,AnnotationsSchema:T,ResourceSchema:O,ResourceTemplateSchema:E,ResourceListChangedNotificationSchema:A,ResourceUpdatedNotificationParamsSchema:W,ResourceUpdatedNotificationSchema:M,PromptArgumentSchema:N,PromptSchema:z,PromptListChangedNotificationSchema:D,TextContentSchema:F,ImageContentSchema:L,AudioContentSchema:U,ToolUseContentSchema:H,EmbeddedResourceSchema:G,ResourceLinkSchema:B,ContentBlockSchema:K,PromptMessageSchema:J,ToolAnnotationsSchema:Z,ToolListChangedNotificationSchema:Q,ModelHintSchema:X,ModelPreferencesSchema:Y,ToolChoiceSchema:ee,BooleanSchemaSchema:et,StringSchemaSchema:er,NumberSchemaSchema:ei,UntitledSingleSelectEnumSchemaSchema:eo,TitledSingleSelectEnumSchemaSchema:en,LegacyTitledEnumSchemaSchema:ea,SingleSelectEnumSchemaSchema:es,UntitledMultiSelectEnumSchemaSchema:ed,TitledMultiSelectEnumSchemaSchema:ec,MultiSelectEnumSchemaSchema:el,EnumSchemaSchema:ep,PrimitiveSchemaDefinitionSchema:eu,ElicitRequestFormParamsSchema:em,ResourceTemplateReferenceSchema:ef,PromptReferenceSchema:eh,RootSchema:ey,ClientCapabilities2026Schema:e_,ServerCapabilities2026Schema:eb,RequestMetaEnvelopeSchema:e$,ToolSchema:eS,ToolResultContentSchema:ek,SamplingMessageContentBlockSchema:ew,SamplingMessageSchema:eP,ResultTypeSchema:eV,ResultMetaSchema:eR,ResultSchema:ex,PaginatedResultSchema:ej,CallToolResultSchema:eC,ListToolsResultSchema:eT,ListPromptsResultSchema:eO,GetPromptResultSchema:eE,ListResourcesResultSchema:eA,ListResourceTemplatesResultSchema:eW,ReadResourceResultSchema:eM,CompleteResultSchema:eN,CacheableResultSchema:ez,DiscoverResultSchema:eD,CreateMessageRequestParamsSchema:eF,CreateMessageRequestSchema:eL,ListRootsRequestSchema:eU,CreateMessageResultSchema:eH,ListRootsResultSchema:eG,ElicitResultSchema:eB,ElicitRequestURLParamsSchema:eK,ElicitRequestParamsSchema:eJ,ElicitRequestSchema:eZ,InputRequestSchema:eQ,InputResponseSchema:eX,InputRequestsSchema:eY,InputResponsesSchema:e1,InputRequiredResultSchema:e0,InputResponseRequestParamsSchema:e4,CallToolRequestSchema:e7,ListToolsRequestSchema:te,ListPromptsRequestSchema:tt,GetPromptRequestSchema:tr,ListResourcesRequestSchema:ti,ListResourceTemplatesRequestSchema:to,ReadResourceRequestSchema:tn,CompleteRequestSchema:ts,DiscoverRequestSchema:td,SubscriptionFilterSchema:tc,SubscriptionsListenRequestSchema:tp,SubscriptionsListenResultMetaSchema:tu,SubscriptionsListenResultSchema:tm,dispatchRequestSchemas:tf,dispatchResultSchemas:ty,NotificationMetaSchema:tg,SubscriptionsAcknowledgedNotificationSchema:t_,CancelledNotificationParamsSchema:tv,CancelledNotificationSchema:tb,notificationSchemas2026:{"notifications/cancelled":tb,"notifications/progress":R,"notifications/message":I,"notifications/resources/updated":M,"notifications/resources/list_changed":A,"notifications/tools/list_changed":Q,"notifications/prompts/list_changed":D,"notifications/subscriptions/acknowledged":t_},JSONRPCResultResponseSchema:t$(ex),CallToolResultResponseSchema:t$(nD([eC,e0])),ListToolsResultResponseSchema:t$(eT),ListPromptsResultResponseSchema:t$(eO),GetPromptResultResponseSchema:t$(nD([eE,e0])),ListResourcesResultResponseSchema:t$(eA),ListResourceTemplatesResultResponseSchema:t$(eW),ReadResourceResultResponseSchema:t$(nD([eM,e0])),CompleteResultResponseSchema:t$(eN),DiscoverResultResponseSchema:t$(eD),SubscriptionsListenResultResponseSchema:t$(tm)}}()}let wn=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],wa=Symbol("modelcontextprotocol.resultCacheHintFallback");function ws(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function wd(e){return"public"===e||"private"===e}let wc=((Y={})[Y.ParseError=-32700]="ParseError",Y[Y.InvalidRequest=-32600]="InvalidRequest",Y[Y.MethodNotFound=-32601]="MethodNotFound",Y[Y.InvalidParams=-32602]="InvalidParams",Y[Y.InternalError=-32603]="InternalError",Y[Y.ResourceNotFound=-32002]="ResourceNotFound",Y[Y.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",Y[Y.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",Y[Y.UrlElicitationRequired=-32042]="UrlElicitationRequired",Y);var wl=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return kD(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kD(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",kz(this,new.target)}static fromError(t,r,i){return t===wc.UrlElicitationRequired&&i&&i.elicitations?new wu(i.elicitations,r):t===wc.UnsupportedProtocolVersion&&i&&Array.isArray(i.supported)&&"string"==typeof i.requested?new wm({supported:i.supported,requested:i.requested},r):(t===wc.InvalidParams||t===wc.ResourceNotFound)&&"string"==typeof i?.uri&&(t===wc.ResourceNotFound||1===Object.keys(i).length)?new wp(i.uri,r):t===wc.MissingRequiredClientCapability&&i&&null!==i.requiredCapabilities&&"object"==typeof i.requiredCapabilities&&!Array.isArray(i.requiredCapabilities)?new wf({requiredCapabilities:i.requiredCapabilities},r):new e(t,r,i)}},wp=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(wc.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},wu=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(wc.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},wm=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(wc.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},wf=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(wc.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let wh=["tools/call","prompts/get","resources/read"],wy=["elicitation/create","sampling/createMessage","roots/list"];function wg(){if(p)return p;let e=wo();return p={request:{"elicitation/create":nM({method:nQ("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":nM({method:nQ("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":nM({method:nQ("roots/list"),params:nN({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function w_(e){return wy.includes(e)}function wv(e){return w_(e)?wg().request[e]:void 0}let wb={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},w$={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function wS(e){return Object.prototype.hasOwnProperty.call(wb,e)}function wk(e){return Object.prototype.hasOwnProperty.call(w$,e)}function ww(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function wP(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(wb),Object.keys(w$);let wV={ok:!1,reason:"not-in-era"},wR=[al,am],wq={era:"2026-07-28",hasRequestMethod:wS,hasNotificationMethod:wk,hasInputRequestMethod:e=>void 0!==wv(e),validateRequest:(e,t)=>wP(wS(e)?wo().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>wP(Object.prototype.hasOwnProperty.call(wb,e)?wo().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>wP(wk(e)?wo().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>wP(wv(e),t),validateInputResponse:(e,t)=>wP(w_(e)?wg().response[e]:void 0,t),samplingResultVariant:()=>wV,outboundEnvelope:e=>({[al]:e.protocolVersion,[ap]:e.clientInfo,[am]:e.clientCapabilities,...void 0!==e.logLevel&&{[ah]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of wR)r in e||t.push({key:r,problem:"missing"});let r=wo().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let e of r.error.issues){let r=e.path.map(String),i=r.length>0?r.join("."):"_meta";1===r.length&&t.some(e=>e.key===i&&"missing"===e.problem)||t.push({key:i,problem:e.message})}return t},projectCallToolResult:e=>kJ(e),inputRequestSchema:wv,decodeResult(e,t){if(!ww(t))return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if("string"!=typeof r)return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,i=ww(r)?r:{},o=t.requestState,n=void 0===t._meta?void 0:wo().ResultMetaSchema.safeParse(t._meta),a=n?.success?n.data:void 0;return 0===Object.keys(i).length&&"string"!=typeof o?{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:i,..."string"==typeof o&&{requestState:o},...void 0!==a&&{_meta:a}}}if("complete"!==r)return{kind:"invalid",error:new kL(kF.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let i=function(){if(u)return u;let e=wo();return u={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema}}(),o=Object.hasOwn(i,e)?i[e]:void 0;if(void 0!==o){let r=o.safeParse(t);if(!r.success)return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}let n={...t};return delete n.resultType,{kind:"complete",result:n}},encodeResult:(e,t,r)=>(function(e,t){if(void 0===t)return e;let r=e._meta;return void 0===r?{...e,_meta:{[au]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[au]?e:{...e,_meta:{...r,[au]:t}}})(function(e,t){var r,i;let o=t[wa];if("complete"!==t.resultType||!wn.includes(e)){let e;return void 0===o?t:(e={...t},delete e[wa],e)}let n=ws(t.ttlMs)?t.ttlMs:void 0!==(r=o)&&ws(r.ttlMs)?r.ttlMs:0,a=wd(t.cacheScope)?t.cacheScope:void 0!==(i=o)&&wd(i.cacheScope)?i.cacheScope:"private",s={...t,ttlMs:n,cacheScope:a};return delete s[wa],s}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||wh.includes(e))return t;throw new wl(wc.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}(e,function(e,t){let r=t,i=!1,o=()=>(i||(r={...r},i=!0),r),n=t.tools;"tools/list"===e&&Array.isArray(n)&&n.some(e=>ww(e)&&"execution"in e)&&(o().tools=n.map(e=>{if(!ww(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let a=t.capabilities;if(ww(a)&&"tasks"in a){let e={...a};delete e.tasks,o().capabilities=e}return r}(e,t))),r),encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope(e){if(void 0===e.envelope)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=wo().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join("; ")}`}},wI="2026-07-28";function wx(e){return void 0!==e&&e>=kH?wq:wi}function wj(e){return void 0!==e.revision?wx(e.revision).era:"modern"===e.era?wq.era:wi.era}function wC(e){return wE.some(t=>t.hasRequestMethod(e))}function wT(e){return wE.some(t=>t.hasNotificationMethod(e))}function wO(e){return"tasks/get"===e||"tasks/cancel"===e}let wE=[wi,wq];var wA=(e=>{let t={};for(var r in e)kI(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>sn,AudioContentSchema:()=>sE,BaseMetadataSchema:()=>aL,BaseRequestParamsSchema:()=>aw,BlobResourceContentsSchema:()=>si,BooleanSchemaSchema:()=>ds,CallToolRequestParamsSchema:()=>sZ,CallToolRequestSchema:()=>sQ,CallToolResultSchema:()=>sK,CancelTaskRequestSchema:()=>dB,CancelTaskResultSchema:()=>dK,CancelledNotificationParamsSchema:()=>aN,CancelledNotificationSchema:()=>az,ClientCapabilitiesSchema:()=>aJ,ClientNotificationSchema:()=>dZ,ClientRequestSchema:()=>dJ,ClientResultSchema:()=>dQ,ClientTasksCapabilitySchema:()=>aB,CompatibilityCallToolResultSchema:()=>sJ,CompleteRequestParamsSchema:()=>dq,CompleteRequestSchema:()=>dI,CompleteResultSchema:()=>dx,ContentBlockSchema:()=>sN,CreateMessageRequestParamsSchema:()=>dr,CreateMessageRequestSchema:()=>di,CreateMessageResultSchema:()=>dn,CreateMessageResultWithToolsSchema:()=>da,CreateTaskResultSchema:()=>dM,CursorSchema:()=>ab,DiscoverRequestSchema:()=>a0,DiscoverResultSchema:()=>a2,ElicitRequestFormParamsSchema:()=>dv,ElicitRequestParamsSchema:()=>d$,ElicitRequestSchema:()=>dS,ElicitRequestURLParamsSchema:()=>db,ElicitResultSchema:()=>dP,ElicitationCompleteNotificationParamsSchema:()=>dk,ElicitationCompleteNotificationSchema:()=>dw,EmbeddedResourceSchema:()=>sW,EmptyResultSchema:()=>aM,EnumSchemaSchema:()=>dg,GetPromptRequestParamsSchema:()=>sj,GetPromptRequestSchema:()=>sC,GetPromptResultSchema:()=>sD,GetTaskPayloadRequestSchema:()=>dL,GetTaskPayloadResultSchema:()=>dU,GetTaskRequestSchema:()=>dD,GetTaskResultSchema:()=>dF,IconSchema:()=>aD,IconsSchema:()=>aF,ImageContentSchema:()=>sO,ImplementationSchema:()=>aU,InitializeRequestParamsSchema:()=>aZ,InitializeRequestSchema:()=>aQ,InitializeResultSchema:()=>aY,InitializedNotificationSchema:()=>a1,JSONArraySchema:()=>a_,JSONObjectSchema:()=>ag,JSONRPCErrorResponseSchema:()=>aE,JSONRPCMessageSchema:()=>aA,JSONRPCNotificationSchema:()=>aT,JSONRPCRequestSchema:()=>aC,JSONRPCResponseSchema:()=>aW,JSONRPCResultResponseSchema:()=>aO,JSONValueSchema:()=>ay,LegacyTitledEnumSchemaSchema:()=>du,ListChangedOptionsBaseSchema:()=>sY,ListPromptsRequestSchema:()=>sI,ListPromptsResultSchema:()=>sx,ListResourceTemplatesRequestSchema:()=>sl,ListResourceTemplatesResultSchema:()=>sp,ListResourcesRequestSchema:()=>sd,ListResourcesResultSchema:()=>sc,ListRootsRequestSchema:()=>dC,ListRootsResultSchema:()=>dT,ListTasksRequestSchema:()=>dH,ListTasksResultSchema:()=>dG,ListToolsRequestSchema:()=>sG,ListToolsResultSchema:()=>sB,LoggingLevelSchema:()=>s1,LoggingMessageNotificationParamsSchema:()=>s4,LoggingMessageNotificationSchema:()=>s6,ModelHintSchema:()=>s3,ModelPreferencesSchema:()=>s9,MultiSelectEnumSchemaSchema:()=>dy,NotificationSchema:()=>aq,NotificationsParamsSchema:()=>aR,NumberSchemaSchema:()=>dc,PaginatedRequestParamsSchema:()=>a5,PaginatedRequestSchema:()=>a8,PaginatedResultSchema:()=>a7,PingRequestSchema:()=>a4,PrimitiveSchemaDefinitionSchema:()=>d_,ProgressNotificationParamsSchema:()=>a3,ProgressNotificationSchema:()=>a9,ProgressSchema:()=>a6,ProgressTokenSchema:()=>av,PromptArgumentSchema:()=>sR,PromptListChangedNotificationSchema:()=>sF,PromptMessageSchema:()=>sz,PromptReferenceSchema:()=>dR,PromptSchema:()=>sq,ReadResourceRequestParamsSchema:()=>su,ReadResourceRequestSchema:()=>sm,ReadResourceResultSchema:()=>sf,RelatedTaskMetadataSchema:()=>aS,RequestIdSchema:()=>aj,RequestMetaSchema:()=>ak,RequestSchema:()=>aV,ResourceContentsSchema:()=>se,ResourceLinkSchema:()=>sM,ResourceListChangedNotificationSchema:()=>sh,ResourceRequestParamsSchema:()=>su,ResourceSchema:()=>sa,ResourceTemplateReferenceSchema:()=>dV,ResourceTemplateSchema:()=>ss,ResourceUpdatedNotificationParamsSchema:()=>sP,ResourceUpdatedNotificationSchema:()=>sV,ResultMetaObjectSchema:()=>aI,ResultSchema:()=>ax,RoleSchema:()=>so,RootSchema:()=>dj,RootsListChangedNotificationSchema:()=>dO,SamplingContentSchema:()=>s7,SamplingMessageContentBlockSchema:()=>de,SamplingMessageSchema:()=>dt,ServerCapabilitiesSchema:()=>aX,ServerNotificationSchema:()=>dY,ServerRequestSchema:()=>dX,ServerResultSchema:()=>d1,ServerTasksCapabilitySchema:()=>aK,SetLevelRequestParamsSchema:()=>s0,SetLevelRequestSchema:()=>s2,SingleSelectEnumSchemaSchema:()=>dm,StringSchemaSchema:()=>dd,SubscribeRequestParamsSchema:()=>su,SubscribeRequestSchema:()=>sy,SubscriptionFilterSchema:()=>s_,SubscriptionsAcknowledgedNotificationParamsSchema:()=>s$,SubscriptionsAcknowledgedNotificationSchema:()=>sS,SubscriptionsListenRequestParamsSchema:()=>sv,SubscriptionsListenRequestSchema:()=>sb,SubscriptionsListenResultMetaSchema:()=>sk,SubscriptionsListenResultSchema:()=>sw,TaskAugmentedRequestParamsSchema:()=>aP,TaskCreationParamsSchema:()=>dE,TaskMetadataSchema:()=>a$,TaskSchema:()=>dW,TaskStatusNotificationParamsSchema:()=>dN,TaskStatusNotificationSchema:()=>dz,TaskStatusSchema:()=>dA,TextContentSchema:()=>sT,TextResourceContentsSchema:()=>st,TitledMultiSelectEnumSchemaSchema:()=>dh,TitledSingleSelectEnumSchemaSchema:()=>dp,ToolAnnotationsSchema:()=>sL,ToolChoiceSchema:()=>s5,ToolExecutionSchema:()=>sU,ToolListChangedNotificationSchema:()=>sX,ToolResultContentSchema:()=>s8,ToolSchema:()=>sH,ToolUseContentSchema:()=>sA,UnsubscribeRequestParamsSchema:()=>su,UnsubscribeRequestSchema:()=>sg,UntitledMultiSelectEnumSchemaSchema:()=>df,UntitledSingleSelectEnumSchemaSchema:()=>dl});let wW=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,wM="x-mcp-header",wN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,wz=new Set(["string","integer","boolean"]);function wD(e){let t,r=[],i=new Map,o=(e,n,a)=>{if(null===e||"object"!=typeof e)return;if(wM in e){if(!a||0===n.length)return`${wU(n)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let o=e[wM];if("string"!=typeof o||0===o.length)return`${wU(n)}: x-mcp-header MUST be a non-empty string`;if(!wN.test(o))return`${wU(n)}: x-mcp-header '${o}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let s="string"==typeof e.type?e.type:void 0;if(void 0===s||!wz.has(s)){let e=`${wU(n)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${s??""}`;if("number"!==s)return e;t??=e}let d=o.toLowerCase(),c=i.get(d);if(void 0!==c)return`x-mcp-header '${o}' is not case-insensitively unique (also declared as '${c}')`;i.set(d,o),r.push({path:n,headerName:o,type:s})}let s=e.properties;if(null!==s&&"object"==typeof s)for(let[e,t]of Object.entries(s)){let r=o(t,[...n,e],a);if(void 0!==r)return r}for(let t of wF){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&wL.has(t)?Object.values(r):[r]){let r=o(e,[...n,`<${t}>`],!1);if(void 0!==r)return r}}},n=o(e,[],!0);return void 0!==n?{valid:!1,reason:t??n}:void 0===t?{valid:!0,declarations:r}:{valid:!1,reason:t,declarations:r}}let wF=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],wL=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function wU(e){return 0===e.length?"":e.join(".")}let wH="=?base64?";function wG(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function wB(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}wc.InvalidRequest,wc.UnsupportedProtocolVersion,wc.InvalidParams,wc.MethodNotFound,wc.InvalidParams,wc.MissingRequiredClientCapability,wc.ParseError,wc.InvalidRequest,wc.MethodNotFound,wc.UnsupportedProtocolVersion,wc.MissingRequiredClientCapability;let wK=!1,wJ="draft-2020-12",wZ=/^#\/(\$defs|definitions)\/([^/~%]+)$/;async function wQ(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(e=>e.path?.length?`${e.path.map(e=>String("object"==typeof e?e.key:e)).join(".")}: ${e.message}`:e.message).join(", ")}:{success:!0,data:r.value}}let wX=/\\\.\\d\{(\d+)\}/;function wY(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let w1=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function w0(e){return w1.has(e)||e.startsWith("x-")}let w2=new Set(["$schema",...Object.keys(dv.shape.requestedSchema.shape)]),w4={string:wG([dd,dl,dp,du]),number:wG([dc]),integer:wG([dc]),boolean:wG([ds]),array:wG([df,dh])},w6=new Set(dd.shape.format.unwrap().options);Object.assign(function(e){let t=void 0!==e.inputRequests&&Object.keys(e.inputRequests).length>0,r="string"==typeof e.requestState;if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==e.inputRequests&&{inputRequests:e.inputRequests},...void 0!==e.requestState&&{requestState:e.requestState}}},{elicit(e){try{return{method:"elicitation/create",params:function(e){var t;if(!wB(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let r=e.requestedSchema["~standard"].vendor,i=function(e,t){let r={},i=[];for(let[o,n]of Object.entries(e))"properties"===o&&wY(n)?r[o]=Object.fromEntries(Object.entries(n).map(([e,r])=>[e,function(e,t,r,i){if(!wY(e))return e;let o="string"==typeof e.type&&Object.hasOwn(w4,e.type)?w4[e.type]:void 0;if(void 0===o)return e;let n={};for(let[s,d]of Object.entries(e))if(o.has(s)||w0(s))n[s]=d;else if("pattern"===s&&"string"===e.type&&"string"==typeof e.format)if(w6.has(e.format)){var a;"string"==typeof d&&(a=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[iS(ni,void 0)];break;case"uri":r=[ik(na,void 0)];break;case"date":r=[iP(ne,void 0)];break;case"date-time":let i,o;i=wX.exec(t),o=[void 0,-1,0],i&&o.push(Number(i[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>o.map(r=>as({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=oq(e,{target:wJ,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(a,d).has(d))||i.push(`${t}.${s}`)}else n[s]=d;else i.push(`${t}.${s}`);return n}(r,`properties.${e}`,t,i)])):w2.has(o)?r[o]=n:w0(o)||i.push(o);if(i.length>0)throw new wl(wc.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);return r}(function(e){try{return function(e,t="input"){let r,i=e["~standard"];if(i.jsonSchema)r=i.jsonSchema[t]({target:wJ});else if("zod"===i.vendor){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");wK||(wK=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=oq(e,{target:wJ,io:t})}else throw Error(`Schema library "${i.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===t)return void 0!==r.type||!function e(t,r=t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;let i="string"==typeof t.$ref&&wZ.exec(t.$ref);if(i&&r[i[1]]?.[i[2]]?.type==="object")return!0;for(let i of["oneOf","anyOf","allOf"]){let o=t[i];if(Array.isArray(o)&&o.length>0)return o.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t,"$id"in t?{}:r)))}return!1}(r)?r:{type:"object",...r};if(void 0!==r.type&&"object"!==r.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}(e,"input")}catch(t){let e=t instanceof Error?t.message:String(t);throw new wl(wc.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),o=(t=dv.shape.requestedSchema,oB(t,i));if(!o.success)throw new wl(wc.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!wY(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!oB(d_,e).success).map(([e])=>`properties.${e}`);return r.length>0?r.join(", "):t}(i,o.error.message)}`);let n=function e(t,r,i=""){return Array.isArray(t)&&Array.isArray(r)?t.flatMap((t,o)=>e(t,r[o],`${i}[${o}]`)):wY(t)&&wY(r)?Object.entries(t).flatMap(([t,o])=>{let n=i?`${i}.${t}`:t;return Object.prototype.hasOwnProperty.call(r,t)?e(o,r[t],n):w0(t)?[]:[n]}):[]}(i,o.data);if(n.length>0)throw new wl(wc.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let a=(o.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(o.data.properties,e));if(a.length>0)throw new wl(wc.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}(e)}}catch(e){throw e instanceof wl?TypeError(e.message,{cause:e}):e}},elicitUrl:e=>({method:"elicitation/create",params:{...e,mode:"url"}}),createMessage:e=>({method:"sampling/createMessage",params:e}),listRoots:()=>({method:"roots/list"})});let w3={},w9={};function w5(e,t){let r=e.slice(0,-6);w3[r]=t,w9[r]=e=>t.safeParse(e).success}for(let e of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])w5(e,wA[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:d7,OAuthClientInformationFullSchema:co,OAuthClientInformationSchema:ci,OAuthClientMetadataSchema:cr,OAuthClientRegistrationErrorSchema:cn,OAuthErrorResponseSchema:ce,OAuthMetadataSchema:d3,OAuthProtectedResourceMetadataSchema:d6,OAuthTokenRevocationRequestSchema:ca,OAuthTokensSchema:d8,OpenIdProviderDiscoveryMetadataSchema:d5,OpenIdProviderMetadataSchema:d9}))w5(e,t);Object.freeze(w3);let w8=Object.freeze(w9),w7=[al,ap,am,ah],Pe=["inputResponses","requestState"];function Pt(e,t){let r=e.params;if(!Pn(r))return{message:e,lifted:{}};let i=r._meta,o=Pn(i)?w7.filter(e=>e in i):[],n="request"===t?Pe.filter(e=>e in r):[];if(0===o.length&&0===n.length)return{message:e,lifted:{}};let a={},s={...r};if(o.length>0&&Pn(i)){let e={},t={...i};for(let r of o)e[r]=i[r],delete t[r];a.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of n)"inputResponses"===e&&(a.inputResponses=s[e]),"requestState"===e&&(a.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:a}}function Pr(e,t){let r=e.validateResult(t,void 0);if(r.ok||"not-in-era"!==r.reason)return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let i=e.validateResult(t,r);return i.ok?{value:i.value}:{issues:[{message:"invalid"===i.reason?i.message:`not-in-era: ${t}`}]}}}}}let Pi=(ee=void 0,()=>ee);var Po=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??ac,this.setNotificationHandler("notifications/cancelled",e=>{this._oncancel(e)}),this.setNotificationHandler("notifications/progress",e=>{this._onprogress(e)}),this.setRequestHandler("ping",e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(void 0===t)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new kL(kF.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){void 0!==e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new kL(kF.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let i=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{if(i?.(e,t),aO.safeParse(e).success||aE.safeParse(e).success)this._onresponse(e);else if(aC.safeParse(e).success)this._onrequest(e,t);else aT.safeParse(e).success?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new kL(kF.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(r);for(let e of t.values())e.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=Pt(e,"notification"),i=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=wj(t.classification);if(e!==i.era)return void this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${e} but this instance serves ${i.era}`))}if(wT(r.method)&&!i.hasNotificationMethod(r.method))return;let o=this._notificationHandlers.get(r.method),n=this.fallbackNotificationHandler;(void 0!==o||void 0!==n)&&Promise.resolve().then(()=>void 0===o?n(r):o(r,i)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r;let{message:i,lifted:o}=Pt(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return void this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));let a=this._transport,s=(e,t,r)=>{let o={jsonrpc:"2.0",id:i.id,error:{code:e,message:t,...void 0!==r&&{data:r}}};a?.send(o).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=wj(t.classification);if(e!==n.era){this._onerror(Error(`Era mismatch on inbound request '${i.method}': classified as ${e} but this instance serves ${n.era}`));let r=t.classification.revision??e;s(wc.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(wC(i.method)&&!n.hasRequestMethod(i.method)&&!(wO(i.method)&&this._customSchemaRequestMethods.has(i.method)))return void s(wc.MethodNotFound,"Method not found");let d=this._requestHandlers.get(i.method)??this.fallbackRequestHandler;if(void 0===d)return void s(wc.MethodNotFound,"Method not found");let c=n.checkInboundEnvelope(o);if(void 0!==c)return void s(wc.InvalidParams,c);let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:i.id}),p=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:i.id}),u=new AbortController;this._requestHandlerAbortControllers.set(i.id,u);let m=void 0===o.inputResponses?void 0:function(e){let t={},r=[];if(!Pa(e))return{accepted:t,droppedKeys:r};for(let[i,o]of Object.entries(e)){if(!Pa(o)||"method"in o||"result"in o){r.push(i);continue}t[i]=o}return{accepted:t,droppedKeys:r}}(o.inputResponses),f={sessionId:a?.sessionId,mcpReq:{id:i.id,method:i.method,_meta:i.params?._meta,...void 0!==o.envelope&&{envelope:o.envelope},...void 0!==m&&{inputResponses:m.accepted},...void 0!==m&&m.droppedKeys.length>0&&{droppedInputResponseKeys:m.droppedKeys},requestState:void 0===o.requestState?Pi:(r=o.requestState,()=>r),signal:u.signal,send:(e,t,r)=>{let i=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(i,e.method),wB(t))return p(e,t,r);let o=Pr(i,e.method);if(void 0===o)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return p(e,o,t)},notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},h=this.buildContext(f,t);Promise.resolve().then(()=>d(i,h)).then(async e=>{let t;if(u.signal.aborted)return;try{t=n.encodeResult(i.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${i.method}: ${e}`)),s(wc.InternalError,"Internal error");return}let r={result:t,jsonrpc:"2.0",id:i.id};await a?.send(r)},async e=>{if(u.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:wc.InternalError,r={jsonrpc:"2.0",id:i.id,error:{code:n.encodeErrorCode(t),message:e.message??"Internal error",...void 0!==e.data&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(i.id)===u&&this._requestHandlerAbortControllers.delete(i.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,i=Number(t),o=this._progressHandlers.get(i);if(!o)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let n=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&n&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(e){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),n(e);return}o(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);void 0===r?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),r(aO.safeParse(e).success?e:wl.fromError(e.error.code,e.error.message,e.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let i=this._resolveOutboundCodec(e.method);if(wB(t))return wO(e.method)||this._assertOutboundRequestInEra(i,e.method),this._requestWithSchemaViaCodec(i,e,t,r);this._assertOutboundRequestInEra(i,e.method);let o=Pr(i,e.method);if(void 0===o)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(i,e,o,t)}_negotiatedWireCodec(){return wx(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(void 0===this._negotiatedProtocolVersion){let t=function(e){switch(e){case"initialize":case"notifications/initialized":return wx(void 0);case"server/discover":return wx(wI);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(wC(t)&&!e.hasRequestMethod(t))throw new kL(kF.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let i=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(i,e.method),this._requestWithSchemaViaCodec(i,e,t,r)}_requestWithSchemaViaCodec(e,t,r,i){let o,n,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:d,headers:c}=i??{},l=Date.now();return new Promise((p,u)=>{let m=e=>{u(e)};if(!this._transport)return void m(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){m(e);return}if(i?.signal?.aborted){let e=i.signal.reason;throw e instanceof kL?e:new kL(kF.RequestTimeout,String(e))}let f=e.era===wI&&!0===this._transport.hasPerRequestStream?new AbortController:void 0,h=this._requestMessageId++;n=h;let y={...t,jsonrpc:"2.0",id:h};i?.onprogress&&(this._progressHandlers.set(h,i.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let g=this._envelopeOutbound(y),_=!1,v=e=>{_||(this._progressHandlers.delete(h),void 0===f?"initialize"!==t.method&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(e)}}),{relatedRequestId:a,resumptionToken:s,onresumptiontoken:d}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):f.abort(),u(e instanceof kL?e:new kL(kF.RequestTimeout,String(e))))};this._responseHandlers.set(h,o=>{let n;if(!i?.signal?.aborted){if(_=!0,o instanceof Error)return u(o);try{n=e.decodeResult(t.method,o.result)}catch(e){return u(e instanceof Error?e:Error(String(e)))}if("invalid"===n.kind)return u(n.error);if("input_required"===n.kind){var a;return i?.allowInputRequired===!0?p({resultType:"input_required",inputRequests:(a=n).inputRequests,...void 0!==a.requestState&&{requestState:a.requestState},...void 0!==a._meta&&{_meta:a._meta}}):p(this._resolveNonCompleteResult(n,{codec:e,request:t,resultSchema:r,options:i,flowStartedAt:l,retry:(i,o)=>this._requestWithSchemaViaCodec(e,void 0===i?{method:t.method}:{method:t.method,params:i},r,o)}))}wQ(r,n.result).then(e=>{e.success?p(e.data):u(new kL(kF.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},u)}}),o=()=>v(i?.signal?.reason),i?.signal?.addEventListener("abort",o,{once:!0});let b=i?.timeout??6e4;this._setupTimeout(h,b,i?.maxTotalTimeout,()=>v(new kL(kF.RequestTimeout,"Request timed out",{timeout:b})),i?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:d,headers:c,requestSignal:f?.signal}).catch(e=>{this._progressHandlers.delete(h),u(e)})}).finally(()=>{o&&i?.signal?.removeEventListener("abort",o),void 0!==n&&(this._responseHandlers.delete(n),this._cleanupTimeout(n))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new kL(kF.NotConnected,"Not connected");if(wT(t.method)&&!e.hasNotificationMethod(t.method))throw new kL(kF.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let i=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(i,r).catch(e=>this._onerror(e))});return}await this._transport.send(i,r)}setRequestHandler(e,t,r){let i;if(this.assertRequestHandlerCapability(e),"function"==typeof t){if(!wC(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);i=(r,i)=>{let o=this._negotiatedWireCodec(),n=o.validateRequest(e,r);if(n.ok||"not-in-era"!==n.reason||(n=o.validateInputRequest(e,r)),!n.ok){if("not-in-era"===n.reason)throw new wl(wc.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(n.message)}return Promise.resolve(t(n.value,i))}}else if(r)i=async(i,o)=>{let n=await wQ(t.params,{...i.params});if(!n.success)throw new wl(wc.InvalidParams,`Invalid params for ${e}: ${n.error}`);return r(n.data,o)};else throw TypeError("setRequestHandler: handler is required");"function"==typeof t?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,i))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if("function"==typeof t){if(!wT(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,i)=>{let o=i.validateNotification(e,r);if(!o.ok){if("not-in-era"===o.reason)throw new wl(wc.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(o.message)}return Promise.resolve(t(o.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async i=>{let o=await wQ(t.params,{...i.params});if(!o.success)throw new wl(wc.InvalidParams,`Invalid params for notification ${e}: ${o.error}`);await r(o.data,i)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Pn(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Pa(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ps(e){throw new kL(kF.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}(kO(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function o(e){this.parameters=Object.create(null),this.type=e}e.parse=function(e){if(!e)throw TypeError("argument string is required");var n,a,s,d="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof d)throw TypeError("argument string is required to be a string");var c=d.indexOf(";"),l=-1!==c?d.slice(0,c).trim():d.trim();if(!i.test(l))throw TypeError("invalid media type");var p=new o(l.toLowerCase());if(-1!==c){for(t.lastIndex=c;a=t.exec(d);){if(a.index!==c)throw TypeError("invalid parameter format");c+=a[0].length,n=a[1].toLowerCase(),34===(s=a[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(r,"$1")),p.parameters[n]=s}if(c!==d.length)throw TypeError("invalid parameter format")}return p}}))();var Pd=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??0xa00000}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let t=this._buffer.indexOf("\n");if(-1===t)break;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");this._buffer=this._buffer.subarray(t+1);try{var e;return e=r,aA.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};let Pc=ed("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"),Pl="win32"===N.platform?["APPDATA","COMSPEC","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PATHEXT","PROCESSOR_ARCHITECTURE","PROGRAMDATA","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","WINDIR"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var Pp=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new Pd({maxBufferSize:e.maxBufferSize}),("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new F)}async start(){if(this._process)throw Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._process=Pc(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of Pl){let r=N.env[t];void 0!==r&&(r.startsWith("()")||(e[t]=r))}return e}(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:"win32"===N.platform,cwd:this._serverParams.cwd}),this._process.on("error",e=>{t(e),this.onerror?.(e)}),this._process.on("spawn",()=>{e()}),this._process.on("close",e=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",e=>{this.onerror?.(e)}),this._process.stdout?.on("data",e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}}),this._process.stdout?.on("error",e=>{this.onerror?.(e)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async _dispose(){let e=this._process;if(this._process=void 0,e&&null===e.exitCode&&null===e.signalCode){let t=new Promise(t=>e.once("exit",()=>t()));try{e.stdin?.end()}catch{}try{e.kill("SIGTERM")}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,1e3).unref())]),null===e.exitCode&&null===e.signalCode)try{e.kill("SIGKILL")}catch{}await t}try{e?.stdout?.destroy()}catch{}try{e?.stdin?.destroy()}catch{}try{e?.stderr?.destroy()}catch{}this._readBuffer.clear()}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(t=>{e.once("close",()=>{t()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())]),null===e.exitCode){try{e.kill("SIGTERM")}catch{}await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())])}if(null===e.exitCode)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw new kL(kF.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let Pu=new TextEncoder,Pm=new TextDecoder,Pf=new TextDecoder("utf-8",{fatal:!0});function Ph(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let i of e)t.set(i,r),r+=i.length;return t}function Py(e,t,r){if(t<0||t>=0x100000000)throw RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function Pg(e){let t=Math.floor(e/0x100000000),r=new Uint8Array(8);return Py(r,t,0),Py(r,e%0x100000000,4),r}function P_(e){let t=new Uint8Array(4);return Py(t,e),t}let Pv=/[^\x00-\x7f]/;function Pb(e){if("string"==typeof e&&e.length>=128){if(Pv.test(e))throw TypeError("non-ASCII string encountered in encode()");return Pu.encode(e)}let t=new Uint8Array(e.length);for(let r=0;r127)throw TypeError("non-ASCII string encountered in encode()");t[r]=i}return t}function P$(e,t=!1){if(Uint8Array.prototype.toBase64)return e.toBase64({alphabet:t?"base64url":"base64",omitPadding:t});let r=[];for(let t=0;t"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);return void 0===t?void 0:new Set(t)}function PX(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function PY(e,t,r,i,o){if(void 0!==o.crit&&i?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||void 0===i.crit)return[];if(!Array.isArray(i.crit)||0===i.crit.length||i.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let n=void 0===r?t:{__proto__:null,...r,...t};for(let t of i.crit){if(!(t in n))throw new Pq(`Extension Header Parameter "${t}" is not recognized`);if(!Object.hasOwn(o,t)||void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(n[t]&&(!Object.hasOwn(i,t)||void 0===i[t]))throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return i.crit}function P1(e,t){if(t.includes("b64")){let t=e.b64;if("boolean"!=typeof t)throw new Pj('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}function P0(e,t){let r,i;try{r=JSON.stringify(t),i=JSON.parse(r)}catch(t){throw new e("JOSE Header is not valid JSON",{cause:t})}if(!PF(i))throw new e("JOSE Header is not a JSON object");return[i,r]}async function P2(e,t,r){let i,o,{alg:n,secret:a}=e,s="decrypt"===r||"sign"===r;if(a&&t instanceof Uint8Array)return t;if(PF(t)){if("string"!=typeof(i=Va(t)).kty)throw Ve(n,t,a);if(!(a?"oct"===i.kty&&"string"==typeof i.k:"oct"!==i.kty&&(s?"AKP"===i.kty&&"string"==typeof i.priv||"string"==typeof i.d:void 0===i.d&&void 0===i.priv)))throw TypeError(a?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${s?"private":"public"} JWK`);if(((e,t,r)=>{let{alg:i}=e;if(void 0!==t.use){let e="sign"===r||"verify"===r?"sig":"enc";if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==i)throw TypeError(`Invalid key for this operation, its "alg" must be "${i}" when present`);if(Array.isArray(t.key_ops)){let i="encrypt"===r||"decrypt"===r?e.ops?.[+("encrypt"!==r)]:r;if(i&&!t.key_ops.includes(i))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${i}" when present`)}})(e,i,r),"oct"===i.kty)return PN(i.k);if(!Object.isFrozen(t)){let{key_ops:e}=t;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}}else{if(!P5(t))throw Ve(n,t,a);let e=a?"secret":s?"private":"public";if(t.type!==e&&(a||["secret","public","private"].includes(t.type)))throw TypeError(`${t[Symbol.toStringTag]} instances must be of type "${e}" for the ${n} algorithm`);if(P3(t))return t;if("secret"===(o=t).type)return o.export()}let d=(m||=new WeakMap).get(t);if(d?.[n])return d[n];if(d||m.set(t,d={}),o&&"function"==typeof o.toCryptoKey){let t="public"===o.type,r=P4[o.asymmetricKeyDetails?.namedCurve],i=e.resolve?.({crv:r,asymmetricKeyType:o.asymmetricKeyType})??e.subtle;return d[n]=o.toCryptoKey(i,t,e.usages[+!t])}return(i??=o.export({format:"jwk"})).alg=n,d[n]=await Vd(e,i)}let P4={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function P6(e){if(!P3(e))throw Error("CryptoKey instance expected")}let P3=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},P9=e=>e?.[Symbol.toStringTag]==="KeyObject",P5=e=>P3(e)||P9(e);function P8(e,t,...r){if(r.length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let P7=(e,...t)=>P8("Key must be ",e,...t);function Ve(e,t,r){let i=["CryptoKey","KeyObject","JSON Web Key"];return r&&i.push("Uint8Array"),TypeError(P8(`Key for the ${e} algorithm must be `,t,...i))}let Vt=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function Vr(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Vi(e,t){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function Vo(e,t,r){let i=e.algorithm;if(i.name!==t.name)throw Vt(t.name);if(t.hash&&i.hash?.name!==t.hash)throw Vt(t.hash,"algorithm.hash");if(t.namedCurve&&i.namedCurve!==t.namedCurve)throw Vt(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&i.length!==t.length)throw Vt(t.length,"algorithm.length");Vr(e,r)}function Vn(e){return{__proto__:null,...e}}function Va(e){let t=Vn(e);if(void 0!==t.ext&&"boolean"!=typeof t.ext)throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(void 0!==t.key_ops){let e=t.key_ops,r=Array.isArray(e)?[...e]:void 0;if(!r||r.some(e=>"string"!=typeof e)||new Set(r).size!==r.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=r}return t}function Vs(e){if(void 0!==e&&"boolean"!=typeof e)throw TypeError('"extractable" option must be a boolean');return e}async function Vd(e,t,r){if(!e.kty.includes(t.kty))throw new Pq('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let i=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,o=!!(t.d||t.priv),n={...t,ext:r??t.ext};return"AKP"!==n.kty&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,i,n.ext??!o,t.key_ops??e.usages[+!!o])}async function Vc(e,t,r,i=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,i,[r])),Vo(e,t,r),e}let Vl=e=>crypto.getRandomValues(new Uint8Array(e.cekBits>>3));function Vp(e,t){let r=e.byteLength<<3;if(r!==t)throw new Px(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}function Vu(e,t){if(t.length<<3!==e.ivBits)throw new Px("Invalid Initialization Vector length")}async function Vm(e,t,r){if(!(t instanceof Uint8Array))throw TypeError(P7(t,"Uint8Array"));let i=e.cekBits>>1;return[await crypto.subtle.importKey("raw",t.subarray(i>>3),"AES-CBC",!1,[r]),await crypto.subtle.importKey("raw",t.subarray(0,i>>3),{hash:`SHA-${i<<1}`,name:"HMAC"},!1,["sign"]),i]}async function Vf(e,t,r){return new Uint8Array((await crypto.subtle.sign("HMAC",e,t)).slice(0,r>>3))}async function Vh(e,t,r,i,o){if(!P3(r)&&!(r instanceof Uint8Array))throw TypeError(P7(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(i?Vu(e,i):i=crypto.getRandomValues(new Uint8Array(e.ivBits>>3)),r instanceof Uint8Array&&Vp(r,e.cekBits),e.cbc)return async function(e,t,r,i,o){let[n,a,s]=await Vm(e,r,"encrypt"),d=new Uint8Array(await crypto.subtle.encrypt({iv:i,name:"AES-CBC"},n,t)),c=Ph(o,i,d,Pg(8*o.length));return{ciphertext:d,tag:await Vf(a,c,s),iv:i}}(e,t,r,i,o);let n=await Vc(r,e.subtle,"encrypt"),a=new Uint8Array(await crypto.subtle.encrypt({additionalData:o,iv:i,name:"AES-GCM",tagLength:128},n,t));return{ciphertext:a.subarray(0,-16),tag:a.subarray(-16),iv:i}}async function Vy(e,t,r,i,o,n){if(!P3(t)&&!(t instanceof Uint8Array))throw TypeError(P7(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!i)throw new Px("JWE Initialization Vector missing");if(!o)throw new Px("JWE Authentication Tag missing");if(!e.cbc&&16!==o.length)throw new Px("Invalid Authentication Tag length");if(Vu(e,i),t instanceof Uint8Array&&Vp(t,e.cekBits),e.cbc)return async function(e,t,r,i,o,n){let[a,s,d]=await Vm(e,t,"decrypt"),c=Ph(n,i,r,Pg(8*n.length)),l=await Vf(s,c,d);try{if(await async function(e,t){let r={name:"HMAC",hash:"SHA-256"},i=await crypto.subtle.generateKey(r,!1,["sign","verify"]),o=await crypto.subtle.sign(r,i,e);return crypto.subtle.verify(r,i,o,t)}(o,l))return new Uint8Array(await crypto.subtle.decrypt({iv:i,name:"AES-CBC"},a,r))}catch{}throw new PI}(e,t,r,i,o,n);let a=await Vc(t,e.subtle,"decrypt");try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:n,iv:i,name:"AES-GCM",tagLength:128},a,Ph(r,o)))}catch{throw new PI}}function Vg(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}let V_=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Vv=[[],["deriveBits"]],Vb=[[],[]];function V$(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:V_,ops:["wrapKey","unwrapKey"]}}function VS(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:e,crv:t,asymmetricKeyType:r})=>{if("X25519"===t||"x25519"===r)return{name:"X25519"};if("OKP"===e)throw new Pq('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:t}},usages:Vv,ops:[void 0,"deriveBits"]}}function Vk(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:Vb,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function Vw(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:Vb,ops:["deriveBits","deriveBits"]}}let VP=Vg({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:Vb,ops:["encrypt","decrypt"]},"RSA-OAEP":V$(1),"RSA-OAEP-256":V$(256),"RSA-OAEP-384":V$(384),"RSA-OAEP-512":V$(512),"ECDH-ES":VS("direct-key-agreement"),"ECDH-ES+A128KW":VS("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":VS("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":VS("key-agreement-with-key-wrapping"),A128KW:Vk(128),A192KW:Vk(192),A256KW:Vk(256),A128GCMKW:Vk(128,!0),A192GCMKW:Vk(192,!0),A256GCMKW:Vk(256,!0),"PBES2-HS256+A128KW":Vw(),"PBES2-HS384+A192KW":Vw(),"PBES2-HS512+A256KW":Vw()}),VV=["encrypt","decrypt"];function VR(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:Vb,ops:VV,cekBits:e,ivBits:t?128:96,cbc:t}}let Vq=Vg({A128GCM:VR(128),A192GCM:VR(192),A256GCM:VR(256),"A128CBC-HS256":VR(256,!0),"A192CBC-HS384":VR(384,!0),"A256CBC-HS512":VR(512,!0)});function VI(e,t){throw new Pq(`Invalid or unsupported "${e}" (JWE ${t}) header value`)}function Vx(e){return("string"==typeof e?VP[e]:void 0)??VI("alg","Algorithm")}function Vj(e){return"key-wrapping"===e.mode||"key-encryption"===e.mode||"key-agreement-with-key-wrapping"===e.mode}function VC(e){return("string"==typeof e?Vq[e]:void 0)??VI("enc","Encryption Algorithm")}function VT(e,t){if("ECDH"!==e.algorithm.name&&"X25519"!==e.algorithm.name)throw TypeError("CryptoKey does not support this operation, its algorithm.name must be ECDH or X25519");Vr(e,t)}function VO(e,t,r){Vo(t,Vx(e).subtle,r),Vi(e,t)}async function VE(e,t,r,i){if(!(e instanceof Uint8Array)||e.length<8)throw new Px("PBES2 Salt Input must be 8 or more octets");if(!Number.isSafeInteger(r)||1!==Math.sign(r))throw new Px("PBES2 Count Input must be a positive integer");let o=Ph(Pb(t),Uint8Array.of(0),e),n=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:o},s=await Vc(i,Vx(t).subtle,"deriveBits");return new Uint8Array(await crypto.subtle.deriveBits(a,s,n))}function VA(e){return Ph(P_(e.length),e)}async function VW(e,t,r,i,o=new Uint8Array,n=new Uint8Array){VT(e),VT(t,"deriveBits");let a=Ph(VA(Pb(r)),VA(o),VA(n),P_(i));return async function(e,t,r){let i=t>>3,o=Math.ceil(i/32),n=new Uint8Array(32*o);for(let t=1;t<=o;t++){let i=await Pk("sha256",Ph(P_(t),e,r));n.set(i,(t-1)*32)}return n.slice(0,i)}(new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,"X25519"===e.algorithm.name?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3)),i,a)}function VM(e){P6(e);let t=e.algorithm.namedCurve;if("P-256"!==t&&"P-384"!==t&&"P-521"!==t&&"X25519"!==e.algorithm.name)throw new Pq("ECDH with the provided key is not allowed or not supported by your javascript runtime")}function VN(e,t){let r=e[t];if(void 0!==r){if("string"!=typeof r)throw new Px(`JOSE Header "${t}" (Agreement Party${"apu"===t?"U":"V"}Info) invalid`);return PG(r,t,Px)}}function Vz(e,t){if(void 0!==e&&void 0!==t&&e.byteLength===t.byteLength){for(let r=0;r"u")throw new Pq(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function VH(e,t,r=1/0){let i=e.writable.getWriter();i.write(t).catch(()=>{}),i.close().catch(()=>{});let o=[],n=0,a=e.readable.getReader();for(;;){let{value:e,done:t}=await a.read();if(t)break;if(o.push(e),n+=e.byteLength,1/0!==r&&n>r)throw new Px("Decompressed plaintext exceeded the configured limit")}return Ph(...o)}function VG(e){let{aad:t,ciphertext:r,iv:i,protected:o,tag:n,unprotected:a}=e;if(void 0!==i&&("string"!=typeof i||!i))throw new Px("JWE Initialization Vector incorrect type");if("string"!=typeof r)throw new Px("JWE Ciphertext missing or incorrect type");if(void 0!==n&&("string"!=typeof n||!n))throw new Px("JWE Authentication Tag incorrect type");if(void 0!==o&&"string"!=typeof o)throw new Px("JWE Protected Header incorrect type");if(void 0!==t&&("string"!=typeof t||!t))throw new Px("JWE AAD incorrect type");if(void 0!==a&&!PF(a))throw new Px("JWE Shared Unprotected Header incorrect type");return{aad:t,ciphertext:r,iv:i,protected:o,tag:n,unprotected:void 0===a?void 0:{...a}}}function VB(e){let t,r;try{let{header:i}=e;if(PF(i)){r=i.alg;let e=Object.keys(i);e.includes("alg")||(r=void 0),t=Object.fromEntries(e.map(e=>[e,"alg"===e?r:i[e]]))}else t=i;let{encrypted_key:o}=e;return[{encrypted_key:o,header:t},r]}catch(e){return[void 0,r,e]}}function VK(e){let{encrypted_key:t,header:r}=e;if(void 0!==t&&"string"!=typeof t)throw new Px("JWE Encrypted Key incorrect type");if(void 0!==r&&!PF(r))throw new Px("JWE Per-Recipient Unprotected Header incorrect type");if(void 0===e.protected&&void 0===r&&void 0===e.unprotected)throw new Px("JOSE Header missing")}function VJ(e){let t,{protected:r,ciphertext:i,iv:o,tag:n,aad:a}=e;return void 0!==r&&(t=PK(r,Px,"JWE Protected Header is invalid")),[t,PG(i,"ciphertext",Px),void 0!==o?PG(o,"iv",Px):void 0,void 0!==n?PG(n,"tag",Px):void 0,PB((r??"")+(void 0!==a?`.${a}`:""),"aad",Px)]}function VZ(e){return[e&&PQ("keyManagementAlgorithms",e.keyManagementAlgorithms),e&&PQ("contentEncryptionAlgorithms",e.contentEncryptionAlgorithms),e?.crit,e?.maxPBES2Count,e?.maxDecompressedLength]}async function VQ(e,t,r,i=VJ(e)){let o,n,a,s,[d,c,l,p,u]=i,{header:m,unprotected:f,aad:h}=e;if(void 0!==m||void 0!==f){if(!PU(d,m,f))throw new Px("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");o={...d,...m,...f}}else o=d??{};let[y,g,_,v,b]=t,{encrypted_key:$}=e;PY(Px,PZ,_,d,o),VL(o,d);let{alg:S,enc:k}=o;if("string"!=typeof S||!S)throw new Px("missing JWE Algorithm (alg) in JWE Header");let w=VP[S];if(""===$&&(!w||!Vj(w)))throw new Px("JWE Encrypted Key incorrect type");let P=w?.mode==="integrated-encryption";if(!P&&("string"!=typeof k||!k))throw new Px("missing JWE Encryption Algorithm (enc) in JWE Header");if(y&&!y.has(S)||!y&&S.startsWith("PBES2"))throw new PR('"alg" (Algorithm) Header Parameter value not allowed');if(P){if(void 0!==k)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter must not be present for integrated encryption');if(l?.byteLength)throw new Px("JWE Initialization Vector must be empty for integrated encryption");if(p?.byteLength)throw new Px("JWE Authentication Tag must be empty for integrated encryption")}else{if(g&&!g.has(k))throw new PR('"enc" (Encryption Algorithm) Header Parameter value not allowed');n=VC(k)}if(void 0!==$)try{a=PG($,"encrypted_key",Px)}catch(e){if(!w||!Vj(w))throw e;a=new Uint8Array}let V=!1;"function"==typeof r&&(r=await r(d,e),V=!0);let R=w??Vx(S);Vj(R)&&void 0===a&&(a=new Uint8Array);let q=await P2("direct-encryption"===R.mode?n:R,r,"decrypt");if("integrated-encryption"===R.mode)s=await R.decrypt(q,a,c,u,d,o);else{let e,t=n;try{e=await async function(e,t,r,i,o,n){let{alg:a}=e,s=e.mode;if("direct-encryption"===s)return VD(i),r;let d="direct-key-agreement"===s;switch(d?VD(i):function(e){if(void 0===e)throw new Px("JWE Encrypted Key missing")}(i),e.subtle.name){case"ECDH":{let{epk:i}=o;if(!PF(i)||["d","k","p","q","dp","dq","qi","oth","priv"].some(e=>Object.hasOwn(i,e)))throw new Px('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');VM(r);let n=await Vd(e,i),s=VN(o,"apu"),c=VN(o,"apv");Vz(s,c);let l=await VW(n,r,d?t.alg:a,d?t.cekBits:parseInt(a.slice(-5,-2),10),s,c);if(d)return l;r=l;break}case"RSA-OAEP":return P6(r),VO(a,r,"decrypt"),new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP",r,i));case"PBKDF2":{if("number"!=typeof o.p2c)throw new Px('JOSE Header "p2c" (PBES2 Count) missing or invalid');if(void 0!==n&&1/0!==n&&(!Number.isSafeInteger(n)||n<1))throw TypeError("maxPBES2Count must be a positive safe integer or Infinity");if(o.p2c>(n??1e4))throw new Px('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof o.p2s)throw new Px('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let e=PG(o.p2s,"p2s",Px);r=await VE(e,a,o.p2c,r);break}case"AES-GCM":{if("string"!=typeof o.iv)throw new Px('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof o.tag)throw new Px('JOSE Header "tag" (Authentication Tag) missing or invalid');let e=PG(o.iv,"iv",Px),t=PG(o.tag,"tag",Px);if(12!==e.byteLength)throw new Px("Invalid Initialization Vector length");if(16!==t.byteLength)throw new Px("Invalid Authentication Tag length");return Vy(VC(a.slice(0,-2)),r,i,e,t,new Uint8Array)}}return async function(e,t,r){let i=await Vc(t,Vx(e).subtle,"unwrapKey",!0),o=await crypto.subtle.unwrapKey("raw",r,i,"AES-KW",{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.exportKey("raw",o))}(a.slice(-6),r,i)}(R,t,q,a,o,v),Vj(R)&&e instanceof Uint8Array&&e.byteLength<<3!==t.cekBits&&(e=Vl(t))}catch(r){if(r instanceof TypeError||r instanceof Px||r instanceof Pq)throw r;e=Vl(t)}s=await Vy(t,e,c,l,p,u)}if("DEF"===o.zip){let e=b??25e4;if(0===e)throw new Pq('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');if(1/0!==e&&(!Number.isSafeInteger(e)||e<1))throw TypeError("maxDecompressedLength must be 0, a positive safe integer, or Infinity");s=await (async function(e,t){return VU("DecompressionStream"),VH(new DecompressionStream("deflate-raw"),e,t)})(s,e).catch(e=>{throw e instanceof Px?e:new Px("Failed to decompress plaintext",{cause:e})})}return{plaintext:s,...d&&{protectedHeader:d},...void 0!==h&&{additionalAuthenticatedData:PG(h,"aad",Px)},...f&&{sharedUnprotectedHeader:f},...m&&{unprotectedHeader:m},...V&&{key:q}}}async function VX(e,t,r){if(e instanceof Uint8Array&&(e=Pm.decode(e)),"string"!=typeof e)throw new Px("Compact JWE must be a string or Uint8Array");let{0:i,1:o,2:n,3:a,4:s,length:d}=e.split(".");if(5!==d)throw new Px("Invalid Compact JWE");return VQ({ciphertext:a,iv:n||void 0,protected:i,tag:s||void 0,encrypted_key:o||void 0},t,r)}async function VY(e,t,r){return VX(e,VZ(r),t)}async function V1(e,t,r){if(!PF(e))throw new Px("Flattened JWE must be an object");let i=VG(e),[o,,n]=VB(e);if(!o)throw n;let a={...i,...o};return VK(a),VQ(a,VZ(r),t)}async function V0(e,t,r){let i,o,n;if(!PF(e))throw new Px("General JWE must be an object");let a=e.recipients;if(!Array.isArray(a))throw new Px("JWE Recipients missing or incorrect type");let s=Array.from(a);if(!s.every(PF))throw new Px("JWE Recipients missing or incorrect type");if(!s.length)throw new Px("JWE Recipients has no members");try{i=VZ(r),o=VG(e),n=VJ(o)}catch{throw new PI}let d=s.map(e=>VB(e));if(s.length>1)for(let[,e]of d){let t=n[0]?.alg??e??o.unprotected?.alg,r="string"==typeof t?VP[t]:void 0;if(r&&!Vj(r))throw new Px(`"${t}" alg may only have a single recipient`)}for(let[e]of d)if(e)try{let r={...o,...e};return VK(r),await VQ(r,i,t,n)}catch{}throw new PI}function V2(e,t,r){if(!PU(e,t,r))throw new Px("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint")}function V4(e,t,r=!1){if(!e[1]&&!e[2]&&!e[3])throw new Px("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");void 0!==t&&(e[8]=t?.crit);let[,i,o,n,a,s,d,c,l]=e;if(void 0!==a&&PD(a,"JWE Additional Authenticated Data"),void 0!==s&&PD(s,"JWE Content Encryption Key"),void 0!==d&&PD(d,"JWE Initialization Vector"),r||void 0===i||(i=P0(Px,i)[0],e[1]=i),void 0!==o&&(o=P0(Px,o)[0],e[2]=o),r||void 0===n||(n=P0(Px,n)[0],e[3]=n),void 0!==c&&!PF(c))throw TypeError("JWE Key Management Parameters must be an object");V2(i,o,n);let p={...i,...o,...n};PX(Px,i),PY(Px,PZ,l,i,p),VL(p,i);let{alg:u,enc:m}=p;if("string"!=typeof u||!u)throw new Px('JWE "alg" (Algorithm) Header Parameter missing or invalid');let f=VP[u];if(f?.mode==="integrated-encryption"){if(void 0!==m)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter must not be present for integrated encryption');if(void 0!==s)throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${u}`);if(void 0!==d)throw TypeError(`setInitializationVector cannot be called with JWE "alg" (Algorithm) Header ${u}`);return[p,void 0,f]}if("string"!=typeof m||!m)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');return[p,VC(m),f]}async function V6(e,t,r){let i,o,n,a,s,d,[c,l,p]=t,[u,m,f,h,y,g,_,v,,b]=e,$=m,S=f,k=p??Vx(c.alg);"integrated-encryption"===k.mode?n=await P2(k,r,"encrypt"):[n,i,o]=await VF(k,l,r,c,g,v),o&&(b?S=S?{...S,...o}:o:$=$?{...$,...o}:o,V2($,S,h));let w=$?Pz(JSON.stringify($)):"",P=y?.byteLength?Pz(y):void 0,V=Pb(P?`${w}.${P}`:w),R=u;"DEF"===c.zip&&(R=await (async function(e){return VU("CompressionStream"),VH(new CompressionStream("deflate-raw"),e)})(R).catch(e=>{throw new Px("Failed to compress plaintext",{cause:e})})),"integrated-encryption"===k.mode?[i,a]=await k.encrypt(n,R,V,$,c,v):{ciphertext:a,tag:s,iv:d}=await Vh(l,R,n,_,V);let q={ciphertext:Pz(a)};return d&&(q.iv=Pz(d)),s&&(q.tag=Pz(s)),i?.byteLength&&(q.encrypted_key=Pz(i)),P&&(q.aad=P),$&&(q.protected=w),h&&(q.unprotected=h),S&&(q.header=S),q}async function V3(e,t,r){return V6(e,V4(e,r),t)}function V9(e){return[e.protected,e.encrypted_key,e.iv,e.ciphertext,e.tag].join(".")}class V5{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r]}setUnprotectedHeader(e){return PH(this.state[0],"setUnprotectedHeader"),this.state[0]=e,this}setKeyManagementParameters(e){return PH(this.state[1],"setKeyManagementParameters"),this.state[1]=e,this}addRecipient(...e){return this.#f.addRecipient(...e)}encrypt(...e){return this.#f.encrypt(...e)}done(){return this.#f}}class V8{#h;#y=[];#g;#_;#v;constructor(e){this.#h=e}addRecipient(e,t){let r=new V5(this,e,t?.crit);return this.#y.push(r),r}setProtectedHeader(e){return PH(this.#g,"setProtectedHeader"),this.#g=e,this}setSharedUnprotectedHeader(e){return PH(this.#_,"setSharedUnprotectedHeader"),this.#_=e,this}setAdditionalAuthenticatedData(e){return this.#v=e,this}async encrypt(){if(!this.#y.length)throw new Px("at least one recipient must be added");PD(this.#h,"plaintext");let e=this.#y.length>1,t,r=this.#g,i=this.#_,o=[];for(let n of this.#y){let[a,s,d,c]=n.state,l=[this.#h,r,a,i,this.#v,void 0,void 0,s,c,e],p=V4(l,void 0,o.length>0);o.length||(r=l[1],i=l[3]),o.push([l,p,d]);let[{alg:u,enc:m},,f]=p;if(e&&f&&!Vj(f))throw new Px(`"${u}" alg may only have a single recipient`);if(t){if(t!==m)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else t=m}for(let[,e]of o)e[2]??=Vx(e[0].alg);let[n,a,s]=o[0],d=e?Vl(a[1]):void 0;n[5]=d;let{encrypted_key:c,header:l,...p}=await V6(n,a,s),u={...p,recipients:[{}]};c&&(u.recipients[0].encrypted_key=c),l&&(u.recipients[0].header=l);for(let e=1;e(function(e,t){try{let r=Rs(e,[t]),i=Rc(r.protected),{b64:o,crit:n}=i;return[r,i,Array.isArray(n)&&n.includes("b64")?"boolean"==typeof o?o?1:2:0:1]}catch{return}})(e,s)).filter(e=>void 0!==e),c=0;for(let[,,e]of d)if(3==(c|=e))throw new Pj("inconsistent use of JWS Unencoded Payload (RFC7797)");for(let e of d)try{let[r]=await Ru(e[0],i,t,Rl,e[1]);return r}catch{}throw new PM}let Rg=e=>Math.floor(e.getTime()/1e3),R_={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},Rv=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Rb="check_failed";function R$(){throw TypeError("Invalid time period format")}function RS(e){"string"!=typeof e&&R$();let t=Rv.exec(e);(!t||t[4]&&t[1])&&R$();let r=Math.round(parseFloat(t[2])*R_[t[3][0].toLowerCase()]);return Number.isFinite(r)||R$(),"-"===t[1]||"ago"===t[4]?-r:r}function Rk(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}function Rw(e,t){if("string"!=typeof t)throw TypeError(`"${e}" claim must be a string`)}function RP(e,t){return"number"==typeof e?Rk(t,e):e instanceof Date?Rk(t,Rg(e)):Rg(new Date)+RS(e)}let RV=e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`};function RR(e,t,r=!1){let i=e[t];if(!(void 0===i&&!r)){if("number"!=typeof i)throw new PP(`"${t}" claim must be a number`,e,t,"invalid");return i}}function Rq(e,t){throw new PP(`unexpected "${t}" claim value`,e,t,Rb)}function RI(e,t,r={}){let i,o,n;try{i=JSON.parse(Pf.decode(t))}catch{}if(!PF(i))throw new PC("JWT Claims Set must be a top-level JSON object");let{typ:a}=r;if(void 0!==a&&("string"!=typeof e.typ||RV(e.typ)!==RV(a)))throw new PP('unexpected "typ" JWT header value',i,"typ",Rb);let{requiredClaims:s=[],issuer:d,subject:c,audience:l,maxTokenAge:p}=r,u=[...s];for(let e of(void 0!==p&&u.push("iat"),void 0!==l&&u.push("aud"),void 0!==c&&u.push("sub"),void 0!==d&&u.push("iss"),new Set(u.reverse())))if(!Object.hasOwn(i,e))throw new PP(`missing required "${e}" claim`,i,e,"missing");void 0===d||(Array.isArray(d)?d:[d]).includes(i.iss)||Rq(i,"iss"),void 0!==c&&i.sub!==c&&Rq(i,"sub"),void 0===l||(o=i.aud,n="string"==typeof l?[l]:l,"string"==typeof o?n.includes(o):!!Array.isArray(o)&&n.some(e=>o.includes(e)))||Rq(i,"aud");let{clockTolerance:m}=r,f=0;if("string"==typeof m)f=RS(m);else if(void 0!==m){if("number"!=typeof m)throw TypeError("Invalid clockTolerance option type");f=m}Rk("clockTolerance option",f);let{currentDate:h}=r,y=Rk("currentDate option",Rg(void 0===h?new Date:h)),g=RR(i,"iat",void 0!==p),_=RR(i,"nbf");if(void 0!==_&&_>y+f)throw new PP('"nbf" claim timestamp check failed',i,"nbf",Rb);let v=RR(i,"exp");if(void 0!==v&&v<=y-f)throw new PV('"exp" claim timestamp check failed',i,"exp",Rb);if(void 0!==p){let e=y-g;if(e-f>Rk("maxTokenAge option","number"==typeof p?p:RS(p)))throw new PV('"iat" claim timestamp check failed (too far in the past)',i,"iat",Rb);if(e<-f)throw new PP('"iat" claim timestamp check failed (it should be in the past)',i,"iat",Rb)}return i}function Rx(e){return f.get(e)}function Rj(e){let t=Rx(e);for(let e of["iat","nbf","exp"]){let r=t[e];if("number"==typeof r&&!Number.isFinite(r))throw TypeError(`"${e}" claim must be a finite number`)}return Pu.encode(JSON.stringify(t))}class RC{constructor(e={}){if(!PF(e))throw TypeError("JWT Claims Set MUST be an object");(f||=new WeakMap).set(this,structuredClone(e))}setIssuer(e){return Rw("iss",e),Rx(this).iss=e,this}setSubject(e){return Rw("sub",e),Rx(this).sub=e,this}setAudience(e){return function(e){if("string"!=typeof e&&(!Array.isArray(e)||Array.from(e).some(e=>"string"!=typeof e)))throw TypeError('"aud" claim must be a string or an array of strings')}(e),Rx(this).aud=e,this}setJti(e){return Rw("jti",e),Rx(this).jti=e,this}setNotBefore(e){return Rx(this).nbf=RP(e,"setNotBefore"),this}setExpirationTime(e){return Rx(this).exp=RP(e,"setExpirationTime"),this}setIssuedAt(e){let t=Rx(this);return void 0===e?t.iat=Rg(new Date):"string"==typeof e?t.iat=Rk("setIssuedAt",Rg(new Date)+RS(e)):t.iat=RP(e,"setIssuedAt"),this}}async function RT(e,t,r){let[i,o]=await Rm(e,Rd(r),t);if(!o)throw new PC("JWTs MUST NOT use unencoded payload");let n=RI(i.protectedHeader,i.payload,r);return{...i,payload:n}}async function RO(e,t,r){let{plaintext:i,...o}=await VX(e,VZ(r),t),{protectedHeader:n}=o,a=RI(n,i,r);for(let e of["iss","sub","aud"])if(void 0!==n[e]&&("aud"===e?JSON.stringify(n.aud)!==JSON.stringify(a.aud):n[e]!==a[e]))throw new PP(`replicated "${e}" claim header parameter mismatch`,a,e,"mismatch");return{payload:a,...o}}class RE{#b;constructor(e){PD(e,"plaintext"),this.#b=[e]}setContentEncryptionKey(e){return PH(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PH(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PH(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}async encrypt(e,t){return V9(await V3([...this.#b],e,t))}}class RA{#b;constructor(e){PD(e,"plaintext"),this.#b=[e]}setKeyManagementParameters(e){return PH(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setSharedUnprotectedHeader(e){return PH(this.#b[3],"setSharedUnprotectedHeader"),this.#b[3]=e,this}setUnprotectedHeader(e){return PH(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}setAdditionalAuthenticatedData(e){return this.#b[4]=e,this}setContentEncryptionKey(e){return PH(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PH(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}async encrypt(e,t){return V3([...this.#b],e,t)}}async function RW(e,t,r){let[i,o,n,a]=e,s="";if(void 0!==o){let e=P0(Pj,o);o=e[0],s=Pz(e[1])}if(void 0!==n&&(n=P0(Pj,n)[0]),!o&&!n)throw new Pj("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!PU(o,n))throw new Pj("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...o,...n};PX(Pj,o);let c=P1(o,PY(Pj,PJ,a,o,d));c||r?.();let{alg:l}=d;if("string"!=typeof l||!l)throw new Pj('JWS "alg" (Algorithm) Header Parameter missing or invalid');let p=Ra(l),u="",m=i,f;if(c){let t=e[4];t?(u=t[0]??=Pz(i),m=t[1]??=Pb(u)):(u=Pz(i),f=Pu.encode(`${s}.${u}`))}f??=Ph(Pb(s),Pb("."),m);let h=await Vc(await P2(p,t,"sign"),p.subtle,"sign");p.minRsaBits&&Vi(p.alg,h);let y={signature:Pz(new Uint8Array(await crypto.subtle.sign(p.signing,h,f))),payload:u};return o&&(y.protected=s),n&&(y.header=n),[y,c]}async function RM(e,t,r,i,o){let[n]=await RW([e,t,void 0,r],i,o);return`${n.protected}.${n.payload}.${n.signature}`}class RN{#$;#g;constructor(e){PD(e,"payload"),this.#$=e}setProtectedHeader(e){return PH(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RM(this.#$,this.#g,t?.crit,e,()=>{throw TypeError("use the flattened module for creating JWS with b64: false")})}}class Rz{#b;constructor(e){PD(e,"payload"),this.#b=[e]}setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setUnprotectedHeader(e){return PH(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}async sign(e,t){let r=[...this.#b];r[3]=t?.crit;let[i]=await RW(r,e);return i}}class RD{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r?.crit]}setProtectedHeader(e){return PH(this.state[0],"setProtectedHeader"),this.state[0]=e,this}setUnprotectedHeader(e){return PH(this.state[1],"setUnprotectedHeader"),this.state[1]=e,this}addSignature(...e){return this.#f.addSignature(...e)}sign(...e){return this.#f.sign(...e)}done(){return this.#f}}class RF{#$;#S=[];constructor(e){this.#$=e}addSignature(e,t){let r=new RD(this,e,t);return this.#S.push(r),r}async sign(){let e;if(!this.#S.length)throw new Pj("at least one signature must be added");PD(this.#$,"payload");let t={signatures:[],payload:""},r=[];for(let i of this.#S){let[o,n,a,s]=i.state,[{payload:d,...c},l]=await RW([this.#$,o,n,s,r],a);if(void 0===e)e=l,t.payload=d;else if(e!==l)throw new Pj("inconsistent use of JWS Unencoded Payload (RFC7797)");t.signatures.push(c)}return t}}let RL=RC;class RU extends RL{#g;setProtectedHeader(e){return PH(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RM(Rj(this),this.#g,t?.crit,e,()=>{throw new PC("JWTs MUST NOT use unencoded payload")})}}let RH=RC;class RG extends RH{#b=[void 0];#k;#w;#P;setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PH(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setContentEncryptionKey(e){return PH(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PH(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}replicateIssuerAsHeader(){return this.#k=!0,this}replicateSubjectAsHeader(){return this.#w=!0,this}replicateAudienceAsHeader(){return this.#P=!0,this}async encrypt(e,t){let r=Rj(this);this.#b[1]&&(this.#k||this.#w||this.#P)&&(this.#b[1]={...this.#b[1],iss:this.#k?Rx(this).iss:void 0,sub:this.#w?Rx(this).sub:void 0,aud:this.#P?Rx(this).aud:void 0});let i=[...this.#b];return i[0]=r,V9(await V3(i,e,t))}}let RB='"alg" (Algorithm)';function RK(e='JWK "alg" (Algorithm) Parameter'){throw new Pq(`Invalid or unsupported ${e} value`)}function RJ(e,t){return("string"==typeof e?Rn[e]??VP[e]:void 0)??RK(t)}let RZ=async(e,t,r)=>{var i,o;let n;if(P9(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!P3(r))throw TypeError(P7(r,"CryptoKey","KeyObject"));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return i=P$(new Uint8Array(await crypto.subtle.exportKey(t,r))),o=`${e.toUpperCase()} KEY`,n=(i.match(/.{1,64}/g)||[]).join(` +`,e.enqueue(t.encode(o)),!0}catch(e){return this.onerror?.(e),!1}}handleUnsupportedRequest(){return this.onerror?.(Error("Method not allowed.")),Response.json({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null},{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,t){try{var r,i;let o,n,a,s,d,c=e.headers.get("accept");if(!c?.includes("application/json")||!c.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");if(r=e.headers.get("content-type"),"application/json"!==r&&"application/json"!==function(e){if(e)try{return lU.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(""===t||e.slice(t.length).includes(","))return;return t}}(r))return this.onerror?.(Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");if(t?.parsedBody===void 0)try{let t=await async function(e,t=4194304){if(Number(e.headers.get("content-length"))>t)return{tooLarge:!0};if(null===e.body)return{tooLarge:!1,text:""};let r=e.body.getReader(),i=new TextDecoder,o=0,n="";try{for(;;){let{done:e,value:a}=await r.read();if(e)break;if((o+=a.byteLength)>t)return{tooLarge:!0};n+=i.decode(a,{stream:!0})}}finally{r.releaseLock()}return{tooLarge:!1,text:n+i.decode()}}(e,this._maxRequestBodySize);if(t.tooLarge){let e=(i=this._maxRequestBodySize,`Payload Too Large: Request body must not exceed ${i} bytes`);return this.onerror?.(Error(e)),this.createJsonErrorResponse(413,-32e3,e)}o=JSON.parse(t.text)}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}else o=t.parsedBody;if(Array.isArray(o)&&o.length>100)return this.onerror?.(Error("Invalid Request: Batch must not exceed 100 messages")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Batch must not exceed 100 messages");try{n=Array.isArray(o)?o.map(e=>aA.parse(e)):[aA.parse(o)]}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let l=n.some(e=>aQ.safeParse(e).success);if(l){if(this._initialized&&void 0!==this.sessionId)return this.onerror?.(Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(n.length>1)return this.onerror?.(Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!l){let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");try{a=await this._checkScopeChallenge(n,t?.authInfo)}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(500,-32603,"Internal server error")}if(a)return a;if(!n.some(e=>lc(e))){for(let r of n)this.onmessage?.(r,{authInfo:t?.authInfo,request:e});return new Response(null,{status:202})}let p=crypto.randomUUID(),u=n.find(e=>aQ.safeParse(e).success),m=u?u.params.protocolVersion:e.headers.get("mcp-protocol-version")??"2025-03-26";if(this._enableJsonResponse)return new Promise(r=>{for(let e of(this._streamMapping.set(p,{resolveJson:r,cleanup:()=>{this._streamMapping.delete(p)}}),n))lc(e)&&this._requestToStreamMapping.set(e.id,p);for(let r of n)this.onmessage?.(r,{authInfo:t?.authInfo,request:e})});let f=new TextEncoder,h=new ReadableStream({start:e=>{s=e},cancel:()=>{void 0!==d&&clearInterval(d),this._streamMapping.get(p)?.controller===s&&this._streamMapping.delete(p)}}),y={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};for(let e of(void 0!==this.sessionId&&(y["mcp-session-id"]=this.sessionId),n))lc(e)&&(this._streamMapping.set(p,{controller:s,encoder:f,cleanup:()=>{void 0!==d&&clearInterval(d),this._streamMapping.delete(p);try{s.close()}catch{}}}),this._requestToStreamMapping.set(e.id,p));for(let r of(await this.writePrimingEvent(s,f,p,m),n)){let i,o;lc(r)&&this._eventStore&&this.supportsEmptySSEData(m)&&(i=()=>{this.closeSSEStream(r.id)},o=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(r,{authInfo:t?.authInfo,request:e,closeSSEStream:i,closeStandaloneSSEStream:o})}return this._streamMapping.get(p)?.controller===s&&(d=this.startKeepAlive(s,f)),new Response(h,{status:200,headers:y})}catch(e){return this.onerror?.(e),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(e)})}}async handleDeleteRequest(e){let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(void 0===this.sessionIdGenerator)return;if(!this._initialized)return this.onerror?.(Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let t=e.headers.get("mcp-session-id");return t?t!==this.sessionId?(this.onerror?.(Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")):void 0:(this.onerror?.(Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required"))}validateProtocolVersion(e){let t=e.headers.get("mcp-protocol-version");if(null!==t&&!this._supportedProtocolVersions.includes(t)){let e=`Bad Request: Unsupported protocol version: ${t} (supported versions: ${this._supportedProtocolVersions.join(", ")})`;return this.onerror?.(Error(e)),this.createJsonErrorResponse(400,-32e3,e)}}async close(){if(!this._closed){for(let{cleanup:e}of(this._closed=!0,this._streamMapping.values()))e();this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}}closeSSEStream(e){let t=this._requestToStreamMapping.get(e);if(!t)return;let r=this._streamMapping.get(t);r&&r.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);e&&e.cleanup()}async send(e,t){let r=t?.relatedRequestId;if((aO.safeParse(e).success||aE.safeParse(e).success)&&(r=e.id),void 0===r){let t;if(aO.safeParse(e).success||aE.safeParse(e).success)throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");this._eventStore&&(t=await this._eventStore.storeEvent(this._standaloneSseStreamId,e));let r=this._streamMapping.get(this._standaloneSseStreamId);if(void 0===r)return;r.controller&&r.encoder&&(void 0===t||!r.replayedEventIds?.has(t))&&this.writeSSEEvent(r.controller,r.encoder,e,t);return}let i=this._requestToStreamMapping.get(r);if(!i)throw Error(`No connection established for request ID: ${String(r)}`);let o=this._streamMapping.get(i);if(!this._enableJsonResponse){let t;this._eventStore&&(t=await this._eventStore.storeEvent(i,e),o=this._streamMapping.get(i)),o?.controller&&o?.encoder&&(void 0===t||!o.replayedEventIds?.has(t))&&this.writeSSEEvent(o.controller,o.encoder,e,t)}if(aO.safeParse(e).success||aE.safeParse(e).success){this._requestResponseMap.set(r,e);let t=[...this._requestToStreamMapping.entries()].filter(([e,t])=>t===i).map(([e])=>e);if(t.every(e=>this._requestResponseMap.has(e))){if(!o){if(this._enableJsonResponse)throw Error(`No connection established for request ID: ${String(r)}`);if(!this._eventStore){for(let e of(this.onerror?.(Error(`Response for request ID ${String(r)} is undeliverable: per-request stream is disconnected and no eventStore is configured`)),t))this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e);return}for(let e of t)this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e);return}if(this._enableJsonResponse&&o.resolveJson){let e={"Content-Type":"application/json"};void 0!==this.sessionId&&(e["mcp-session-id"]=this.sessionId);let r=t.map(e=>this._requestResponseMap.get(e));1===r.length?o.resolveJson(Response.json(r[0],{status:200,headers:e})):o.resolveJson(Response.json(r,{status:200,headers:e})),o.cleanup()}else o.cleanup();for(let e of t)this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e)}}}};let uY=Symbol("swallowsErrorsAfterClose");var u1=class{_readBuffer;_started=!1;_closed=!1;constructor(e=N.stdin,t=N.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new lH({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");for(let e of(this._started=!0,this._stdout.listeners("error")))e[uY]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[uY]=!0,0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(Error("StdioServerTransport is closed")):new Promise((t,r)=>{let i=JSON.stringify(e)+"\n",o=!1,n=e=>{o||(o=!0,this._stdout.off("error",n),this._stdout.off("drain",a),r(e))},a=()=>{o||(o=!0,this._stdout.off("error",n),this._stdout.off("drain",a),t())};if(this._stdout.once("error",n),this._stdout.write(i)){if(o)return;o=!0,this._stdout.off("error",n),t()}else o||this._stdout.once("drain",a)})}},u0=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}};let u2=new Set(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","server","user-agent"]),u4=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,u6=e=>9===e||10===e||13===e||32===e,u3=e=>{if(!u6(e.charCodeAt(0))&&!u6(e.charCodeAt(e.length-1)))return e;let t=0,r=e.length;for(;tt&&u6(e.charCodeAt(r-1));)r--;return e.slice(t,r)},u9=/[\0\r\n]/,u5=globalThis.Headers,u8=(e,t=u5)=>{let r=new t;for(let t=0;t{e.call(t,r,i,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(u7.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Headers (lightweight) ${r(Object.fromEntries(this),{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(u7.prototype,u5.prototype);let me=e=>globalThis.Headers===u5?new u7(e):u8(e.rawHeaders,globalThis.Headers),mt=/^\/[!#$&-;=?-\[\]_a-z~]*$/,mr=/\/\.\.?(?:[/?#]|$)/,mi=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,mo=global.Request;var mn=class extends mo{constructor(e,t){if("object"==typeof e&&mh in e){let r=void 0!==t&&"body"in t&&null!=t.body;if(e[mV]&&!r)throw TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[mh]()}void 0!==t?.body?.getReader&&(t.duplex??="half"),super(e,t)}};let ma=Symbol("wrapBodyStream"),ms=new Set(["latin1","binary","hex","base64","base64url"]),md=Symbol("bodyBufferedBeforeDisconnect"),mc=Symbol("bodyBufferedLengthBeforeDisconnect"),ml=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),mp=e=>{let t;return!(e instanceof z)&&!!e.complete&&!!e.readableAborted&&"function"==typeof e.read&&(null===(t=e.readableEncoding)||ms.has(t))},mu=e=>{e.readableDidRead||!mp(e)||(e[mc]??=e.readableLength)},mm=(e,t)=>{let r;if(e.readableDidRead&&!t||!mp(e))return;if(void 0!==e[md])return e[md];let i=e.errored;if(i&&"ECONNRESET"!==i.code)r=i;else if(void 0!==e[mc]&&e.readableLength!==e[mc])r=mI();else{let i=t??[],o=e.read();null!==o&&i.push(ml(o,e.readableEncoding));let n=1===i.length?i[0]:Buffer.concat(i);r=n;let a=e.headers["content-length"];if("string"==typeof a&&/^\d+$/.test(a)){let e=Number(a);Number.isSafeInteger(e)&&n.length!==e&&(r=mI())}}return e[md]=r,r},mf=(e,t)=>{t instanceof Error?e.error(t):(t.length>0&&e.enqueue(t),e.close())},mh=Symbol("getRequestCache"),my=Symbol("requestCache"),mg=Symbol("incomingKey"),m_=Symbol("urlKey"),mv=Symbol("methodKey"),mb=Symbol("headersKey"),m$=Symbol("abortControllerKey"),mS=Symbol("getAbortController"),mk=Symbol("abortRequest"),mw=Symbol("bodyBuffer"),mP=Symbol("bodyReadPromise"),mV=Symbol("bodyConsumedDirectly"),mR=Symbol("bodyLockReader"),mq=Symbol("abortReason"),mI=()=>TypeError("Body is unusable"),mx=new TextDecoder,mj=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,mC=(e,t,r)=>{if(e[mV])return Promise.reject(mI());let i=e.method;if("GET"===i||"HEAD"===i)return e[mh]()[t]();let o=(e=>{if(!mj.test(e))return TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if("CONNECT"===t||"TRACK"===t||"TRACE"===t&&"TRACE"!==e)return TypeError(`'${e}' HTTP method is unsupported.`)})(i);if(o)return Promise.reject(o);if(e[my]&&"TRACE"!==i)return e[my][t]();let n=(e=>{if(e[mV])return Promise.reject(mI());e[mV]=!0})(e);if(n)return n;let a=mT(e);if(a){let t=Promise.resolve(r(a,e));return e[mw]=void 0,t}return mE(e).then(t=>{let i=r(t,e);return e[mw]=void 0,i})},mT=e=>{let t=e[mg];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},mO=(e,t)=>{if(t.errored)return t.errored;let r=e[mq];return void 0!==r?r instanceof Error?r:Error(String(r)):Error("Client connection prematurely closed.")},mE=e=>{if(e[mw])return Promise.resolve(e[mw]);if(e[mP])return e[mP];let t=e[mg];if(t.readableDidRead)return Promise.reject(mI());let r=mm(t);if(void 0!==r)return r instanceof Error?Promise.reject(r):(e[mw]=r,Promise.resolve(r));let i=new Promise((r,i)=>{let o=[],n=!1,a=e=>{n||(n=!0,u(),e())},s=n=>{let s=t.errored??n;return!!mp(t)&&(!s||"ECONNRESET"===s.code)&&(a(()=>{let a=mm(t,o);a instanceof Error?i(a):void 0===a?i(n??mO(e,t)):(e[mw]=a,r(a))}),!0)},d=e=>{o.push(ml(e,t.readableEncoding))},c=()=>{a(()=>{let t=1===o.length?o[0]:Buffer.concat(o);e[mw]=t,r(t)})},l=e=>{s(e)||a(()=>{i(e)})},p=()=>{t.readableEnded?c():s()||a(()=>{i(mO(e,t))})},u=()=>{t.off("data",d),t.off("end",c),t.off("error",l),t.off("close",p),e[mP]=void 0};t.on("data",d),t.on("end",c),t.on("error",l),t.on("close",p),queueMicrotask(()=>{!n&&(t.readableEnded?c():t.errored?l(t.errored):t.destroyed&&p())})});return e[mP]=i,i},mA={get method(){return this[mv]},get url(){return this[m_]},get headers(){return this[mb]||=me(this[mg])},[mk](e){void 0===this[mq]&&(this[mq]=e);let t=this[m$];t&&!t.signal.aborted&&t.abort(e)},[mS](){return this[m$]||=new AbortController,void 0===this[mq]||this[m$].signal.aborted||this[m$].abort(this[mq]),this[m$]},[mh](){let e=this[mS]();if(this[my])return this[my];let t=this.method;if(this[mV]&&"GET"!==t&&"HEAD"!==t){this[mw]=void 0;let r={method:"TRACE"===t?"GET":t,headers:this.headers,signal:e.signal};"TRACE"!==t&&(r.body=new ReadableStream({start(e){e.close()}}),r.duplex="half");let i=new mn(this[m_],r);return"TRACE"===t&&Object.defineProperty(i,"method",{get:()=>"TRACE"}),this[my]=i}return this[my]=((e,t,r,i,o)=>{let n={method:e,headers:r,signal:o.signal};if("TRACE"===e){n.method="GET";let e=new mn(t,n);return Object.defineProperty(e,"method",{get:()=>"TRACE"}),e}if("GET"!==e&&"HEAD"!==e)if("rawBody"in i&&i.rawBody instanceof Buffer)n.body=new ReadableStream({start(e){e.enqueue(i.rawBody),e.close()}});else if(i[ma]){let e;n.body=new ReadableStream({async pull(t){try{if(!e){let e=mm(i);if(void 0!==e)return void mf(t,e)}e||=L.toWeb(i).getReader();let{done:r,value:o}=await e.read();r?t.close():t.enqueue(o)}catch(e){t.error(e)}}})}else{let e=mm(i);void 0!==e?n.body=new ReadableStream({start(t){mf(t,e)}}):n.body=L.toWeb(i)}return new mn(t,n)})(this.method,this[m_],this.headers,this[mg],e)},get body(){if(!this[mV])return this[mh]().body;let e=this[mh]();return!this[mR]&&e.body&&(this[mR]=e.body.getReader()),e.body},get bodyUsed(){return!!this[mV]||!!this[my]&&this[my].bodyUsed}};Object.defineProperty(mA,"signal",{get(){return this[mS]().signal}}),["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(mA,e,{get(){return this[mh]()[e]}})}),["clone","formData"].forEach(e=>{Object.defineProperty(mA,e,{value:function(){if(this[mV]){if("clone"===e)throw mI();return Promise.reject(mI())}return this[mh]()[e]()}})}),Object.defineProperty(mA,"text",{value:function(){return mC(this,"text",e=>mx.decode(e))}}),Object.defineProperty(mA,"arrayBuffer",{value:function(){return mC(this,"arrayBuffer",e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}}),Object.defineProperty(mA,"blob",{value:function(){return mC(this,"blob",(e,t)=>{let r=(t[mb]||=me(t[mg])).get("content-type")||"";return new Response(e,r?{headers:{"content-type":r}}:void 0).blob()})}}),Object.defineProperty(mA,"json",{value:function(){return this[mV]?Promise.reject(mI()):this.text().then(JSON.parse)}}),Object.defineProperty(mA,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[my]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mA,mn.prototype);let mW="text/plain; charset=UTF-8",mM=Symbol("responseCache"),mN=Symbol("getResponseCache"),mz=Symbol("cache"),mD=global.Response;var mF=class e{#c;#l;[mN](){let e=this[mz],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[mz],this[mM]||=new mD(this.#c,t?{status:this.#l?.status,statusText:this.#l?.statusText,headers:t}:this.#l)}constructor(t,r){let i;if(this.#c=t,r instanceof mD){let t=r[mM];if(t){this.#l=t,this[mN]();return}this.#l=r instanceof e?r.#l:r,i=new Headers(r.headers)}else this.#l=r;(null==t||"string"==typeof t||void 0!==t?.getReader||t instanceof Blob||t instanceof Uint8Array)&&(this[mz]=[r?.status||200,t??null,i||r?.headers])}get headers(){let e=this[mz];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(null===e[1]?void 0:{"content-type":mW}))),e[2]):this[mN]().headers}get status(){return this[mz]?.[0]??this[mN]().status}get ok(){let e=this.status;return e>=200&&e<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(mF.prototype,e,{get(){return this[mN]()[e]}})}),["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(mF.prototype,e,{value:function(){return this[mN]()[e]()}})}),Object.defineProperty(mF.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[mM]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mF,mD),Object.setPrototypeOf(mF.prototype,mD.prototype);let mL=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,mU=new Set([301,302,303,307,308]);function mH(e,t,r){let i=t=>{e.cancel(t).catch(()=>{})};return t.on("close",i),t.on("error",i),(r??e.read()).then(a,o),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function o(e){e&&t.destroy(e)}function n(){e.read().then(a,o)}function a({done:r,value:i}){try{if(r)t.end();else{if(t.write(i))return e.read().then(a,o);t.once("drain",n)}}catch(e){o(e)}}}function mG(e,t){if(e.locked)throw TypeError("ReadableStream is locked.");if(!t.destroyed)return mH(e.getReader(),t)}Object.defineProperty(mF,"redirect",{value:function(e,t=302){if(!mU.has(t))throw RangeError("Invalid status code");return new mF(null,{status:t,headers:{location:e instanceof URL?e.href:mL.test(e)?e:new URL(e).href}})},writable:!0,configurable:!0}),Object.defineProperty(mF,"json",{value:function(e,t){let r,i=JSON.stringify(e);if(void 0===i)throw TypeError("The data is not JSON serializable");let o=t?.headers;return o?(r=new Headers(o)).has("content-type")||r.set("content-type","application/json"):r={"content-type":"application/json"},new mF(i,{status:t?.status??200,statusText:t?.statusText,headers:r})},writable:!0,configurable:!0});let mB=(e,t)=>{let r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){let t=[];for(let[i,o]of e)"set-cookie"===i?t.push(o):r[i]=o;t.length>0&&(r["set-cookie"]=t)}else for(let[t,i]of e)r[t]=i;return t&&(r["content-type"]??=t),r},mK=Symbol("outgoingEnded"),mJ=Symbol("incomingDraining"),mZ=e=>{if(e.destroyed||e[mJ])return;if(e[mJ]=!0,e instanceof z){try{e.stream?.close?.(D.NGHTTP2_NO_ERROR)}catch{}return}let t=0,r=()=>{clearTimeout(o),e.off("data",n),e.off("end",r),e.off("error",r)},i=()=>{r();let t=e.socket;t&&!t.destroyed&&("function"==typeof t.destroySoon?t.destroySoon():"function"==typeof t.destroy&&t.destroy())},o=setTimeout(i,500);o.unref?.();let n=e=>{(t+=e.length)>0x4000000&&i()};e.on("data",n),e.on("end",r),e.on("error",r),e.resume()},mQ=e=>new Response(null,{status:e instanceof Error&&("TimeoutError"===e.name||"TimeoutError"===e.constructor.name)?504:500}),mX=(e,t)=>{let r=e instanceof Error?e:Error("unknown error",{cause:e});"ERR_STREAM_PREMATURE_CLOSE"===r.code?console.info("The user aborted a request."):(console.error(e),t.headersSent||(t instanceof T&&(t._contentLength=null),t.writeHead(500,{"Content-Type":"text/plain"})),t.end(`Error: ${r.message}`),t.destroy(r))},mY=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},m1=(e,t,r)=>!(null!==e._contentLength||!e._hasBody||!e.useChunkedEncodingByDefault||e._removedContLen||!(t>=200)||204===t||304===t||e.hasHeader("content-length")||e.hasHeader("transfer-encoding")||e.hasHeader("trailer"))&&(e._contentLength=r,!0),m0=(e,t,r)=>{m1(e,t,r)?e.writeHead(t,{"Content-Type":mW}):e.writeHead(t,{"Content-Type":mW,"Content-Length":r})},m2=async(e,t)=>{let[r,i,o]=e[mz];if(!o){null===i?(t.writeHead(r),t.end()):"string"==typeof i?(m0(t,r,Buffer.byteLength(i)),t.end(i)):i instanceof Uint8Array?(m0(t,r,i.byteLength),t.end(i)):i instanceof Blob?(m0(t,r,i.size),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(r,{"Content-Type":mW}),mY(t),await mG(i,t)?.catch(e=>mX(e,t))),t[mK]?.();return}let n=!1,a=!1,s=!0;if(o instanceof Headers)n=o.has("content-length"),o=mB(o,null===i?void 0:mW);else if(Array.isArray(o)){let e=new Headers(o);n=e.has("content-length"),o=mB(e,null===i?void 0:mW)}else for(let e in a=!0,o){if(14===e.length&&"content-length"===e.toLowerCase()){n=!0;break}(17===e.length&&"transfer-encoding"===e.toLowerCase()||7===e.length&&"trailer"===e.toLowerCase())&&(s=!1)}if(!n){let e;"string"==typeof i?e=Buffer.byteLength(i):i instanceof Uint8Array?e=i.byteLength:i instanceof Blob&&(e=i.size),void 0===e||a&&s&&m1(t,r,e)||(a&&(o={...o}),o["Content-Length"]=e)}t.writeHead(r,o),null==i?t.end():"string"==typeof i||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(mY(t),await mG(i,t)?.catch(e=>mX(e,t))),t[mK]?.()},m4=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return!1!==t.overrideGlobalObjects&&global.Request!==mn&&(Object.defineProperty(global,"Request",{value:mn}),Object.defineProperty(global,"Response",{value:mF})),async(i,o)=>{let n,a,s=!1,d=!1,c=()=>{if(a&&!d){let e,t;d=!0,o.on("close",(e=a,t=s,()=>{i.errored?(mu(i),e[mk](i.errored.toString())):(!o.writableFinished||i instanceof z&&i.aborted)&&(mu(i),e[mk]("Client connection prematurely closed.")),t&&!i.readableEnded&&setTimeout(()=>{i.readableEnded||setTimeout(()=>{mZ(i)})})}))}};try{let d;if(a=((e,t)=>{let r,i=Object.create(mA);i[mg]=e,i[mv]=(e=>{if("string"!=typeof e||0===e.length)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return e}let t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}})(e.method);let o=e.url||"";if("/"!==o[0]&&(o.startsWith("http://")||o.startsWith("https://"))){if(e instanceof z)throw new u0("Absolute URL for :path is not allowed in HTTP/2");try{i[m_]=new URL(o).href}catch(e){throw new u0("Invalid absolute URL",{cause:e})}return i}let n=(e instanceof z?e.authority:e.headers.host)||t;if(!n)throw new u0("Missing host header");if(e instanceof z){if("http"!==(r=e.scheme)&&"https"!==r)throw new u0("Unsupported scheme")}else r=e.socket&&e.socket.encrypted?"https":"http";try{i[m_]=((e,t,r)=>{let i=`${e}://${t}${r}`;if(mi.test(t)){if(0===r.length)return i+"/";if(47!==r.charCodeAt(0))throw new u0("Invalid URL");return!mt.test(r)||mr.test(r)?new URL(i).href:i}{let e=new URL(i);if(e.hostname.length!==t.length&&e.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new u0("Invalid host header");return e.href}})(r,n,o)}catch(e){if(e instanceof u0)throw e;throw new u0("Invalid URL",{cause:e})}return i})(i,t.hostname),(s=r&&"GET"!==i.method&&"HEAD"!==i.method)&&(i[ma]=!0,i instanceof z&&(o[mK]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),o.destroy()})})})),d=n=e(a,{incoming:i,outgoing:o}),"function"!=typeof d.then&&(e=>{if(!(mz in e))return!1;let t=e[mz][1];return null===t||"string"==typeof t||t instanceof Uint8Array})(n))return s&&!i.readableEnded&&o.once("finish",()=>{i.readableEnded||mZ(i)}),m2(n,o);c()}catch(e){if(n)return mX(e,o);if(t.errorHandler){if(c(),!(n=await t.errorHandler(a||e instanceof u0?e:new u0(e.message,{cause:e}))))return}else n=a?mQ(e):new Response(null,{status:400})}try{return await (async(e,t,r={})=>{if("function"==typeof e.then)if(r.errorHandler)try{e=await e}catch(i){let t=await r.errorHandler(i);if(!t)return;e=t}else e=await e.catch(mQ);if(mz in e)return m2(e,t);let i=mB(e.headers,null===e.body?void 0:mW);if(e.body){let r,o=e.body.getReader(),n=[],a=!1;if("chunked"!==i["transfer-encoding"]){let e=2;for(let t=0;tPromise.resolve(void 0))])})(r).catch(e=>{console.error(e),a=!0});if(!i){if(1===t){await new Promise(e=>setTimeout(e)),e=3;continue}break}if(r=void 0,i.value&&n.push(i.value),i.done){a=!0;break}}!a||"content-length"in i||(i["content-length"]=n.reduce((e,t)=>e+t.length,0))}t.writeHead(e.status,i),n.forEach(e=>{t.write(e)}),a?t.end():(0===n.length&&mY(t),await mH(o,t,r))}else i["x-hono-already-sent"]||(t.writeHead(e.status,i),t.end());t[mK]?.()})(n,o,t)}catch(e){return mX(e,o)}}};globalThis.CloseEvent??Event,globalThis.ErrorEvent??Event,Symbol("CONNECTION_SYMBOL_KEY"),Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");var m6=class{_webStandardTransport;_requestListener;_requestContext=new WeakMap;constructor(e={}){this._webStandardTransport=new uX(e),this._requestListener=m4(async e=>{let t=this._requestContext.get(e);return this._webStandardTransport.handleRequest(e,{authInfo:t?.authInfo,parsedBody:t?.parsedBody})},{overrideGlobalObjects:!1})}get sessionId(){return this._webStandardTransport.sessionId}set onclose(e){this._webStandardTransport.onclose=e}get onclose(){return this._webStandardTransport.onclose}set onerror(e){this._webStandardTransport.onerror=e}get onerror(){return this._webStandardTransport.onerror}set onmessage(e){this._webStandardTransport.onmessage=e}get onmessage(){return this._webStandardTransport.onmessage}async start(){return this._webStandardTransport.start()}async close(){return this._webStandardTransport.close()}async send(e,t){return this._webStandardTransport.send(e,t)}setSupportedProtocolVersions(e){this._webStandardTransport.setSupportedProtocolVersions(e)}setScopeChallengeResolver(e){this._webStandardTransport.setScopeChallengeResolver(e)}async handleRequest(e,t,r){let i=e.auth;await m4(async e=>this._webStandardTransport.handleRequest(e,{authInfo:i,parsedBody:r}),{overrideGlobalObjects:!1})(e,t)}closeSSEStream(e){this._webStandardTransport.closeSSEStream(e)}closeStandaloneSSEStream(){this._webStandardTransport.closeStandaloneSSEStream()}};function m3(e=process.env){let t=e.TRACEDECAY_DATA_DIR;if(void 0!==t&&t.length>0)return E.resolve(t);let r="win32"===process.platform?e.USERPROFILE:e.HOME,i=void 0!==r&&r.length>0?r:U.homedir();return E.join(i,".tracedecay")}let m9=o5().min(1),m5=nM({pid:nk().int().nonnegative(),process_run_id:o5(),started_at_unix_secs:nk().int(),epoch:nk().int().nonnegative(),version:o5(),endpoint:nT(),http_application_endpoint:m9.nullable().optional(),auth_token:o5().min(1),profile_root:o5().min(1)});function m8(e){if(e<=0)return!1;try{return process.kill(e,0),!0}catch(e){return"object"==typeof e&&null!==e&&"code"in e&&"EPERM"===e.code}}function m7(e){let t=e.http_application_endpoint;return null==t?null:`http://${t}`}function fe(e){let t=JSON.stringify(function e(t){return Array.isArray(t)?t.map(e):"object"==typeof t&&null!==t?Object.fromEntries(Object.entries(t).sort(([e],[t])=>et)).map(([t,r])=>[t,e(r)])):t}(e));if(void 0===t)throw TypeError("value is not canonical JSON");return t}function ft(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical schema: ${t} must be an object`);return e}function fr(e,t){switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"integer":return"number"==typeof e&&Number.isSafeInteger(e);case"number":return"number"==typeof e&&Number.isFinite(e);case"string":return"string"==typeof e;case"array":return Array.isArray(e);case"object":return"object"==typeof e&&null!==e&&!Array.isArray(e);default:throw TypeError(`unsupported canonical schema type: ${t}`)}}function fi(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an object`);return e}function fo(e,t){if("string"!=typeof e)throw TypeError(`malformed canonical envelope: ${t} must be a string`);return e}function fn(e,t){if("number"!=typeof e||!Number.isFinite(e))throw TypeError(`malformed canonical envelope: ${t} must be a finite number`);return e}function fa(e,t){if(!Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an array`);return e}function fs(e,t){let r=fn(e,t);if(!Number.isSafeInteger(r))throw TypeError(`malformed canonical envelope: ${t} must be a safe integer`);return r}function fd(e,t){let r=fs(e,t);if(r<0)throw TypeError(`malformed canonical envelope: ${t} must be non-negative`);return r}let fc=new TextEncoder;function fl(e,t,r){let i=fo(e,t);if(0===i.length||i.trim()!==i||fc.encode(i).byteLength>r||/\p{Cc}/u.test(i))throw TypeError(`malformed canonical envelope: ${t} is not a bounded identifier`);return i}function fp(e,t,r,i,o,n,a,s,d){let c=fi(e,"success envelope");if(fo(c.binding_id,"binding_id")!==t)throw TypeError("malformed canonical envelope: binding mismatch");let l=fi(c.contract,"contract");if(fo(l.schema_id,"contract.schema_id")!==r||fn(l.schema_revision,"contract.schema_revision")!==i)throw TypeError("malformed canonical envelope: result contract mismatch");fo(c.request_id,"request_id"),fi(c.scope,"scope");let p=fi(c.outcome,"outcome"),u=fo(p.outcome,"outcome.outcome");return{...c,outcome:{...p,outcome:u,value:function(e,t,r,i,o,n,a){let s=fi(t,"outcome.value");if(!("payload"in s))throw TypeError("malformed canonical envelope: outcome.value.payload is required");if(("durable_effect"!==o||"required"!==n||"effect"!==e)&&("operation"!==o||"not_required"!==n||"evidence"!==e&&"preview"!==e))throw TypeError(`malformed canonical envelope: outcome ${e} is outside the operation receipt contract`);if(!function(e,t,r){let i=fi(e,"outcome.value.execution");if(fn(i.started_at,"execution.started_at"),fn(i.ended_at,"execution.ended_at"),!("effective_deadline"in i)||!("cancellation"in i))throw TypeError("malformed canonical envelope: receipt fields are required");let o=fi(i.budget,"execution.budget");fn(o.units_consumed,"budget.units_consumed"),fn(o.bytes_consumed,"budget.bytes_consumed"),fn(o.elapsed_micros,"budget.elapsed_micros");let n=fo(i.termination,"execution.termination");if(!t.includes(n))throw TypeError(`malformed canonical envelope: termination ${n} is not legal for this operation`);if(("cancelled"===n||"timed_out"===n)&&null===i.cancellation)throw TypeError("malformed canonical envelope: terminal cancellation observation is required");if(null!==i.cancellation){let e=fi(r,"operation.cancellation"),t=fo(e.mode,"operation.cancellation.mode"),o=fi(i.cancellation,"execution.cancellation"),a=fo(o.stage,"execution.cancellation.stage");if(fs(o.observed_at,"execution.cancellation.observed_at"),!["before_admission","before_read","during_read","before_effect","effect_in_flight","reconciling","after_commit"].includes(a))throw TypeError(`malformed canonical envelope: unknown cancellation stage ${a}`);if("not_cancellable"===t){if("timed_out"!==n)throw TypeError("malformed canonical envelope: non-cancellable operation returned cancellation evidence")}else if(!fa(e.points,"operation.cancellation.points").includes(a))throw TypeError(`malformed canonical envelope: cancellation stage ${a} is not legal for this operation`)}}(s.execution,r,i),"evidence"===e)fi(s.temporal,"temporal"),fi(s.authority,"authority"),fa(s.evidence_authorities,"evidence_authorities"),fi(s.coverage,"coverage"),fa(s.omissions,"omissions"),fa(s.scores,"scores"),fa(s.contributions,"contributions"),function(e){let t=fi(e,"outcome.value.page");if(fl(t.sort_contract_id,"page.sort_contract_id",192),1>fd(t.sort_revision,"page.sort_revision"))throw TypeError("malformed canonical envelope: page sort_revision must be positive");let r=null===t.total?null:fd(t.total,"page.total"),i=fd(t.returned,"page.returned");if(null!==r&&i>r)throw TypeError("malformed canonical envelope: page returned exceeds total");null!==t.cursor&&function(e){let t=fi(e,"page.cursor"),r=fo(t.kind,"page.cursor.kind");if("opaque"===r)fl(t.cursor,"page.cursor.cursor",4096);else throw TypeError(`malformed canonical envelope: unsupported page cursor kind ${r}`)}(t.cursor),null!==t.expires_at&&fs(t.expires_at,"page.expires_at")}(s.page);else if("preview"===e)fo(s.preview_id,"preview_id"),fo(s.preview_digest,"preview_digest"),fo(s.effect_class,"effect_class"),fi(s.authority,"authority"),fo(s.expected_state,"expected_state");else if("effect"===e)fo(s.effect_id,"effect_id"),fo(s.effect_class,"effect_class"),fo(s.idempotency_key,"idempotency_key"),fi(s.authority,"authority"),fo(s.expected_state,"expected_state"),fo(s.reconciliation,"reconciliation"),fi(s.receipt,"receipt");else throw TypeError(`malformed canonical envelope: unsupported outcome ${e}`);return{...s,payload:null===s.payload?null:a(s.payload)}}(u,p.value,o,n,a,s,d)}}}function fu(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function fm(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function ff(e){return"number"==typeof e&&Number.isSafeInteger(e)}function fh(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&fc.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}async function fy(e){let t=await crypto.subtle.digest("SHA-256",fc.encode(fe(e)));return`sha256:${Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}`}function fg(e){return fu(e)&&"string"==typeof e.code&&"string"==typeof e.message}let f_={description:"Strongly typed algorithm-tagged integrity digest: `AccessPolicyDigest`.",type:"string"},fv={description:"Strongly typed canonical identity: `AccessRuleId`.",type:"string"},fb={description:"Strongly typed canonical identity: `ActorId`.",type:"string"},f$={description:"Strongly typed canonical identity: `AgentInstanceId`.",type:"string"},fS={enum:["memory_curator","session_reflector","skill_writer","combined_review","user_job"],type:"string"},fk={properties:{coverage:{$ref:"#/$defs/MetricCoverageV1"},current:{anyOf:[{$ref:"#/$defs/AnalyticsModeV1"},{type:"null"}]},transition_watermark:{type:["string","null"]},unavailable_reason:{type:["string","null"]}},required:["coverage"],type:"object"},fw={enum:["off","local_only","aggregate_share"],type:"string"},fP={oneOf:[{const:"project",description:"Analytics events of the resolved project.",type:"string"},{const:"all",description:"Analytics events of every registered project.",type:"string"}]},fV={description:"Strongly typed canonical identity: `AnalyzerEnvironmentVariable`.",type:"string"},fR={description:"Strongly typed canonical identity: `AnalyzerExecutableId`.",type:"string"},fq={oneOf:[{properties:{executable_id:{$ref:"#/$defs/AnalyzerExecutableId"},kind:{const:"built_in",type:"string"}},required:["kind","executable_id"],type:"object"},{properties:{executable_digest:{$ref:"#/$defs/ManifestDigest"},kind:{const:"approved_external",type:"string"}},required:["kind","executable_digest"],type:"object"}]},fI={description:"Strongly typed canonical identity: `AnalyzerLanguageId`.",type:"string"},fx={additionalProperties:!1,description:"One language's analyzer selection. Host registration may project only the\nnon-sensitive `language_id`/`enabled` pair; all other fields remain in the\nconfiguration authority.",properties:{arguments:{items:{type:"string"},type:"array"},enabled:{type:"boolean"},environment_allowlist:{items:{$ref:"#/$defs/AnalyzerEnvironmentVariable"},type:"array",uniqueItems:!0},executable:{$ref:"#/$defs/AnalyzerExecutableReferenceV1"},initialization_options:{additionalProperties:{$ref:"#/$defs/AnalyzerStructuredValueV1"},type:"object"},language_id:{$ref:"#/$defs/AnalyzerLanguageId"},privacy_class:{$ref:"#/$defs/AnalyzerPrivacyClassV1"},resource_limits:{$ref:"#/$defs/AnalyzerResourceLimitsV1"},restart_policy:{$ref:"#/$defs/AnalyzerRestartPolicyV1"},settings:{additionalProperties:{$ref:"#/$defs/AnalyzerStructuredValueV1"},type:"object"}},required:["language_id","enabled","executable","arguments","initialization_options","settings","environment_allowlist","privacy_class","resource_limits","restart_policy"],type:"object"},fj={enum:["non_sensitive","sensitive","restricted"],type:"string"},fC={additionalProperties:!1,properties:{maximum_memory_mib:{format:"uint32",minimum:0,type:"integer"},request_timeout_millis:{format:"uint64",minimum:0,type:"integer"},startup_timeout_millis:{format:"uint64",minimum:0,type:"integer"}},required:["maximum_memory_mib","startup_timeout_millis","request_timeout_millis"],type:"object"},fT={enum:["restart_on_configuration_change","manual_restart_only"],type:"string"},fO={additionalProperties:!1,description:"Canonical analyzer settings. A changed selection produces a new\nconfiguration revision/digest; cache invalidation remains owned elsewhere.",properties:{schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"},selections:{items:{$ref:"#/$defs/AnalyzerLanguageSelectionV1"},type:"array"}},required:["schema_version","selections"],type:"object"},fE={description:"A structured analyzer option value. This deliberately excludes raw\nenvironment values, commands, credential material, and transport blobs.",oneOf:[{properties:{kind:{const:"boolean",type:"string"},value:{type:"boolean"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"integer",type:"string"},value:{format:"int64",type:"integer"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"text",type:"string"},value:{type:"string"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"text_list",type:"string"},value:{items:{type:"string"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"object",type:"string"},value:{additionalProperties:{$ref:"#/$defs/AnalyzerStructuredValueV1"},type:"object"}},required:["kind","value"],type:"object"}]},fA={description:"The structured facts behind a problem. Adapters read these fields; the\nproblem's `message` is only their one human rendering.",oneOf:[{additionalProperties:!1,description:"The worktree's code index is parked until the operator applies\n`remedy`; repeating the request cannot change the answer.",properties:{cause:{type:"string"},kind:{const:"parked",type:"string"},remedy:{type:"string"},retries_on_wake:{type:"boolean"}},required:["kind","cause","remedy","retries_on_wake"],type:"object"},{additionalProperties:!1,description:"A session refresh asked to begin from a source frontier the\ncommitted projection has already passed.",properties:{active:{format:"uint64",minimum:0,type:"integer"},committed:{format:"uint64",minimum:0,type:"integer"},kind:{const:"stale_refresh_frontier",type:"string"},requested:{format:"uint64",minimum:0,type:"integer"}},required:["kind","requested","committed","active"],type:"object"},{additionalProperties:!1,description:"A compare-and-swap request named `requested` in `field`, but the\nauthority holds `current`. Resending with `current` is a new request.",properties:{current:{format:"uint64",minimum:0,type:"integer"},field:{type:"string"},kind:{const:"stale_precondition",type:"string"},requested:{format:"uint64",minimum:0,type:"integer"}},required:["kind","field","requested","current"],type:"object"},{additionalProperties:!1,description:"A workflow step effect named placement digest `found`, but the step's\ncurrent placement is `expected`: the effect was settled against a\nplacement the run has since replaced.",properties:{expected:{type:"string"},found:{type:"string"},kind:{const:"workflow_placement_digest_stale",type:"string"}},required:["kind","expected","found"],type:"object"},{additionalProperties:!1,description:"A writer lock stayed held by other writers past its admission\ndeadline.",properties:{deadline_ms:{format:"uint64",minimum:0,type:"integer"},kind:{const:"lock_deadline",type:"string"},resource:{type:"string"}},required:["kind","resource","deadline_ms"],type:"object"},{additionalProperties:!1,description:"A persisted store whose shape this binary does not open. It is served\nin this typed state until the operator runs `remedy`, which deletes\nthe old data; nothing is migrated or backed up.",properties:{authority:{type:"string"},found_version:{format:"int64",type:["integer","null"]},kind:{const:"reset_required",type:"string"},reason:{type:"string"},remedy:{type:"string"},required_version:{format:"int64",type:["integer","null"]}},required:["kind","authority","reason","remedy"],type:"object"},{additionalProperties:!1,description:"No compiler runs automatically for the diagnostics scope: no tsconfig\nowns `file`, or, for a workspace read (`file` null), none exists under\nthe project root. `searched` lists the owner search's candidates,\nnearest first; it is empty for a workspace read or a file outside the\nproject root.",properties:{file:{type:["string","null"]},kind:{const:"diagnostics_unsupported",type:"string"},searched:{items:{$ref:"#/$defs/DiagnosticsSearchedTsconfigV1"},type:"array"}},required:["kind","searched"],type:"object"},{additionalProperties:!1,description:"The TypeScript `producer` has not published diagnostics for the\ncurrent code generation yet. `generation` is the last generation it\npublished, null when it has published none.",properties:{generation:{type:["string","null"]},kind:{const:"diagnostics_pending",type:"string"},producer:{type:"string"}},required:["kind","producer"],type:"object"},{additionalProperties:!1,description:"The code graph's engine or catalog was released for memory and was\nstill warming again when the read's budget ran out;\n`retry_after_millis` is the measured warm-up it still needs.",properties:{kind:{const:"code_graph_rewarming",type:"string"},retry_after_millis:{format:"uint64",minimum:0,type:"integer"}},required:["kind","retry_after_millis"],type:"object"},{additionalProperties:!1,description:"No TraceDecay daemon accepts connections on `socket`. `named_by` is\nthe environment variable that chose the socket, when one did;\n`service_unit` is what this client observed of the managed service.",properties:{kind:{const:"daemon_unreachable",type:"string"},named_by:{type:["string","null"]},service_unit:{$ref:"#/$defs/DaemonServiceUnitObservationV1"},socket:{type:"string"}},required:["kind","socket","service_unit"],type:"object"}]},fW={description:"Strongly typed canonical identity: `AttemptId`.",type:"string"},fM={description:"Authoritative scope of a source binding. A mutable path, label, or host\nprofile cannot be represented as authority.",oneOf:[{properties:{id:{$ref:"#/$defs/ProjectId"},kind:{const:"project",type:"string"}},required:["kind","id"],type:"object"},{properties:{id:{$ref:"#/$defs/UserProfileId"},kind:{const:"projectless_hermes",type:"string"}},required:["kind","id"],type:"object"}]},fN={additionalProperties:!1,description:"One exact application scope paired with its registered physical locator.\n\nThe scope remains the identity authority. The locator is retained only so\na later read or restart can reopen the exact registered root without an\nactive-graph or CWD fallback.",properties:{locator:{anyOf:[{$ref:"#/$defs/RegisteredRootLocatorV1"},{type:"null"}]},scope:{$ref:"#/$defs/ResolvedScope"}},required:["scope"],type:"object"},fz={additionalProperties:!1,description:"Immutable canonical set of exact roots admitted by their existing request\ncontexts. A registered locator participates only as frozen reopening\nevidence; its paired [`ResolvedScope`](crate::context::ResolvedScope) remains\nthe root identity authority.",properties:{actor_id:{$ref:"#/$defs/ActorId"},digest:{$ref:"#/$defs/ManifestDigest"},revision:{$ref:"#/$defs/ScopeSetRevision"},roots:{items:{$ref:"#/$defs/AuthorizedRoot"},type:"array"},scope_set_id:{$ref:"#/$defs/ScopeSetId"}},required:["scope_set_id","revision","actor_id","roots","digest"],type:"object"},fD={description:"A terminal automatic-fact receipt state.",enum:["applied","quarantined"],type:"string"},fF={oneOf:[{properties:{kind:{const:"disabled",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"eligible_only",type:"string"},maximum_per_run:{format:"uint16",maximum:65535,minimum:1,type:"integer"},minimum_idle_seconds:{format:"uint64",minimum:1,type:"integer"}},required:["kind","minimum_idle_seconds","maximum_per_run"],type:"object"}]},fL={enum:["disabled","codex_app_server"],type:"string"},fU={enum:["standalone","delegated_host"],type:"string"},fH={description:"The settled status every successful read in this family reports.",enum:["ok"],type:"string"},fG={description:"Which owner's automation schedulers a reconcile covers.",oneOf:[{const:"project",description:"The served project's scheduler, answered by the project's owner.",type:"string"},{const:"profile",description:"Every cached project scheduler of the profile, answered by the\ndaemon's profile owner.",type:"string"}]},fB={properties:{created_at:{type:"string"},kind:{type:"string"},path:{type:"string"},schema_version:{format:"uint32",minimum:0,type:"integer"},sha256:{type:"string"},summary:{type:["string","null"]}},required:["schema_version","kind","path","sha256","created_at"],type:"object"},fK={description:"Automation run reads answer from the active project's ledger only.",enum:["active_project"],type:"string"},fJ={enum:["queued","running","succeeded","failed","skipped"],type:"string"},fZ={additionalProperties:!1,properties:{allow_job_commands:{type:"boolean"},backend:{$ref:"#/$defs/AutomationBackendV1"},combine_due_tasks:{type:"boolean"},enabled:{type:"boolean"},host_mode:{$ref:"#/$defs/AutomationHostModeV1"},model_id:{type:["string","null"]},scheduler_tick_secs:{format:"uint64",minimum:0,type:"integer"},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"},tasks:{$ref:"#/$defs/AutomationTaskSetV1"},timeout_secs:{format:"uint64",minimum:0,type:"integer"}},required:["schema_version","enabled","backend","host_mode","timeout_secs","scheduler_tick_secs","combine_due_tasks","allow_job_commands","tasks"],type:"object"},fQ={additionalProperties:!1,properties:{memory_curator:{$ref:"#/$defs/AutomationTaskSettingsV1"},session_reflector:{$ref:"#/$defs/AutomationTaskSettingsV1"},skill_writer:{$ref:"#/$defs/AutomationTaskSettingsV1"}},required:["memory_curator","session_reflector","skill_writer"],type:"object"},fX={additionalProperties:!1,properties:{cooldown_secs:{format:"uint64",minimum:0,type:["integer","null"]},enabled:{type:"boolean"},interval_secs:{format:"uint64",minimum:0,type:["integer","null"]},min_idle_secs:{format:"uint64",minimum:0,type:["integer","null"]},schedule:{type:["string","null"]},session_evidence_budget_backoff_secs:{description:"Suppression window between session-evidence retrieval attempts while\nthe evidence budget stays exhausted. Unset uses the automation crate's\none-hour default. Distinct from `cooldown_secs`, which paces retries\nafter failed runs; budget exhaustion is a skip, not a failure.",format:"uint64",minimum:0,type:["integer","null"]}},required:["enabled"],type:"object"},fY={enum:["manual_cli","manual_mcp","dashboard","application","scheduler","host_receipt"],type:"string"},f1={description:"Strongly typed canonical identity: `BrainId`.",type:"string"},f0={oneOf:[{properties:{kind:{const:"reject",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"append_monotonic_ordinal",type:"string"},maximum_attempts:{format:"uint16",maximum:65535,minimum:1,type:"integer"}},required:["kind","maximum_attempts"],type:"object"}]},f2={oneOf:[{properties:{bytes:{format:"uint8",maximum:255,minimum:1,type:"integer"},kind:{const:"task_id_digest_prefix",type:"string"}},required:["kind","bytes"],type:"object"},{properties:{kind:{const:"repository_slug",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"work_class",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"monotonic_collision_ordinal",type:"string"}},required:["kind"],type:"object"}]},f4={enum:["hyphen","underscore","slash"],type:"string"},f6={additionalProperties:!1,properties:{collision:{$ref:"#/$defs/BranchCollisionPolicyV1"},components:{items:{$ref:"#/$defs/BranchNameComponentV1"},type:"array"},maximum_bytes:{format:"uint16",maximum:65535,minimum:1,type:"integer"},prefix:{$ref:"#/$defs/CanonicalGitRefPrefix"},separator:{$ref:"#/$defs/BranchNameSeparatorV1"}},required:["prefix","components","separator","maximum_bytes","collision"],type:"object"},f3={additionalProperties:!1,description:"A declared dependency edge; propagation direction remains an application\ndecision and is never inferred from this edge.",properties:{dependency:{$ref:"#/$defs/StackNodeId"},dependent:{$ref:"#/$defs/StackNodeId"}},required:["dependency","dependent"],type:"object"},f9={description:"Strongly typed canonical identity: `BranchStackId`.",type:"string"},f5={additionalProperties:!1,description:"One visible branch/ref at one immutable tip.",properties:{node_id:{$ref:"#/$defs/StackNodeId"},project_id:{$ref:"#/$defs/ProjectId"},reference:{$ref:"#/$defs/RefId"},repository_id:{$ref:"#/$defs/RepositoryId"},tip:{$ref:"#/$defs/CommitId"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["node_id","project_id","repository_id","reference","tip"],type:"object"},f8={description:"Strongly typed canonical identity: `BranchStackRevisionId`.",type:"string"},f7={additionalProperties:!1,description:"Immutable branch-stack projection at one exact inventory revision.",properties:{canonical_order:{items:{$ref:"#/$defs/StackNodeId"},type:"array"},digest:{$ref:"#/$defs/ManifestDigest"},edges:{items:{$ref:"#/$defs/BranchStackEdgeV1"},type:"array"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},inventory_snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},nodes:{items:{$ref:"#/$defs/BranchStackNodeV1"},type:"array"},revision_id:{$ref:"#/$defs/BranchStackRevisionId"},source:{$ref:"#/$defs/BranchStackSourceV1"},stack_id:{$ref:"#/$defs/BranchStackId"}},required:["stack_id","revision_id","inventory_snapshot_id","inventory_epoch","source","nodes","edges","canonical_order","digest"],type:"object"},he={description:"Authoritative source that declared the exact stack topology.",enum:["explicit_declaration","accepted_task_branch_topology"],type:"string"},ht={enum:["no_branches","unbranched","independent_branches","local_stack"],type:"string"},hr={additionalProperties:!1,properties:{allowed:{items:{$ref:"#/$defs/BranchTopologyKindV1"},type:"array",uniqueItems:!0}},required:["allowed"],type:"object"},hi={description:"Strongly typed canonical identity: `CalibrationProfileId`.",type:"string"},ho={additionalProperties:!1,description:"Surface-owned query semantics. Page size remains an invocation control, but\ncontinuation is a request field so CLI, MCP, and HTTP callers all have the\nsame channel for spending a `next_cursor`.",properties:{cursor:{default:null,type:["string","null"]},order:{$ref:"#/$defs/RetrievalOrder"},projection:{$ref:"#/$defs/ResultProjection"}},required:["projection","order"],type:"object"},hn={additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},stage:{$ref:"#/$defs/CancellationStage"}},required:["stage","observed_at"],type:"object"},ha={description:"Exact stage at which cancellation or deadline state was observed.",enum:["before_admission","before_read","during_read","before_effect","effect_in_flight","reconciling","after_commit"],type:"string"},hs={additionalProperties:!1,description:"One retriever's scored contribution to a fused candidate. Every ranked\ncandidate retains every retriever's raw score domain, ordinal rank,\ncalibrated feature, weight, and weighted contribution.",properties:{calibrated_feature_micros:{format:"uint32",minimum:0,type:"integer"},calibration_profile_id:{$ref:"#/$defs/CalibrationProfileId"},ordinal_rank:{format:"uint32",minimum:0,type:"integer"},raw_score:{$ref:"#/$defs/FixedPointScore"},retriever:{$ref:"#/$defs/RetrieverKind"},retriever_revision:{$ref:"#/$defs/ComponentRevision"},score_domain:{$ref:"#/$defs/ScoreDomainId"},source_occurrence_id:{$ref:"#/$defs/SourceOccurrenceId"},weight_micros:{format:"uint32",minimum:0,type:"integer"},weighted_contribution_micros:{format:"uint64",minimum:0,type:"integer"}},required:["retriever","retriever_revision","source_occurrence_id","ordinal_rank","raw_score","score_domain","calibration_profile_id","calibrated_feature_micros","weight_micros","weighted_contribution_micros"],type:"object"},hd={description:"A validated full native Git ref name, such as `refs/heads/main`.",type:"string"},hc={description:"A validated ref/branch prefix. Branch naming accepts a short branch prefix\n(for example `tracedecay/`) while protected-ref selectors use full\n`refs/.../` prefixes.",type:"string"},hl={description:"Strongly typed canonical identity: `CapabilityId`.",type:"string"},hp={description:"Strongly typed canonical identity: `CatalogGenerationId`.",type:"string"},hu={description:"Strongly typed canonical identity: `ChangePlanId`.",type:"string"},hm={additionalProperties:!1,properties:{from_inclusive:{format:"int64",type:["integer","null"]},through_inclusive:{format:"int64",type:["integer","null"]}},type:"object"},hf={additionalProperties:!1,description:'Why co-change mining produced no answer, so an empty\n`missing_co_change_partners` does not read as "no partner is missing".',properties:{reason:{type:"string"},retryable:{type:"boolean"}},required:["reason","retryable"],type:"object"},hh={enum:["kind","language","path"],type:"string"},hy={description:"Strongly typed canonical identity: `CodeGenerationId`.",type:"string"},hg={description:"Freshness of the generation a verified graph read serves.",oneOf:[{properties:{state:{const:"current",type:"string"}},required:["state"],type:"object"},{properties:{rebuild_in_flight:{type:"boolean"},sealed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"last_complete_stale",type:"string"}},required:["state","sealed_at","rebuild_in_flight"],type:"object"}]},h_={description:"A typed reason an otherwise active generation cannot make durable progress.",enum:["resident_memory","source_unavailable","artifact_store_unavailable","retry_backoff","publication_authority_corrupt"],type:"string"},hv={description:'A deterministic contract violation that parked background convergence.\n\nParked is not dead: the worker keeps re-observing the violation on its\nordinary wake cadence, so an operator fix (for example restoring an\nowner-private mode) is picked up on the next wake without a restart. The\nstate exists so `status`, doctor, and the dashboard report the violation\ntyped instead of an indefinite "warming".',properties:{blocked_reason:{anyOf:[{$ref:"#/$defs/CodeIndexBuildBlockedReasonV1"},{type:"null"}],description:"Stable class for callers that must decide whether new work is admissible."},observed_passes:{description:"Background passes that re-observed the violation since parking.",format:"uint64",minimum:0,type:"integer"},parked_at_micros:{description:"When the violation was first observed (microseconds since the Unix epoch).",format:"int64",type:"integer"},reason:{description:"Exact typed failure that parked convergence.",type:"string"},remediation:{description:"Operator action that clears the violation.",type:"string"},retries_on_wake:{description:"Whether the worker re-checks this violation on every ordinary wake.\nTrue for filesystem/contract violations an operator fix clears in\nplace; false for an abnormal task failure that only changed input (a\nnew sealed generation) retries.",type:"boolean"}},required:["reason","remediation","parked_at_micros","observed_passes","retries_on_wake"],type:"object"},hb={properties:{display_path:{description:"`git_path_bytes` decoded for display, invalid UTF-8 replaced.",type:"string"},git_path_bytes:{description:"The exact Git path bytes, which need not be UTF-8.",items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},reason:{$ref:"#/$defs/CodeIndexSourceOmissionReasonV1"}},required:["git_path_bytes","display_path","reason"],type:"object"},h$={description:"Sources a sealed snapshot captured but does not index.",properties:{count:{description:"Every omitted source in the snapshot.",format:"uint64",minimum:0,type:"integer"},sources:{description:"The first omitted sources in Git path order, at most\n[`CODE_INDEX_OMITTED_SOURCE_LIST_LIMIT`].",items:{$ref:"#/$defs/CodeIndexOmittedSourceV1"},type:"array"}},required:["count","sources"],type:"object"},hS={oneOf:[{description:"No logical path can carry the Git path: not UTF-8, a backslash, a\ncontrol character, or leading or trailing whitespace.",properties:{kind:{const:"unrepresentable_path",type:"string"}},required:["kind"],type:"object"},{description:"The privacy boundary withheld the file's bytes.",properties:{detail:{type:"string"},kind:{const:"privacy_withheld",type:"string"}},required:["kind","detail"],type:"object"}]},hk={description:"Closed staleness ladder for one mounted worktree.\n\nThe scheduler publishes one of these tokens. MCP, the dashboard, and the\nCLI must match the variant, not a hand-copied string, so a new ladder\nstate cannot appear at one caller and be missed at the others.",enum:["fresh","stale","indexing","refreshing","restoring","verifying","parked"],type:"string"},hw={description:"Profile-level worker-count intent for the process-wide code-index pool.\n`Automatic` delegates the concrete count to runtime resource admission;\n`Exact` persists an operator-requested positive worker count.",oneOf:[{additionalProperties:!1,properties:{mode:{const:"automatic",type:"string"}},required:["mode"],type:"object"},{additionalProperties:!1,properties:{mode:{const:"exact",type:"string"},workers:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["mode","workers"],type:"object"}]},hP={additionalProperties:!1,properties:{chunk:{anyOf:[{$ref:"#/$defs/CodeSearchChunkId"},{type:"null"}]},file:{$ref:"#/$defs/FileOccurrenceId"},path:{type:"string"},span:{$ref:"#/$defs/SourceSpan"},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["file","path","span"],type:"object"},hV={additionalProperties:!1,description:"One immutable code-index generation inside the authorized single root.\nThe path prefix narrows a query but never establishes project identity.",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},path_prefix:{type:["string","null"]}},required:["generation"],type:"object"},hR={description:"Strongly typed canonical identity: `CodeSearchChunkId`.",type:"string"},hq={description:"Strongly typed canonical identity: `CommitId`.",type:"string"},hI={enum:["promote","reject","insufficient_evidence"],type:"string"},hx={description:"Whether the bounded complexity walk over a symbol's body ran to the end.\n\nThe extractor stops walking a body once its traversal budget is spent. The\ncounters accumulated by then are lower bounds over the visited prefix, not\nfacts about the whole body, so every surface that prints, ranks, or\naggregates complexity must render this state instead of treating those\ncounters as exact.",oneOf:[{enum:["complete"],type:"string"},{const:"traversal_budget_exhausted",description:"The walk stopped when the traversal budget ran out.",type:"string"}]},hj={description:"Strongly typed canonical identity: `ComponentRevision`.",type:"string"},hC={description:"Strongly typed canonical identity: `ComponentVersion`.",type:"string"},hT={enum:["config_summary"],type:"string"},hO={additionalProperties:!1,description:"One entry per changed config file instead of one per config key.",properties:{config_keys:{format:"uint",minimum:0,type:"integer"},file:{type:"string"},kind:{$ref:"#/$defs/ConfigSummaryKindV1"}},required:["file","kind","config_keys"],type:"object"},hE={description:"Strongly typed canonical identity: `ConfigurationIdempotencyKey`.",type:"string"},hA={description:"A typed configuration layer identity. The default layer intentionally has\nno caller-controlled identifier.",oneOf:[{properties:{kind:{const:"default",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"user_profile",type:"string"},profile_id:{$ref:"#/$defs/UserProfileId"}},required:["kind","profile_id"],type:"object"},{properties:{kind:{const:"project",type:"string"},project_id:{$ref:"#/$defs/ProjectId"}},required:["kind","project_id"],type:"object"},{properties:{collection_id:{$ref:"#/$defs/QueryCollectionId"},kind:{const:"collection",type:"string"}},required:["kind","collection_id"],type:"object"}]},hW={description:"Strongly typed canonical identity: `ConfigurationReceiptId`.",type:"string"},hM={description:"Strongly typed canonical identity: `ConfigurationRevisionId`.",type:"string"},hN={description:"Strongly typed canonical identity: `ConfigurationSnapshotId`.",type:"string"},hz={description:"Values that the typed registry can accept.",oneOf:[{properties:{kind:{const:"boolean",type:"string"},value:{type:"boolean"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"unsigned",type:"string"},value:{format:"uint64",minimum:0,type:"integer"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"code_index_worker_selection",type:"string"},value:{$ref:"#/$defs/CodeIndexWorkerSelectionV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"text",type:"string"},value:{type:"string"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"string_list",type:"string"},value:{items:{type:"string"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"source_bindings",type:"string"},value:{items:{$ref:"#/$defs/ScopeSourceBinding"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"access_rules",type:"string"},value:{items:{$ref:"#/$defs/ScopeAccessRule"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"analyzer_settings",type:"string"},value:{$ref:"#/$defs/AnalyzerSettingsV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"work_topology_policy",type:"string"},value:{$ref:"#/$defs/WorkTopologyPolicyV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"work_executable_bindings",type:"string"},value:{items:{$ref:"#/$defs/WorkExecutableBindingV1"},type:"array"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"work_expertise_consent",type:"string"},value:{$ref:"#/$defs/WorkExpertiseConsentV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"context_scout_settings",type:"string"},value:{$ref:"#/$defs/ContextScoutSettingsV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"automation_settings",type:"string"},value:{$ref:"#/$defs/AutomationSettingsV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"lcm_summarizer_executables",type:"string"},value:{$ref:"#/$defs/LcmSummarizerExecutablesV1"}},required:["kind","value"],type:"object"}]},hD={description:"Strongly typed algorithm-tagged integrity digest: `ContentDigest`.",type:"string"},hF={description:"What one caller `lexical_anchors` entry contributed to the response, in\ncaller order.",oneOf:[{additionalProperties:!1,description:"`matched` indexed rows carried the anchor; `admitted` result sites\ncarrying it are in this response, and `dropped` counts the sites the\nlexical lane admitted that a later stage removed, by reason.",properties:{admitted:{format:"uint64",minimum:0,type:"integer"},anchor:{type:"string"},dropped:{items:{$ref:"#/$defs/LexicalAnchorDropV1"},type:"array"},matched:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"matched",type:"string"}},required:["outcome","anchor","matched","admitted"],type:"object"},{additionalProperties:!1,description:"No indexed row carries the anchor.",properties:{anchor:{type:"string"},outcome:{const:"unmatched",type:"string"}},required:["outcome","anchor"],type:"object"},{additionalProperties:!1,description:"The anchor's route did not serve; `coverage` names the lane state.",properties:{anchor:{type:"string"},outcome:{const:"not_served",type:"string"}},required:["outcome","anchor"],type:"object"}]},hL={enum:["explore","plan"],type:"string"},hU={additionalProperties:!1,description:"Exact opaque destination for one public Context Scout operation.\n\nThe daemon converts this transport-neutral address into its runtime value\nonly after catalog admission. Keeping the public wire here makes CLI, MCP,\nHTTP, and both SDKs share one generated schema authority.",properties:{agent_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},logical_message_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},profile_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},project_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},protected_session_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},provider_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},thread_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},turn_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"}},required:["profile_id","provider_id","protected_session_id","thread_id","turn_id","agent_id","logical_message_id","project_id"],type:"object"},hH={enum:["retrieval","diagnostic","coordination","verification"],type:"string"},hG={additionalProperties:!1,description:"Public lease proof. It carries only opaque identities; the daemon resolves\nit back to the durable queue row before recording delivery.",properties:{envelope_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},lease_expires_at:{$ref:"#/$defs/UtcMicros"},lease_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},work:{$ref:"#/$defs/ContextScoutWorkV1"}},required:["work","envelope_id","lease_id","lease_expires_at"],type:"object"},hB={additionalProperties:!1,properties:{max_candidates:{format:"uint32",minimum:0,type:"integer"},max_evidence:{format:"uint32",minimum:0,type:"integer"},max_model_input_tokens:{format:"uint32",minimum:0,type:"integer"},max_model_output_tokens:{format:"uint32",minimum:0,type:"integer"},max_text_bytes:{format:"uint32",minimum:0,type:"integer"}},required:["max_candidates","max_evidence","max_text_bytes","max_model_input_tokens","max_model_output_tokens"],type:"object"},hK={enum:["deterministic","configured_model"],type:"string"},hJ={enum:["active","paused","disabled"],type:"string"},hZ={enum:["codex_app_server"],type:"string"},hQ={enum:["attempted","delayed","displayed","expanded","explicitly_accepted","explicitly_rejected","dismissed","expired_unseen","corrected","unknown"],type:"string"},hX={additionalProperties:!1,properties:{delivered_at:{$ref:"#/$defs/UtcMicros"},envelope_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},outcome:{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"},receipt_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"}},required:["receipt_id","envelope_id","delivered_at","outcome"],type:"object"},hY={enum:["immediate","next_boundary","idle_window","on_request","suppressed"],type:"string"},h1={enum:["complete","partial","stale","cancelled","unavailable"],type:"string"},h0={additionalProperties:!1,properties:{anchor_ids:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},availability:{$ref:"#/$defs/ContextScoutEvidenceAvailabilityV1"},claim_digest:{$ref:"#/$defs/ManifestDigest"},content_generation:{$ref:"#/$defs/CodeGenerationId"},session_window:{anyOf:[{$ref:"#/$defs/ContextScoutSessionWindowV1"},{type:"null"}],description:"Session turns a session-evidence suggestion was judged from. Absent for\ncode evidence."}},required:["content_generation","availability","anchor_ids","claim_digest"],type:"object"},h2={enum:["explicitly_accepted","explicitly_rejected","dismissed","corrected"],type:"string"},h4={additionalProperties:!1,properties:{kind:{$ref:"#/$defs/ContextScoutFeedbackKindV1"},receipt_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"}},required:["receipt_id","kind"],type:"object"},h6={description:"One user intent the Scout can recognize. The serialized keys are the\nhistorical hook hint category keys, so persisted hint analytics, hint\nsettlement, and evals keep one vocabulary.",enum:["search","semantic_search","file_read","tool_descriptor_read","broad_read","call_graph","impact","symbol_lookup","file_lookup","project_context","session_recall","atomic_edit","type_orientation","explore_subagent","subagent_start_context","build_diagnostics","review_changes","memory_store","edit_redundancy","unexpected_changes"],type:"string"},h3={additionalProperties:!1,description:"Operator configuration for the Context Scout intent pass.",properties:{action_fact_score_permille:{description:"Score a deterministic action fact contributes for its intent.",format:"uint16",maximum:65535,minimum:0,type:"integer"},enabled:{type:"boolean"},engine:{$ref:"#/$defs/DecisionEngineSettingsV1"},min_delivery_gap_secs:{format:"uint32",minimum:0,type:"integer"},prompt_lookup_deadline_ms:{format:"uint32",minimum:0,type:"integer"},questions:{items:{$ref:"#/$defs/IntentQuestionSettingsV1"},type:"array"},ttl_secs:{format:"uint32",minimum:0,type:"integer"},window:{$ref:"#/$defs/IntentWindowSettingsV1"}},required:["enabled","engine","window","questions","action_fact_score_permille","ttl_secs","min_delivery_gap_secs","prompt_lookup_deadline_ms"],type:"object"},h9={additionalProperties:!1,properties:{max_candidates:{format:"uint",minimum:0,type:"integer"},max_evidence:{format:"uint",minimum:0,type:"integer"},max_model_input_tokens:{format:"uint",minimum:0,type:"integer"},max_model_output_tokens:{format:"uint",minimum:0,type:"integer"},max_text_bytes:{format:"uint",minimum:0,type:"integer"}},required:["max_candidates","max_evidence","max_text_bytes","max_model_input_tokens","max_model_output_tokens"],type:"object"},h5={enum:["disabled","codex_app_server","unsupported","decision_engine"],type:"string"},h8={oneOf:[{enum:["not_requested","succeeded","disabled","unavailable","denied","disconnected","cancelled","deadline_exceeded","token_budget_exceeded","invalid_output"],type:"string"},{const:"backpressured",description:"The engine's concurrency bound was full; the request was not sent.",type:"string"}]},h7={additionalProperties:!1,properties:{actual_model:{type:["string","null"]},actual_provider:{type:["string","null"]},estimated_cost_microusd:{format:"uint64",minimum:0,type:["integer","null"]},input_tokens:{format:"uint64",minimum:0,type:["integer","null"]},output_tokens:{format:"uint64",minimum:0,type:["integer","null"]},requested_backend:{$ref:"#/$defs/ContextScoutModelBackendV1"}},required:["requested_backend"],type:"object"},ye={additionalProperties:!1,properties:{feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackV1"},{type:"null"}]},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"},suggestion:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"}},required:["suggestion","receipt"],type:"object"},yt={oneOf:[{enum:["deterministic","model_assisted","deterministic_fallback"],type:"string"},{const:"decision_engine",description:"Produced by the session intent pass: decision-engine answers combined\nwith deterministic action facts.",type:"string"}]},yr={enum:["deterministic","configured_model"],type:"string"},yi={enum:["active","paused","disabled"],type:"string"},yo={additionalProperties:!1,description:"Exact bounded span of one session's transcript an intent pass read. The\nwindow body is never retained; only its digest and store-id bounds are.",properties:{first_store_id:{format:"int64",type:"integer"},last_store_id:{format:"int64",type:"integer"},message_count:{format:"uint16",maximum:65535,minimum:0,type:"integer"},newest_timestamp:{format:"int64",type:["integer","null"]},window_digest:{$ref:"#/$defs/ManifestDigest"}},required:["first_store_id","last_store_id","message_count","window_digest"],type:"object"},yn={additionalProperties:!1,description:"Canonical Context Scout control-plane value. Disabled is the only stock\nstate; deterministic or configured-model execution requires an explicit\nconfiguration revision.",properties:{intent:{anyOf:[{$ref:"#/$defs/ContextScoutIntentSettingsV1"},{type:"null"}],description:"Session intent pass. Absent means the Scout runs no intent pass; the\nfield is omitted from the canonical encoding so settings written before\nit existed keep their behavior digest."},limits:{$ref:"#/$defs/ContextScoutConfigurationLimitsV1"},mode:{$ref:"#/$defs/ContextScoutConfigurationModeV1"},model_id:{type:["string","null"]},model_path:{anyOf:[{$ref:"#/$defs/ContextScoutConfiguredModelPathV1"},{type:"null"}]},model_timeout_secs:{format:"uint64",minimum:0,type:["integer","null"]},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"},state:{$ref:"#/$defs/ContextScoutConfigurationStateV1"}},required:["schema_version","state","mode","limits"],type:"object"},ya={enum:["stored","duplicate","superseded"],type:"string"},ys={additionalProperties:!1,properties:{category:{$ref:"#/$defs/ContextScoutCategoryV1"},configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},dedupe_key:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},delivery_window:{$ref:"#/$defs/ContextScoutDeliveryWindowV1"},envelope_id:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:16,minItems:16,type:"array"},evidence:{$ref:"#/$defs/ContextScoutEvidenceProjectionV1"},expires_at:{$ref:"#/$defs/UtcMicros"},model_outcome:{$ref:"#/$defs/ContextScoutModelOutcomeV1"},model_receipt:{anyOf:[{$ref:"#/$defs/ContextScoutModelReceiptV1"},{type:"null"}]},relevance_score:{format:"uint16",maximum:65535,minimum:0,type:"integer"},route:{$ref:"#/$defs/ContextScoutRouteV1"},suggestion_text:{type:"string"},work:{$ref:"#/$defs/ContextScoutWorkV1"}},required:["work","envelope_id","configuration_revision","delivery_window","route","model_outcome","dedupe_key","category","relevance_score","suggestion_text","evidence","expires_at"],type:"object"},yd={oneOf:[{enum:["disabled","paused","dirty_overlay","quiet_or_unreceptive","no_eligible_candidate","expired","duplicate","cancelled","model_output_invalid","evidence_partial","evidence_stale","evidence_unavailable"],type:"string"},{const:"pending_sibling",description:"A suggestion for the same session is already pending delivery.",type:"string"}]},yc={additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},generation:{format:"uint64",minimum:0,type:"integer"},input_watermark:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"}},required:["address","generation","input_watermark"],type:"object"},yl={properties:{authorized_scope_ref:{type:"string"},current:{type:"boolean"},estimated_cost:{items:{$ref:"#/$defs/MetricValueV1"},type:"array"},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},latency:{description:"Provider-backed operation latency, projected from the same retained\nPlan 26 operation-resource events as Observatory. Each entry keeps\nprovider/model identity explicit; `None` is a real uncorrelated state,\nnever a client-side guess.",items:{$ref:"#/$defs/ProviderLatencyReadModelV1"},type:"array"},observed_at_micros:{format:"int64",type:"integer"},pricing_revision:{type:["string","null"]},usage:{items:{$ref:"#/$defs/MetricValueV1"},type:"array"},watermark:{type:"string"}},required:["authorized_scope_ref","horizon","watermark","observed_at_micros","current","usage","estimated_cost","latency"],type:"object"},yp={description:"Which side of a file dependency the coupling report counts.",enum:["fan_in","fan_out"],type:"string"},yu={description:"Completeness is explicit; unknown never renders as clean.",enum:["complete","partial","unknown"],type:"string"},ym={additionalProperties:!1,properties:{completeness:{$ref:"#/$defs/CoverageCompleteness"},domain:{$ref:"#/$defs/EvidenceDomain"}},required:["domain","completeness"],type:"object"},yf={enum:["known","partial","stale","unknown","sampled","capped"],type:"string"},yh={description:"Strongly typed canonical identity: `CredentialReferenceId`.",type:"string"},yy={enum:["disabled","manual_receipt_only","fast_forward_only","merge_commit","cherry_pick_exact_commits"],type:"string"},yg={additionalProperties:!1,properties:{allow_cross_repository:{type:"boolean"},allowed_modes:{items:{$ref:"#/$defs/CrossMergeModeV1"},type:"array",uniqueItems:!0},default_mode:{$ref:"#/$defs/CrossMergeModeV1"}},required:["allowed_modes","default_mode","allow_cross_repository"],type:"object"},y_={description:"The managed daemon service unit as a client observed it, from the unit\nfile alone.",oneOf:[{additionalProperties:!1,properties:{state:{const:"not_installed",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The unit file could not be read.",properties:{error:{type:"string"},state:{const:"unobservable",type:"string"}},required:["state","error"],type:"object"},{additionalProperties:!1,description:"The unit file at `path` serves the socket `serves`.",properties:{path:{type:"string"},serves:{type:"string"},state:{const:"installed",type:"string"}},required:["state","path","serves"],type:"object"}]},yv={additionalProperties:!1,description:"One immutable deadline supplied by the caller or upstream admission layer.",properties:{expires_at:{$ref:"#/$defs/UtcMicros"}},required:["expires_at"],type:"object"},yb={additionalProperties:!1,description:"The decision engine the intent pass asks. There is no default endpoint or\nmodel; both come only from explicit operator configuration.",properties:{base_url:{type:"string"},max_concurrent:{format:"uint8",maximum:255,minimum:0,type:"integer"},max_state_bytes:{format:"uint32",minimum:0,type:"integer"},model:{type:["string","null"]},timeout_ms:{format:"uint32",minimum:0,type:"integer"}},required:["base_url","timeout_ms","max_concurrent","max_state_bytes"],type:"object"},y$={description:"Diagnostic severity. Source severity is preserved exactly; TraceDecay\nnever raises severity because several producers agree.",enum:["error","warning","information","hint"],type:"string"},yS={additionalProperties:!1,description:"One tsconfig location the diagnostics owner search checked.",properties:{path:{description:"Relative to the project root, forward-slash separated.",type:"string"},present:{description:"The config exists, but neither it nor its references include the\nfile.",type:"boolean"}},required:["path","present"],type:"object"},yk={description:"Whether Doctor observed all of a family's evidence sources.",oneOf:[{const:"complete",description:"Every relevant evidence source for the family was observed.",type:"string"},{const:"partial",description:"Some evidence sources were observed; others were omitted.",type:"string"},{const:"unknown",description:"Whether coverage is complete could not be determined.",type:"string"}]},yw={description:"Shape of the design-structure-matrix report.",enum:["stats","clusters","matrix"],type:"string"},yP={enum:["prevented","committed","unknown","not_applicable"],type:"string"},yV={enum:["exact_duplicate","superseded_overlap","repeated_investigation","duplicate_effect","not_duplicate","censored","unknown"],type:"string"},yR={description:"The stable effect classification of one application operation.\n\nGit index writes remain separate classes so policy cannot accidentally\nsubstitute one index mutation for another.",oneOf:[{enum:["read","preview","source_edit","git_index_stage","git_index_unstage","configuration_write","administrative"],type:"string"},{const:"spawns_process",description:"Runs a child process in the project (e.g. the project's test runner).",type:"string"},{const:"binds_server",description:"Binds a listening server in the daemon process.",type:"string"},{const:"schedules_work",description:"Queues work on a daemon-owned scheduler; the call answers with the\nscheduler's admission, not the finished work.",type:"string"},{const:"maintains_owner_state",description:"Maintains bookkeeping the daemon keeps for the project or profile it\nserves: resets a usage counter, records registry token accounting, or\nreconciles automation schedulers with the saved configuration. Each\nwrite settles within the call and answers its new state.",type:"string"},{const:"maintains_profile_state",description:"Reads and rewrites the daemon profile's own state: its project\nregistry, accounting ledgers, and session stores. Unlike bookkeeping,\nit includes long work, a registry collection or a transcript import,\nthat a cancelled call stops.",type:"string"},{const:"records_host_evidence",description:"Records a host's session evidence (transcripts, hook admissions,\nreceipts) in daemon-owned session stores.",type:"string"}]},yq={additionalProperties:!1,description:"Durable effect proof. It records identities and receipts, never credentials\nor arbitrary command text.",properties:{actor:{$ref:"#/$defs/ActorId"},catalog_digest:{$ref:"#/$defs/ManifestDigest"},committed_state:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},configuration_digest:{$ref:"#/$defs/ManifestDigest"},effect_class:{$ref:"#/$defs/EffectClass"},expected_state:{$ref:"#/$defs/ManifestDigest"},external_proof:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},idempotency_key:{type:"string"},input_digest:{$ref:"#/$defs/ManifestDigest"},operation:{$ref:"#/$defs/UseCaseId"},outcome:{$ref:"#/$defs/EffectTermination"},policy_digest:{$ref:"#/$defs/ManifestDigest"},privacy_digest:{$ref:"#/$defs/ManifestDigest"},request_id:{type:"string"},scope:{$ref:"#/$defs/ResolvedScope"}},required:["operation","request_id","actor","scope","effect_class","idempotency_key","input_digest","expected_state","policy_digest","configuration_digest","catalog_digest","privacy_digest","outcome"],type:"object"},yI={description:"Durable effect receipt terminal state.",enum:["completed","cancelled","timed_out","failed","partial","effect_unknown"],type:"string"},yx={additionalProperties:!1,description:"Deterministic coverage fold input for an evidence packet.",properties:{completeness:{$ref:"#/$defs/CoverageCompleteness"},domains:{items:{$ref:"#/$defs/CoverageDomainState"},type:"array"},eligible:{format:"uint64",minimum:0,type:["integer","null"]},requested_domains:{items:{$ref:"#/$defs/EvidenceDomain"},type:"array"},returned:{format:"uint64",minimum:0,type:"integer"},visited:{format:"uint64",minimum:0,type:["integer","null"]}},required:["requested_domains","returned","completeness","domains"],type:"object"},yj={description:"Requested evidence domain for bounded coverage and omissions.",enum:["symbol","source","graph","test","temporal","anchor","operational","diagnostic"],type:"string"},yC={description:"Evidence role used by dedupe/diversity caps. Independent corroboration\nand contradictions are preserved.",enum:["primary","corroboration","contradiction","context"],type:"string"},yT={description:"The exact tiers, lexicographically ordered above all approximate\ncandidates. Fusion derives this only from a validated [`ExactAdmissionProof`].",enum:["exact_message","exact_literal_phrase","approximate"],type:"string"},yO={description:"The classification of one whole exact technical term. Whole exact terms\nand language-profiled subtokens are distinct fields.",enum:["whole_symbol","qualified_name","path","compiler_error_code","compiler_error_text","runtime_error_code","runtime_error_text","cli_flag","tool_name","configuration_key","commit_identifier"],type:"string"},yE={description:"Strongly typed canonical identity: `FactAssertionId`.",type:"string"},yA={enum:["general","user_pref","project","tool","decision","code_area"],type:"string"},yW={enum:["committed","idempotent_replay"],type:"string"},yM={oneOf:[{additionalProperties:!1,properties:{kind:{const:"profile",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"project",type:"string"},project_id:{$ref:"#/$defs/ProjectId"}},required:["kind","project_id"],type:"object"}]},yN={additionalProperties:!1,properties:{active_assertion_id:{anyOf:[{$ref:"#/$defs/FactAssertionId"},{type:"null"}]},committed_event_ids:{items:{$ref:"#/$defs/FactEventId"},type:"array"},disposition:{$ref:"#/$defs/FactCommitDispositionV1"},fact_id:{$ref:"#/$defs/FactId"},last_event_id:{$ref:"#/$defs/FactEventId"},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["disposition","fact_id","owner","committed_event_ids","last_event_id"],type:"object"},yz={description:"Strongly typed canonical identity: `FactEventId`.",type:"string"},yD={enum:["helpful","unhelpful"],type:"string"},yF={description:"Strongly typed canonical identity: `FactId`.",type:"string"},yL={oneOf:[{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},kind:{const:"evidence",type:"string"},stable_key:{$ref:"#/$defs/LocatorDigest"}},required:["kind","anchor_id","stable_key"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"application",type:"string"},operation_id:{$ref:"#/$defs/ProvenanceId"}},required:["kind","operation_id"],type:"object"}]},yU={description:"Payload states that structurally cannot expose an available fact payload.",enum:["redacted","quarantined","retention_expired","deleted","unavailable","ambiguous"],type:"string"},yH={oneOf:[{additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},kind:{const:"available",type:"string"}},required:["kind","fact"],type:"object"},{additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},kind:{const:"superseded",type:"string"},superseded_by:{$ref:"#/$defs/FactId"}},required:["kind","fact","superseded_by"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"unavailable",type:"string"},status:{$ref:"#/$defs/FactStatusV1"}},required:["kind","status"],type:"object"}]},yG={oneOf:[{additionalProperties:!1,properties:{kind:{const:"not_applicable",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"not_mounted",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{expanded_fact_count:{format:"uint",minimum:0,type:"integer"},kind:{const:"complete",type:"string"},relation_count:{format:"uint",minimum:0,type:"integer"},root_count:{format:"uint",minimum:0,type:"integer"}},required:["kind","root_count","relation_count","expanded_fact_count"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"degraded",type:"string"},reason:{$ref:"#/$defs/FactSearchGraphDegradationV1"}},required:["kind","reason"],type:"object"}]},yB={enum:["conflict","unavailable","budget_exhausted","deadline_exceeded"],type:"string"},yK={additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},scores:{$ref:"#/$defs/FactSearchScoresV1"},why:{type:["string","null"]}},required:["fact","scores"],type:"object"},yJ={additionalProperties:!1,properties:{fts_score_millionths:{format:"uint32",minimum:0,type:"integer"},holographic_score_millionths:{format:"uint32",minimum:0,type:"integer"},jaccard_score_millionths:{format:"uint32",minimum:0,type:"integer"},score_millionths:{format:"uint32",minimum:0,type:"integer"},trust_score_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["score_millionths","fts_score_millionths","jaccard_score_millionths","holographic_score_millionths","trust_score_millionths"],type:"object"},yZ={additionalProperties:!1,properties:{fact_id:{$ref:"#/$defs/FactId"},owner:{$ref:"#/$defs/FactCommitOwnerV1"},payload_access:{$ref:"#/$defs/FactPayloadAccessV1"},projected_as_of:{$ref:"#/$defs/UtcMicros"}},required:["owner","fact_id","payload_access","projected_as_of"],type:"object"},yQ={additionalProperties:!1,properties:{access_count:{format:"uint64",minimum:0,type:"integer"},created_at:{$ref:"#/$defs/UtcMicros"},helpful_count:{format:"uint64",minimum:0,type:"integer"},last_feedback_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},last_recalled_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},last_retrieved_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},retrieval_count:{format:"uint64",minimum:0,type:"integer"},unhelpful_count:{format:"uint64",minimum:0,type:"integer"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["retrieval_count","access_count","helpful_count","unhelpful_count","created_at","updated_at"],type:"object"},yX={additionalProperties:!1,description:"Available fact projection. Unavailable payload states use\n[`FactProjectionV1::Unavailable`] and cannot fabricate payload fields.",properties:{active_assertion_id:{$ref:"#/$defs/FactAssertionId"},category:{$ref:"#/$defs/FactCategoryV1"},content:{type:"string"},entities:{items:{type:"string"},type:"array"},fact_id:{$ref:"#/$defs/FactId"},last_event_id:{$ref:"#/$defs/FactEventId"},metadata:{additionalProperties:!0,type:"object"},owner:{$ref:"#/$defs/FactCommitOwnerV1"},projected_as_of:{$ref:"#/$defs/UtcMicros"},source:{$ref:"#/$defs/FactIdentitySourceResultV1"},source_label:{type:["string","null"]},tags:{items:{type:"string"},type:"array"},telemetry:{$ref:"#/$defs/FactTelemetryV1"},trust_score_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["owner","fact_id","content","category","tags","entities","trust_score_millionths","source","active_assertion_id","last_event_id","projected_as_of","telemetry","metadata"],type:"object"},yY={additionalProperties:!1,description:"Exact source-owned state for one advisory producer in a composed feedback\ncycle. The producer tag is part of the durable cycle result so consumers\nnever infer provenance from the position of an aggregate provider state.",properties:{producer:{$ref:"#/$defs/FeedbackDiagnosticProducerV1"},state:{$ref:"#/$defs/ProviderEvaluationStateV1"}},required:["producer","state"],type:"object"},y1={description:"Availability of the canonical baseline used to classify a current\ndiagnostic. An unavailable or partial baseline never upgrades a finding\nto `New`; only an authoritative `NoPriorBaseline` state may do so without\na baseline record.",oneOf:[{enum:["complete","partial","stale","unavailable"],type:"string"},{const:"no_prior_baseline",description:"The authoritative runtime confirmed that there is no prior saved\ngeneration to compare. This is authoritative empty history, not an\ninvented horizon and not unavailable/partial coverage.",type:"string"}]},y0={description:"Content identity distinguishes durable saved content from an authorized\nephemeral document overlay. Overlay identity is deliberately local to its\nowning session and cannot be made durable by converting it to a digest.",oneOf:[{properties:{file_digest:{$ref:"#/$defs/ManifestDigest"},generation_digest:{$ref:"#/$defs/ManifestDigest"},kind:{const:"saved_content",type:"string"}},required:["kind","generation_digest","file_digest"],type:"object"},{properties:{agent_id:{anyOf:[{$ref:"#/$defs/AgentInstanceId"},{type:"null"}]},document_version:{format:"uint64",minimum:0,type:"integer"},kind:{const:"ephemeral_overlay",type:"string"},overlay_digest:{$ref:"#/$defs/ManifestDigest"},owner_client_id:{$ref:"#/$defs/HostInstanceId"},session_id:{$ref:"#/$defs/SessionId"}},required:["kind","session_id","owner_client_id","document_version","overlay_digest"],type:"object"}]},y2={description:"Strongly typed canonical identity: `FeedbackCycleId`.",type:"string"},y4={enum:["clean","duplicate_noop","blocked","incomplete_coverage","stale_replan_required","budget_exceeded","cancelled","user_stop","daemon_unavailable"],type:"string"},y6={enum:["new","pre_existing","unknown"],type:"string"},y3={description:"Closed producer vocabulary for standard diagnostic projection.",enum:["code_diagnostic","git_hub_review","ci_localization","proximity"],type:"string"},y9={additionalProperties:!1,description:"Bounded code location used only to project an anchored advisory finding\ninto an editor. The finding's `retrieval_anchor_id` remains the evidence\nexpansion authority; this value carries no source body or provider payload.",properties:{code:{type:"string"},code_description_uri:{type:["string","null"]},file:{$ref:"#/$defs/FileOccurrenceId"},producer:{$ref:"#/$defs/FeedbackDiagnosticProducerV1"},safe_bounded_message:{type:"string"},severity:{$ref:"#/$defs/DiagnosticSeverityV1"},span:{$ref:"#/$defs/SourceSpan"},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["file","span","code","severity","safe_bounded_message","producer"],type:"object"},y5={enum:["durable","session_only"],type:"string"},y8={description:"Strongly typed canonical identity: `FeedbackFindingId`.",type:"string"},y7={enum:["active","superseded","resolved","cleared"],type:"string"},ge={additionalProperties:!1,properties:{cycle_id:{$ref:"#/$defs/FeedbackCycleId"},expand_handle:{description:"Server-minted request handle for `feedback_expand`, present only when\nthe canonical finding has a retained retrieval anchor.",type:["string","null"]},finding:{$ref:"#/$defs/FeedbackFindingV1"},get_handle:{description:"Server-minted request handle for `feedback_get`; durable identity remains\n`finding.finding_id`.\n\nCursor identity types are deliberately absent from the generated schema\nsurface; the public wire form is the bounded opaque string.",type:"string"},result_id:{$ref:"#/$defs/FeedbackResultId"},scope:{$ref:"#/$defs/FeedbackScopeV1"}},required:["result_id","cycle_id","scope","finding","get_handle"],type:"object"},gt={additionalProperties:!1,description:"Reference-only post-edit feedback finding. The safe preview is bounded display framing,\nnever a source-text copy or a second diagnostic store.",properties:{classification:{$ref:"#/$defs/FeedbackDiagnosticClassificationV1"},diagnostic_projection:{anyOf:[{$ref:"#/$defs/FeedbackDiagnosticProjectionV1"},{type:"null"}]},finding_id:{$ref:"#/$defs/FeedbackFindingId"},lifecycle:{$ref:"#/$defs/FeedbackFindingLifecycleV1"},provider_state:{$ref:"#/$defs/ProviderEvaluationStateV1"},retrieval_anchor_id:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},safe_bounded_preview:{type:["string","null"]}},required:["finding_id","classification","lifecycle","provider_state"],type:"object"},gr={description:"Coverage state for graph impact and affected-test evidence. An empty impact\nset is clean only when its state is complete.",enum:["complete","partial","stale","unavailable"],type:"string"},gi={additionalProperties:!1,description:"Reference-only graph and test impact for one feedback target. The owning\ngraph/query layer supplies these identities; this contract does not create\nanother graph, test map, or evidence store.",properties:{affected_callers:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},affected_files:{items:{$ref:"#/$defs/FileOccurrenceId"},type:"array"},affected_tests:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},affected_tests_state:{$ref:"#/$defs/FeedbackImpactStateV1"},evidence_anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},state:{$ref:"#/$defs/FeedbackImpactStateV1"},target:{$ref:"#/$defs/FeedbackTargetV1"}},required:["target","affected_files","affected_callers","affected_tests","evidence_anchors","state","affected_tests_state"],type:"object"},go={description:"Strongly typed canonical identity: `FeedbackResultId`.",type:"string"},gn={additionalProperties:!1,description:"Exact repository scope used for a feedback evaluation. A path, current\nworking directory, repository display name, or mutable branch label is not\na substitute for this identity.",properties:{branch_ref:{type:"string"},head_commit_id:{$ref:"#/$defs/CommitId"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","branch_ref","head_commit_id"],type:"object"},ga={additionalProperties:!1,description:"Exact changed-code address for one single-root feedback evaluation. The\naddress carries canonical file/range/symbol identities, never a path or\nmutable line number.",properties:{file:{$ref:"#/$defs/FileOccurrenceId"},generation_id:{anyOf:[{$ref:"#/$defs/CodeGenerationId"},{type:"null"}]},span:{anyOf:[{$ref:"#/$defs/SourceSpan"},{type:"null"}]},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["file"],type:"object"},gs={description:"Strongly typed canonical identity: `FileOccurrenceId`.",type:"string"},gd={description:"How `tracedecay_files` lays out its listing.",oneOf:[{const:"flat",description:"One file per line.",type:"string"},{const:"grouped",description:"Grouped by directory.",type:"string"}]},gc={description:"Deterministic fixed-point score in millionths. No floating point crosses\nthis boundary.",format:"uint64",minimum:0,type:"integer"},gl={description:"Compatibility state of one source/projection pair.",enum:["current","stale","incompatible","missing","unknown"],type:"string"},gp={additionalProperties:!1,description:"A candidate after contribution grouping and fixed-point fusion.",properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},contributions:{items:{$ref:"#/$defs/CandidateContribution"},type:"array"},decisions:{items:{$ref:"#/$defs/RankingDecision"},type:"array"},exact_class:{$ref:"#/$defs/ExactClass"},freshness:{items:{$ref:"#/$defs/SourceFreshness"},type:"array"},logical_evidence_id:{$ref:"#/$defs/LogicalEvidenceId"},occurrences:{items:{$ref:"#/$defs/OccurrenceProvenance"},type:"array"},source_role:{$ref:"#/$defs/RetrievalSourceRoleV1",description:"Strongest source role across the fused occurrences."},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","logical_evidence_id","occurrences","exact_class","source_role","utility_micros","contributions","freshness","decisions"],type:"object"},gu={description:"Metric whose distribution the Gini report measures.",enum:["complexity","lines","fan_in","fan_out","members"],type:"string"},gm={description:"Unit the Gini report aggregates its metric over.",enum:["file","symbol"],type:"string"},gf={description:"Expected blob identity, or explicit absent-file state.",oneOf:[{enum:["absent_file"],type:"string"},{additionalProperties:!1,properties:{present:{$ref:"#/$defs/GitOidV1"}},required:["present"],type:"object"}]},gh={description:"Native change kind for one side (index or worktree) of a status entry,\nor for a whole-file diff record.",enum:["unmodified","modified","added","deleted","renamed","copied","type_changed","unmerged"],type:"string"},gy={additionalProperties:!1,description:"A symbol the exact base/head branch-generation comparison reports.",properties:{content_digest:{type:"string"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},name:{type:"string"},qualified_name:{type:"string"}},required:["id","name","qualified_name","kind","file","content_digest"],type:"object"},gg={oneOf:[{additionalProperties:!1,description:"Caller-selected files: symbols may be unchanged or not yet edited.",properties:{kind:{const:"proposed_files",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{base:{$ref:"#/$defs/GitOidV1"},head:{$ref:"#/$defs/GitOidV1"},kind:{const:"commit_range",type:"string"}},required:["kind","base","head"],type:"object"},{additionalProperties:!1,description:"Pinned HEAD (or empty tree) to the selected immutable index blobs.",properties:{head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},kind:{const:"staged",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,description:"Selected index blobs to captured working-tree bytes.",properties:{kind:{const:"working_tree",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,description:"Net change from pinned HEAD (or empty tree), including untracked files.",properties:{head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},kind:{const:"head_to_worktree",type:"string"}},required:["kind"],type:"object"}]},g_={additionalProperties:!1,description:"A verified-graph symbol a git-context read reports.",properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line"],type:"object"},gv={additionalProperties:!1,description:"Typed coverage of a read-only Git result: the sorted, de-duplicated set\nof degradations observed while capturing it.",properties:{degradations:{items:{$ref:"#/$defs/GitDegradationV1"},type:"array"}},required:["degradations"],type:"object"},gb={description:"Typed coverage/degradation reasons for a read-only Git result. A result\ncarrying any degradation is truthful but not complete; callers must not\ntreat it as a clean full view.",oneOf:[{enum:["detached_head","unborn_branch","sparse_checkout","split_index","unreadable_state","unsupported_object_format","in_progress_operation","shallow_boundary","truncated_output"],type:"string"},{const:"ignored_collision",description:"Ignored content shares a directory with live tracked/untracked\nentries, so the untracked/ignored view may be collapsed by Git.",type:"string"},{const:"conflicted_state",description:"Unmerged index stages are present.",type:"string"},{const:"submodule_state",description:"Submodule entries exist; the adapter does not recurse into them.",type:"string"}]},g$={description:"A native Git file mode as stored in tree/index records (six octal digits,\ne.g. `100644`, `100755`, `120000` symlink, `160000` gitlink/submodule).",type:"string"},gS={description:"A changed file's semantic role.",enum:["config","docs","source","test"],type:"string"},gk={description:"Native HEAD state. Missing, unborn, and detached states are explicit,\nnever guessed.",oneOf:[{properties:{branch:{type:"string"},commit:{$ref:"#/$defs/GitOidV1"},state:{const:"attached",type:"string"}},required:["state","branch","commit"],type:"object"},{properties:{commit:{$ref:"#/$defs/GitOidV1"},state:{const:"detached",type:"string"}},required:["state","commit"],type:"object"},{properties:{branch:{type:"string"},state:{const:"unborn",type:"string"}},required:["state","branch"],type:"object"}]},gw={enum:["disabled","probe_private_preview"],type:"string"},gP={additionalProperties:!1,description:"Expected index entry state for compare-and-swap: blob identity (or\nabsent), mode, and unmerged-stage state. `unmerged_stage` is `None` for a\nmerged (stage-0) entry.",properties:{blob:{$ref:"#/$defs/GitBlobExpectationV1"},mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},unmerged_stage:{format:"uint8",maximum:255,minimum:0,type:["integer","null"]}},required:["blob"],type:"object"},gV={description:"Strongly typed canonical identity: `GitIndexPreviewId`.",type:"string"},gR={description:"The only native Git mutations represented by the index-transaction runtime. Generic Git execution,\nref rewrites, commits, merge/rebase/cherry-pick, push, and worktree writes are\ndeliberately absent.",enum:["stage_hunks","unstage_hunks"],type:"string"},gq={description:"A native Git object id (commit, tree, or blob), lowercase hex, SHA-1 or\nSHA-256 length. This is identity evidence only; it never authorizes\nobject reconstruction or traversal outside native Git.",type:"string"},gI={description:"In-progress native Git operation state, read from repository metadata.",enum:["none","merge","rebase","cherry_pick","revert","bisect","sequencer","unknown"],type:"string"},gx={description:"Whether a bounded page holds every answer or stopped at its limit.",enum:["complete","partial"],type:"string"},gj={enum:["complete"],type:"string"},gC={enum:["partial"],type:"string"},gT={enum:["unavailable"],type:"string"},gO={enum:["result_limit"],type:"string"},gE={additionalProperties:!1,properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},worktree:{type:["string","null"]}},type:"object"},gA={description:"Flat public selector for an admitted Git diff scope.\n\nThis intentionally differs from [`tracedecay_domain::GitDiffScopeV1`]: MCP\nand CLI accept `scope`, `base`, and `head` as sibling fields, then\ntransport parsing builds the canonical domain scope after checking their\nlegal combinations.",enum:["working_tree","staged","commit_range"],type:"string"},gW={enum:["git"],type:"string"},gM={additionalProperties:!1,properties:{kind:{$ref:"#/$defs/GitToolErrorKindV1"},message:{type:"string"},operation:{$ref:"#/$defs/GitToolOperationV1"}},required:["kind","operation","message"],type:"object"},gN={additionalProperties:!1,description:"Git itself refused the refs, worktree status, or history the tool reads.",properties:{error:{$ref:"#/$defs/GitToolErrorV1"}},required:["error"],type:"object"},gz={description:"The git step that refused the read.",enum:["diff","status","log"],type:"string"},gD={additionalProperties:!1,properties:{binding_digest:{$ref:"#/$defs/ManifestDigest"},consumed_at:{$ref:"#/$defs/UtcMicros"},input_digest:{$ref:"#/$defs/ManifestDigest"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},request_id:{type:"string"},token_digest:{$ref:"#/$defs/ManifestDigest"}},required:["binding_digest","token_digest","request_id","input_digest","consumed_at","receipt_digest"],type:"object"},gF={enum:["forbid_force_and_rebase"],type:"string"},gL={description:"Strongly typed canonical identity: `HostInstanceId`.",type:"string"},gU={description:"`HunkRef` operation direction: working tree to index, or index to\nHEAD/base. No other direction is encodable.",enum:["working_tree_to_index","index_to_head"],type:"string"},gH={additionalProperties:!1,description:"Immutable hunk identity for compare-and-swap. A hunk is identified by exact repository,\ndirection, path, expected base/index/worktree identity, normalized hunk\nheader, context and patch digests, and the preview that issued the\nreference, never by display ordinal or line number alone.\n\nquery mints these as read-only identity evidence only. Applying them is a\ndaemon Git mutation path and is not representable here.",properties:{attributes_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Attributes/filter identity relevant to clean/smudge and EOL handling."},context_digest:{$ref:"#/$defs/ManifestDigest"},direction:{$ref:"#/$defs/HunkDirectionV1"},expected_base_blob:{$ref:"#/$defs/GitBlobExpectationV1"},expected_index_entry:{$ref:"#/$defs/GitIndexEntryExpectationV1"},expected_worktree_blob:{anyOf:[{$ref:"#/$defs/GitBlobExpectationV1"},{type:"null"}],description:"Expected working-tree identity when the operation reads the worktree:\na native content digest or explicit absent-file state. `None` means\nthe operation direction does not read the worktree."},expected_worktree_mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},hunk_header:{description:"Normalized `@@ -o,l +n,m @@` header text.",type:"string"},original_path:{description:"Old path for a rename or copy.",type:["string","null"]},patch_digest:{$ref:"#/$defs/ManifestDigest"},path:{type:"string"},preview_id:{type:"string"},repository:{$ref:"#/$defs/RepositoryId"},schema_version:{type:"string"},selected_line_bitmap:{description:"Selected hunk-line bitmap (little-endian word order, line 1 = bit 0\nof word 0). Full-hunk identity covers the larger old/new side so\ndeletion-only hunks remain representable.",items:{format:"uint64",minimum:0,type:"integer"},type:"array"},snapshot_digest:{$ref:"#/$defs/ManifestDigest"},worktree:{$ref:"#/$defs/WorktreeId"}},required:["repository","worktree","direction","path","expected_base_blob","expected_index_entry","hunk_header","context_digest","patch_digest","selected_line_bitmap","preview_id","schema_version","snapshot_digest"],type:"object"},gG={enum:["available","retained_but_unavailable","redacted","deleted","retention_expired","unauthorized","locked","unverifiable"],type:"string"},gB={additionalProperties:!1,description:"One yes/no question asked of the decision engine for one intent. The\nintent is a candidate when the engine's probability reaches\n`threshold_permille` and, when set, exceeds the runner-up by\n`margin_permille`.",properties:{instructions:{type:"string"},intent:{$ref:"#/$defs/ContextScoutIntentKindV1"},margin_permille:{format:"uint16",maximum:65535,minimum:0,type:["integer","null"]},threshold_permille:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["intent","instructions","threshold_permille"],type:"object"},gK={additionalProperties:!1,description:"Bounds on the recent-session window one intent pass reads.",properties:{freshen_budget_ms:{description:"Time the pass may wait for the transcript store to ingest the newest\nturn before it reads the window as it stands.",format:"uint32",minimum:0,type:"integer"},max_age_secs:{format:"uint32",minimum:0,type:"integer"},max_bytes:{format:"uint32",minimum:0,type:"integer"},max_messages:{format:"uint8",maximum:255,minimum:0,type:"integer"},max_user_turns:{format:"uint8",maximum:255,minimum:0,type:"integer"}},required:["max_user_turns","max_messages","max_bytes","max_age_secs","freshen_budget_ms"],type:"object"},gJ={description:"p50/p95/p99 for one provider operation latency stage.",properties:{p50:{$ref:"#/$defs/MetricValueV1"},p95:{$ref:"#/$defs/MetricValueV1"},p99:{$ref:"#/$defs/MetricValueV1"}},required:["p50","p95","p99"],type:"object"},gZ={oneOf:[{properties:{state:{const:"ready",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"cancelled",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"timed_out",type:"string"}},required:["state"],type:"object"},{properties:{reason:{type:"string"},state:{const:"unavailable",type:"string"}},required:["state","reason"],type:"object"},{properties:{diagnostic:{type:"string"},state:{const:"failed",type:"string"}},required:["state","diagnostic"],type:"object"}]},gQ={additionalProperties:!1,properties:{limit:{format:"uint64",minimum:0,type:"integer"},offset:{format:"uint64",minimum:0,type:"integer"},returned_chars:{format:"uint64",minimum:0,type:"integer"},total_chars:{format:"uint64",minimum:0,type:"integer"},truncated:{type:"boolean"}},required:["offset","limit","returned_chars","total_chars","truncated"],type:"object"},gX={description:"Whether historical discovery, projection publication, and summary\nconvergence have all settled for everything the store's sources hold.",oneOf:[{const:"converging",description:"A stage still owes committed work.",type:"string"},{const:"converged",description:"The worker committed the last owed item and has nothing pending.",type:"string"},{const:"blocked",description:"Every runnable stage settled, but historical discovery is blocked.",type:"string"},{const:"unavailable",description:"No worker is serving the store.",type:"string"}]},gY={additionalProperties:!1,properties:{converged_at_unix_micros:{description:"When the latest convergence event was published.",format:"int64",type:["integer","null"]},epoch:{description:"Convergence events this worker has published; a larger value is a\nnewer event.",format:"uint64",minimum:0,type:"integer"},reason:{description:"The historical discovery blocker when `state` is `blocked`.",type:["string","null"]},state:{$ref:"#/$defs/LcmConvergenceStateV1"}},required:["state","epoch"],type:"object"},g1={description:"Whether the refresh worker that serves this store's temporal projection\nis current, still converging history, or not serving at all.",enum:["current","stale","unavailable"],type:"string"},g0={additionalProperties:!1,description:"The temporal projection's serving state at diagnosis time. A store whose\nschema is healthy can still have nothing to serve while history is being\nre-derived (for example on a fresh profile); this is where\nthat state is named instead of being read as absent data.",properties:{convergence:{$ref:"#/$defs/LcmConvergenceV1"},reason:{description:"Machine reason for a non-current state: `historical_convergence`,\n`historical_retry:`, `historical_blocked:`, or the worker\nunavailability (`worker_missing`, `worker_recovering`, `worker_stalled`,\n`worker_stopped`).",type:["string","null"]},state:{$ref:"#/$defs/LcmDoctorProjectionStateV1"},worker:{$ref:"#/$defs/RetrievalWorkerStatusV1"}},required:["state","worker","convergence"],type:"object"},g2={additionalProperties:!1,properties:{content:{type:"string"},content_hash:{type:"string"},message_id:{type:"string"},metadata_json:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},payload_ref:{type:["string","null"]},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:"integer"},timestamp:{format:"int64",type:["integer","null"]}},required:["provider","message_id","session_id","store_id","role","ordinal","content","content_hash","storage_kind"],type:"object"},g4={oneOf:[{properties:{freshness:{$ref:"#/$defs/TemporalFreshnessV1"},outcome:{const:"complete",type:"string"}},required:["outcome","freshness"],type:"object"},{properties:{freshness:{$ref:"#/$defs/TemporalFreshnessV1"},omitted:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"partial",type:"string"}},required:["outcome","freshness","omitted"],type:"object"},{properties:{freshness:{$ref:"#/$defs/TemporalFreshnessV1"},outcome:{const:"stale",type:"string"}},required:["outcome","freshness"],type:"object"}]},g6={oneOf:[{properties:{kind:{const:"raw_message",type:"string"},store_id:{format:"int64",type:"integer"}},required:["kind","store_id"],type:"object"},{properties:{kind:{const:"summary_node",type:"string"},node_id:{type:"string"}},required:["kind","node_id"],type:"object"}]},g3={enum:["inline","external","canonical_occurrence"],type:"string"},g9={description:"One provider's summarizer executable: absent by default, or the exact\nabsolute path the operator configured with its optional tuning.",oneOf:[{properties:{state:{const:"unconfigured",type:"string"}},required:["state"],type:"object"},{properties:{canonical_path:{type:"string"},model:{description:"Model requested for summary turns; the provider default when absent.",type:["string","null"]},state:{const:"configured",type:"string"},timeout_secs:{description:"Wall-clock budget for one summary run, within\n[`LCM_SUMMARIZER_TIMEOUT_SECS_RANGE`]; the caller's default when absent.",format:"uint64",minimum:0,type:["integer","null"]}},required:["state","canonical_path"],type:"object"}]},g5={additionalProperties:!1,description:"The per-provider summarizer executables one configuration snapshot admits.",properties:{codex:{$ref:"#/$defs/LcmSummarizerExecutableV1",default:{state:"unconfigured"},description:"`codex`, driven over app-server JSON-RPC for Codex sessions."},cursor_agent:{$ref:"#/$defs/LcmSummarizerExecutableV1",default:{state:"unconfigured"},description:"`cursor-agent`, asked for a summary of Cursor sessions."}},type:"object"},g8={additionalProperties:!1,properties:{conversation_id:{type:"string"},created_at:{format:"int64",type:"integer"},depth:{format:"int64",type:"integer"},expand_hint:{type:["string","null"]},metadata_json:{type:["string","null"]},node_id:{type:"string"},provider:{type:"string"},session_id:{type:"string"},source_refs:{items:{$ref:"#/$defs/LcmSourceRefV1"},type:"array"},source_time_end:{format:"int64",type:["integer","null"]},source_time_start:{format:"int64",type:["integer","null"]},source_token_count:{format:"int64",type:"integer"},summary_hash:{type:"string"},summary_text:{type:"string"},summary_token_count:{format:"int64",type:"integer"}},required:["node_id","provider","conversation_id","session_id","depth","summary_text","summary_hash","source_refs","summary_token_count","source_token_count","created_at"],type:"object"},g7={additionalProperties:!1,properties:{anchors:{items:{type:"string"},type:"array"},authorized_root:{type:["string","null"]},coverage:{$ref:"#/$defs/TemporalCoverageV1"},explanations:{items:{$ref:"#/$defs/TemporalExplanationV1"},type:"array"},next_cursor:{type:["string","null"]},omissions:{items:{$ref:"#/$defs/TemporalOmissionV1"},type:"array"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},watermarks:{$ref:"#/$defs/TemporalWatermarksV1"}},required:["anchors","watermarks","coverage","explanations"],type:"object"},_e={description:"Why a site the lexical lane admitted for a caller anchor is absent from\nthe response.",oneOf:[{const:"diversity_cap",description:"Collapsed as a duplicate or held back by the per-file diversity cap.",type:"string"},{const:"outside_page",description:"Ranked, but outside the returned page: an earlier page, or behind\n`next_cursor`.",type:"string"},{const:"not_hydrated",description:"On the page, but late hydration returned no source for it.",type:"string"},{const:"out_of_scope",description:"Outside the caller's scope prefix.",type:"string"}]},_t={additionalProperties:!1,description:"Anchor sites one serving stage removed from the response.",properties:{reason:{$ref:"#/$defs/LexicalAnchorDropReasonV1"},sites:{format:"uint64",minimum:0,type:"integer"}},required:["reason","sites"],type:"object"},_r={description:"Strongly typed algorithm-tagged integrity digest: `LocatorDigest`.",type:"string"},_i={description:"Strongly typed canonical identity: `LogicalCopyClusterId`.",type:"string"},_o={description:"Strongly typed canonical identity: `LogicalEvidenceId`.",type:"string"},_n={enum:["global","project"],type:"string"},_a={properties:{absorbed_into:{type:["string","null"]},activated_at:{format:"int64",type:["integer","null"]},archived_reason:{type:["string","null"]},category:{type:"string"},checksum:{type:"string"},created_at:{format:"int64",type:"integer"},id:{type:"string"},materialization_scope:{$ref:"#/$defs/ManagedSkillMaterializationScope"},pinned:{type:"boolean"},provenance:{$ref:"#/$defs/ManagedSkillProvenance"},routing_description:{type:"string"},state:{$ref:"#/$defs/ManagedSkillState"},summary:{type:"string"},targets:{default:["cursor","codex","claude","agents","opencode","kimi","kiro","hermes"],items:{$ref:"#/$defs/SkillInstallTarget"},type:"array"},title:{type:"string"},updated_at:{format:"int64",type:"integer"}},required:["id","title","summary","routing_description","category","state","pinned","checksum","created_at","updated_at","provenance"],type:"object"},_s={properties:{actor:{type:"string"},run_id:{type:["string","null"]},source:{$ref:"#/$defs/ManagedSkillSource"}},required:["source","actor"],type:"object"},_d={enum:["automation_run","user","import"],type:"string"},_c={enum:["active","disabled","archived"],type:"string"},_l={description:"Strongly typed algorithm-tagged integrity digest: `ManifestDigest`.",type:"string"},_p={description:"The only Git histories this product operation can create.",enum:["fast_forward","two_parent_merge","cherry_pick_exact_commits"],type:"string"},_u={enum:["project","user"],type:"string"},_m={enum:["all","parents_only","subagents_only"],type:"string"},_f={enum:["all","direct_user","tool_result"],type:"string"},_h={properties:{calibration_revision:{type:"string"},cohort_revision:{type:"string"},drift_valid:{type:"boolean"},estimator_revision:{type:"string"},support:{format:"uint64",minimum:0,type:"integer"}},required:["estimator_revision","calibration_revision","cohort_revision","support","drift_valid"],type:"object"},_y={properties:{descriptor_revision:{type:"string"},eligible_population:{type:"string"}},required:["descriptor_revision","eligible_population"],type:"object"},_g={properties:{censored:{format:"uint64",minimum:0,type:"integer"},completed:{format:"uint64",minimum:0,type:"integer"},eligible:{description:"Exact denominator cardinality. `None` means the denominator is unknown.",format:"uint64",minimum:0,type:["integer","null"]},excluded:{format:"uint64",minimum:0,type:"integer"},observed:{format:"uint64",minimum:0,type:"integer"},state:{$ref:"#/$defs/CoverageStateV1"},unknown:{format:"uint64",minimum:0,type:"integer"}},required:["observed","completed","censored","unknown","excluded","state"],type:"object"},__={enum:["measurement","association","calibrated_prediction"],type:"string"},_v={properties:{projector_revision:{type:"string"},source:{$ref:"#/$defs/MetricSourceV1"},source_revision:{type:"string"},watermark:{type:"string"}},required:["source","source_revision","projector_revision","watermark"],type:"object"},_b={enum:["observability_envelope","feedback_observations","provider_usage_observation","savings_ledger"],type:"string"},_$={properties:{baseline_watermark:{type:["string","null"]},delta:{format:"double",type:["number","null"]},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"}},required:["horizon"],type:"object"},_S={properties:{lower:{format:"double",type:["number","null"]},reason:{type:["string","null"]},upper:{format:"double",type:["number","null"]}},type:"object"},_k={properties:{calibration:{anyOf:[{$ref:"#/$defs/MetricCalibrationV1"},{type:"null"}]},cohort:{$ref:"#/$defs/MetricCohortV1"},coverage:{$ref:"#/$defs/MetricCoverageV1"},denominator:{type:"string"},denominator_value:{format:"uint64",minimum:0,type:["integer","null"]},descriptor_revision:{type:"string"},evidence_class:{$ref:"#/$defs/MetricEvidenceClassV1"},metric:{type:"string"},provenance:{$ref:"#/$defs/MetricProvenanceV1"},temporal:{$ref:"#/$defs/MetricTemporalV1"},unavailable_reason:{type:["string","null"]},uncertainty:{$ref:"#/$defs/MetricUncertaintyV1"},unit:{type:"string"},value:{description:"Aggregate value. It is absent whenever its denominator or coverage is\ninsufficient; observed lower bounds remain available in `coverage`.",format:"double",type:["number","null"]}},required:["descriptor_revision","metric","unit","denominator","coverage","evidence_class","provenance","cohort","temporal","uncertainty"],type:"object"},_w={additionalProperties:!1,description:"A file that historically changes with `partner_of` but is missing from the\nchange set under review, e.g. a migration beside its schema.",properties:{co_changes:{description:"Commits that changed both `partner_of` and `file`.",format:"uint64",minimum:0,type:"integer"},file:{type:"string"},partner_of:{type:"string"},partner_of_changes:{description:"Commits that changed `partner_of`.",format:"uint64",minimum:0,type:"integer"}},required:["file","partner_of","co_changes","partner_of_changes"],type:"object"},_P={additionalProperties:!1,description:"Frozen continuation identity shared by all participating roots.",properties:{digest:{$ref:"#/$defs/ManifestDigest"},next_page:{format:"uint64",minimum:1,type:"integer"},order_digest:{$ref:"#/$defs/ManifestDigest"},query_digest:{$ref:"#/$defs/ManifestDigest"},root_cursors:{items:{$ref:"#/$defs/RootScopeOutcomeV1_for_Nullable_string"},type:"array"},root_generations:{items:{$ref:"#/$defs/RootScopeOutcomeV1_for_Nullable_RootGenerationV1"},type:"array"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_set_digest","root_generations","root_cursors","query_digest","order_digest","next_page","digest"],type:"object"},_V={description:"Strongly typed canonical identity: `NativeIntegrationApprovalId`.",type:"string"},_R={description:"Explicit direction of one integration. Stack meaning is never inferred.",enum:["propagate_dependency_to_dependent","land_dependent_into_dependency","integrate_independent_branch"],type:"string"},_q={description:"Truthful preview classification. Only `MechanicalIntegrationEligible`\ncarries apply-eligible evidence.",oneOf:[{properties:{detail:{$ref:"#/$defs/MechanicalIntegrationModeV1"},state:{const:"mechanical_integration_eligible",type:"string"}},required:["state","detail"],type:"object"},{properties:{state:{const:"already_integrated",type:"string"}},required:["state"],type:"object"},{properties:{detail:{properties:{conflict_digest:{$ref:"#/$defs/ManifestDigest"}},required:["conflict_digest"],type:"object"},state:{const:"native_conflict",type:"string"}},required:["state","detail"],type:"object"},{properties:{detail:{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"}},required:["evidence_digest"],type:"object"},state:{const:"semantic_review_required",type:"string"}},required:["state","detail"],type:"object"},{properties:{detail:{properties:{reason:{$ref:"#/$defs/NativeIntegrationUnavailabilityV1"}},required:["reason"],type:"object"},state:{const:"partial",type:"string"}},required:["state","detail"],type:"object"},{properties:{detail:{properties:{reason:{$ref:"#/$defs/NativeIntegrationUnavailabilityV1"}},required:["reason"],type:"object"},state:{const:"unavailable",type:"string"}},required:["state","detail"],type:"object"}]},_I={description:"Strongly typed canonical identity: `NativeIntegrationPreviewId`.",type:"string"},_x={additionalProperties:!1,description:"Canonical stack-snapshot proof returned by `stack_snapshot` and consumed\nverbatim by preflight.",properties:{authorized_scope_set_digest:{$ref:"#/$defs/ManifestDigest"},authorized_scope_set_id:{$ref:"#/$defs/ScopeSetId"},authorized_scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},destination:{$ref:"#/$defs/ResolvedScope"},grant_digest:{$ref:"#/$defs/ManifestDigest"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},inventory_snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},policy_digest:{$ref:"#/$defs/ManifestDigest"},selection:{$ref:"#/$defs/NativeIntegrationSelectionBindingV1"},source:{$ref:"#/$defs/ResolvedScope"}},required:["source","destination","authorized_scope_set_id","authorized_scope_set_revision","authorized_scope_set_digest","inventory_snapshot_id","inventory_epoch","selection","grant_digest","policy_digest"],type:"object"},_j={description:"Canonically sealed selection passed to the topology authority.\n\n`stack_snapshot` requests carry declaration content; its boundary seals\nthat declaration into this proof, and preflight accepts the proof verbatim.\nThe topology authority never discovers roots or edges.",oneOf:[{properties:{binding:{properties:{declared_revision:{$ref:"#/$defs/BranchStackRevisionV1"},destination_node_id:{$ref:"#/$defs/StackNodeId"},direction:{$ref:"#/$defs/NativeIntegrationDirectionV1"},revision_digest:{$ref:"#/$defs/ManifestDigest"},revision_id:{$ref:"#/$defs/BranchStackRevisionId"},source_node_id:{$ref:"#/$defs/StackNodeId"},stack_id:{$ref:"#/$defs/BranchStackId"}},required:["stack_id","revision_id","revision_digest","declared_revision","source_node_id","destination_node_id","direction"],type:"object"},kind:{const:"declared_stack_edge",type:"string"}},required:["kind","binding"],type:"object"},{properties:{binding:{properties:{destination_ref:{$ref:"#/$defs/RefId"},proposal_digest:{$ref:"#/$defs/ManifestDigest"},source_ref:{$ref:"#/$defs/RefId"}},required:["proposal_digest","source_ref","destination_ref"],type:"object"},kind:{const:"independent_branch",type:"string"}},required:["kind","binding"],type:"object"}]},_C={description:"The only truthful terminal outcomes after recovery.",enum:["committed","aborted_no_change","rolled_back","needs_inspection"],type:"string"},_T={description:"Strongly typed canonical identity: `NativeIntegrationTransactionId`.",type:"string"},_O={description:"Why a preflight cannot authorize apply.",enum:["partial_evidence","stale_scope","denied","native_state_unavailable","reset_required","durability_uncertain","unsupported_hooks","signing_required","destination_occupied"],type:"string"},_E={description:"A target selected by exact registered identity. Repository inventory names\none repository; cleanup names one worktree within that repository.",oneOf:[{properties:{kind:{const:"repository",type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"}},required:["kind","project_id","repository_id"],type:"object"},{properties:{kind:{const:"worktree",type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["kind","project_id","repository_id","worktree_id"],type:"object"}]},_A={additionalProperties:!1,properties:{body:{format:"uint64",minimum:0,type:"integer"},full_file:{format:"uint64",minimum:0,type:"integer"}},required:["body","full_file"],type:"object"},_W={properties:{since_micros:{format:"int64",type:"integer"},until_micros:{format:"int64",type:"integer"}},required:["since_micros","until_micros"],type:"object"},_M={additionalProperties:!1,description:"Stable logical identity of one provider observation source.\n\nThe session identity is provider-native evidence. The physical file identity\nis represented separately by [`ObservationSourceGenerationV1`].",properties:{provider:{$ref:"#/$defs/ProviderId"},session_id:{$ref:"#/$defs/SessionId"},source_key:{anyOf:[{$ref:"#/$defs/SessionId"},{type:"null"}]}},required:["provider","session_id"],type:"object"},_N={properties:{analytics_mode:{$ref:"#/$defs/AnalyticsModeReadModelV1"},authorized_scope_ref:{type:"string"},comparison:{$ref:"#/$defs/PerformanceComparisonReadModelV1"},current:{type:"boolean"},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},metrics:{items:{$ref:"#/$defs/MetricValueV1"},type:"array"},observed_at_micros:{format:"int64",type:"integer"},rejected_arguments:{$ref:"#/$defs/RejectedArgumentAnalyticsV1"},watermark:{type:"string"}},required:["authorized_scope_ref","horizon","watermark","observed_at_micros","current","metrics","analytics_mode","comparison","rejected_arguments"],type:"object"},_z={additionalProperties:!1,description:"Structured occurrence provenance retained through fusion. Fusion\npreserves each exact `(source_occurrence_id, retriever_evidence_anchor)`\npair; parallel unassociated provenance vectors are forbidden.",properties:{evidence_role:{$ref:"#/$defs/EvidenceRole"},file_occurrence_id:{anyOf:[{$ref:"#/$defs/FileOccurrenceId"},{type:"null"}]},freshness:{$ref:"#/$defs/SourceFreshness"},logical_copy_cluster_id:{anyOf:[{$ref:"#/$defs/LogicalCopyClusterId"},{type:"null"}]},logical_copy_evidence_anchor:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},repository_id:{anyOf:[{$ref:"#/$defs/RepositoryId"},{type:"null"}]},retriever_evidence_anchor:{$ref:"#/$defs/RetrievalAnchorId"},session_or_thread_id:{anyOf:[{$ref:"#/$defs/SessionOrThreadId"},{type:"null"}]},source_namespace:{$ref:"#/$defs/SourceNamespace"},source_occurrence_id:{$ref:"#/$defs/SourceOccurrenceId"}},required:["source_occurrence_id","retriever_evidence_anchor","source_namespace","evidence_role","freshness"],type:"object"},_D={additionalProperties:!1,description:"Bounded work accounting supplied by an owning port or transaction.",properties:{bytes_consumed:{format:"uint64",minimum:0,type:"integer"},elapsed_micros:{format:"uint64",minimum:0,type:"integer"},units_consumed:{format:"uint64",minimum:0,type:"integer"}},required:["units_consumed","bytes_consumed","elapsed_micros"],type:"object"},_F={additionalProperties:!1,description:"Canonical operation evidence. An admitted failure remains represented here\nrather than being replaced by a transport exception.",properties:{budget:{$ref:"#/$defs/OperationBudgetUsage"},cancellation:{anyOf:[{$ref:"#/$defs/CancellationObservation"},{type:"null"}]},effective_deadline:{$ref:"#/$defs/Deadline"},ended_at:{$ref:"#/$defs/UtcMicros"},started_at:{$ref:"#/$defs/UtcMicros"},termination:{$ref:"#/$defs/OperationTermination"}},required:["started_at","ended_at","effective_deadline","budget","termination"],type:"object"},_L={description:"Terminal state after an operation has been admitted.",enum:["completed","cancelled","timed_out","failed","unavailable","partial","effect_unknown"],type:"string"},_U={additionalProperties:!1,description:"Bounded opaque page request. Resume authorization occurs before an adapter\ndecodes or hydrates the cursor.",properties:{cursor:{description:"Opaque resume token. The identifier type is deliberately absent from the\ngenerated schema surface, so the public wire form is its bounded string.",type:["string","null"]},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],type:"object"},_H={properties:{baseline_build:{type:["string","null"]},candidate_build:{type:["string","null"]},configuration:{type:["string","null"]},corpus:{type:["string","null"]},coverage:{$ref:"#/$defs/MetricCoverageV1"},disposition:{$ref:"#/$defs/ComparisonDispositionV1"},eligible_outcomes:{format:"uint64",minimum:0,type:["integer","null"]},environment:{type:["string","null"]},oracle:{type:["string","null"]},paired_outcomes:{format:"uint64",minimum:0,type:["integer","null"]},platform:{type:["string","null"]},regression_observed:{type:["boolean","null"]},rollback_profile:{type:["string","null"]},unavailable_reason:{type:["string","null"]},workload:{type:["string","null"]}},required:["disposition","coverage"],type:"object"},_G={oneOf:[{enum:["brief"],type:"string"},{const:"symbols",description:"Exact changed-symbol enumeration, with its existing continuation cursor.",type:"string"}]},_B={description:"Whether the served code generation is known current at serve time.",enum:["fresh","possibly_stale"],type:"string"},_K={additionalProperties:!1,description:"The indexing state behind a `possibly_stale` verdict: the served\ngeneration, the scheduler's latest sealed generation, its staleness-ladder\nstate, and the lanes that answered from an older generation. `summary` is\nthe one-line rendering agents read.",properties:{latest_generation:{type:["string","null"]},parked:{anyOf:[{$ref:"#/$defs/CodeIndexConvergenceParkedV1"},{type:"null"}],description:"The park holding convergence until the operator applies its remedy.\nNo wake retries it, so repeating the request cannot change the answer."},reason:{type:["string","null"]},rebuild_in_flight:{type:["boolean","null"]},served_generation:{type:["string","null"]},stale_lanes:{items:{type:"string"},type:"array"},staleness_state:{anyOf:[{$ref:"#/$defs/CodeIndexStalenessStateV1"},{type:"null"}]},summary:{type:"string"}},required:["summary"],type:"object"},_J={enum:["complete"],type:"string"},_Z={additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},message:{type:"string"},node_id:{type:"string"},reason_code:{type:"string"},status:{type:"string"},suggestions:{description:"Nearest served symbols by edit distance to the requested id, by id,\nsimple name, or qualified name.",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"}},required:["status","reason_code","node_id","message"],type:"object"},_Q={enum:["full","partial"],type:"string"},_X={additionalProperties:!1,description:"Freshness verdict carried by every search and context response. `indexing`\nis present exactly when the state is `possibly_stale`.",properties:{indexing:{anyOf:[{$ref:"#/$defs/PrimitiveIndexingStateV1"},{type:"null"}]},state:{$ref:"#/$defs/PrimitiveFreshnessStateV1"}},required:["state"],type:"object"},_Y={additionalProperties:!1,properties:{language:{type:["string","null"]},provider:{type:["string","null"]},reason:{type:"string"}},required:["reason"],type:"object"},_1={additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},kind:{type:"string"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"},unavailable_fields:{items:{type:"string"},type:"array"}},required:["node_id","name","qualified_name","kind","file","start_line","end_line","unavailable_fields"],type:"object"},_0={additionalProperties:!1,properties:{detail:{type:"string"},reason_code:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/PrimitiveUnavailableStatusV1"}},required:["status","reason_code","retryable","detail"],type:"object"},_2={enum:["unavailable"],type:"string"},_4={description:"Strongly typed canonical identity: `ProjectId`.",type:"string"},_6={properties:{alias_count:{format:"uint",minimum:0,type:"integer"},artifact_count:{format:"uint",minimum:0,type:"integer"},branches:{items:{type:"string"},type:"array"},canonical_root:{type:"string"},default_branch:{description:"Repository default branch recorded at registration.",type:["string","null"]},head_branch:{description:"Branch the checkout's HEAD names now; `None` when HEAD is detached or\nno checkout of this project could be read.",type:["string","null"]},is_active:{type:["boolean","null"]},kind:{type:"string"},label:{type:"string"},last_seen_at:{format:"int64",type:"integer"},project_id:{type:"string"},project_root:{type:"string"},store_count:{format:"uint",minimum:0,type:"integer"}},required:["project_id","label","project_root","canonical_root","kind","branches","store_count","artifact_count","alias_count","last_seen_at"],type:"object"},_3={properties:{project_count:{format:"uint",minimum:0,type:"integer"},repo_count:{format:"uint",minimum:0,type:"integer"},truncated:{type:"boolean"}},required:["project_count","repo_count","truncated"],type:"object"},_9={properties:{branches:{items:{type:"string"},type:"array"},git_common_dir:{type:["string","null"]},label:{type:"string"},project_count:{format:"uint",minimum:0,type:"integer"},projects:{items:{$ref:"#/$defs/ProjectRegistryEntry"},type:"array"}},required:["label","project_count","branches","projects"],type:"object"},_5={description:"Strongly typed canonical identity: `ProjectionGenerationId`.",type:"string"},_8={description:"Strongly typed canonical identity: `ProposalId`.",type:"string"},_7={enum:["reject","require_human_approval_and_independent_review"],type:"string"},ve={additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/ProtectedRefDispositionV1"},selector:{$ref:"#/$defs/ProtectedRefSelectorV1"}},required:["selector","disposition"],type:"object"},vt={oneOf:[{properties:{kind:{const:"native_default_branch",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"exact",type:"string"},value:{$ref:"#/$defs/CanonicalGitRefNameV1"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"prefix",type:"string"},value:{$ref:"#/$defs/CanonicalGitRefPrefix"}},required:["kind","value"],type:"object"}]},vr={description:"Strongly typed canonical identity: `ProvenanceId`.",type:"string"},vi={description:"Complete provider states remain distinct. Empty findings are clean only\nwhen every requested provider completed with complete supported coverage.",enum:["supported_completed_complete","unsupported","absent","indexing","stale","cancelled","timed_out","failed","partial","unavailable"],type:"string"},vo={description:"Strongly typed canonical identity: `ProviderId`.",type:"string"},vn={description:"One provider/model cohort in the Costs latency read model.\n\nThe percentile cells are ordinary canonical metrics so every value carries\nits exact unit, horizon, denominator, coverage/censoring, and projector\nprovenance. Identity provenance is kept separately because latency is\nmeasured by `OperationResourceObservedV1`, while provider/model identity\nmay be joined from an exact `ProviderUsageObservationV1` request/session.",properties:{first_progress:{$ref:"#/$defs/LatencyDistributionReadModelV1"},identity_provenance:{$ref:"#/$defs/MetricProvenanceV1"},identity_unavailable_reason:{type:["string","null"]},model:{type:["string","null"]},provider:{type:["string","null"]},queue:{$ref:"#/$defs/LatencyDistributionReadModelV1"},service:{$ref:"#/$defs/LatencyDistributionReadModelV1"},start:{$ref:"#/$defs/LatencyDistributionReadModelV1"},terminal:{$ref:"#/$defs/LatencyDistributionReadModelV1"}},required:["identity_provenance","queue","start","first_progress","service","terminal"],type:"object"},va={properties:{canonical_root:{type:"string"},created_at:{format:"int64",type:"integer"},default_branch:{description:"Repository default branch recorded at registration.",type:["string","null"]},display_root:{type:"string"},git_common_dir:{type:["string","null"]},head_branch:{description:"Branch the checkout's HEAD names now; `None` when HEAD is detached or\nno checkout of this project could be read.",type:["string","null"]},is_active:{type:["boolean","null"]},label:{type:"string"},last_seen_at:{format:"int64",type:"integer"},project_id:{type:"string"},project_root:{type:"string"}},required:["project_id","label","project_root","display_root","canonical_root","created_at","last_seen_at"],type:"object"},vs={enum:["owner_receipt","locally_measured","estimated","unknown"],type:"string"},vd={description:"Strongly typed canonical identity: `QueryCollectionId`.",type:"string"},vc={description:"Which endpoint of each counted edge the rank report ranks.",enum:["incoming","outgoing"],type:"string"},vl={description:"Relationship the rank report counts.",enum:["implements","extends","calls","uses","contains","annotates","type_of","returns","receives"],type:"string"},vp={additionalProperties:!1,description:"One recorded ranking decision. Explanations are rendered from this\nprovenance, never reconstructed from a final scalar score.",properties:{detail:{type:"string"},evidence_anchor:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},kind:{$ref:"#/$defs/RankingDecisionKind"},policy_anchor:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]},retriever:{anyOf:[{$ref:"#/$defs/RetrieverKind"},{type:"null"}]}},required:["kind","detail"],type:"object"},vu={description:"The decision kinds the pipeline must record.",enum:["exact_tier_admission","same_source_duplicate_collapse","logical_copy_representative_selection","contradiction_preservation","diversity_cap","comparator_provenance","fallback"],type:"string"},vm={description:"Strongly typed canonical identity: `RefId`.",type:"string"},vf={additionalProperties:!1,description:"Exact registered root locator retained with an authorized scope.\n\n`canonical_root` is routing evidence for the already-resolved\n[`ResolvedScope`]. It cannot replace or manufacture that scope identity.",properties:{canonical_root:{type:"string"},profile:{$ref:"#/$defs/SharedProfileStoreLocatorV1"},project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id","profile","canonical_root"],type:"object"},vh={description:"Frequency and rate projection for dispatcher rejected-argument observations.\n\nCounts may be known while `rejection_rate` stays absent: Plan 26 forbids\nfabricating a rate when the eligible-attempt denominator is unknown.",properties:{coverage:{$ref:"#/$defs/MetricCoverageV1"},eligible_attempts:{format:"uint64",minimum:0,type:["integer","null"]},groups:{items:{$ref:"#/$defs/RejectedArgumentGroupV1"},type:"array"},projector_revision:{type:"string"},redacted_name_count:{format:"uint64",minimum:0,type:"integer"},rejected_total:{format:"uint64",minimum:0,type:["integer","null"]},rejection_rate:{format:"double",type:["number","null"]},unavailable_reason:{type:["string","null"]},watermark:{type:"string"}},required:["coverage","projector_revision","watermark","redacted_name_count","groups"],type:"object"},vy={description:"Closed error class for a rejected surface argument.",enum:["missing","invalid_shape","out_of_bounds","unsupported","unauthorized","stale","unknown"],type:"string"},vg={description:"One surface \xd7 operation \xd7 argument \xd7 error-class cell in the rejected-argument view.",properties:{argument:{$ref:"#/$defs/RejectedArgumentNameV1"},count:{format:"uint64",minimum:0,type:"integer"},error_class:{$ref:"#/$defs/RejectedArgumentErrorClassV1"},operation:{type:"string"},rate:{description:"Eligible-attempt rate for this cell. Absent when the attempt\ndenominator or coverage is insufficient.",format:"double",type:["number","null"]},surface:{$ref:"#/$defs/RejectedArgumentSurfaceV1"}},required:["surface","operation","argument","error_class","count"],type:"object"},v_={description:"Normalized rejected-argument name. Raw flags, values, and tokens never\nenter this vocabulary.",enum:["request_body","pagination","request_handle","operation","lifecycle","unknown"],type:"string"},vv={description:"Transport that rejected a surface argument. Unknown preserves missing\nattribution instead of inventing cli/mcp/http.",enum:["cli","mcp","http","unknown"],type:"string"},vb={description:"Strongly typed canonical identity: `RepositoryId`.",type:"string"},v$={oneOf:[{properties:{kind:{const:"all_authorized",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"allowlist",type:"string"},repositories:{items:{$ref:"#/$defs/RepositoryId"},type:"array",uniqueItems:!0}},required:["kind","repositories"],type:"object"}]},vS={enum:["successful_terminal"],type:"string"},vk={additionalProperties:!1,properties:{capability_id:{$ref:"#/$defs/CapabilityId"},expectation:{$ref:"#/$defs/RequiredCheckExpectationV1"},maximum_age_seconds:{format:"uint32",minimum:1,type:"integer"}},required:["capability_id","expectation","maximum_age_seconds"],type:"object"},vw={additionalProperties:!1,description:"The resolved configuration scope is one exact project/repository/worktree root.\n\nPaths, CWDs, labels, and mutable branch spellings are deliberately absent.",properties:{project_id:{$ref:"#/$defs/ProjectId"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository_id:{$ref:"#/$defs/RepositoryId"},scope_digest:{$ref:"#/$defs/ManifestDigest"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","scope_digest"],type:"object"},vP={description:"Bounded output projection chosen by a concrete use case.",enum:["summary","evidence","references_only"],type:"string"},vV={additionalProperties:!1,properties:{code:{type:"string"},kind:{type:["string","null"]},maximum:{format:"uint",minimum:0,type:["integer","null"]},message:{type:"string"},observed:{format:"uint",minimum:0,type:["integer","null"]},reason:{type:["string","null"]},retryable:{type:["boolean","null"]}},required:["code","message"],type:"object"},vR={enum:["aborted","budget_exhausted","busy","cancelled","complete","complete_zero","cursor_manifest_limit_exceeded","deadline_exceeded","deleted","denied","error","failed","joined","locked","not_found","ok","partial","recorded","redacted","running","stale","started","unavailable","unsupported_filter","wrong_scope"],type:"string"},vq={anyOf:[{format:"uint64",minimum:0,type:"integer"},{type:"string"}],description:"The temporal filter intentionally retains the established integer-or-text\nwire form (Unix timestamps, RFC3339, and relative expressions)."},vI={description:"Strongly typed canonical identity: `RetrievalAnchorId`.",type:"string"},vx={description:"Stable semantic ordering; adapters may not replace it with transport order.",enum:["relevance","source_position","temporal_descending","stable_identity"],type:"string"},vj={additionalProperties:!1,properties:{order:{$ref:"#/$defs/RetrievalOrder"},page:{$ref:"#/$defs/PageRequest"},projection:{$ref:"#/$defs/ResultProjection"},temporal:{$ref:"#/$defs/TemporalModeV1"}},required:["temporal","page","projection","order"],type:"object"},vC={description:"Source-role evidence used at lane admission and fusion.\n\nA production definition outranks a test-file hit for the same symbol even\nwhen the test has a higher measured score. Non-definition production hits\ncompete with test hits on measured scores so comments and references do\nnot crowd out relevant tests.",oneOf:[{const:"production_definition",description:"Non-test path whose name or signature matched the query.",type:"string"},{const:"production_other",description:"Non-test path that is not a name or signature definition match.",type:"string"},{const:"test_reference",description:"Hit under a test path.",type:"string"}]},vT={additionalProperties:!1,properties:{backlog:{format:"uint",minimum:0,type:"integer"},blocker:{type:["string","null"]},last_progress_at_unix_micros:{format:"int64",type:["integer","null"]},retry_class:{type:["string","null"]}},required:["backlog"],type:"object"},vO={description:"Runtime-backed retrieval lanes. Each lane is independently testable,\ndisableable, budgeted, and attributable; one lane is never an alias over\nanother.",enum:["exact_literal","lexical","graph","temporal","task_session","diagnostic"],type:"string"},vE={oneOf:[{properties:{kind:{const:"none",type:"string"}},required:["kind"],type:"object"},{properties:{count:{format:"uint16",maximum:65535,minimum:1,type:"integer"},kind:{const:"independent_review_count",type:"string"}},required:["kind","count"],type:"object"},{properties:{kind:{const:"code_owner_and_independent_review",type:"string"}},required:["kind"],type:"object"}]},vA={enum:["no_review","independent_review","standard_pull_requests","git_hub_stacked_pull_requests"],type:"string"},vW={additionalProperties:!1,properties:{allowed:{items:{$ref:"#/$defs/ReviewTopologyKindV1"},type:"array",uniqueItems:!0},github_stacked_prs:{$ref:"#/$defs/GitHubStackedPullRequestPolicyV1"}},required:["allowed","github_stacked_prs"],type:"object"},vM={additionalProperties:!1,description:"Immutable collection and stack revisions for one exact resolved root.",properties:{collection_revision:{$ref:"#/$defs/ManifestDigest"},generation_digest:{$ref:"#/$defs/ManifestDigest"},scope_digest:{$ref:"#/$defs/ManifestDigest"},stack_revision:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","collection_revision","stack_revision","generation_digest"],type:"object"},vN={additionalProperties:!1,description:"One typed outcome pinned to the digest of an exact resolved root.",properties:{outcome:{$ref:"#/$defs/ScopeOutcome_for_Nullable_RootGenerationV1"},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","outcome"],type:"object"},vz={additionalProperties:!1,description:"One typed outcome pinned to the digest of an exact resolved root.",properties:{outcome:{$ref:"#/$defs/ScopeOutcome_for_Nullable_string"},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","outcome"],type:"object"},vD={enum:["allow","deny"],type:"string"},vF={description:"Strongly typed canonical identity: `RunId`.",type:"string"},vL={additionalProperties:!1,properties:{degraded_row:{type:["string","null"]},stage:{$ref:"#/$defs/SchemaConvergenceStageV1"},started_at_micros:{format:"int64",type:"integer"},state:{$ref:"#/$defs/SchemaConvergenceStateV1"},store:{type:"string"}},required:["store","stage","state","started_at_micros"],type:"object"},vU={enum:["registered_schema"],type:"string"},vH={oneOf:[{enum:["pending","running","completed"],type:"string"},{const:"retrying",description:"The last attempt failed and the store's convergence task tries again by\nitself. `degraded_row` carries that attempt's failure.",type:"string"},{const:"degraded",description:"Convergence stopped on a failure and nothing retries it on this mount.",type:"string"}]},vG={additionalProperties:!1,description:"Restrictive policy input. An allow never grants capabilities absent from\nthe independently authorized capability set passed to the resolver.",properties:{authority:{$ref:"#/$defs/AuthorityRef"},capabilities:{items:{$ref:"#/$defs/CapabilityId"},type:"array",uniqueItems:!0},effect:{$ref:"#/$defs/RuleEffect"},expires_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},rule_id:{$ref:"#/$defs/AccessRuleId"},subject:{$ref:"#/$defs/ScopeAccessSubjectV1"}},required:["rule_id","subject","authority","capabilities","effect"],type:"object"},vB={additionalProperties:!1,description:"Typed rule selectors. Unset dimensions match all values at that dimension,\nbut at least one dimension must be constrained. Free-form paths, labels,\ncollection names, and branch names are deliberately absent.",properties:{actor:{anyOf:[{$ref:"#/$defs/ActorId"},{type:"null"}]},operation:{anyOf:[{$ref:"#/$defs/ScopeControlOperationV1"},{type:"null"}]},source_kind:{anyOf:[{$ref:"#/$defs/SourceKindV1"},{type:"null"}]}},type:"object"},vK={enum:["read","source_bind","source_rebind","source_unbind","access_rule_upsert","access_rule_remove","replace_topology_policy","rollback"],type:"string"},vJ={description:"Truthful outcome for one authorized root or an aggregate over roots.\n\n`Denied` and `Unavailable` carry no value and therefore cannot be confused\nwith a successful empty result.",oneOf:[{properties:{outcome:{const:"exact",type:"string"},value:{anyOf:[{$ref:"#/$defs/RootGenerationV1"},{type:"null"}]}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"partial",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopePartialReasonV1"},value:{anyOf:[{$ref:"#/$defs/RootGenerationV1"},{type:"null"}]}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"denied",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopeUnavailableReasonV1"}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"}]},vZ={description:"Truthful outcome for one authorized root or an aggregate over roots.\n\n`Denied` and `Unavailable` carry no value and therefore cannot be confused\nwith a successful empty result.",oneOf:[{properties:{outcome:{const:"exact",type:"string"},value:{type:["string","null"]}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"partial",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopePartialReasonV1"},value:{type:["string","null"]}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"denied",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopeUnavailableReasonV1"}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"}]},vQ={description:"Typed explanation for a root that returned usable but incomplete data.",enum:["incomplete","stale","budget_exceeded","root_denied","root_unavailable"],type:"string"},vX={description:"Stable identity of one authorized scope-set record.",type:"string"},vY={description:"Monotonic optimistic-concurrency revision of one scope set.",format:"uint64",minimum:1,type:"integer"},v1={additionalProperties:!1,description:"A source-to-authority binding. It stores only the source kind, a redacted\nlocator digest, and the pre-resolved authority reference.",properties:{authority:{$ref:"#/$defs/AuthorityRef"},binding_id:{$ref:"#/$defs/SourceBindingId"},source_kind:{$ref:"#/$defs/SourceKindV1"},source_locator_digest:{$ref:"#/$defs/LocatorDigest"}},required:["binding_id","source_kind","source_locator_digest","authority"],type:"object"},v0={description:"Typed explanation for a root that could not return usable data.",enum:["authority_unavailable","root_missing","store_unavailable"],type:"string"},v2={description:"Strongly typed canonical identity: `ScoreDomainId`.",type:"string"},v4={additionalProperties:!1,description:"Reference-only filesystem locator. The raw path is sealed outside this\ncontract; only the privacy-bound locator digest and sealed-value digest are\nrepresentable here.",properties:{locator_digest:{$ref:"#/$defs/LocatorDigest"},sealed_value_digest:{$ref:"#/$defs/ManifestDigest"}},required:["locator_digest","sealed_value_digest"],type:"object"},v6={additionalProperties:!1,properties:{knowledge:{$ref:"#/$defs/ClosedUtcIntervalV1"},valid:{$ref:"#/$defs/ValidCoverageIntervalV1"}},required:["knowledge","valid"],type:"object"},v3={oneOf:[{properties:{kind:{const:"caught_up",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"projection_behind_source",type:"string"},lag:{format:"uint64",minimum:0,type:"integer"}},required:["kind","lag"],type:"object"},{properties:{kind:{const:"source_behind_target",type:"string"},lag:{format:"uint64",minimum:0,type:"integer"}},required:["kind","lag"],type:"object"},{properties:{kind:{const:"projection_and_source_behind",type:"string"},projection_lag:{format:"uint64",minimum:0,type:"integer"},source_lag:{format:"uint64",minimum:0,type:"integer"}},required:["kind","projection_lag","source_lag"],type:"object"},{properties:{kind:{const:"locked",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"redacted",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"retention_withheld",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"unavailable",type:"string"}},required:["kind"],type:"object"}]},v9={additionalProperties:!1,properties:{mode:{$ref:"#/$defs/TemporalModeV1"}},required:["mode"],type:"object"},v5={enum:["fresh","stale","partial","locked","redacted","retention_withheld","unavailable"],type:"string"},v8={description:"Strongly typed canonical identity: `SessionId`.",type:"string"},v7={description:"Strongly typed canonical identity: `SessionOrThreadId`.",type:"string"},be={additionalProperties:!1,properties:{committed_through:{format:"uint64",minimum:0,type:"integer"},observed_through:{format:"uint64",minimum:0,type:"integer"}},required:["observed_through","committed_through"],type:"object"},bt={additionalProperties:!1,properties:{committed_batches:{format:"uint64",minimum:0,type:"integer"},committed_records:{format:"uint64",minimum:0,type:"integer"},coverage:{$ref:"#/$defs/TemporalCoverageV1"},frontier:{$ref:"#/$defs/SessionRefreshFrontierResultV1"},operation_id:{type:"string"},session_id:{type:"string"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},updated_at:{format:"int64",type:"integer"}},required:["operation_id","session_id","frontier","coverage","committed_batches","committed_records","updated_at"],type:"object"},br={additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/TemporalCoverageV1"},failure_code:{type:["string","null"]},frontier:{$ref:"#/$defs/SessionRefreshFrontierResultV1"},operation_id:{type:"string"},session_id:{type:"string"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},state:{$ref:"#/$defs/SessionRefreshTerminalStateResultV1"},terminal_at:{format:"int64",type:"integer"}},required:["operation_id","session_id","frontier","coverage","state","terminal_at"],type:"object"},bi={enum:["complete","failed","cancelled"],type:"string"},bo={description:"Structural budget boundary that rejected a session retrieval request.\nThese causes are non-retryable request corrections; concurrent permit or\nqueue pressure remains a separate capacity-saturation failure.",enum:["request_result_limit","request_hydration_limit","request_context_bytes","request_candidate_bytes","request_record_bytes","request_hydration_bytes","estimator_version_mismatch","execution_work_exhausted","candidate_read_exhausted","record_read_exhausted","kernel_result_limit","participant_manifest_participants","participant_manifest_canonical_bytes","cursor_manifest_limit","hydration_bytes","context_bytes","context_tokens"],type:"string"},bn={additionalProperties:!1,properties:{committed_frontier:{format:"uint64",minimum:0,type:"integer"},covered_intervals:{items:{$ref:"#/$defs/SessionCoverageIntervalV1"},type:"array"},missing_intervals:{items:{$ref:"#/$defs/SessionCoverageIntervalV1"},type:"array"},observed_frontier:{format:"uint64",minimum:0,type:"integer"},reason:{$ref:"#/$defs/SessionCoverageReasonV1"},request:{$ref:"#/$defs/SessionCoverageRequestV1"},source_id:{type:"string"},state:{$ref:"#/$defs/SessionCoverageStateV1"},target_watermark:{format:"uint64",minimum:0,type:"integer"}},required:["source_id","observed_frontier","committed_frontier","target_watermark","request","covered_intervals","missing_intervals","state","reason"],type:"object"},ba={description:"Typed configuration key. Keys are lowercase, dotted product identifiers;\nuntyped host/adapter keys are not representable.",type:"string"},bs={additionalProperties:!1,description:"Logical and verified physical identity of the shared Profile shard.\n\nBrain and profile IDs select the shard; the verified store locator binds its\nphysical store. Lease incarnations and authority epochs remain runtime fences.",properties:{brain_id:{$ref:"#/$defs/BrainId"},profile_id:{$ref:"#/$defs/UserProfileId"},store_id:{type:"string"}},required:["brain_id","profile_id","store_id"],type:"object"},bd={additionalProperties:!1,properties:{complete:{type:"boolean"},family_digest:{$ref:"#/$defs/ManifestDigest"},match_class:{$ref:"#/$defs/SimilarMatchClassV1"},member_count:{format:"uint",minimum:0,type:"integer"},members:{items:{$ref:"#/$defs/SimilarOccurrenceV1"},type:"array"},next_cursor:{type:["string","null"]},normalization_revision:{format:"uint16",maximum:65535,minimum:0,type:"integer"},representative_payload_digest:{$ref:"#/$defs/ManifestDigest"}},required:["match_class","normalization_revision","family_digest","representative_payload_digest","member_count","members","complete"],type:"object"},bc={enum:["conservative_exact","rename_normalized_exact"],type:"string"},bl={additionalProperties:!1,properties:{body_span:{$ref:"#/$defs/SourceSpan"},path:{type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},snapshot_digest:{$ref:"#/$defs/ManifestDigest"},source_generation:{$ref:"#/$defs/CodeGenerationId"},symbol_occurrence_id:{$ref:"#/$defs/SymbolOccurrenceId"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["project_id","repository_id","source_generation","snapshot_digest","symbol_occurrence_id","path","body_span"],type:"object"},bp={properties:{evidence:{default:[],items:{type:"string"},type:"array"},improvement:{type:"boolean"},priority:{type:"string"},reason:{type:"string"},recommendation:{type:"string"},skill_id:{type:"string"}},required:["skill_id","improvement","recommendation","reason","priority"],type:"object"},bu={enum:["cursor","codex","claude","agents","opencode","kimi","kiro","hermes"],type:"string"},bm={properties:{evidence:{default:[],items:{type:"string"},type:"array"},reason:{type:"string"},recommendation:{type:"string"},skill_id:{type:"string"},stale:{type:"boolean"}},required:["skill_id","stale","recommendation","reason"],type:"object"},bf={description:"One skill's durable usage counters. The ledger stores one per skill; a\nsummary is the same record merged with the skill's current metadata.",properties:{activated_at:{description:"When the skill last transitioned into the active state; mirrors the\nmanaged skill metadata so outcome scoring works from summaries alone.",format:"int64",type:["integer","null"]},category:{type:["string","null"]},created_by:{type:["string","null"]},first_seen_at:{format:"int64",type:"integer"},imported_analytics_events:{description:"Import keys that already counted toward this skill. They are not a\nstore-wide set: each key names this skill, so another skill must not\nshare the write.",items:{type:"string"},type:"array",uniqueItems:!0},last_activity_at:{format:"int64",type:"integer"},last_patched_at:{format:"int64",type:["integer","null"]},last_used_at:{format:"int64",type:["integer","null"]},last_viewed_at:{format:"int64",type:["integer","null"]},patch_count:{format:"uint64",minimum:0,type:"integer"},pinned:{type:"boolean"},provenance_source:{anyOf:[{$ref:"#/$defs/ManagedSkillSource"},{type:"null"}]},schema_version:{format:"uint32",minimum:0,type:"integer"},skill_id:{type:"string"},state:{anyOf:[{$ref:"#/$defs/ManagedSkillState"},{type:"null"}]},targets:{default:[],items:{type:"string"},type:"array"},title:{type:["string","null"]},use_count:{format:"uint64",minimum:0,type:"integer"},use_count_at_activation:{format:"uint64",minimum:0,type:["integer","null"]},view_count:{format:"uint64",minimum:0,type:"integer"},view_count_at_activation:{description:"View/use totals captured at activation time so activity since activation\nis an exact delta rather than a heuristic.",format:"uint64",minimum:0,type:["integer","null"]}},required:["schema_version","skill_id","pinned","view_count","use_count","patch_count","first_seen_at","last_activity_at"],type:"object"},bh={description:"Strongly typed canonical identity: `SourceBindingId`.",type:"string"},by={additionalProperties:!1,description:"Source freshness is source- and retriever-specific: there is no global\nage-decay multiplier. Missing, stale, incompatible, and current are\ndistinct states.",properties:{compatibility:{$ref:"#/$defs/FreshnessCompatibilityV1"},generation_lag:{format:"uint64",minimum:0,type:["integer","null"]},observed_at:{$ref:"#/$defs/UtcMicros"},policy_revision:{$ref:"#/$defs/ComponentRevision"},projection_watermark:{format:"uint64",minimum:0,type:["integer","null"]},source_generation:{format:"uint64",minimum:0,type:["integer","null"]},source_instance:{$ref:"#/$defs/SourceInstanceKey"},source_namespace:{$ref:"#/$defs/SourceNamespace"},source_watermark:{format:"uint64",minimum:0,type:["integer","null"]}},required:["source_namespace","source_instance","observed_at","compatibility","policy_revision"],type:"object"},bg={description:"Strongly typed canonical identity: `SourceInstanceKey`.",type:"string"},b_={enum:["claude","codex","cursor","git_hub","hermes","kiro"],type:"string"},bv={description:"Strongly typed canonical identity: `SourceNamespace`.",type:"string"},bb={description:"Strongly typed canonical identity: `SourceOccurrenceId`.",type:"string"},b$={additionalProperties:!1,description:"Byte range inside one sanitized source file. Mutable line numbers are\nnever part of identity.",properties:{end_byte:{format:"uint64",minimum:0,type:"integer"},start_byte:{format:"uint64",minimum:0,type:"integer"}},required:["start_byte","end_byte"],type:"object"},bS={description:"Strongly typed canonical identity: `SourceStoreId`.",type:"string"},bk={description:"Strongly typed canonical identity: `StackDeliveryWatermarkId`.",type:"string"},bw={description:"Strongly typed canonical identity: `StackNodeId`.",type:"string"},bP={description:"Strongly typed canonical identity: `StackSignalId`.",type:"string"},bV={additionalProperties:!1,description:"Exact base/head symbol comparison was unavailable; the git evidence beside\nit is still the answer.",properties:{reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","reason","retryable"],type:"object"},bR={additionalProperties:!1,description:"Optional narrowing inside the immutable project/repository/worktree scope\ncarried by [`RequestContext`]. A path prefix never establishes identity or\nauthorization.",properties:{path_prefix:{type:["string","null"]}},type:"object"},bq={description:"Strongly typed canonical identity: `SymbolOccurrenceId`.",type:"string"},bI={additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},is_async:{type:"boolean"},kind:{type:"string"},line:{description:"One-based user-facing line.",format:"uint32",minimum:0,type:"integer"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},score:{format:"double",type:["number","null"]},signature:{type:["string","null"]}},required:["node_id","name","qualified_name","kind","file","line","end_line","is_async"],type:"object"},bx={additionalProperties:!1,properties:{depth:{format:"uint32",minimum:0,type:["integer","null"]},dispatch_from:{type:["string","null"]},dispatch_via_trait:{type:"boolean"},edge_kind:{type:"string"},symbol:{$ref:"#/$defs/SymbolPrimitiveRecord"}},required:["symbol","edge_kind","dispatch_via_trait"],type:"object"},bj={additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},link_id:{type:"string"},observed_at:{$ref:"#/$defs/UtcMicros"},revision:{format:"uint64",minimum:0,type:"integer"},task_id:{$ref:"#/$defs/TaskId"}},required:["link_id","revision","task_id","anchor_id","evidence_digest","observed_at"],type:"object"},bC={additionalProperties:!1,properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},from_actor_id:{$ref:"#/$defs/ActorId"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},run_id:{$ref:"#/$defs/RunId"},step_id:{$ref:"#/$defs/WorkflowStepId"},task_id:{$ref:"#/$defs/TaskId"},thread_id:{$ref:"#/$defs/ThreadId"},to_actor_id:{$ref:"#/$defs/ActorId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","definition_id","definition_version","step_id","task_id","thread_id","run_id","from_actor_id","to_actor_id"],type:"object"},bT={description:"Strongly typed canonical identity: `TaskId`.",type:"string"},bO={additionalProperties:!1,properties:{hidden:{format:"uint64",minimum:0,type:"integer"},redacted:{format:"uint64",minimum:0,type:"integer"},unknown:{format:"uint64",minimum:0,type:"integer"},visible:{format:"uint64",minimum:0,type:"integer"}},required:["visible","hidden","unknown","redacted"],type:"object"},bE={additionalProperties:!1,properties:{anchor:{type:"string"},summary:{type:"string"}},required:["anchor","summary"],type:"object"},bA={oneOf:[{properties:{state:{const:"fresh",type:"string"}},required:["state"],type:"object"},{properties:{generation_lag:{format:"uint64",minimum:0,type:"integer"},state:{const:"stored",type:"string"}},required:["state","generation_lag"],type:"object"},{properties:{generation_lag:{format:"uint64",minimum:0,type:"integer"},state:{const:"partial",type:"string"}},required:["state","generation_lag"],type:"object"}]},bW={description:"Requested temporal interpretation.",oneOf:[{additionalProperties:!1,properties:{kind:{const:"current",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{cutoff:{$ref:"#/$defs/UtcMicros"},kind:{const:"as_of",type:"string"}},required:["kind","cutoff"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"evolution",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"forensic",type:"string"}},required:["kind"],type:"object"}]},bM={additionalProperties:!1,properties:{anchor:{type:"string"},rank:{format:"uint32",minimum:0,type:"integer"},reason:{$ref:"#/$defs/HydrationStateResultV1"}},required:["rank","anchor","reason"],type:"object"},bN={additionalProperties:!1,properties:{generation:{format:"uint64",minimum:0,type:"integer"},index:{format:"uint64",minimum:0,type:"integer"},projection:{format:"uint64",minimum:0,type:"integer"},source:{format:"uint64",minimum:0,type:"integer"},summary:{format:"uint64",minimum:0,type:"integer"}},required:["generation","source","projection","index","summary"],type:"object"},bz={description:"Strongly typed canonical identity: `ThreadId`.",type:"string"},bD={additionalProperties:!1,description:"What a token budget did to an answer. `est_tokens` is the kept rows.\n`over_ceiling` means a single row was larger than its section quota and\nwas kept anyway.",properties:{budget_tokens:{format:"uint32",minimum:0,type:"integer"},est_tokens:{format:"uint32",minimum:0,type:"integer"},over_ceiling:{type:"boolean"},sections:{items:{$ref:"#/$defs/TokenBudgetSectionV1"},type:"array"}},required:["budget_tokens","est_tokens","over_ceiling","sections"],type:"object"},bF={additionalProperties:!1,description:"One section a token budget kept or cut.",properties:{section:{type:"string"},shown:{format:"uint32",minimum:0,type:"integer"},total:{format:"uint32",minimum:0,type:"integer"}},required:["section","total","shown"],type:"object"},bL={additionalProperties:!1,properties:{maximum_active_per_repository:{format:"uint16",maximum:65535,minimum:1,type:"integer"},maximum_global_active:{format:"uint16",maximum:65535,minimum:1,type:"integer"},maximum_parallel_per_task:{format:"uint16",maximum:65535,minimum:1,type:"integer"},maximum_stack_depth:{format:"uint16",maximum:65535,minimum:1,type:"integer"}},required:["maximum_active_per_repository","maximum_parallel_per_task","maximum_global_active","maximum_stack_depth"],type:"object"},bU={enum:["reject","require_explicit_human_approval","require_human_approval_and_independent_review"],type:"string"},bH={additionalProperties:!1,properties:{cleanliness:{$ref:"#/$defs/WorktreeCleanlinessRequirementV1"},maximum_preflight_age_seconds:{format:"uint32",minimum:1,type:"integer"},require_fresh_preflight:{type:"boolean"},review:{$ref:"#/$defs/ReviewRequirementV1"},tests:{items:{$ref:"#/$defs/RequiredCheckV1"},type:"array"}},required:["cleanliness","tests","review","require_fresh_preflight","maximum_preflight_age_seconds"],type:"object"},bG={enum:["critical_only","lifecycle","verbose"],type:"string"},bB={description:"Risky construct the pattern scan looks for.",enum:["unwrap","expect","panic","todo","unimplemented","unsafe_block"],type:"string"},bK={description:"Stable, canonical catalog identity for `UseCaseId`.",type:"string"},bJ={description:"Strongly typed canonical identity: `UserProfileId`.",type:"string"},bZ={description:"UTC timestamp represented as microseconds from the Unix epoch.",format:"int64",type:"integer"},bQ={oneOf:[{properties:{interval:{$ref:"#/$defs/ClosedUtcIntervalV1"},kind:{const:"known",type:"string"}},required:["kind","interval"],type:"object"},{properties:{kind:{const:"unknown",type:"string"}},required:["kind"],type:"object"}]},bX={additionalProperties:!1,description:"One exact verified graph snapshot identity.",properties:{event_sequence:{format:"uint64",minimum:0,type:"integer"},graph_version:{format:"uint64",minimum:0,type:"integer"},recovered_graph_digest:{$ref:"#/$defs/ManifestDigest"},source_watermark:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},type:"object"}},required:["graph_version","event_sequence","source_watermark","recovered_graph_digest"],type:"object"},bY={additionalProperties:!1,properties:{criterion_id:{type:"string"},description:{type:"string"},evidence_required:{type:"boolean"}},required:["criterion_id","description","evidence_required"],type:"object"},b1={enum:["never","on_request"],type:"string"},b0={description:"Strongly typed canonical identity: `WorkArtifactId`.",type:"string"},b2={additionalProperties:!1,properties:{artifact_id:{$ref:"#/$defs/WorkArtifactId"},byte_length:{format:"uint64",minimum:0,type:"integer"},digest:{$ref:"#/$defs/ManifestDigest"}},required:["artifact_id","digest","byte_length"],type:"object"},b4={additionalProperties:!1,description:"Sealed terminal evidence for one provider attempt. The digest of this\nrecord is the evidence digest carried by [`WorkTerminalEvidenceV1`] and by\nthe `RuntimeEvidenceRef` attached to the Work projection, so the receipt\nin Work always names an inspectable record.",properties:{actual_route:{anyOf:[{$ref:"#/$defs/WorkProviderRouteV1"},{type:"null"}]},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{$ref:"#/$defs/WorkAttemptProviderOutcomeV1"},provider_fallback:{anyOf:[{$ref:"#/$defs/WorkProviderFallbackRecordV1"},{type:"null"}],description:"Present only when the pinned preferred backend was disqualified before\nstartup. `None` means the attempt ran on its first-choice backend."},provider_session:{anyOf:[{$ref:"#/$defs/ObservationSourceIdentityV1"},{type:"null"}],description:"Native provider-qualified session/thread identity, when the provider\nreported one. Admission cannot supply this value and no fallback is\nfabricated."},requested_route:{$ref:"#/$defs/WorkProviderRouteV1"},stderr:{anyOf:[{$ref:"#/$defs/WorkAttemptStreamSummaryV1"},{type:"null"}]},stdout:{anyOf:[{$ref:"#/$defs/WorkAttemptStreamSummaryV1"},{type:"null"}]}},required:["identity","requested_route","outcome","observed_at"],type:"object"},b6={additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_id"],type:"object"},b3={description:"How much of the authorized attempt set one page covers.",oneOf:[{additionalProperties:!1,description:"Every attempt after the page start was returned; zero returned is the\nexplicit empty authorized result, not a concealment.",properties:{coverage:{const:"complete",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned"],type:"object"},{additionalProperties:!1,description:"The page cap was reached; `resume` continues under the same verified\ntopology generation.",properties:{coverage:{const:"capped",type:"string"},remaining:{format:"uint32",minimum:0,type:"integer"},resume:{$ref:"#/$defs/WorkAttemptListCursorV1"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","remaining","resume"],type:"object"}]},b9={description:"Opaque resume point for the next page of one attempt-list-family read,\nbound to the operation and `page_size` that minted it and pinned to the\nverified topology generation the page was read under.",type:"string"},b5={additionalProperties:!1,properties:{completed:{format:"uint64",minimum:0,type:"integer"},total:{format:"uint64",minimum:0,type:"integer"}},required:["completed","total"],type:"object"},b8={additionalProperties:!1,properties:{accepted_proposal:{$ref:"#/$defs/ProposalId",description:"Exact accepted proposal the attempt was admitted against. A superseded\nor cleared proposal is a different binding, not a compatible refresh."},event_sequence:{description:"Exact immutable product event that verified this graph version.",format:"uint64",minimum:0,type:"integer"},graph_version:{format:"uint64",minimum:0,type:"integer"},recovered_graph_digest:{$ref:"#/$defs/ManifestDigest",description:"Digest of the graph recovered and verified at admission."},source_watermark:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},description:"Source-frontier identity preserved from the verified product graph.",type:"object"}},required:["graph_version","event_sequence","source_watermark","recovered_graph_digest","accepted_proposal"],type:"object"},b7={description:"How one provider attempt ended, as observed by the daemon runtime.",oneOf:[{properties:{code:{format:"int32",type:"integer"},outcome:{const:"exited",type:"string"}},required:["outcome","code"],type:"object"},{properties:{outcome:{const:"signalled",type:"string"},signal:{format:"int32",type:"integer"}},required:["outcome","signal"],type:"object"},{properties:{outcome:{const:"timed_out",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"cancelled",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"provider_unavailable",type:"string"},state:{$ref:"#/$defs/WorkProviderAvailabilityV1"}},required:["outcome","state"],type:"object"},{properties:{channel:{$ref:"#/$defs/WorkAttemptStreamChannelV1"},outcome:{const:"stream_overflow",type:"string"}},required:["outcome","channel"],type:"object"},{properties:{outcome:{const:"launch_failed",type:"string"}},required:["outcome"],type:"object"},{description:"The provider started but its typed protocol session did not reach a\nterminal answer: a malformed, out-of-order, oversized, or lost frame.\nPlan 32 requires such a stream to seal failed evidence rather than a\ntext-scraped success.",properties:{outcome:{const:"protocol_failed",type:"string"}},required:["outcome"],type:"object"}]},$e={additionalProperties:!1,properties:{artifacts:{items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},evidence:{anyOf:[{$ref:"#/$defs/WorkAttemptEvidenceRecordV1"},{type:"null"}]},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["identity","artifacts"],type:"object"},$t={enum:["leased","running","cancellation_requested","cancellation_acknowledged","cancellation_escalated","recovery_required","succeeded","failed","timed_out","cancelled"],type:"string"},$r={enum:["stdout","stderr"],type:"string"},$i={additionalProperties:!1,description:"Bounded summary of one captured provider stream.",properties:{byte_length:{format:"uint64",minimum:0,type:"integer"},digest:{$ref:"#/$defs/ManifestDigest"},truncated:{type:"boolean"}},required:["byte_length","truncated","digest"],type:"object"},$o={additionalProperties:!1,description:"The verified Work topology snapshot one attempt-list page was read under.",properties:{generation:{description:"The verified graph generation the topology snapshot is published under.",type:"string"},task_count:{description:"The number of tasks in the verified topology.",format:"uint32",minimum:0,type:"integer"}},required:["generation","task_count"],type:"object"},$n={properties:{actual_route:{anyOf:[{$ref:"#/$defs/WorkProviderRouteV1"},{type:"null"}]},artifacts:{items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},cancellation:{$ref:"#/$defs/WorkCancellationStateV1"},execution:{$ref:"#/$defs/WorkExecutionEnvelopeV1"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},lease:{$ref:"#/$defs/WorkLeaseFenceV1"},progress:{anyOf:[{$ref:"#/$defs/WorkAttemptProgressV1"},{type:"null"}]},projection_binding:{$ref:"#/$defs/WorkAttemptProjectionBindingV1"},recovery:{$ref:"#/$defs/WorkRecoveryStateV1"},requested_route:{$ref:"#/$defs/WorkProviderRouteV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"},terminal:{anyOf:[{$ref:"#/$defs/WorkTerminalEvidenceV1"},{type:"null"}]}},required:["identity","projection_binding","execution","lease","state","artifacts","cancellation","recovery","requested_route"],type:"object"},$a={additionalProperties:!1,properties:{acknowledged_at:{$ref:"#/$defs/UtcMicros"},request:{$ref:"#/$defs/WorkCancellationRequestV1"}},required:["request","acknowledged_at"],type:"object"},$s={additionalProperties:!1,properties:{acknowledgement:{$ref:"#/$defs/WorkCancellationAcknowledgementV1"},escalated_at:{$ref:"#/$defs/UtcMicros"}},required:["acknowledgement","escalated_at"],type:"object"},$d={description:"Strongly typed canonical identity: `WorkCancellationRequestId`.",type:"string"},$c={additionalProperties:!1,properties:{request_id:{$ref:"#/$defs/WorkCancellationRequestId"},requested_at:{$ref:"#/$defs/UtcMicros"}},required:["request_id","requested_at"],type:"object"},$l={oneOf:[{properties:{state:{const:"none",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"requested",type:"string"},value:{$ref:"#/$defs/WorkCancellationRequestV1"}},required:["state","value"],type:"object"},{properties:{state:{const:"acknowledged",type:"string"},value:{$ref:"#/$defs/WorkCancellationAcknowledgementV1"}},required:["state","value"],type:"object"},{properties:{state:{const:"escalated",type:"string"},value:{$ref:"#/$defs/WorkCancellationEscalationV1"}},required:["state","value"],type:"object"}]},$p={description:"Strongly typed canonical identity: `WorkCommandId`.",type:"string"},$u={description:"Where a configured route places task content.",enum:["local","tenant","external"],type:"string"},$m={additionalProperties:!1,properties:{topology_generation:{$ref:"#/$defs/WorkTopologyGenerationRefV1"},work_generation:{$ref:"#/$defs/ProjectionGenerationId"}},required:["work_generation","topology_generation"],type:"object"},$f={additionalProperties:!1,properties:{cost_micros:{format:"uint64",minimum:0,type:["integer","null"]},coverage:{$ref:"#/$defs/CoverageStateV1"},effect_count:{format:"uint64",minimum:0,type:["integer","null"]},effect_outcome:{$ref:"#/$defs/DuplicateEffectOutcomeV1"},evidence:{$ref:"#/$defs/QuantityEvidenceClassV1"},test_count:{format:"uint64",minimum:0,type:["integer","null"]},token_count:{format:"uint64",minimum:0,type:["integer","null"]},wall_micros:{format:"uint64",minimum:0,type:["integer","null"]}},required:["evidence","effect_outcome","coverage"],type:"object"},$h={description:"Effect semantics admitted for one provider attempt.",enum:["observational","intercepted","compound_non_repeatable"],type:"string"},$y={description:"Declared effort class of a configured route.",enum:["minimal","standard","extended"],type:"string"},$g={enum:["deny","allowlisted"],type:"string"},$_={oneOf:[{additionalProperties:!1,properties:{cursor:{type:"string"},kind:{const:"anchor",type:"string"},link_id:{type:"string"}},required:["kind","link_id","cursor"],type:"object"},{additionalProperties:!1,properties:{continuation:{$ref:"#/$defs/WorkTaskSessionContinuationV1"},kind:{const:"task_session",type:"string"}},required:["kind","continuation"],type:"object"}]},$v={additionalProperties:!1,description:"One immutable evidence frontier. Local code/session evidence and live Git\nevidence each carry their own frontier; the evaluator never merges,\nsubstitutes, or advances one from the other.",properties:{digest:{$ref:"#/$defs/ManifestDigest"},watermark:{$ref:"#/$defs/UtcMicros"}},required:["watermark","digest"],type:"object"},$b={additionalProperties:!1,description:"Exact on-disk executable selected for one opaque executable identity.\n\nThe path is configuration data, never a lookup hint. Runtime admission\ncanonicalizes it again and verifies the file bytes against\n`executable.artifact_digest` before returning an executable binding.",properties:{canonical_path:{type:"string"},capabilities:{items:{$ref:"#/$defs/WorkExecutableCapabilityV1"},type:"array"},executable:{$ref:"#/$defs/WorkExecutableReference"},routes:{items:{$ref:"#/$defs/WorkRouteCandidateV1"},type:"array"}},required:["executable","canonical_path","capabilities","routes"],type:"object"},$$={description:"One executable capability admitted by a configured artifact binding.\n\nThe closed variants bind a provider backend to its exact wire protocol.\nCallers cannot claim an arbitrary backend/protocol combination.",enum:["claude_code_stream_json","codex_app_server_json_rpc","codex_cli_exec_json"],type:"string"},$S={additionalProperties:!1,properties:{artifact_digest:{$ref:"#/$defs/ManifestDigest"},executable_id:{type:"string"}},required:["executable_id","artifact_digest"],type:"object"},$k={additionalProperties:!1,description:"Exact immutable provider admission attached to the durable Work attempt.\n\nCallers name typed route and scope facts, never argv, environment entries,\nor executable paths. The daemon resolves the registered executable only\nafter this envelope has been persisted and admitted to the canonical queue.",properties:{attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},cancellation_generation:{format:"uint64",minimum:0,type:"integer"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},instructions:{description:"Exact provider instructions admitted with this attempt. The adapter\ndelivers these bytes verbatim on the provider's typed input channel;\nthey are never interpolated into argv or an ambient prompt source.",type:"string"},operation:{$ref:"#/$defs/WorkflowOperationRef"},project_id:{$ref:"#/$defs/ProjectId"},projection_binding:{$ref:"#/$defs/WorkAttemptProjectionBindingV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"},worktree_root:{type:"string"}},required:["attempt_identity","projection_binding","operation","execution_snapshot","project_id","repository_id","worktree_id","worktree_root","commit","instructions","cancellation_generation","effect_state"],type:"object"},$w={additionalProperties:!1,properties:{max_concurrency:{format:"uint32",minimum:0,type:"integer"},max_input_tokens:{format:"uint64",minimum:0,type:"integer"},max_output_tokens:{format:"uint64",minimum:0,type:"integer"},max_protocol_bytes:{format:"uint64",minimum:0,type:"integer"},max_stderr_bytes:{format:"uint64",minimum:0,type:"integer"},max_stdout_bytes:{format:"uint64",minimum:0,type:"integer"}},required:["max_input_tokens","max_output_tokens","max_stdout_bytes","max_stderr_bytes","max_protocol_bytes","max_concurrency"],type:"object"},$P={additionalProperties:!1,description:"Immutable provider and topology authority pinned for exactly one Work\nexecution. Every constraint the execution is governed by is named here;\nnothing in this value is an opaque stand-in that a reader must resolve\nagainst a mutable store.",properties:{approval:{$ref:"#/$defs/WorkApprovalPolicy"},backend:{$ref:"#/$defs/WorkProviderBackendV1"},configuration_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},configuration_snapshot_id:{$ref:"#/$defs/ConfigurationSnapshotId"},credential_references:{items:{$ref:"#/$defs/CredentialReferenceId"},type:"array",uniqueItems:!0},deadline:{$ref:"#/$defs/UtcMicros"},effective_behavior_digest:{$ref:"#/$defs/ManifestDigest"},egress:{$ref:"#/$defs/WorkEgressPolicy"},environment_allowlist:{items:{type:"string"},type:"array",uniqueItems:!0},executable:{$ref:"#/$defs/WorkExecutableReference"},fallback:{$ref:"#/$defs/WorkFallbackTopology"},filesystem:{$ref:"#/$defs/WorkFilesystemPolicy"},limits:{$ref:"#/$defs/WorkExecutionLimits"},model:{type:"string"},protocol:{$ref:"#/$defs/WorkProviderProtocol"},resolution_provenance_digest:{$ref:"#/$defs/ManifestDigest"},route:{$ref:"#/$defs/WorkProviderRouteV1"},sandbox:{$ref:"#/$defs/WorkSandboxPolicy"},topology:{$ref:"#/$defs/WorkTopologyPolicyV1",description:"See [`WorkExecutionSnapshotInput::topology`]. Validated on construction,\nso an admitted snapshot can never pin a topology that weakens the\nprotected-ref floor or permits a native integration without its gates."}},required:["configuration_revision_id","configuration_snapshot_id","effective_behavior_digest","resolution_provenance_digest","route","backend","protocol","model","executable","sandbox","approval","filesystem","egress","environment_allowlist","credential_references","limits","deadline","fallback","topology"],type:"object"},$V={enum:["language","framework","architecture","testing","operations","security","domain"],type:"string"},$R={additionalProperties:!1,description:"Explicit, expiring consent for ephemeral expertise context.\n\nUser-profile and project authorization are separate registered settings;\nWork requires both and uses only their category intersection.",properties:{allowed_categories:{items:{$ref:"#/$defs/WorkExpertiseCategoryV1"},type:"array",uniqueItems:!0},enabled:{type:"boolean"},expires_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},granted_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["schema_version","enabled","allowed_categories"],type:"object"},$q={oneOf:[{additionalProperties:!1,properties:{kind:{const:"disabled",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{executable:{$ref:"#/$defs/WorkExecutableReference"},kind:{const:"codex_cli",type:"string"},route:{$ref:"#/$defs/WorkProviderRouteV1"}},required:["kind","route","executable"],type:"object"}]},$I={format:"uint64",minimum:0,title:"WorkFenceEpochV1",type:"integer"},$x={enum:["read_only","workspace_write"],type:"string"},$j={oneOf:[{additionalProperties:!1,properties:{item:{$ref:"#/$defs/WorkItemV1"},kind:{const:"task_added",type:"string"}},required:["kind","item"],type:"object"},{additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},kind:{const:"task_created",type:"string"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"}},required:["kind","initiative","plan","milestone","item"],type:"object"},{additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},kind:{const:"relation_replan_decided",type:"string"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["kind","proposal","disposition","decided_at"],type:"object"},{additionalProperties:!1,properties:{applied_at:{$ref:"#/$defs/UtcMicros"},kind:{const:"task_relations_replanned",type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"}},required:["kind","proposal_id","applied_at"],type:"object"},{additionalProperties:!1,properties:{evidence:{$ref:"#/$defs/TaskEvidenceLinkV1"},kind:{const:"evidence_linked",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","evidence"],type:"object"},{additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},kind:{const:"proposal_decided",type:"string"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["kind","proposal","disposition","decided_at"],type:"object"},{additionalProperties:!1,properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},kind:{const:"proposal_accepted",type:"string"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["kind","proposal","accepted_at"],type:"object"},{additionalProperties:!1,properties:{admitted_at:{$ref:"#/$defs/UtcMicros"},based_on_version:{format:"uint64",minimum:0,type:"integer"},kind:{const:"execution_admitted",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","based_on_version","admitted_at"],type:"object"},{additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},kind:{const:"accepted_attempt_linked",type:"string"},linked_at:{$ref:"#/$defs/UtcMicros"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","based_on_version","identity","linked_at"],type:"object"},{additionalProperties:!1,properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},evidence_by_criterion:{additionalProperties:{type:"string"},type:"object"},kind:{const:"task_accepted",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","evidence_by_criterion","accepted_at"],type:"object"},{additionalProperties:!1,properties:{handoff:{$ref:"#/$defs/WorkHandoffV1"},kind:{const:"handoff_recorded",type:"string"}},required:["kind","handoff"],type:"object"}]},$C={additionalProperties:!1,description:"One attempt on the evidence frontier: exactly which attempt, in which\nstate, backed by which sealed evidence digest (when the attempt has\nreported one). No lease or fence is part of the frontier. Those are\nruntime authority, not checkpoint evidence.",properties:{evidence_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"The digest of the sealed terminal evidence record, when the attempt\nhas one. `None` is the typed not-yet-reported state."},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["identity","state"],type:"object"},$T={additionalProperties:!1,description:"The exact work/evidence frontier one handoff records.",properties:{attempts:{description:"The evidence frontier: every attempt the issuer knows about, in\nstable identity order.",items:{$ref:"#/$defs/WorkHandoffAttemptFrontierV1"},type:"array"},blockers:{description:"What is blocking progress. Bounded, non-empty entries.",items:{type:"string"},type:"array"},legal_actions:{description:"The actions the issuer believes are legal next steps.",items:{type:"string"},type:"array"},lineage:{$ref:"#/$defs/WorkHandoffLineageV1"},task_id:{$ref:"#/$defs/TaskId"},unknowns:{description:"What the issuer does not know yet. Bounded, non-empty entries.",items:{type:"string"},type:"array"},work_version:{description:"The exact Work version the frontier was cut at.",format:"uint64",minimum:0,type:"integer"}},required:["task_id","work_version","attempts","unknowns","blockers","legal_actions","lineage"],type:"object"},$O={additionalProperties:!1,description:"Who issued this frontier and what it supersedes.",properties:{issued_at:{$ref:"#/$defs/UtcMicros"},issued_by:{$ref:"#/$defs/ActorId"},prior_frontier_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"The canonical digest of the frontier this one supersedes, when the\ntask has been handed off before. `None` states a first handoff."}},required:["issued_by","issued_at"],type:"object"},$E={additionalProperties:!1,properties:{evidence_frontier:{items:{type:"string"},type:"array",uniqueItems:!0},from_actor:{$ref:"#/$defs/ActorId"},handed_off_at:{$ref:"#/$defs/UtcMicros"},handoff_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"},to_actor:{$ref:"#/$defs/ActorId"},unknowns:{items:{type:"string"},type:"array",uniqueItems:!0}},required:["handoff_id","task_id","from_actor","to_actor","evidence_frontier","unknowns","handed_off_at"],type:"object"},$A={additionalProperties:!1,properties:{initiative_id:{type:"string"},milestone_id:{type:"string"},plan_id:{type:"string"}},required:["initiative_id","plan_id","milestone_id"],type:"object"},$W={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},title:{type:"string"}},required:["id","title","created_at"],type:"object"},$M={additionalProperties:!1,properties:{acceptance_criteria:{items:{$ref:"#/$defs/WorkAcceptanceCriterionV1"},type:"array"},causal_candidates:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},created_at:{$ref:"#/$defs/UtcMicros"},deadline:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},dependencies:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},effort:{format:"uint32",minimum:0,type:"integer"},hierarchy:{$ref:"#/$defs/WorkHierarchyV1"},informational_relations:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},scheduled_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},task_id:{$ref:"#/$defs/TaskId"},title:{type:"string"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","hierarchy","title","dependencies","informational_relations","causal_candidates","acceptance_criteria","effort","created_at","updated_at"],type:"object"},$N={additionalProperties:!1,properties:{accepted_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},accepted_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},accepted_criteria:{additionalProperties:{type:"string"},type:"object"},accepted_proposal:{anyOf:[{$ref:"#/$defs/ProposalId"},{type:"null"}]},accepted_route:{anyOf:[{$ref:"#/$defs/WorkRouteDecisionV1"},{type:"null"}]},archived_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},evidence_links:{items:{type:"string"},type:"array",uniqueItems:!0},execution_admitted_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},handoffs:{items:{$ref:"#/$defs/WorkHandoffV1"},type:"array"},input:{$ref:"#/$defs/WorkItemInputV1"}},required:["input","evidence_links","accepted_criteria","accepted_attempts","handoffs"],type:"object"},$z={description:"A job task key: `[a-z0-9-]`, 1 to 48 bytes. Identities derive from it.",type:"string"},$D={additionalProperties:!1,properties:{epoch:{$ref:"#/$defs/WorkFenceEpochV1"},lease_id:{$ref:"#/$defs/WorkLeaseId"}},required:["lease_id","epoch"],type:"object"},$F={description:"Strongly typed canonical identity: `WorkLeaseId`.",type:"string"},$L={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},plan_id:{type:"string"},title:{type:"string"}},required:["id","plan_id","title","created_at"],type:"object"},$U={description:"Ordinal band. Never a probability, never a scalar score.\n\nBands are ordered `Lowest` .. `Highest`. Comparison is the only operation\nconsumers perform over them, so no weighted sum can be reconstructed from\na recorded decision.",enum:["lowest","low","moderate","high","highest"],type:"string"},$H={description:"Closed set of conditions that block admission or removal.",oneOf:[{const:"dirty_tracked_files",description:"Tracked files differ from the index or HEAD.",type:"string"},{const:"untracked_data",description:"Untracked data is present in the target.",type:"string"},{const:"unique_commits",description:"The target holds commits reachable from nowhere else.",type:"string"},{const:"active_holder",description:"Another admitted placement holds this target.",type:"string"},{const:"unresolved_effect",description:"An effect against this placement is unresolved.",type:"string"},{const:"unacknowledged_receipt",description:"A receipt produced against this placement is unacknowledged.",type:"string"},{const:"uncertain_pull_request",description:"A pull request produced from this placement is in an uncertain state.",type:"string"},{const:"shared_ref",description:"A ref in this target is shared with another holder.",type:"string"},{const:"missing_anchor",description:"A retrieval or evidence anchor this placement referenced is missing.",type:"string"},{const:"stale_scope",description:"The authorized scope no longer matches the placement.",type:"string"},{const:"authorization_lost",description:"Authorization for this placement was lost.",type:"string"},{const:"target_unreadable",description:"The target could not be read, so its state is unknown.",type:"string"},{const:"network_required",description:"The placement declared itself network-free but the action needs network.",type:"string"}],title:"WorkPlacementBlockerV1"},$G={additionalProperties:!1,description:"Which run a placement belongs to. Placement never redefines TaskId.",properties:{run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id"],title:"WorkPlacementIdentityV1",type:"object"},$B={description:"The supported placement choices, and only those.",oneOf:[{const:"no_managed_placement",description:"TraceDecay manages no checkout for this run. No-Git work is first class.",type:"string"},{const:"clean_in_place",description:"The caller's own strictly clean checkout, explicitly acknowledged.",type:"string"},{const:"linked_worktree",description:"A linked worktree of the same repository.",type:"string"},{const:"isolated_clone",description:"An isolated local clone.",type:"string"}],title:"WorkPlacementKindV1"},$K={description:"The durable state of one admitted placement.",oneOf:[{const:"admitted",description:"The placement holds its target.",type:"string"},{const:"released",description:"The placement gave its target up cleanly. Nothing was deleted by this\ntransition; removal is a separate cleanup preflight.",type:"string"},{const:"quarantined",description:"The placement was retained because removal is blocked.",type:"string"}],title:"WorkPlacementStateV1"},$J={additionalProperties:!1,description:"The exact placement a caller asked for.",properties:{in_place_acknowledged:{description:"Set only for `CleanInPlace`: the caller states it accepts running in\nits own checkout. Acknowledgement is explicit, never inferred.",type:"boolean"},kind:{$ref:"#/$defs/WorkPlacementKindV1"},network_free:{description:"The placement declares it needs no network. Declared, not detected.",type:"boolean"},root:{description:"Absolute root, present exactly when the kind manages one.",type:["string","null"]}},required:["kind","in_place_acknowledged","network_free"],title:"WorkPlacementTargetV1",type:"object"},$Z={additionalProperties:!1,description:"One run's durable placement relation.",properties:{authority_version:{format:"uint64",minimum:0,type:"integer"},blockers:{items:{$ref:"#/$defs/WorkPlacementBlockerV1"},type:"array",uniqueItems:!0},identity:{$ref:"#/$defs/WorkPlacementIdentityV1"},retention_eligible_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],description:"When retention makes this placement *eligible* for a fresh cleanup\npreflight. Eligibility is not delete authority."},state:{$ref:"#/$defs/WorkPlacementStateV1"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["identity","target","state","authority_version","transitioned_at","blockers"],title:"WorkPlacementV1",type:"object"},$Q={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},initiative_id:{type:"string"},title:{type:"string"}},required:["id","initiative_id","title","created_at"],type:"object"},$X={oneOf:[{additionalProperties:!1,properties:{kind:{const:"project",type:"string"},project_id:{$ref:"#/$defs/ProjectId"}},required:["kind","project_id"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"repository",type:"string"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"}},required:["kind","project_id","repository_id"],type:"object"}]},$Y={additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},source_store_id:{$ref:"#/$defs/SourceStoreId"}},required:["source_store_id","anchor_id","evidence_digest"],type:"object"},$1={oneOf:[{additionalProperties:!1,properties:{graph:{$ref:"#/$defs/WorkProductGraphV1"},kind:{const:"created",type:"string"}},required:["kind","graph"],type:"object"},{additionalProperties:!1,properties:{change:{$ref:"#/$defs/WorkGraphChangeV1"},kind:{const:"changed",type:"string"}},required:["kind","change"],type:"object"}]},$0={additionalProperties:!1,properties:{actor_id:{$ref:"#/$defs/ActorId"},authorized_relation_scopes:{items:{$ref:"#/$defs/WorkProductAuthorizedRelationScopeV1"},type:"array"},canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},catalog_generation_id:{$ref:"#/$defs/CatalogGenerationId"},causation_event_id:{type:["string","null"]},command_id:{$ref:"#/$defs/WorkCommandId"},configuration_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},event_id:{type:"string"},evidence:{items:{$ref:"#/$defs/WorkProductEventEvidenceV1"},type:"array"},expected_graph_version:{format:"uint64",minimum:0,type:["integer","null"]},occurred_at:{$ref:"#/$defs/UtcMicros"},owner_scope:{$ref:"#/$defs/WorkProductProfileScopeV1"},payload:{$ref:"#/$defs/WorkProductEventPayloadV1"},policy_revision_id:{type:"string"},result_graph_version:{format:"uint64",minimum:0,type:"integer"},sequence:{format:"uint64",minimum:0,type:"integer"},source_watermark:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},type:"object"}},required:["event_id","sequence","actor_id","owner_scope","authorized_relation_scopes","result_graph_version","command_id","canonical_input_digest","evidence","source_watermark","occurred_at","policy_revision_id","configuration_revision_id","catalog_generation_id","payload"],type:"object"},$2={oneOf:[{additionalProperties:!1,properties:{authority:{const:"no_prior_graph",type:"string"}},required:["authority"],type:"object"},{additionalProperties:!1,properties:{authority:{const:"verified",type:"string"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["authority","verified_version"],type:"object"}]},$4={additionalProperties:!1,properties:{evidence:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},initiatives:{items:{$ref:"#/$defs/WorkInitiativeV1"},type:"array"},items:{items:{$ref:"#/$defs/WorkItemV1"},type:"array"},milestones:{items:{$ref:"#/$defs/WorkMilestoneV1"},type:"array"},plans:{items:{$ref:"#/$defs/WorkPlanV1"},type:"array"},proposal_decisions:{items:{$ref:"#/$defs/WorkProposalDecisionV1"},type:"array"},relation_replan_decisions:{items:{$ref:"#/$defs/WorkRelationReplanDecisionV1"},type:"array"},version:{format:"uint64",minimum:0,type:"integer"}},required:["version","initiatives","plans","milestones","items","proposal_decisions","relation_replan_decisions","evidence"],type:"object"},$6={additionalProperties:!1,properties:{causation_event_id:{type:["string","null"]},command_id:{$ref:"#/$defs/WorkCommandId"},evidence:{items:{$ref:"#/$defs/WorkProductEventEvidenceV1"},type:"array"},expected_authority:{$ref:"#/$defs/WorkProductExpectedAuthorityV1"},occurred_at:{$ref:"#/$defs/UtcMicros"},revisions:{$ref:"#/$defs/WorkProductRevisionPinsV1"}},required:["expected_authority","command_id","evidence","occurred_at","revisions"],type:"object"},$3={additionalProperties:!1,properties:{event:{$ref:"#/$defs/WorkProductEventV1"},replayed:{type:"boolean"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["event","verified_graph_version","replayed"],type:"object"},$9={additionalProperties:!1,properties:{brain_id:{$ref:"#/$defs/BrainId"},profile_id:{$ref:"#/$defs/UserProfileId"}},required:["brain_id","profile_id"],type:"object"},$5={oneOf:[{properties:{initiative_id:{type:"string"},kind:{const:"initiative_contains_plan",type:"string"},plan_id:{type:"string"}},required:["kind","initiative_id","plan_id"],type:"object"},{properties:{kind:{const:"plan_contains_milestone",type:"string"},milestone_id:{type:"string"},plan_id:{type:"string"}},required:["kind","plan_id","milestone_id"],type:"object"},{properties:{kind:{const:"milestone_contains_task",type:"string"},milestone_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","milestone_id","task_id"],type:"object"},{properties:{dependency:{$ref:"#/$defs/TaskId"},dependent:{$ref:"#/$defs/TaskId"},kind:{const:"gates",type:"string"}},required:["kind","dependency","dependent"],type:"object"},{properties:{kind:{const:"informational",type:"string"},source:{$ref:"#/$defs/TaskId"},target:{$ref:"#/$defs/TaskId"}},required:["kind","source","target"],type:"object"},{properties:{cause:{$ref:"#/$defs/TaskId"},effect:{$ref:"#/$defs/TaskId"},kind:{const:"causal_candidate",type:"string"}},required:["kind","cause","effect"],type:"object"},{properties:{kind:{const:"evidence",type:"string"},link_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","link_id"],type:"object"},{properties:{identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},kind:{const:"accepted_attempt",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","identity"],type:"object"},{properties:{handoff_id:{type:"string"},kind:{const:"handoff",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","handoff_id"],type:"object"},{properties:{kind:{const:"proposal_decision",type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"},task_id:{$ref:"#/$defs/TaskId"}},required:["kind","task_id","proposal_id"],type:"object"}]},$8={additionalProperties:!1,properties:{catalog_generation_id:{$ref:"#/$defs/CatalogGenerationId"},configuration_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},policy_revision_id:{type:"string"}},required:["policy_revision_id","configuration_revision_id","catalog_generation_id"],type:"object"},$7={description:"The exact owner-relative relation set selected for a canonical Work graph.\n\nThis identity lives in the domain because attempt admission must retain\nit byte-for-byte through provider settlement. Reconstructing it from a\nproject context would conflate explicit no-Git work with a scoped\nrepository relation.",oneOf:[{properties:{selection:{const:"profile_owned_no_git",type:"string"}},required:["selection"],type:"object"},{properties:{relation_scopes:{items:{$ref:"#/$defs/WorkProductAuthorizedRelationScopeV1"},type:"array",uniqueItems:!0},selection:{const:"relations",type:"string"}},required:["selection","relation_scopes"],type:"object"}]},Se={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},St={enum:["accepted","rejected","superseded"],type:"string"},Sr={additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},children:{items:{$ref:"#/$defs/WorkProposedChildV1"},type:"array"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},explanation:{type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"},route:{$ref:"#/$defs/WorkRouteDecisionV1"},shape:{$ref:"#/$defs/WorkShapeAssessmentV1"},sizing:{$ref:"#/$defs/WorkSizingV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["proposal_id","task_id","based_on_version","shape","sizing","children","route","explanation","evidence_digest","configuration_digest"],type:"object"},Si={additionalProperties:!1,properties:{dependencies:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},effort:{format:"uint32",minimum:0,type:"integer"},task_id:{$ref:"#/$defs/TaskId"},title:{type:"string"}},required:["task_id","title","effort","dependencies"],type:"object"},So={description:"Typed provider availability observed at negotiation. These are product\nstates, not transport errors: each one names why the configured native\nprovider could not run, without inventing a fallback.",oneOf:[{const:"absent",description:"No executable binding is configured for the pinned executable identity.",type:"string"},{const:"stale",description:"The configured binding no longer matches the pinned reference.",type:"string"},{const:"unsupported",description:"The configured binding does not admit the pinned backend/protocol.",type:"string"},{const:"digest_mismatch",description:"The on-disk executable bytes do not match the pinned digest.",type:"string"},{const:"unavailable",description:"The configured executable could not be read or is not executable.",type:"string"}]},Sn={description:"Provider protocol selected by the pinned Work configuration snapshot.",enum:["claude_code_cli","codex_app_server","codex_cli"],type:"string"},Sa={additionalProperties:!1,description:'Why an admitted attempt did not run on the backend its pinned execution\nsnapshot preferred.\n\nPlan 32 (`docs/plans/tracedecay-v2/32-dynamic-workflow-runtime-and-sdk.md`,\n"Native provider execution") admits the Codex CLI "only when app-server is\nunsupported or absent before session start and the pinned Plan 20 snapshot\nexplicitly allows that fallback", and the plan index requires that fallback\nto be "reported rather than hidden". This record is that report: it names\nthe preferred backend, the typed state that disqualified it, and the\nconfiguration-bounded fallback that was selected, so a fallback run can\nnever be read as a first choice.\n\nIt is also written when the fallback itself was refused, so a denial keeps\nboth failures instead of collapsing them into one state.',properties:{fallback_backend:{$ref:"#/$defs/WorkProviderBackendV1",description:"The backend named by the snapshot's configured fallback topology."},fallback_route:{$ref:"#/$defs/WorkProviderRouteV1",description:"The route that fallback runs on."},fallback_state:{anyOf:[{$ref:"#/$defs/WorkProviderAvailabilityV1"},{type:"null"}],description:"`None` when the fallback actually started; `Some(state)` when the\nfallback was itself refused."},preferred_backend:{$ref:"#/$defs/WorkProviderBackendV1",description:"The backend the pinned snapshot named first."},preferred_route:{$ref:"#/$defs/WorkProviderRouteV1",description:"The route that backend would have run on."},preferred_state:{$ref:"#/$defs/WorkProviderAvailabilityV1",description:"Why the preferred backend could not be used."}},required:["preferred_backend","preferred_route","preferred_state","fallback_backend","fallback_route"],type:"object"},Ss={enum:["claude_stream_json","codex_app_server_json_rpc","codex_exec_json"],type:"string"},Sd={description:"Strongly typed canonical identity: `WorkProviderRouteId`.",type:"string"},Sc={additionalProperties:!1,properties:{provider_id:{$ref:"#/$defs/ProviderId"},route_id:{$ref:"#/$defs/WorkProviderRouteId"}},required:["provider_id","route_id"],type:"object"},Sl={oneOf:[{properties:{state:{const:"fresh",type:"string"}},required:["state"],type:"object"},{properties:{checkpoint:{anyOf:[{$ref:"#/$defs/WorkArtifactRefV1"},{type:"null"}]},source_attempt_id:{$ref:"#/$defs/AttemptId"},state:{const:"resumed",type:"string"}},required:["state","source_attempt_id"],type:"object"},{properties:{reason:{$ref:"#/$defs/WorkRestartReasonV1"},source_attempt_id:{$ref:"#/$defs/AttemptId"},state:{const:"restarted",type:"string"}},required:["state","source_attempt_id","reason"],type:"object"},{description:"The attempt cannot continue and must be recovered. A first attempt\nlost before it ever resumed anything has no predecessor, so the source\nis absent rather than pointing at the attempt itself.",properties:{observed_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/WorkRestartReasonV1"},source_attempt_id:{anyOf:[{$ref:"#/$defs/AttemptId"},{type:"null"}],default:null},state:{const:"recovery_required",type:"string"}},required:["state","reason","observed_at"],type:"object"}]},Sp={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},Su={additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},causal_candidates:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},dependencies:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},informational_relations:{items:{$ref:"#/$defs/TaskId"},type:"array",uniqueItems:!0},payload_digest:{$ref:"#/$defs/ManifestDigest"},proposal_id:{$ref:"#/$defs/ProposalId"},task_id:{$ref:"#/$defs/TaskId"}},required:["proposal_id","task_id","based_on_version","dependencies","informational_relations","causal_candidates","payload_digest"],type:"object"},Sm={enum:["lease_lost","provider_unavailable","process_lost","failure_observed"],type:"string"},Sf={enum:["runtime_failure","restart_recovery_required"],type:"string"},Sh={additionalProperties:!1,description:"A selector into the owning runtime-terminal evidence authority.\n\n`evidence_ref` is an opaque local reference. The Work retry owner resolves\nit through [`WorkRetryEvidencePortV1`]; callers never submit the evidence\ndigest, outcome, or observation time that decides eligibility.",properties:{cause:{$ref:"#/$defs/WorkRetryCauseV1"},evidence_ref:{type:"string"},source:{$ref:"#/$defs/WorkRetrySourceV1"}},required:["source","cause","evidence_ref"],type:"object"},Sy={enum:["runtime"],type:"string"},Sg={additionalProperties:!1,description:"One eligible route supplied by the authorized configuration snapshot.\n\nThe application filters these candidates by the current request grant and\nverifies the exact pinned executable before policy evaluates them.",properties:{autonomy:{$ref:"#/$defs/WorkOrdinalBandV1"},content_location:{$ref:"#/$defs/WorkContentLocationClassV1"},correctness:{$ref:"#/$defs/WorkOrdinalBandV1"},cost:{$ref:"#/$defs/WorkOrdinalBandV1"},declared_budget_ceiling:{format:"uint64",minimum:0,type:"integer"},effort:{$ref:"#/$defs/WorkEffortClassV1"},evidence_quality:{$ref:"#/$defs/WorkOrdinalBandV1"},execution:{$ref:"#/$defs/WorkRouteExecutionProfileV1"},latency:{$ref:"#/$defs/WorkOrdinalBandV1"},model_id:{type:"string"},provider_capability_id:{type:"string"},route_id:{type:"string"},sensitive_data_fitness:{$ref:"#/$defs/WorkOrdinalBandV1"}},required:["route_id","provider_capability_id","model_id","effort","declared_budget_ceiling","content_location","correctness","sensitive_data_fitness","latency","cost","autonomy","evidence_quality","execution"],type:"object"},S_={oneOf:[{properties:{alternatives:{items:{$ref:"#/$defs/WorkProviderRouteV1"},type:"array"},decision:{const:"selected",type:"string"},exclusions:{items:{type:"string"},type:"array",uniqueItems:!0},fallback:{type:"string"},recommended:{$ref:"#/$defs/WorkProviderRouteV1"}},required:["decision","recommended","alternatives","exclusions","fallback"],type:"object"},{properties:{decision:{const:"abstained",type:"string"},reason:{type:"string"}},required:["decision","reason"],type:"object"}]},Sv={additionalProperties:!1,description:"Complete execution constraints configured for one provider route.\n\nThe route candidate is the configuration authority for these values. Work\nadmission copies them into the immutable execution snapshot; provider\nadapters never supply defaults.",properties:{approval:{$ref:"#/$defs/WorkApprovalPolicy"},credential_references:{items:{$ref:"#/$defs/CredentialReferenceId"},type:"array",uniqueItems:!0},egress:{$ref:"#/$defs/WorkEgressPolicy"},environment_allowlist:{items:{type:"string"},type:"array",uniqueItems:!0},fallback:{$ref:"#/$defs/WorkFallbackTopology"},filesystem:{$ref:"#/$defs/WorkFilesystemPolicy"},limits:{$ref:"#/$defs/WorkExecutionLimits"},maximum_duration_micros:{description:"Maximum elapsed time from execution admission to provider completion.",format:"uint64",minimum:0,type:"integer"},sandbox:{$ref:"#/$defs/WorkSandboxPolicy"}},required:["sandbox","approval","filesystem","egress","environment_allowlist","credential_references","limits","maximum_duration_micros","fallback"],type:"object"},Sb={description:"A monotonically versioned control authority.",format:"uint64",minimum:0,title:"WorkRunControlAuthorityV1",type:"integer"},S$={description:"Why a run was paused or resumed. A closed vocabulary keeps the reason out\nof free text so it can be read by a projection without being a prompt.",oneOf:[{const:"operator_request",description:"An authorized operator asked for the transition.",type:"string"},{const:"human_wait",description:"The run is waiting on a human approval or answer.",type:"string"},{const:"budget_exhausted",description:"The shared budget ledger is exhausted for now.",type:"string"},{const:"recovery",description:"Recovery or failover is reconciling the run.",type:"string"}],title:"WorkRunControlReasonV1"},SS={description:'The published control state of one run.\n\nThere is no `Cancelled` here: cancellation is an attempt-level authority\nowned through the lease fence, and duplicating it as a run state would\ncreate a second place a run could be "over".',oneOf:[{const:"running",description:"New reservations are admitted.",type:"string"},{const:"paused",description:"New reservations are fenced; committed evidence is preserved.",type:"string"}],title:"WorkRunControlStateV1"},Sk={additionalProperties:!1,description:"The run's deadline as of the last control transition.\n\n`remaining_micros` is the authority; `deadline` is the absolute instant that\nremaining resolves to while the run is running. Both are recorded so a\nreader never has to recompute one from a clock it does not trust.",properties:{checkpoint_at:{$ref:"#/$defs/UtcMicros",description:"The instant the checkpoint was taken."},deadline:{$ref:"#/$defs/UtcMicros",description:"The absolute deadline the run is measured against right now."},remaining_micros:{description:"Micros left against that deadline at `checkpoint_at`. Never negative,\nand never larger than the value the previous checkpoint carried.",format:"int64",type:"integer"}},required:["deadline","remaining_micros","checkpoint_at"],title:"WorkRunDeadlineCheckpointV1",type:"object"},Sw={enum:["required"],type:"string"},SP={enum:["ordinal","heuristic","calibrated_range"],type:"string"},SV={additionalProperties:!1,properties:{ambiguity:{format:"uint8",maximum:255,minimum:0,type:"integer"},blast_radius:{format:"uint8",maximum:255,minimum:0,type:"integer"},complexity:{format:"uint8",maximum:255,minimum:0,type:"integer"},integration_overhead:{format:"uint8",maximum:255,minimum:0,type:"integer"},score_kind:{$ref:"#/$defs/WorkScoreKindV1"}},required:["score_kind","complexity","ambiguity","blast_radius","integration_overhead"],type:"object"},SR={additionalProperties:!1,properties:{coverage:{type:"string"},high:{format:"uint32",minimum:0,type:"integer"},likely:{format:"uint32",minimum:0,type:"integer"},low:{format:"uint32",minimum:0,type:"integer"},score_kind:{$ref:"#/$defs/WorkScoreKindV1"}},required:["score_kind","low","likely","high","coverage"],type:"object"},Sq={additionalProperties:!1,description:"Succeeded sources grouped by the exact artifact digest list they produced.\nGroups are ordered largest first; smaller groups are the minority\nevidence, and more than one group is the disagreement, preserved as\nstructure instead of being resolved by fiat.",properties:{artifacts:{description:"The artifact digest list every source in this group produced.",items:{$ref:"#/$defs/ManifestDigest"},type:"array"},sources:{description:"The concurring sources, in the caller's requested order.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["artifacts","sources"],type:"object"},SI={description:"Why a synthesis request was answered with the unsynthesized set instead\nof an admitted attempt.",oneOf:[{const:"no_citable_sources",description:"No source contributed a citable artifact: every source failed, was\ncancelled, timed out, is still unknown, or succeeded without\ndeclaring artifacts. There is nothing a synthesis could truthfully\ncite.",type:"string"}]},Sx={additionalProperties:!1,description:"One immutable source envelope: which attempt, and what it truthfully\ncontributed at admission time.",properties:{outcome:{$ref:"#/$defs/WorkSynthesisSourceOutcomeV1"},source:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["source","outcome"],type:"object"},Sj={description:"One sibling attempt's terminal contribution, captured verbatim from the\nWork authority at admission time.",oneOf:[{description:"The source succeeded; its declared artifact digests, in declaration\norder, are the evidence a synthesis may cite.",properties:{artifacts:{items:{$ref:"#/$defs/ManifestDigest"},type:"array"},outcome:{const:"succeeded",type:"string"}},required:["outcome","artifacts"],type:"object"},{description:"The source failed; its sealed terminal evidence digest is preserved\nso the failure stays visible in the synthesis record.",properties:{evidence:{$ref:"#/$defs/ManifestDigest"},outcome:{const:"failed",type:"string"}},required:["outcome","evidence"],type:"object"},{description:"The source timed out; preserved like a failure.",properties:{evidence:{$ref:"#/$defs/ManifestDigest"},outcome:{const:"timed_out",type:"string"}},required:["outcome","evidence"],type:"object"},{description:"The source was cancelled; preserved like a failure.",properties:{evidence:{$ref:"#/$defs/ManifestDigest"},outcome:{const:"cancelled",type:"string"}},required:["outcome","evidence"],type:"object"},{description:"The source has not reached a terminal state. The unknown is preserved\nas an unknown; it contributes no citable evidence and is never\nguessed at.",properties:{outcome:{const:"unknown",type:"string"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["outcome","state"],type:"object"}]},SC={additionalProperties:!1,description:"The ordered, digest-sealed source envelope set a synthesis admission\nconsumed. Reordering or mutating any envelope changes the digest, so a\nreplayed or tampered set is distinguishable from the admitted one.",properties:{set_digest:{$ref:"#/$defs/ManifestDigest",description:"Canonical digest over the ordered envelopes."},sources:{description:"The envelopes, exactly in the caller's requested order.",items:{$ref:"#/$defs/WorkSynthesisSourceEnvelopeV1"},type:"array"}},required:["sources","set_digest"],type:"object"},ST={additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},binding:{description:"Binds the continuation to the retrieve-evidence operation and the\nresult-shaping request fields the envelope does not echo.",type:"string"},participant_epoch:{$ref:"#/$defs/ManifestDigest"},ranking_cursor:{type:["string","null"]},source:{$ref:"#/$defs/ObservationSourceIdentityV1"},temporal_cursor:{type:["string","null"]},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["verified_version","attempt","source","participant_epoch","binding"],type:"object"},SO={oneOf:[{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"succeeded",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"},{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"failed",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"},{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"timed_out",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"},{properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"cancelled",type:"string"}},required:["outcome","evidence_digest","observed_at"],type:"object"}]},SE={description:"Strongly typed algorithm-tagged integrity digest: `WorkTopologyGenerationRefV1`.",type:"string"},SA={additionalProperties:!1,description:"Complete V1 policy. Partial values are intentionally impossible: callers\nmust provide the entire policy and validation rejects adapter-local defaults.",properties:{branch_naming:{$ref:"#/$defs/BranchNamingPolicyV1"},branch_topology:{$ref:"#/$defs/BranchTopologyPolicyV1"},concurrency:{$ref:"#/$defs/TopologyConcurrencyPolicyV1"},cross_merge:{$ref:"#/$defs/CrossMergePolicyV1"},escalation:{$ref:"#/$defs/TopologyEscalationPolicyV1"},gates:{$ref:"#/$defs/TopologyGatePolicyV1"},history_rewrite:{$ref:"#/$defs/HistoryRewritePolicyV1"},notifications:{$ref:"#/$defs/TopologyNotificationLevelV1"},placement:{$ref:"#/$defs/WorktreePlacementModeV1"},protected_refs:{items:{$ref:"#/$defs/ProtectedRefRuleV1"},type:"array"},retention:{$ref:"#/$defs/WorktreeRetentionPolicyV1"},review_topology:{$ref:"#/$defs/ReviewTopologyPolicyV1"},roots:{items:{$ref:"#/$defs/WorktreeRootPolicyV1"},type:"array"},schema_version:{format:"uint16",maximum:65535,minimum:0,type:"integer"}},required:["schema_version","placement","roots","branch_topology","review_topology","branch_naming","concurrency","cross_merge","gates","protected_refs","history_rewrite","escalation","retention","notifications"],type:"object"},SW={additionalProperties:!1,properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:0,type:"integer"},pinned_catalog_digest:{$ref:"#/$defs/ManifestDigest",description:"Must equal the live Work executable catalog digest. Validation and\nactivation report the current digest when this pin is stale."},pinned_configuration_digest:{$ref:"#/$defs/ManifestDigest"},pinned_policy_digest:{$ref:"#/$defs/ManifestDigest"},project_id:{$ref:"#/$defs/ProjectId"},steps:{items:{$ref:"#/$defs/WorkflowStep"},type:"array"}},required:["definition_id","definition_version","project_id","steps","pinned_policy_digest","pinned_configuration_digest","pinned_catalog_digest"],type:"object"},SM={description:"Strongly typed canonical identity: `WorkflowDefinitionId`.",type:"string"},SN={additionalProperties:!1,properties:{max_width:{format:"uint32",minimum:0,type:"integer"}},required:["max_width"],type:"object"},Sz={description:"Strongly typed canonical identity: `WorkflowOperationRef`.",type:"string"},SD={description:"Strongly typed canonical identity: `WorkflowOutputName`.",type:"string"},SF={additionalProperties:!1,properties:{output_name:{$ref:"#/$defs/WorkflowOutputName"},producer_step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["producer_step_id","output_name"],type:"object"},SL={additionalProperties:!1,properties:{fan_out:{anyOf:[{$ref:"#/$defs/WorkflowFanOut"},{type:"null"}]},inputs:{items:{$ref:"#/$defs/WorkflowOutputReference"},type:"array"},operation:{$ref:"#/$defs/WorkflowOperationRef"},outputs:{items:{$ref:"#/$defs/WorkflowOutputName"},type:"array"},predecessors:{items:{$ref:"#/$defs/WorkflowStepId"},type:"array",uniqueItems:!0},step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["step_id","operation","predecessors","inputs","outputs"],type:"object"},SU={description:"Strongly typed canonical identity: `WorkflowStepId`.",type:"string"},SH={additionalProperties:!1,description:"A provider's claim that one artifact of a fan-out output synthesizes its\nsibling source artifacts.",properties:{cited_source_digests:{description:"Content digests of every source artifact the synthesis consumed.",items:{$ref:"#/$defs/ManifestDigest"},type:"array",uniqueItems:!0},output_name:{$ref:"#/$defs/WorkflowOutputName",description:"The fan-out output the synthesis belongs to."},synthesis_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1",description:"The attempt that produced the synthesis artifact inside that output."}},required:["output_name","synthesis_attempt","cited_source_digests"],type:"object"},SG={enum:["require_clean","allow_untracked_only_for_preflight","read_only_preflight_only"],type:"string"},SB={description:"Strongly typed canonical identity: `WorktreeId`.",type:"string"},SK={description:"Monotonic epoch of the worktree inventory frozen into a stack revision.",format:"uint64",minimum:0,type:"integer"},SJ={description:"Strongly typed canonical identity: `WorktreeInventorySnapshotId`.",type:"string"},SZ={oneOf:[{properties:{kind:{const:"existing_worktree_only",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"sibling_of_primary_checkout",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"repository_local_root",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"configured_root",type:"string"},root_id:{type:"string"}},required:["kind","root_id"],type:"object"}]},SQ={additionalProperties:!1,properties:{abandoned_retention_seconds:{format:"uint64",minimum:1,type:["integer","null"]},automatic_gc:{$ref:"#/$defs/AutomaticWorktreeGcV1"},maximum_retained_per_repository:{format:"uint16",maximum:65535,minimum:1,type:["integer","null"]},terminal_retention_seconds:{format:"uint64",minimum:1,type:["integer","null"]}},required:["automatic_gc"],type:"object"},SX={additionalProperties:!1,properties:{locator:{$ref:"#/$defs/SensitiveFilesystemLocatorV1"},maximum_active_worktrees:{format:"uint16",maximum:65535,minimum:1,type:"integer"},repository_scope:{$ref:"#/$defs/RepositoryPlacementScopeV1"},root_id:{type:"string"}},required:["root_id","locator","repository_scope","maximum_active_worktrees"],type:"object"},SY=[{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"ActiveProjectSurfaceRequestV1",type:"object"},{$defs:{ActiveProjectBranchV1:{additionalProperties:!1,properties:{branch_drifted:{type:"boolean"},branch_resolution:{type:"string"},current_branch:{type:["string","null"]},open_active_branch:{type:["string","null"]},serving_branch:{type:["string","null"]},tracked_branch_count:{format:"uint",minimum:0,type:"integer"},warnings:{items:{type:"string"},type:"array"}},required:["branch_resolution","branch_drifted","tracked_branch_count","warnings"],type:"object"},ActiveProjectResolutionSourceV1:{enum:["active_project"],type:"string"},ActiveProjectStorageV1:{additionalProperties:!1,properties:{class:{type:"string"},data_root:{type:"string"},graph_db_exists:{type:"boolean"},graph_db_path:{type:"string"},graph_db_size_bytes:{format:"uint64",minimum:0,type:"integer"},lcm_payload_root:{type:"string"},mode:{type:"string"},response_handle_root:{type:"string"},sessions_db_path:{type:"string"}},required:["class","mode","data_root","graph_db_path","graph_db_exists","graph_db_size_bytes","sessions_db_path","response_handle_root","lcm_payload_root"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The resolved active project of this MCP session.",properties:{branch:{$ref:"#/$defs/ActiveProjectBranchV1"},project_id:{type:["string","null"]},project_root:{type:"string"},repository_id:{type:"string"},resolution_source:{$ref:"#/$defs/ActiveProjectResolutionSourceV1"},scope_prefix:{type:["string","null"]},storage:{$ref:"#/$defs/ActiveProjectStorageV1"}},required:["repository_id","project_root","resolution_source","storage","branch"],title:"ActiveProjectResultV1",type:"object"},{$defs:{AdminCliScopeV1:{description:"What a cost or analytics action reads: the served project's ledgers and\nsessions, or the whole profile's.",enum:["project","profile"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,description:"Savings and provider-usage cost over `range` (`today`, `7d`, ...).",properties:{action:{const:"cost_summary",type:"string"},range:{type:"string"},scope:{$ref:"#/$defs/AdminCliScopeV1"}},required:["action","range","scope"],type:"object"},{additionalProperties:!1,description:"Import every host's transcripts into the project's session store.",properties:{action:{const:"sessions_import",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Converge project sessions with Git history.",properties:{action:{const:"sessions_git_sync",type:"string"},dry_run:{type:"boolean"},limit_sessions:{format:"uint",minimum:0,type:"integer"},since:{format:"int64",type:"integer"}},required:["action","since","limit_sessions","dry_run"],type:"object"},{additionalProperties:!1,properties:{action:{const:"sessions_sync_status",type:"string"},idempotency_key:{type:"string"}},required:["action","idempotency_key"],type:"object"},{additionalProperties:!1,properties:{action:{const:"sessions_sync_cancel",type:"string"},idempotency_key:{type:"string"}},required:["action","idempotency_key"],type:"object"},{additionalProperties:!1,properties:{action:{const:"sessions_unfinished",type:"string"},limit:{format:"uint",minimum:0,type:"integer"}},required:["action","limit"],type:"object"},{additionalProperties:!1,description:"Import hook analytics JSONL into the accounting ledger.",properties:{action:{const:"analytics_sync",type:"string"},scope:{$ref:"#/$defs/AdminCliScopeV1"}},required:["action","scope"],type:"object"},{additionalProperties:!1,properties:{action:{const:"analytics_diagnostics",type:"string"},all:{type:"boolean"},no_sync:{type:"boolean"},scope:{$ref:"#/$defs/AdminCliScopeV1"}},required:["action","scope","all","no_sync"],type:"object"},{additionalProperties:!1,description:"Record the served project's saved-token total.",properties:{action:{const:"registry_update",type:"string"},tokens:{format:"uint64",minimum:0,type:"integer"}},required:["action","tokens"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_list",type:"string"},limit:{format:"uint",minimum:0,type:"integer"},project_arg:{description:"Checkout to mark active when the caller's connection names no\nproject.",type:["string","null"]},query:{type:["string","null"]}},required:["action","limit"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_context",type:"string"},project_arg:{description:"Project path or alias; the caller's project when omitted.",type:["string","null"]}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_empty",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"registry_project_tokens",type:"string"},project_args:{items:{type:"string"},type:"array"}},required:["action","project_args"],type:"object"},{additionalProperties:!1,description:"Plan, or with `apply` execute, collection of registry rows whose\ncheckout is gone.",properties:{action:{const:"registry_gc",type:"string"},apply:{type:"boolean"},prefix:{type:["string","null"]}},required:["action","apply"],type:"object"},{additionalProperties:!1,description:"One project's storage (`project_id` with `project_root`), or one page\nof the profile's.",properties:{action:{const:"storage_report",type:"string"},cursor:{default:null,type:["string","null"]},limit:{default:8,format:"uint",minimum:0,type:"integer"},project_id:{type:["string","null"]},project_root:{type:["string","null"]}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"gain_query",type:"string"},history:{type:"boolean"},project_arg:{type:["string","null"]},since:{format:"int64",type:"integer"}},required:["action","since","history"],type:"object"}],title:"AdminCliSurfaceRequestV1"},{$defs:{AdminCliAnalyticsImportV1:{additionalProperties:!1,properties:{imported:{format:"uint64",minimum:0,type:"integer"},sources:{description:"One row per hook JSONL source: `path`, `imported`, `skipped`, `error`.",items:!0,type:"array"}},required:["imported","sources"],type:"object"},AdminCliCostSummaryV1:{additionalProperties:!1,properties:{range:{type:"string"},summary:{$ref:"#/$defs/AdminCliCostTotalsV1"},today:{$ref:"#/$defs/AdminCliCostTodayV1"}},required:["range","summary","today"],type:"object"},AdminCliCostTodayV1:{additionalProperties:!1,properties:{provider_usage:!0},required:["provider_usage"],type:"object"},AdminCliCostTotalsV1:{additionalProperties:!1,properties:{efficiency_ratio:{description:"Saved over saved-plus-consumed; null when consumption is unmeasured.",format:"double",type:["number","null"]},provider_usage:{description:"The provider-usage cost summary as the session memory prices it."},tokens_saved:{format:"uint64",minimum:0,type:"integer"}},required:["provider_usage","tokens_saved"],type:"object"},AdminCliGainDayV1:{additionalProperties:!1,properties:{calls:{format:"uint64",minimum:0,type:"integer"},day:{description:"Start-of-day epoch seconds (UTC).",format:"int64",type:"integer"},saved_tokens:{format:"uint64",minimum:0,type:"integer"}},required:["day","saved_tokens","calls"],type:"object"},AdminCliGainHistoryV1:{additionalProperties:!1,properties:{history:{items:{$ref:"#/$defs/AdminCliGainDayV1"},type:"array"}},required:["history"],type:"object"},AdminCliGainTotalV1:{additionalProperties:!1,properties:{calls:{format:"uint64",minimum:0,type:"integer"},saved_tokens:{format:"uint64",minimum:0,type:"integer"}},required:["saved_tokens","calls"],type:"object"},AdminCliProjectTokenTotalV1:{additionalProperties:!1,description:"A project whose ledger could not be read reports a null total and the\nreason, never a measured zero.",properties:{error:{type:["string","null"]},project:{type:"string"},tokens:{format:"uint64",minimum:0,type:["integer","null"]}},required:["project"],type:"object"},AdminCliProjectTokensV1:{additionalProperties:!1,properties:{projects:{items:{$ref:"#/$defs/AdminCliProjectTokenTotalV1"},type:"array"}},required:["projects"],type:"object"},AdminCliRegistryContextV1:{oneOf:[{additionalProperties:!1,properties:{aliases:{description:"Alias rows exactly as the registry serializes them.",items:!0,type:"array"},profile_id:{type:"string"},project:{$ref:"#/$defs/PublicCodeProject"},status:{const:"ok",type:"string"},stores:{description:"Store rows exactly as the registry serializes them.",items:!0,type:"array"}},required:["status","profile_id","project","aliases","stores"],type:"object"},{additionalProperties:!1,description:"The call named no project and its connection has none.",properties:{project:{type:"null"},status:{const:"invalid",type:"string"}},required:["status","project"],type:"object"},{additionalProperties:!1,properties:{project:{type:"null"},status:{const:"not_found",type:"string"}},required:["status","project"],type:"object"}]},AdminCliRegistryEmptyV1:{additionalProperties:!1,properties:{empty:{type:"boolean"}},required:["empty"],type:"object"},AdminCliRegistryGcV1:{additionalProperties:!1,description:"The registry collection plan, with its deletion counters filled when it\nwas applied.",properties:{apply:{type:"boolean"},candidate_count:{format:"uint",minimum:0,type:"integer"},candidate_paths:{items:{type:"string"},type:"array"},candidates:{description:"Registry project rows exactly as the registry serializes them.",items:!0,type:"array"},code_project_candidate_count:{format:"uint",minimum:0,type:"integer"},deleted_code_project_count:{format:"uint",minimum:0,type:"integer"},deleted_count:{format:"uint",minimum:0,type:"integer"},deleted_storage_project_count:{format:"uint",minimum:0,type:"integer"},metadata_candidate_count:{format:"uint",minimum:0,type:"integer"},prefix:{type:["string","null"]},protected_code_project_count:{format:"uint",minimum:0,type:"integer"},protected_code_projects:{items:!0,type:"array"},storage_project_candidate_count:{format:"uint",minimum:0,type:"integer"},storage_project_candidates:{items:{type:"string"},type:"array"}},required:["apply","candidate_count","metadata_candidate_count","code_project_candidate_count","storage_project_candidate_count","protected_code_project_count","deleted_count","deleted_code_project_count","deleted_storage_project_count","candidate_paths","candidates","protected_code_projects","storage_project_candidates"],type:"object"},AdminCliRegistryListV1:{oneOf:[{additionalProperties:!1,properties:{limit:{format:"uint",minimum:0,type:"integer"},project_tree:{items:{$ref:"#/$defs/ProjectRepoGroup"},type:"array"},projects:{items:{$ref:"#/$defs/PublicCodeProject"},type:"array"},query:{type:["string","null"]},status:{const:"ok",type:"string"},summary:{$ref:"#/$defs/ProjectRegistrySummary"},truncated:{type:"boolean"}},required:["status","limit","truncated","summary","project_tree","projects"],type:"object"}]},AdminCliRegistryUpdateV1:{additionalProperties:!1,properties:{current:{format:"uint64",minimum:0,type:"integer"},previous:{description:"The total before this write; null when the ledger could not be read.",format:"uint64",minimum:0,type:["integer","null"]},previous_error:{type:["string","null"]}},required:["current"],type:"object"},AdminCliSessionSyncV1:{description:"The daemon session-sync owner's answer.",oneOf:[{additionalProperties:!1,properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},idempotency_key:{type:"string"},operation_id:{type:"string"},status:{const:"accepted",type:"string"}},required:["status","operation_id","idempotency_key","accepted_at"],type:"object"},{additionalProperties:!1,description:"An identical sync was already running; this call joined it.",properties:{accepted_at:{$ref:"#/$defs/UtcMicros"},idempotency_key:{type:"string"},operation_id:{type:"string"},status:{const:"joined",type:"string"}},required:["status","operation_id","idempotency_key","accepted_at"],type:"object"},{additionalProperties:!1,properties:{coalesced_primary:{type:["string","null"]},completed_at:{$ref:"#/$defs/UtcMicros"},coverage:{items:{$ref:"#/$defs/SessionSyncSourceCoverageV1"},type:"array"},failure_codes:{items:{type:"string"},type:"array"},idempotency_key:{type:"string"},operation_id:{type:"string"},source:{$ref:"#/$defs/SessionSyncSourceV1"},source_frontiers:{items:{$ref:"#/$defs/SessionSyncSourceFrontierV1"},type:"array"},stats:{$ref:"#/$defs/SessionSyncStatsV1"},status:{const:"complete",type:"string"},termination:{$ref:"#/$defs/OperationTermination"}},required:["status","operation_id","idempotency_key","source","termination","stats","coverage","source_frontiers","failure_codes","completed_at"],type:"object"},{additionalProperties:!1,properties:{status:{const:"cancelled",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{status:{const:"deadline_exceeded",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{status:{const:"wrong_scope",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{reason_code:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason_code"],type:"object"}]},AdminCliStorageReportV1:{additionalProperties:!1,description:"One storage report page, or one project's report.",properties:{code_generation_retention:{items:!0,type:"array"},code_generation_retention_availability:{items:!0,type:"array"},coverage:!0,full_profile_size:!0,global_db_bytes:{format:"uint64",minimum:0,type:"integer"},profile_root:{type:"string"},stores:{description:"Report rows exactly as the retention report serializes them.",items:!0,type:"array"},unregistered_bytes:{format:"uint64",minimum:0,type:"integer"},unregistered_dir_count:{format:"uint",minimum:0,type:"integer"},user_sessions_db_bytes:{default:0,format:"uint64",minimum:0,type:"integer"}},required:["profile_root","stores","code_generation_retention","code_generation_retention_availability","unregistered_dir_count","unregistered_bytes","global_db_bytes","coverage"],type:"object"},AdminCliUnfinishedSessionsV1:{additionalProperties:!1,properties:{items:{description:"Workflow state rows exactly as the session store serializes them.",items:!0,type:"array"}},required:["items"],type:"object"},OperationTermination:_L,ProjectRegistryEntry:_6,ProjectRegistrySummary:_3,ProjectRepoGroup:_9,PublicCodeProject:va,SessionSyncCoverageV1:{oneOf:[{properties:{outcome:{const:"complete",type:"string"}},required:["outcome"],type:"object"},{properties:{deferred_units:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"partial",type:"string"}},required:["outcome","deferred_units"],type:"object"},{properties:{admitted_units:{format:"uint64",minimum:0,type:"integer"},outcome:{const:"backpressured",type:"string"},rejected_units:{format:"uint64",minimum:0,type:"integer"}},required:["outcome","admitted_units","rejected_units"],type:"object"}]},SessionSyncSourceCoverageV1:{properties:{coverage:{$ref:"#/$defs/SessionSyncCoverageV1"},store_scope:{type:"string"}},required:["store_scope","coverage"],type:"object"},SessionSyncSourceFrontierV1:{description:"Exact canonical observation cursor committed by one source/store authority.",properties:{committed_cursor_json:{type:"string"},scope_json:{type:"string"},source_json:{type:"string"},store_scope:{type:"string"}},required:["store_scope","source_json","scope_json","committed_cursor_json"],type:"object"},SessionSyncSourceV1:{description:"The command that started a session sync, without its options.",oneOf:[{const:"import_transcripts",description:"Hands its remaining historical catch-up to the background refresh\nworkers.",type:"string"},{const:"synchronize_git",description:"A bounded foreground pass; nothing resumes its unfinished coverage.",type:"string"}]},SessionSyncStatsV1:{properties:{commits_attributed:{format:"uint64",minimum:0,type:"integer"},messages_imported:{format:"uint64",minimum:0,type:"integer"},sessions_imported:{format:"uint64",minimum:0,type:"integer"},sessions_scanned:{format:"uint64",minimum:0,type:"integer"},skipped:{format:"uint64",minimum:0,type:"integer"},spans_written:{format:"uint64",minimum:0,type:"integer"}},required:["sessions_imported","messages_imported","sessions_scanned","spans_written","commits_attributed","skipped"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AdminCliCostSummaryV1"},{$ref:"#/$defs/AdminCliSessionSyncV1"},{$ref:"#/$defs/AdminCliUnfinishedSessionsV1"},{$ref:"#/$defs/AdminCliAnalyticsImportV1"},{$ref:"#/$defs/AdminCliRegistryUpdateV1"},{$ref:"#/$defs/AdminCliRegistryListV1"},{$ref:"#/$defs/AdminCliRegistryContextV1"},{$ref:"#/$defs/AdminCliRegistryEmptyV1"},{$ref:"#/$defs/AdminCliProjectTokensV1"},{$ref:"#/$defs/AdminCliRegistryGcV1"},{$ref:"#/$defs/AdminCliStorageReportV1"},{$ref:"#/$defs/AdminCliGainHistoryV1"},{$ref:"#/$defs/AdminCliGainTotalV1"},{description:"The diagnostics report is the analytics bridge's open document; it\ndecodes last so it never claims another action's body."}],description:"One action's answer.",title:"AdminCliResultV1"},{$defs:{AutomaticFactReceiptStateV1:fD,AutomationReconcileScope:fG},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Every action is a struct variant: an internally tagged unit variant would\nignore keys beside its tag instead of refusing them.",oneOf:[{additionalProperties:!1,description:"Read the project's local usage counter.",properties:{action:{const:"counter_get",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Reset the project's local usage counter to zero.",properties:{action:{const:"counter_reset",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Record the project's saved-token total in the profile registry and\nread it back beside the other projects' total.",properties:{action:{const:"status_accounting",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"List terminal automatic-fact receipts.",properties:{action:{const:"automatic_fact_receipt_list",type:"string"},limit:{format:"uint",minimum:0,type:"integer"},state:{anyOf:[{$ref:"#/$defs/AutomaticFactReceiptStateV1"},{type:"null"}],description:"Only receipts in this state (default: every state)."}},required:["action","limit"],type:"object"},{additionalProperties:!1,description:"Read one automatic-fact receipt by its apply id.",properties:{action:{const:"automatic_fact_receipt_view",type:"string"},id:{type:"string"}},required:["action","id"],type:"object"},{additionalProperties:!1,description:"Reconcile automation schedulers with the saved configuration.",properties:{action:{const:"automation_reconcile",type:"string"},scope:{$ref:"#/$defs/AutomationReconcileScope"}},required:["action","scope"],type:"object"}],title:"AdminProjectSurfaceRequestV1"},{$defs:{AdminProjectCounterResetV1:{additionalProperties:!1,properties:{reset:{description:"Always true: a reset that did not settle is a refusal.",type:"boolean"}},required:["reset"],type:"object"},AdminProjectCounterV1:{additionalProperties:!1,properties:{counter:{format:"uint64",minimum:0,type:"integer"}},required:["counter"],type:"object"},AdminProjectStatusAccountingV1:{additionalProperties:!1,properties:{global_tokens_saved:{description:"Tokens the profile's other projects saved; null when they saved none.",format:"uint64",minimum:0,type:["integer","null"]},tokens_saved:{format:"uint64",minimum:0,type:"integer"}},required:["tokens_saved"],type:"object"},AutomaticFactAddRequestV1:{additionalProperties:!1,description:"The add-fact request an automatic apply recorded.",properties:{category:{$ref:"#/$defs/FactCategoryV1"},content:{type:"string"},entities:{items:{type:"string"},type:"array"},metadata:!0,source_label:{type:["string","null"]},tags:{items:{type:"string"},type:"array"},trust:{format:"double",type:"number"}},required:["content","category","tags","entities","trust","metadata"],type:"object"},AutomaticFactEvidenceV1:{additionalProperties:!1,description:"Automation evidence retained with the receipt.",properties:{evidence_hash:{type:["string","null"]},item:!0,validation:!0},type:"object"},AutomaticFactReceiptAvailabilityV1:{oneOf:[{additionalProperties:!1,properties:{state:{const:"available",type:"string"}},required:["state"],type:"object"}]},AutomaticFactReceiptListV1:{additionalProperties:!1,properties:{availability:{$ref:"#/$defs/AutomaticFactReceiptAvailabilityV1"},count:{format:"uint",minimum:0,type:"integer"},next_after_apply_id:{description:"Continue after this apply id; null on the last page.",type:["string","null"]},receipts:{items:{$ref:"#/$defs/AutomaticFactReceiptV1"},type:"array"}},required:["availability","count","receipts"],type:"object"},AutomaticFactReceiptStateV1:fD,AutomaticFactReceiptV1:{additionalProperties:!1,description:"One terminal automatic-fact apply receipt.",properties:{add_fact_request:{$ref:"#/$defs/AutomaticFactAddRequestV1"},applied_fact_id:{description:"Present when the fact was applied.",type:["string","null"]},apply_id:{type:"string"},evidence:{$ref:"#/$defs/AutomaticFactEvidenceV1"},operation_id:{type:"string"},quarantine_reason:{description:"Present when the fact was quarantined.",type:["string","null"]},recorded_at_micros:{format:"int64",type:"integer"},state:{$ref:"#/$defs/AutomaticFactReceiptStateV1"}},required:["apply_id","state","operation_id","add_fact_request","evidence","recorded_at_micros"],type:"object"},AutomaticFactReceiptViewV1:{additionalProperties:!1,properties:{receipt:{$ref:"#/$defs/AutomaticFactReceiptV1"}},required:["receipt"],type:"object"},AutomationReconcileScope:fG,AutomationSchedulerOwnerReconcileOutcome:{additionalProperties:!1,properties:{graph_db_path:{type:"string"},outcome:{$ref:"#/$defs/AutomationSchedulerReconcileOutcome"},project_id:{type:["string","null"]},scope_prefix:{type:["string","null"]},store_root:{type:"string"}},required:["store_root","graph_db_path","outcome"],type:"object"},AutomationSchedulerReconcileOutcome:{description:"What reconciling one automation scheduler did.",enum:["started","running_notified","exiting","finished","retiring","not_configured","lifecycle_inactive","owner_unavailable"],type:"string"},FactCategoryV1:yA,ProfileAutomationReconcileReport:{additionalProperties:!1,description:"Every cached project scheduler of the profile, reconciled.",properties:{cached_owners:{format:"uint",minimum:0,type:"integer"},outcomes:{items:{$ref:"#/$defs/AutomationSchedulerOwnerReconcileOutcome"},type:"array"},scope:{$ref:"#/$defs/AutomationReconcileScope",description:"Always `profile`."},uncached_projects:{$ref:"#/$defs/UncachedProjectReconcileOutcome"}},required:["scope","cached_owners","outcomes","uncached_projects"],type:"object"},ProjectAutomationReconcileReport:{additionalProperties:!1,description:"The served project's scheduler reconcile.",properties:{outcome:{$ref:"#/$defs/AutomationSchedulerReconcileOutcome"},scope:{$ref:"#/$defs/AutomationReconcileScope",description:"Always `project`."}},required:["scope","outcome"],type:"object"},UncachedProjectReconcileOutcome:{description:"A project whose scheduler is not cached reconciles when it next starts.",enum:["deferred_until_project_startup"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AdminProjectCounterV1"},{$ref:"#/$defs/AdminProjectCounterResetV1"},{$ref:"#/$defs/AdminProjectStatusAccountingV1"},{$ref:"#/$defs/AutomaticFactReceiptListV1"},{$ref:"#/$defs/AutomaticFactReceiptViewV1"},{$ref:"#/$defs/ProjectAutomationReconcileReport"},{$ref:"#/$defs/ProfileAutomationReconcileReport"}],description:"One action's result, in the shape the action has always answered.",title:"AdminProjectResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`tracedecay_admin_sync` takes no arguments: it reconciles the served\nproject.",title:"AdminSyncSurfaceRequestV1",type:"object"},{$defs:{AdminSyncAdmissionV1:{description:"The code-index scheduler's admission of the reconcile.",oneOf:[{enum:["queued"],type:"string"},{const:"not_applicable",description:"Code indexing does not apply to this project.",type:"string"}]},AdminSyncReconcileScopeV1:{description:"What the reconcile covers.",enum:["authoritative_project"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{project_root:{type:"string"},reconcile_scope:{$ref:"#/$defs/AdminSyncReconcileScopeV1"},status:{$ref:"#/$defs/AdminSyncAdmissionV1"}},required:["reconcile_scope","status","project_root"],title:"AdminSyncResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{depth:{description:"Maximum dependency traversal depth (default: 5, at most 10).",format:"uint32",minimum:0,type:["integer","null"]},files:{description:"List of changed file paths to analyze.",items:{type:"string"},type:"array"},filter:{description:"Custom glob pattern for test files (default: common test patterns).",type:["string","null"]}},required:["files"],title:"AffectedSurfaceRequestV1",type:"object"},{$defs:{AffectedRankingMetadataV1:{additionalProperties:!1,properties:{distance:{type:"string"},recommended_proximity:{items:{type:"string"},type:"array"},strategy:{type:"string"}},required:["strategy","distance","recommended_proximity"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RankedAffectedTestV1:{additionalProperties:!1,properties:{distance:{format:"uint",minimum:0,type:"integer"},path:{type:"string"},proximity:{type:"string"},rank:{format:"uint",minimum:0,type:"integer"}},required:["path","rank","distance","proximity"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{changed_files:{items:{type:"string"},type:"array"},count:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranked_tests:{items:{$ref:"#/$defs/RankedAffectedTestV1"},type:"array"},ranking_metadata:{$ref:"#/$defs/AffectedRankingMetadataV1"},recommended_tests:{description:"Tests within two dependency hops of a changed file.",items:{type:"string"},type:"array"}},required:["changed_files","count","ranked_tests","recommended_tests","ranking_metadata"],title:"AffectedResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Opaque daemon-minted handle accepted by the first feedback read invocation.",properties:{request_handle:{type:"string"}},required:["request_handle"],title:"FeedbackHandleRequestV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackImpactStateV1:gr,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical affected-tests projection returned by `affected_tests`.",properties:{affected_tests:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},evidence_anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},result_id:{$ref:"#/$defs/FeedbackResultId"},scope:{$ref:"#/$defs/FeedbackScopeV1"},state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},target:{anyOf:[{$ref:"#/$defs/FeedbackTargetV1"},{type:"null"}]}},required:["result_id","cycle_id","scope","affected_tests","evidence_anchors"],title:"CanonicalAffectedTestsProjectionV1",type:"object"},{$defs:{AnalyticsScopeV1:fP,AnalyticsSectionV1:{enum:["tools","hints","facts","automation"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope:{anyOf:[{$ref:"#/$defs/AnalyticsScopeV1"},{type:"null"}],description:'"project" (default) scopes analytics_events to the resolved project;\n"all" reports across every registered project.'},section:{anyOf:[{$ref:"#/$defs/AnalyticsSectionV1"},{type:"null"}],description:"Optional filter to a single section. Omit to return all sections."},window_days:{description:"Lookback window in days for events and automation runs (default: 14,\n1-365).",format:"uint32",maximum:365,minimum:1,type:["integer","null"]}},title:"AnalyticsSurfaceRequestV1",type:"object"},{$defs:{AnalyticsAutomationJobOutcomesV1:{additionalProperties:!1,properties:{failed:{format:"int64",type:"integer"},job:{type:"string"},other:{format:"int64",type:"integer"},skipped:{format:"int64",type:"integer"},succeeded:{format:"int64",type:"integer"}},required:["job","succeeded","failed","skipped","other"],type:"object"},AnalyticsAutomationOutcomesV1:{additionalProperties:!1,description:"`available` is always `true`.",properties:{available:{type:"boolean"},by_job:{items:{$ref:"#/$defs/AnalyticsAutomationJobOutcomesV1"},type:"array"},dashboard_root:{type:"string"},records_considered:{format:"uint",minimum:0,type:"integer"},records_in_window:{format:"uint",minimum:0,type:"integer"},records_truncated:{type:"boolean"}},required:["available","dashboard_root","records_considered","records_in_window","records_truncated","by_job"],type:"object"},AnalyticsAutomationSectionV1:{anyOf:[{$ref:"#/$defs/AnalyticsAutomationOutcomesV1"},{$ref:"#/$defs/AnalyticsLedgerUnavailableV1"},{$ref:"#/$defs/AnalyticsSectionUnavailableV1"}],description:"The automation run outcomes of the resolved project's ledger, or why the\nledger is unavailable."},AnalyticsCanonicalCallNameV1:{additionalProperties:!1,description:"A recorded event name that resolved to a canonical tool under another\nspelling.",properties:{calls:{format:"int64",type:"integer"},canonical_tool_name:{type:"string"},errors:{format:"int64",type:"integer"},event_name:{type:"string"}},required:["event_name","canonical_tool_name","calls","errors"],type:"object"},AnalyticsEventCallNameV1:{additionalProperties:!1,description:"A recorded event name with no advertised canonical tool.",properties:{calls:{format:"int64",type:"integer"},errors:{format:"int64",type:"integer"},event_name:{type:"string"}},required:["event_name","calls","errors"],type:"object"},AnalyticsFactFunnelV1:{additionalProperties:!1,description:"`available` is always `true`.",properties:{available:{type:"boolean"},facts:{format:"uint64",minimum:0,type:"integer"},facts_rated:{format:"uint64",minimum:0,type:"integer"},facts_retrieved:{format:"uint64",minimum:0,type:"integer"},helpful_feedback:{format:"uint64",minimum:0,type:"integer"},project_root:{type:"string"},retrievals:{format:"uint64",minimum:0,type:"integer"},unhelpful_feedback:{format:"uint64",minimum:0,type:"integer"}},required:["available","project_root","facts","retrievals","facts_retrieved","helpful_feedback","unhelpful_feedback","facts_rated"],type:"object"},AnalyticsFactsSectionV1:{anyOf:[{$ref:"#/$defs/AnalyticsFactFunnelV1"},{$ref:"#/$defs/AnalyticsProjectSectionUnavailableV1"},{$ref:"#/$defs/AnalyticsSectionUnavailableV1"}],description:"The fact-store funnel of the resolved project, or why it is unavailable.\n\nThe variants are distinguished by their exact field sets, so each one\ndenies unknown fields and the most specific shape is tried first."},AnalyticsHintCategoryV1:{properties:{category:{type:"string"},emitted:{format:"int64",type:"integer"},followed:{format:"int64",type:"integer"},ignored:{format:"int64",type:"integer"},suppressed:{format:"int64",type:"integer"}},required:["category","emitted","followed","ignored","suppressed"],type:"object"},AnalyticsHintsPayloadV1:{properties:{available:{type:"boolean"},by_category:{items:{$ref:"#/$defs/AnalyticsHintCategoryV1"},type:"array"},error:{default:null,type:["string","null"]},source:{type:"string"}},required:["available","source","by_category"],type:"object"},AnalyticsLedgerUnavailableV1:{additionalProperties:!1,description:"The ledger exists but failed to read. `available` is always `false`.",properties:{available:{type:"boolean"},dashboard_root:{type:"string"},reason:{type:"string"}},required:["available","reason","dashboard_root"],type:"object"},AnalyticsModeReadModelV1:fk,AnalyticsModeV1:fw,AnalyticsProjectSectionUnavailableV1:{additionalProperties:!1,description:"A project-scoped section whose store failed to read. `available` is\nalways `false`.",properties:{available:{type:"boolean"},project_root:{type:"string"},reason:{type:"string"}},required:["available","reason","project_root"],type:"object"},AnalyticsReportStatusV1:{description:"The settled status of an analytics report.",enum:["ok"],type:"string"},AnalyticsScopeV1:fP,AnalyticsSectionUnavailableV1:{additionalProperties:!1,description:"A section the report could not read. `available` is always `false`.",properties:{available:{type:"boolean"},reason:{type:"string"}},required:["available","reason"],type:"object"},AnalyticsTierCountsV1:{additionalProperties:!1,properties:{calls:{format:"int64",type:"integer"},errors:{format:"int64",type:"integer"},tier:{type:"string"}},required:["tier","calls","errors"],type:"object"},AnalyticsToolsSectionV1:{additionalProperties:!1,properties:{aliased_call_names:{items:{$ref:"#/$defs/AnalyticsCanonicalCallNameV1"},type:"array"},available:{type:"boolean"},available_defined_tool_count:{format:"uint",minimum:0,type:"integer"},bound_internal_call_names:{items:{$ref:"#/$defs/AnalyticsEventCallNameV1"},type:"array"},called_available_defined_tool_count:{format:"uint",minimum:0,type:"integer"},raw_distinct_event_name_count:{format:"uint",minimum:0,type:"integer"},tiers:{items:{$ref:"#/$defs/AnalyticsTierCountsV1"},type:"array"},top_tools:{items:{$ref:"#/$defs/AnalyticsTopToolV1"},type:"array"},unknown_or_retired_call_names:{items:{$ref:"#/$defs/AnalyticsEventCallNameV1"},type:"array"},zero_call_available_defined_tools:{$ref:"#/$defs/AnalyticsZeroCallToolsV1"}},required:["available","tiers","top_tools","raw_distinct_event_name_count","called_available_defined_tool_count","available_defined_tool_count","aliased_call_names","bound_internal_call_names","unknown_or_retired_call_names","zero_call_available_defined_tools"],type:"object"},AnalyticsTopToolV1:{additionalProperties:!1,properties:{calls:{format:"int64",type:"integer"},errors:{format:"int64",type:"integer"},tier:{type:"string"},tool_name:{type:"string"}},required:["tool_name","tier","calls","errors"],type:"object"},AnalyticsZeroCallToolsV1:{additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},sample:{items:{type:"string"},type:"array"},sample_truncated:{type:"boolean"}},required:["count","sample","sample_truncated"],type:"object"},ComparisonDispositionV1:hI,CostsReadModelV1:yl,CoverageStateV1:yf,LatencyDistributionReadModelV1:gJ,MetricCalibrationV1:_h,MetricCohortV1:_y,MetricCoverageV1:_g,MetricEvidenceClassV1:__,MetricProvenanceV1:_v,MetricSourceV1:_b,MetricTemporalV1:_$,MetricUncertaintyV1:_S,MetricValueV1:_k,ObservabilityHorizonV1:_W,ObservatoryReadModelV1:_N,PerformanceComparisonReadModelV1:_H,ProviderLatencyReadModelV1:vn,RejectedArgumentAnalyticsV1:vh,RejectedArgumentErrorClassV1:vy,RejectedArgumentGroupV1:vg,RejectedArgumentNameV1:v_,RejectedArgumentSurfaceV1:vv},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{automation:{anyOf:[{$ref:"#/$defs/AnalyticsAutomationSectionV1"},{type:"null"}]},costs:{anyOf:[{$ref:"#/$defs/CostsReadModelV1"},{type:"null"}],description:"Present only when no section filter was requested."},event_count:{format:"int64",type:"integer"},event_count_truncated:{type:"boolean"},facts:{anyOf:[{$ref:"#/$defs/AnalyticsFactsSectionV1"},{type:"null"}]},hints:{anyOf:[{$ref:"#/$defs/AnalyticsHintsPayloadV1"},{type:"null"}]},observatory:{anyOf:[{$ref:"#/$defs/ObservatoryReadModelV1"},{type:"null"}],description:"Present only when no section filter was requested."},project_id:{description:'The canonical analytics project key; `None` for `scope: "all"`.',type:["string","null"]},project_root:{type:"string"},scope:{$ref:"#/$defs/AnalyticsScopeV1"},since:{format:"int64",type:"integer"},status:{$ref:"#/$defs/AnalyticsReportStatusV1"},tools:{anyOf:[{$ref:"#/$defs/AnalyticsToolsSectionV1"},{type:"null"}]},window_days:{format:"uint32",minimum:0,type:"integer"}},required:["status","scope","project_root","window_days","since","event_count","event_count_truncated"],title:"AnalyticsResultV1",type:"object"},{$defs:{ManifestDigest:_l,NativeIntegrationApprovalId:_V,NativeIntegrationPreviewId:_I,NativeIntegrationTransactionId:_T},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact one-use apply request.\n\nApply accepts only an unexpired preview identity/digest plus a one-use\ncontent-bound approval. Arbitrary Git arguments, caller-supplied paths,\nSHAs, patches, commit lists, messages, environment, or config are\nunrepresentable.",properties:{approval_digest:{$ref:"#/$defs/ManifestDigest"},approval_id:{$ref:"#/$defs/NativeIntegrationApprovalId"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["preview_id","preview_digest","approval_id","approval_digest","transaction_id"],title:"NativeIntegrationApplySurfaceRequest",type:"object"},{$defs:{ActorId:fb,BranchStackEdgeV1:f3,BranchStackId:f9,BranchStackNodeV1:f5,BranchStackRevisionId:f8,BranchStackRevisionV1:f7,BranchStackSourceV1:he,CapabilityId:hl,CodeGenerationId:hy,CommitId:hq,ContentDigest:hD,GitOidV1:gq,GitOperationStateV1:gI,ManifestDigest:_l,MechanicalIntegrationModeV1:_p,NativeIntegrationAnalysisAnchorV1:{additionalProperties:!1,description:"Source-local anchor for a semantic conflict finding.",properties:{generation_id:{$ref:"#/$defs/CodeGenerationId"},logical_path:{type:"string"},source_span:{$ref:"#/$defs/SourceSpan"}},required:["generation_id","logical_path","source_span"],type:"object"},NativeIntegrationAnalysisCoverageV1:{description:"Completeness of one independently evaluated semantic evidence lane.",enum:["complete","partial","unsupported"],type:"string"},NativeIntegrationAnalysisGapV1:{description:"Why one semantic evidence lane cannot authorize integration.",enum:["parser_failure","unresolved_required_edge","withheld_source","stale_evidence","unsupported_language","dynamic_schema","unbound_migration_order","capacity_unavailable","authority_unavailable"],type:"string"},NativeIntegrationAnalysisLaneV1:{additionalProperties:!1,description:"Coverage and exact gaps for one independently evaluated analysis lane.",properties:{coverage:{$ref:"#/$defs/NativeIntegrationAnalysisCoverageV1"},gaps:{items:{$ref:"#/$defs/NativeIntegrationAnalysisGapV1"},type:"array"}},required:["coverage","gaps"],type:"object"},NativeIntegrationAnalysisReportV1:{additionalProperties:!1,description:"Daemon-produced semantic evidence for one exact native candidate tree.",properties:{analyzer_revision:{type:"string"},candidate:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},conflicts:{items:{$ref:"#/$defs/NativeIntegrationSemanticConflictV1"},type:"array"},destination:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},digest:{$ref:"#/$defs/ManifestDigest"},graph:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"},merge_base:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},migrations:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"},schema:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"},source:{$ref:"#/$defs/NativeIntegrationGenerationBindingV1"},tests:{$ref:"#/$defs/NativeIntegrationAnalysisLaneV1"}},required:["merge_base","source","destination","candidate","graph","tests","schema","migrations","conflicts","analyzer_revision","digest"],type:"object"},NativeIntegrationApprovalId:_V,NativeIntegrationDirectionV1:_R,NativeIntegrationGenerationBindingV1:{additionalProperties:!1,description:"One immutable code-generation binding used by native integration analysis.",properties:{content_identity:{$ref:"#/$defs/ContentDigest"},generation_id:{$ref:"#/$defs/CodeGenerationId"},project_id:{$ref:"#/$defs/ProjectId"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository_id:{$ref:"#/$defs/RepositoryId"},seal_digest:{$ref:"#/$defs/ManifestDigest"},snapshot_digest:{$ref:"#/$defs/ManifestDigest"},source_revision:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},source_tree:{$ref:"#/$defs/GitOidV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["generation_id","project_id","repository_id","snapshot_digest","content_identity","source_tree","seal_digest"],type:"object"},NativeIntegrationPhaseV1:{description:"Durable transaction phase. `RefCommitStarted` is the cancellation boundary.",enum:["prepared","candidate_verified","ref_commit_started","final_state_verification","terminal"],type:"string"},NativeIntegrationPreviewDispositionV1:_q,NativeIntegrationPreviewId:_I,NativeIntegrationSealedStackSnapshotV1:_x,NativeIntegrationSelectionBindingV1:_j,NativeIntegrationSemanticConflictKindV1:{description:"Static conflict class produced from canonical generation evidence.",enum:["divergent_symbol","signature_dependent","test_write_interaction","divergent_schema","migration_order"],type:"string"},NativeIntegrationSemanticConflictV1:{additionalProperties:!1,description:"One deterministic conflict finding with source evidence from both branches.",properties:{destination:{$ref:"#/$defs/NativeIntegrationAnalysisAnchorV1"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},kind:{$ref:"#/$defs/NativeIntegrationSemanticConflictKindV1"},source:{$ref:"#/$defs/NativeIntegrationAnalysisAnchorV1"}},required:["kind","source","destination","evidence_digest"],type:"object"},NativeIntegrationSnapshotProjectionV1:{additionalProperties:!1,description:"Bounded projection of one frozen selection.",properties:{destination_ref:{$ref:"#/$defs/RefId"},frozen_at:{$ref:"#/$defs/UtcMicros"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},selection_digest:{$ref:"#/$defs/ManifestDigest"},source_ref:{$ref:"#/$defs/RefId"}},required:["selection_digest","project_id","repository_id","source_ref","destination_ref","inventory_epoch","frozen_at"],type:"object"},NativeIntegrationStatusProjectionV1:{additionalProperties:!1,description:"Bounded projection of one durable transaction status.",properties:{cancellation_requested:{type:"boolean"},destination_ref:{$ref:"#/$defs/RefId"},phase:{$ref:"#/$defs/NativeIntegrationPhaseV1"},phase_revision:{format:"uint64",minimum:0,type:"integer"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},repository_id:{$ref:"#/$defs/RepositoryId"},terminal_outcome:{anyOf:[{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"},{type:"null"}]},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["transaction_id","preview_id","preview_digest","repository_id","destination_ref","phase","phase_revision","cancellation_requested","updated_at"],type:"object"},NativeIntegrationSurfaceUnavailableV1:{description:"Why a native-integration operation produced no advancing state.\n\nEvery variant is read-only and truthful. None of them authorizes apply, and\na denied or absent target is reported indistinguishably from an unavailable\nauthority so no identity, path, count, or topology leaks.",oneOf:[{enum:["partial","stale","denied","reset_required","durability_uncertain","cancelled","approval_conflict","transaction_conflict","recovery_required","needs_inspection","unknown_transaction"],type:"string"},{const:"authority_unmounted",description:"No native-integration runtime authority is mounted for this daemon.",type:"string"}]},NativeIntegrationTerminalOutcomeV1:_C,NativeIntegrationTransactionId:_T,NativeIntegrationUnavailabilityV1:_O,NativeWorktreeSurfaceResultV1:{oneOf:[{oneOf:[{properties:{coverage:{$ref:"#/$defs/WorktreeCoverageV1"},digest:{$ref:"#/$defs/ManifestDigest"},entries:{items:{$ref:"#/$defs/WorktreeInventoryEntryV1"},type:"array"},epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},observed_at:{$ref:"#/$defs/UtcMicros"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},state:{const:"snapshot",type:"string"}},required:["state","scope_set_id","scope_set_revision","scope_set_digest","snapshot_id","epoch","entries","coverage","observed_at","digest"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}],properties:{operation:{const:"inventory",type:"string"}},required:["operation"],type:"object"},{oneOf:[{properties:{clean:{$ref:"#/$defs/WorktreeObservationV1",description:"Whether Git status contains no tracked or untracked changes."},head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},holder:{$ref:"#/$defs/WorktreeObservationV1"},inspection_digest:{$ref:"#/$defs/ManifestDigest"},kind:{anyOf:[{$ref:"#/$defs/WorktreeKindV1"},{type:"null"}]},locked:{$ref:"#/$defs/WorktreeObservationV1"},observed_at:{$ref:"#/$defs/UtcMicros"},operation_state:{anyOf:[{$ref:"#/$defs/GitOperationStateV1"},{type:"null"}]},presence:{$ref:"#/$defs/WorktreePresenceV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},state:{const:"inspection",type:"string"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"},unique_data:{$ref:"#/$defs/WorktreeObservationV1"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["state","target","presence","worktree_id","clean","locked","holder","unique_data","observed_at","inspection_digest"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"foreign",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}],properties:{operation:{const:"inspection",type:"string"}},required:["operation"],type:"object"},{oneOf:[{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},confirmed_at:{$ref:"#/$defs/UtcMicros"},inspection_digest:{$ref:"#/$defs/ManifestDigest"},state:{const:"confirmed",type:"string"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["state","target","inspection_digest","confirmation_digest","confirmed_at"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"needs_inspection",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}],properties:{operation:{const:"confirmation",type:"string"}},required:["operation"],type:"object"},{$ref:"#/$defs/WorktreeCleanupRemovalV1",properties:{operation:{const:"removal",type:"string"}},required:["operation"],type:"object"},{$ref:"#/$defs/WorktreeCleanupReconciliationV1",properties:{operation:{const:"reconciliation",type:"string"}},required:["operation"],type:"object"}]},NativeWorktreeTargetV1:_E,ProjectId:_4,RefId:vm,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,SourceSpan:b$,StackNodeId:bw,UtcMicros:bZ,WorktreeCleanupReconciliationV1:{oneOf:[{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"removed",type:"string"}},required:["state","confirmation_digest","observed_at"],type:"object"},{properties:{state:{const:"still_present",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"durability_uncertain",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}]},WorktreeCleanupRemovalV1:{oneOf:[{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"removed",type:"string"}},required:["state","confirmation_digest","observed_at"],type:"object"},{properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"already_removed",type:"string"}},required:["state","confirmation_digest","observed_at"],type:"object"},{properties:{state:{const:"denied",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"stale",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"durability_uncertain",type:"string"}},required:["state"],type:"object"},{properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"}]},WorktreeCoverageV1:{enum:["complete","partial"],type:"string"},WorktreeId:SB,WorktreeInventoryEntryV1:{additionalProperties:!1,properties:{clean:{$ref:"#/$defs/WorktreeObservationV1",description:"Whether Git status contains no tracked or untracked changes."},evidence_digest:{$ref:"#/$defs/ManifestDigest"},head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},holder:{$ref:"#/$defs/WorktreeObservationV1"},kind:{anyOf:[{$ref:"#/$defs/WorktreeKindV1"},{type:"null"}]},locked:{$ref:"#/$defs/WorktreeObservationV1"},observed_at:{$ref:"#/$defs/UtcMicros"},operation:{anyOf:[{$ref:"#/$defs/GitOperationStateV1"},{type:"null"}]},presence:{$ref:"#/$defs/WorktreePresenceV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},target:{$ref:"#/$defs/NativeWorktreeTargetV1"},unique_data:{$ref:"#/$defs/WorktreeObservationV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["target","presence","clean","locked","holder","unique_data","observed_at","evidence_digest"],type:"object"},WorktreeInventoryEpoch:SK,WorktreeInventorySnapshotId:SJ,WorktreeKindV1:{description:"Native Git worktree kind visible to an authorized caller.",enum:["main","linked","bare"],type:"string"},WorktreeObservationV1:{enum:["yes","no","unknown"],type:"string"},WorktreePresenceV1:{description:"Presence is intentionally not a bool: stale, unavailable and foreign are\npolicy-safe states with different reconciliation consequences.",enum:["present","stale","unavailable","foreign"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One typed result for every native-integration surface operation.",oneOf:[{additionalProperties:!1,description:"Frozen selection summary plus the exact sealed proof preflight accepts.",properties:{outcome:{const:"stack_snapshot",type:"string"},sealed_snapshot:{$ref:"#/$defs/NativeIntegrationSealedStackSnapshotV1"},selection:{$ref:"#/$defs/NativeIntegrationSnapshotProjectionV1"}},required:["outcome","selection","sealed_snapshot"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one immutable preview.\n\nCandidate trees, conflict bodies, and ordered commit objects stay behind the\npreview digest: the surface reports identity, classification, and expiry so\na caller can approve exactly this preview and nothing else.",properties:{analysis:{anyOf:[{$ref:"#/$defs/NativeIntegrationAnalysisReportV1"},{type:"null"}]},created_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/NativeIntegrationPreviewDispositionV1"},expires_at:{$ref:"#/$defs/UtcMicros"},ordered_commit_count:{format:"uint32",minimum:0,type:"integer"},outcome:{const:"preview",type:"string"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},selection:{$ref:"#/$defs/NativeIntegrationSnapshotProjectionV1"}},required:["outcome","preview_id","preview_digest","selection","disposition","ordered_commit_count","created_at","expires_at"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one issued one-use approval.\n\nThe approval digest is the caller's proof-of-issuance handle for apply;\nthe preview binding and expiry are audit metadata. No preview body,\ncandidate tree, or commit content crosses this boundary.",properties:{approval_digest:{$ref:"#/$defs/ManifestDigest"},approval_id:{$ref:"#/$defs/NativeIntegrationApprovalId"},capability:{$ref:"#/$defs/CapabilityId"},expires_at:{$ref:"#/$defs/UtcMicros"},issued_at:{$ref:"#/$defs/UtcMicros"},outcome:{const:"approval",type:"string"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},principal:{$ref:"#/$defs/ActorId"},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId",description:"Daemon-minted identity consumed verbatim by apply, status, and cancel."}},required:["outcome","transaction_id","approval_id","preview_id","preview_digest","principal","capability","issued_at","expires_at","approval_digest"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one durable terminal receipt.\n\nThe receipt digest and final ref/tree identity are audit metadata; no patch,\nworktree body, or source content crosses this boundary.",properties:{completed_at:{$ref:"#/$defs/UtcMicros"},final_ref_tip:{type:"string"},final_tree:{type:"string"},outcome:{const:"receipt",type:"string"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},status:{$ref:"#/$defs/NativeIntegrationStatusProjectionV1"},terminal_outcome:{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"}},required:["outcome","status","terminal_outcome","final_ref_tip","final_tree","completed_at","receipt_digest"],type:"object"},{additionalProperties:!1,description:"Bounded projection of one durable transaction status.",properties:{cancellation_requested:{type:"boolean"},destination_ref:{$ref:"#/$defs/RefId"},outcome:{const:"status",type:"string"},phase:{$ref:"#/$defs/NativeIntegrationPhaseV1"},phase_revision:{format:"uint64",minimum:0,type:"integer"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},repository_id:{$ref:"#/$defs/RepositoryId"},terminal_outcome:{anyOf:[{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"},{type:"null"}]},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["outcome","transaction_id","preview_id","preview_digest","repository_id","destination_ref","phase","phase_revision","cancellation_requested","updated_at"],type:"object"},{description:"Cancellation disposition. After the native commit point the committed\nreceipt is returned instead of a cancellation claim.",oneOf:[{enum:["cancellation_requested","commit_point_passed"],type:"string"},{properties:{already_terminal:{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"}},required:["already_terminal"],type:"object"}],properties:{outcome:{const:"cancellation",type:"string"}},required:["outcome"],type:"object"},{$ref:"#/$defs/NativeWorktreeSurfaceResultV1",properties:{outcome:{const:"worktree",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},reason:{$ref:"#/$defs/NativeIntegrationSurfaceUnavailableV1"}},required:["outcome","reason"],type:"object"}],title:"NativeIntegrationSurfaceResultV1"},{$defs:{ManifestDigest:_l,NativeIntegrationPreviewId:_I},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact approval-issuance request (the owner-decided sixth operation).\n\nThe caller names one unexpired preview by exact identity *and* digest;\napproving an identity without its content digest is unrepresentable. The\ndaemon mints the one-use approval bound to the requesting principal, the\napply capability, the current grant lineage, and a bounded expiry, none\nof which the caller can choose.",properties:{preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"}},required:["preview_id","preview_digest"],title:"NativeIntegrationApproveSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_ast_grep_rewrite`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},path:{type:"string"},pattern:{type:"string"},rewrite:{type:"string"},verify:{default:!1,type:"boolean"}},required:["path","pattern","rewrite"],title:"AstGrepRewriteSurfaceRequestV1",type:"object"},{$defs:{ActorId:fb,AstGrepResult:{description:"Result of an ast-grep rewrite operation.",properties:{diff:{description:"Bounded preview of the would-be change. Populated only on a successful\ndry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: the rewrite was resolved but nothing was\nwritten.",type:"boolean"},file_path:{type:"string"},message:{type:"string"},pattern:{type:"string"},rewrite:{type:"string"},success:{type:"boolean"}},required:["success","file_path","pattern","rewrite","message"],type:"object"},AuthorityReceipt:{additionalProperties:!1,description:"Proof that this request crossed the current authorization boundary.",properties:{authorized_scope_digest:{$ref:"#/$defs/ManifestDigest"},disclosure:{$ref:"#/$defs/DisclosureClass"},grant_digest:{$ref:"#/$defs/ManifestDigest"},grant_id:{type:"string"},grant_revision:{format:"uint64",minimum:0,type:"integer"},policy:{$ref:"#/$defs/PolicyDecisionRef"},revalidated_at:{$ref:"#/$defs/UtcMicros"}},required:["grant_id","grant_revision","grant_digest","authorized_scope_digest","disclosure","policy","revalidated_at"],type:"object"},CancellationObservation:hn,CancellationStage:ha,ComponentVersion:hC,Deadline:yv,DisclosureClass:{description:"Disclosure ceiling carried by an immutable grant and revalidated at sinks.",enum:["metadata","evidence","sensitive"],type:"string"},EditResult:{description:"Result of a single string replacement edit.",properties:{diff:{description:"Bounded preview diff of the would-be change. Populated only on a\nsuccessful dry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: validation, spans, and the resulting\ncontent were all computed, but nothing was written to disk.",type:"boolean"},file_path:{type:"string"},matched_str:{type:"string"},message:{type:"string"},new_str:{type:"string"},replaced_span:{description:"The exact source text that was replaced. For `replace_symbol` this is\nthe item's full span, including any leading doc-comment / attribute\nblock, so callers can recover its docs/attrs if the replacement\ndropped them; for `str_replace` it is the matched `old_str` text.\n`None` only on a failed edit, where nothing was resolved to replace.",type:["string","null"]},success:{type:"boolean"}},required:["success","file_path","matched_str","new_str","message"],type:"object"},EffectClass:yR,EffectReceipt:yq,EffectResult:{additionalProperties:!1,description:"Result of an admitted effect. `EffectUnknown` remains a receipt state and\ncannot be remapped into a pre-admission problem.",properties:{authority:{$ref:"#/$defs/AuthorityReceipt"},effect_class:{$ref:"#/$defs/EffectClass"},effect_id:{type:"string"},execution:{$ref:"#/$defs/OperationReceipt"},expected_state:{$ref:"#/$defs/ManifestDigest"},idempotency_key:{type:"string"},payload:{anyOf:[{$ref:"#/$defs/SourceEditDurableEffectPayloadV1"},{type:"null"}]},receipt:{$ref:"#/$defs/EffectReceipt"},reconciliation:{$ref:"#/$defs/ReconciliationState"}},required:["effect_id","effect_class","idempotency_key","authority","expected_state","execution","reconciliation","receipt"],type:"object"},EffectTermination:yI,InsertResult:{description:"Result of an insert-at operation.",properties:{anchor_line:{format:"uint32",minimum:0,type:"integer"},before:{type:"boolean"},content:{type:"string"},diff:{description:"Bounded preview diff of the would-be change. Populated only on a\nsuccessful dry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: the insertion point was resolved and the\nresulting content computed, but nothing was written to disk.",type:"boolean"},file_path:{type:"string"},message:{type:"string"},success:{type:"boolean"}},required:["success","file_path","anchor_line","content","before","message"],type:"object"},ManifestDigest:_l,MoveHint:{description:"One evidence-based, actionable finding produced by the `move_symbol` impact\nengine. Each hint points at a concrete file/line and carries a suggestion\nthe caller (or a follow-up refactor) can act on. Hints are derived from graph\nedges (callers/callees) and parse-level facts (identifiers, `use` lines,\nmodule declarations), never speculative noise.",properties:{detail:{description:"Human-readable description of what the move breaks or affects.",type:"string"},file:{description:"File the finding concerns (the caller's file, the destination, or the\nsource), project-relative.",type:"string"},kind:{description:"Taxonomy tag: `caller_reference`, `dependency_broken`, `import_needed`,\n`visibility_required`, `collision`, `module_missing`, `cycle_risk`,\n`orphaned_import`, or `cfg_context`.",type:"string"},line:{description:"1-based line the finding concerns, when a specific site is known.",format:"uint32",minimum:0,type:["integer","null"]},suggestion:{description:"The exact change to make (e.g. a `use` line to add, a path to rewrite, a\nvisibility to escalate). `None` when no single mechanical fix applies.",type:["string","null"]}},required:["kind","file","detail"],type:"object"},MoveResult:{description:"Result of a `move_symbol` operation: the moved span, a dry-run diff of the\nsource + destination files, and the centerpiece, the impact report of\neverything the move breaks or that needs attention.",properties:{applied_imports:{description:"`use` lines auto-inserted at the destination because the moved body's\ndependency on them was unambiguous. Reported so the caller sees exactly\nwhat the move added.",items:{type:"string"},type:"array"},dest_file:{type:"string"},diff:{description:"Combined preview diff of the source (removal) and destination (insertion)\nfiles. Populated on a successful dry run; `None` for real moves.",type:["string","null"]},dry_run:{description:"True when this was a dry run: spans, the destination shape, and the\nimpact report were all computed, but nothing was written to disk.",type:"boolean"},impact:{description:"The impact report: every actionable finding. Empty on a truly clean\nmove.",items:{$ref:"#/$defs/MoveHint"},type:"array"},message:{type:"string"},moved_span:{description:"The exact source span that was moved, including its leading\ndoc-comment / attribute block. `None` on failure.",type:["string","null"]},source_file:{type:"string"},success:{type:"boolean"},symbol:{description:"The resolved symbol that was (or would be) moved, `name (kind)`.",type:"string"}},required:["success","symbol","source_file","dest_file","message"],type:"object"},MultiEditResult:{description:"Result of a multi-string replacement edit.",properties:{applied_count:{format:"uint",minimum:0,type:"integer"},diff:{description:"Bounded preview diff of the would-be change. Populated only on a\nsuccessful dry run; `None` for real edits and for failures.",type:["string","null"]},dry_run:{description:"True when this was a dry run: replacements were validated and the\nresulting content computed, but nothing was written to disk.",type:"boolean"},file_path:{type:"string"},message:{type:"string"},success:{type:"boolean"}},required:["success","file_path","applied_count","message"],type:"object"},OperationBudgetUsage:_D,OperationReceipt:_F,OperationTermination:_L,PolicyDecisionRef:{additionalProperties:!1,description:"A policy decision pinned into a receipt or provider identity.",properties:{decision_id:{type:"string"},digest:{$ref:"#/$defs/ManifestDigest"},evaluator_revision:{$ref:"#/$defs/ComponentVersion"},revision:{format:"uint64",minimum:0,type:"integer"}},required:["decision_id","revision","digest","evaluator_revision"],type:"object"},ProjectId:_4,ReconciliationState:{description:"Reconciliation state retained after an admitted effect.",enum:["pending","reconciled","failed"],type:"string"},RefId:vm,RenameDispositionCountsV1:{additionalProperties:!1,properties:{blocked:{format:"uint",minimum:0,type:"integer"},changed:{format:"uint",minimum:0,type:"integer"},skipped:{format:"uint",minimum:0,type:"integer"},unchanged:{format:"uint",minimum:0,type:"integer"}},required:["changed","unchanged","skipped","blocked"],type:"object"},RenameFileEditV1:{additionalProperties:!1,description:"One file a rename changed (or would change), with the exact bound-site count.",properties:{file:{type:"string"},replaced_count:{format:"uint",minimum:0,type:"integer"}},required:["file","replaced_count"],type:"object"},RenameHazardKindV1:{enum:["invalid_identifier","stale_evidence","ambiguous_symbol","namespace_collision","changed_resolution","shadowing","unsupported_syntax","macro_expansion","generated_source","overlapping_site"],type:"string"},RenameHazardV1:{additionalProperties:!1,properties:{blocking:{type:"boolean"},kind:{$ref:"#/$defs/RenameHazardKindV1"},message:{type:"string"},site_id:{type:["string","null"]}},required:["kind","blocking","message"],type:"object"},RenameImpactV1:{additionalProperties:!1,properties:{affected_files:{items:{type:"string"},type:"array"},affected_tests:{items:{type:"string"},type:"array"},callers:{items:{type:"string"},type:"array"},reexports:{items:{type:"string"},type:"array"}},required:["callers","reexports","affected_files","affected_tests"],type:"object"},RenameProtectedValueCategoryV1:{enum:["wire_value","serialized_name","sql_identifier","persisted_name","schema_epoch","hash_domain","protocol_name","contract_snapshot","string_literal","byte_literal"],type:"string"},RenameProtectedValueV1:{additionalProperties:!1,description:"A byte-exact stable value deliberately preserved by the rename.",properties:{category:{$ref:"#/$defs/RenameProtectedValueCategoryV1"},end_byte:{format:"uint64",minimum:0,type:"integer"},exact_bytes:{type:"string"},file:{type:"string"},site_id:{type:"string"},start_byte:{format:"uint64",minimum:0,type:"integer"}},required:["site_id","file","start_byte","end_byte","category","exact_bytes"],type:"object"},RenameResult:{description:"The same typed payload is serialized by application, CLI, and MCP paths.",properties:{diff:{type:["string","null"]},dispositions:{$ref:"#/$defs/RenameDispositionCountsV1"},dry_run:{type:"boolean"},files:{items:{$ref:"#/$defs/RenameFileEditV1"},type:"array"},graph_revision:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest of the admitted generation, exact target, same-name symbols,\nand graph edges used to classify bound and protected sites."},hazards:{items:{$ref:"#/$defs/RenameHazardV1"},type:"array"},impact:{$ref:"#/$defs/RenameImpactV1"},message:{type:"string"},new_name:{type:"string"},old_name:{type:"string"},plan_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest of the complete typed site/hazard/protected-value manifest."},preview_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Exact candidate-state digest that apply must echo as `expected_state`."},preview_id:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest-addressed identity of the bound symbol plus proposed name."},protected_values:{items:{$ref:"#/$defs/RenameProtectedValueV1"},type:"array"},reference_count:{format:"uint",minimum:0,type:"integer"},repository_revision:{default:null,description:"Current Git HEAD when the worktree has one; dirty bytes remain bound by\n`preview_digest` independently of this revision.",type:["string","null"]},sites:{items:{$ref:"#/$defs/RenameSiteV1"},type:"array"},success:{type:"boolean"},symbol:{description:"Qualified name of the renamed symbol at plan time.",type:"string"}},required:["success","symbol","old_name","new_name","reference_count","dispositions","impact","message"],type:"object"},RenameSiteDispositionV1:{enum:["changed","unchanged","skipped","blocked"],type:"string"},RenameSiteKindV1:{enum:["declaration","import","reexport","qualified_path","unqualified_path","annotation","generic_argument","constructor","pattern","trait_declaration","trait_implementation","resolved_call","inherent_method","enum_variant","test","example","documentation","protected_value","unresolved_text"],type:"string"},RenameSiteV1:{additionalProperties:!1,description:"One exact old-name occurrence and the rename planner's disposition.",properties:{disposition:{$ref:"#/$defs/RenameSiteDispositionV1"},end_byte:{format:"uint64",minimum:0,type:"integer"},expected_bytes:{type:"string"},file:{type:"string"},kind:{$ref:"#/$defs/RenameSiteKindV1"},line:{format:"uint32",minimum:0,type:"integer"},reason:{type:"string"},replacement_bytes:{type:"string"},site_id:{type:"string"},source_node_id:{description:"Canonical source `SymbolOccurrenceId` that attested this site.",type:["string","null"]},start_byte:{format:"uint64",minimum:0,type:"integer"}},required:["site_id","kind","disposition","file","line","start_byte","end_byte","expected_bytes","replacement_bytes","reason"],type:"object"},RepositoryId:vb,ResolvedScope:vw,RetrievalAnchorId:vI,SourceEditCancelledResultV1:{description:"Terminal payload when cancellation is observed before an edit commits.",properties:{cancelled:{type:"boolean"},message:{type:"string"},success:{type:"boolean"}},required:["success","cancelled","message"],type:"object"},SourceEditDiagnosticV1:{properties:{code:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},message:{type:"string"}},required:["line","code","message"],type:"object"},SourceEditDurableEffectPayloadV1:{additionalProperties:!1,description:"Body-free source-edit evidence retained inside durable effect receipts.\n\nThis payload intentionally contains no caller-supplied edit text, preview\ndiff, moved span, import, diagnostic, or impact detail. It is also the\nexact replay outcome, so replay never fabricates a live edit body.",properties:{before:{type:["boolean","null"]},cancelled:{type:"boolean"},change_count:{format:"uint",minimum:0,type:["integer","null"]},durable_metadata_only:{type:"boolean"},effect_unknown:{type:"boolean"},failed:{type:"boolean"},files:{items:{type:"string"},type:"array"},finding_count:{format:"uint",minimum:0,type:["integer","null"]},import_count:{format:"uint",minimum:0,type:["integer","null"]},line:{format:"uint32",minimum:0,type:["integer","null"]},message:{type:"string"},observed_state:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Exact candidate-file observation from an inspection attempt."},operation:{$ref:"#/$defs/UseCaseId"},reconciled:{type:"boolean"},success:{type:"boolean"},timed_out:{type:"boolean"}},required:["operation","success","files","failed","cancelled","timed_out","effect_unknown","reconciled","durable_metadata_only","message"],type:"object"},SourceEditEffectUnknownResultV1:{description:"Terminal payload when publication may have occurred and inspection is required.",properties:{effect_unknown:{type:"boolean"},message:{type:"string"},success:{type:"boolean"}},required:["success","effect_unknown","message"],type:"object"},SourceEditFailedResultV1:{description:"Terminal payload when an edit is refused before it can publish an effect.",properties:{failed:{type:"boolean"},message:{type:"string"},success:{type:"boolean"}},required:["success","failed","message"],type:"object"},SourceEditReconciledResultV1:{description:"Terminal payload returned by explicit reconciliation.",properties:{message:{type:"string"},reconciled:{type:"boolean"},success:{type:"boolean"}},required:["success","reconciled","message"],type:"object"},SourceEditTimedOutResultV1:{description:"Terminal payload when an edit deadline expires before commit.",properties:{message:{type:"string"},success:{type:"boolean"},timed_out:{type:"boolean"}},required:["success","timed_out","message"],type:"object"},SourceEditVerificationStateV1:{enum:["clean","errors","unavailable","failed","cancelled"],type:"string"},SourceEditVerificationV1:{properties:{error_count:{format:"uint",minimum:0,type:"integer"},first_errors:{items:{$ref:"#/$defs/SourceEditDiagnosticV1"},type:"array"},message:{type:["string","null"]},state:{$ref:"#/$defs/SourceEditVerificationStateV1"},verdict:{type:"string"},warning_count:{format:"uint",minimum:0,type:"integer"}},required:["state","verdict","error_count","warning_count","first_errors"],type:"object"},UseCaseId:bK,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/SourceEditDurableEffectPayloadV1"},{$ref:"#/$defs/EditResult"},{$ref:"#/$defs/MultiEditResult"},{$ref:"#/$defs/InsertResult"},{$ref:"#/$defs/AstGrepResult"},{$ref:"#/$defs/MoveResult"},{$ref:"#/$defs/RenameResult"},{$ref:"#/$defs/SourceEditFailedResultV1"},{$ref:"#/$defs/SourceEditCancelledResultV1"},{$ref:"#/$defs/SourceEditTimedOutResultV1"},{$ref:"#/$defs/SourceEditEffectUnknownResultV1"},{$ref:"#/$defs/SourceEditReconciledResultV1"}],description:"Canonical result returned directly by every source-edit use case.",properties:{effect:{anyOf:[{$ref:"#/$defs/EffectResult"},{type:"null"}]},expected_state:{$ref:"#/$defs/ManifestDigest"},predicted_state:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},replayed:{type:"boolean"},verification:{anyOf:[{$ref:"#/$defs/SourceEditVerificationV1"},{type:"null"}]}},required:["expected_state","replayed"],title:"SourceEditSurfaceResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{lang:{description:"Optional language key to force (e.g. 'rust', 'typescript', 'python').\nOmit to auto-detect each file from its extension.",type:["string","null"]},max_results:{description:"Maximum number of matches to return (default: 50, max: 200).",format:"uint32",minimum:0,type:["integer","null"]},path_glob:{description:"Optional glob restricting which files are searched, matched against\nproject-relative paths (e.g. 'src/**/*.rs').",type:["string","null"]},pattern:{description:"ast-grep structural pattern (SGPattern syntax), e.g.\n'reserve_stock($$$)' or 'Result<$T, $E>'.",type:"string"}},required:["pattern"],title:"AstGrepSearchSurfaceRequestV1",type:"object"},{$defs:{AstGrepSearchMatchV1:{additionalProperties:!1,properties:{column:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},lang:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},line_text:{type:"string"},match:{type:"string"}},required:["file","line","column","lang","match","line_text"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{files_scanned:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},results:{items:{$ref:"#/$defs/AstGrepSearchMatchV1"},type:"array"},truncated:{type:"boolean"}},required:["results","match_count","files_scanned","truncated"],title:"AstGrepSearchResultV1",type:"object"},{$defs:{AutomationRunArtifactKind:{enum:["traces","feedback","generated_evals","validation_gate","optimizer_diagnosis","codex_handoff"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kind:{$ref:"#/$defs/AutomationRunArtifactKind",description:"Artifact kind to read."},run_id:{description:"Automation run id to inspect.",type:"string"}},required:["run_id","kind"],title:"AutomationRunArtifactViewSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,AutomationRunArtifact:fB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{artifact:{$ref:"#/$defs/AutomationRunArtifact"},payload:{description:"The hash-verified artifact document, as the run wrote it."},run_id:{type:"string"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","run_id","artifact","payload"],title:"AutomationRunArtifactViewResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum run records to return (default: 50, max: 200).",format:"uint32",maximum:200,minimum:1,type:["integer","null"]}},title:"AutomationRunListSurfaceRequestV1",type:"object"},{$defs:{AgentTaskKind:fS,AutomationReadStatusV1:fH,AutomationRunListEntryV1:{additionalProperties:!1,description:"One run as the list shows it: the ledger record's identity, outcome and\nartifact kinds, without the artifact payloads or operation bodies.",properties:{accepted_count:{format:"uint",minimum:0,type:"integer"},artifact_kinds:{items:{type:"string"},type:"array"},backend:{type:"string"},completed_at:{type:"string"},error:{type:["string","null"]},model:{type:["string","null"]},rejected_count:{format:"uint",minimum:0,type:"integer"},reviewed_count:{format:"uint",minimum:0,type:"integer"},run_id:{type:"string"},skipped_count:{format:"uint",minimum:0,type:"integer"},started_at:{type:"string"},status:{$ref:"#/$defs/AutomationRunStatus"},task:{$ref:"#/$defs/AgentTaskKind"},task_key:{type:"string"},trigger:{$ref:"#/$defs/AutomationTrigger"}},required:["run_id","task","task_key","trigger","backend","status","reviewed_count","accepted_count","rejected_count","skipped_count","started_at","completed_at","artifact_kinds"],type:"object"},AutomationRunPageCompletenessV1:{description:"Whether a run page read every ledger row it examined.",oneOf:[{const:"known",description:"Every examined row decoded.",type:"string"},{const:"partial",description:"The page skipped malformed rows or more runs exist past it.",type:"string"}]},AutomationRunScopeV1:fK,AutomationRunStatus:fJ,AutomationTrigger:fY},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{completeness:{$ref:"#/$defs/AutomationRunPageCompletenessV1"},count:{format:"uint",minimum:0,type:"integer"},has_more:{type:"boolean"},limit:{format:"uint32",minimum:0,type:"integer"},malformed_row_count:{format:"uint",minimum:0,type:"integer"},runs:{items:{$ref:"#/$defs/AutomationRunListEntryV1"},type:"array"},scope:{$ref:"#/$defs/AutomationRunScopeV1"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","scope","runs","count","limit","has_more","malformed_row_count","completeness"],title:"AutomationRunListResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{description:"Exact automation run id to inspect.",minLength:1,type:"string"}},required:["run_id"],title:"AutomationRunViewSurfaceRequestV1",type:"object"},{$defs:{AgentTaskFailureClass:{oneOf:[{enum:["retryable","permanent","timeout","unavailable","denied","disconnected","malformed_output"],type:"string"},{const:"input_too_large",description:"The backend refused the request because it exceeds its input or\ncontext-window limit.",type:"string"}]},AgentTaskKind:fS,AgentTaskRetryAttempt:{properties:{attempt:{format:"uint32",minimum:0,type:"integer"},backoff_millis:{format:"uint64",minimum:0,type:"integer"},failure_classification:{anyOf:[{$ref:"#/$defs/AgentTaskFailureClass"},{type:"null"}]},succeeded:{type:"boolean"}},required:["attempt","succeeded","backoff_millis"],type:"object"},AutomationReadStatusV1:fH,AutomationRunArtifact:fB,AutomationRunLedgerRecord:{properties:{accepted_count:{format:"uint",minimum:0,type:"integer"},applied_ops:!0,artifacts:{items:{$ref:"#/$defs/AutomationRunArtifact"},type:"array"},backend:{type:"string"},backend_attempt_count:{default:0,format:"uint",minimum:0,type:"integer"},backend_attempts:{items:{$ref:"#/$defs/AgentTaskRetryAttempt"},type:"array"},backend_identity:{description:"The durable backend/configuration identity this run executed under.\n\nA settled deterministic failure stays suppressed only while this\nmatches the identity now configured, so the scheduler can re-admit the\ntask the moment the backend or configuration changes. Records written\nbefore this field existed carry `None` and never suppress: an\nunidentified failure cannot be shown to have failed under the current\nidentity.",type:["string","null"]},completed_at:{type:"string"},completed_at_micros:{format:"int64",type:["integer","null"]},error:{type:["string","null"]},error_classification:{anyOf:[{$ref:"#/$defs/AgentTaskFailureClass"},{type:"null"}]},error_retryable:{type:["boolean","null"]},evidence_hash:{type:["string","null"]},fallback_status:{type:["string","null"]},host_mode:{type:["string","null"]},input_hash:{type:["string","null"]},model:{type:["string","null"]},output_hash:{type:["string","null"]},prompt_version:{type:["string","null"]},proposed_ops:!0,rejected_count:{format:"uint",minimum:0,type:"integer"},rejected_ops:!0,report_ref:!0,response_schema:!0,reviewed_count:{default:0,format:"uint",minimum:0,type:"integer"},run_id:{type:"string"},schema_version:{format:"uint32",minimum:0,type:"integer"},session_evidence_budget_stage:{anyOf:[{$ref:"#/$defs/SessionRetrievalBudgetStageV1"},{type:"null"}],description:"Exhausted retrieval boundary of a `session_evidence_budget_exhausted`\nskip; present exactly on those skips."},skipped_count:{default:0,format:"uint",minimum:0,type:"integer"},started_at:{type:"string"},status:{$ref:"#/$defs/AutomationRunStatus"},strict_json:{type:["boolean","null"]},task:{$ref:"#/$defs/AgentTaskKind"},task_key:{type:"string"},trigger:{$ref:"#/$defs/AutomationTrigger"},validation_report:!0},required:["schema_version","run_id","trigger","task","task_key","backend","status","accepted_count","rejected_count","started_at","completed_at"],type:"object"},AutomationRunScopeV1:fK,AutomationRunStatus:fJ,AutomationTrigger:fY,SessionRetrievalBudgetStageV1:bo},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run:{$ref:"#/$defs/AutomationRunLedgerRecord"},scope:{$ref:"#/$defs/AutomationRunScopeV1"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","scope","run"],title:"AutomationRunViewResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{base:{description:"Base local branch name (e.g. 'main').",type:"string"},cursor:{description:"Authenticated continuation cursor returned by the preceding exact\nbranch-diff page.",type:["string","null"]},file:{description:"Optional file path filter, only show diffs for symbols in this file.",type:["string","null"]},head:{description:"Head local branch name (e.g. 'feature/foo'). Defaults to the current\nbranch.",type:["string","null"]},kind:{description:"Optional kind filter, only show diffs for this symbol kind (e.g.\n'function', 'struct').",type:["string","null"]},limit:{description:"Maximum combined added, removed, and changed results (default: 100,\nat most 256).",format:"uint32",minimum:0,type:["integer","null"]}},required:["base"],title:"BranchDiffSurfaceRequestV1",type:"object"},{$defs:{BranchDiffCompleteV1:{additionalProperties:!1,properties:{base:{type:"string"},base_generation:{type:"string"},base_revision:{type:"string"},base_tree:{type:"string"},changes:{items:{$ref:"#/$defs/BranchSymbolChangeV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},head:{type:"string"},head_generation:{type:"string"},head_revision:{type:"string"},head_tree:{type:"string"},status:{$ref:"#/$defs/GitReadCompleteV1"},summary:{$ref:"#/$defs/BranchDiffSummaryV1"},total_changes:{format:"uint",minimum:0,type:"integer"}},required:["status","base","head","base_revision","base_tree","head_revision","head_tree","base_generation","head_generation","total_changes","summary","changes"],type:"object"},BranchDiffPartialV1:{additionalProperties:!1,properties:{base:{type:"string"},base_generation:{type:"string"},base_revision:{type:"string"},base_tree:{type:"string"},changes:{items:{$ref:"#/$defs/BranchSymbolChangeV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},head:{type:"string"},head_generation:{type:"string"},head_revision:{type:"string"},head_tree:{type:"string"},next_cursor:{type:"string"},reason:{$ref:"#/$defs/GitResultLimitV1"},status:{$ref:"#/$defs/GitReadPartialV1"},summary:{$ref:"#/$defs/BranchDiffSummaryV1"},total_changes:{format:"uint",minimum:0,type:"integer"}},required:["status","reason","base","head","base_revision","base_tree","head_revision","head_tree","base_generation","head_generation","total_changes","next_cursor","summary","changes"],type:"object"},BranchDiffReferenceUnavailableV1:{additionalProperties:!1,description:"Either branch of `base..head` does not resolve to a local commit.",properties:{base_or_head:{description:"The requested range, `base..head`.",type:"string"},reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","base_or_head","reason","retryable"],type:"object"},BranchDiffSummaryV1:{additionalProperties:!1,properties:{added:{format:"uint",minimum:0,type:"integer"},changed:{format:"uint",minimum:0,type:"integer"},removed:{format:"uint",minimum:0,type:"integer"}},required:["added","removed","changed"],type:"object"},BranchDiffUnavailableV1:{additionalProperties:!1,description:"No sealed code-index generations compare the two branches' commits.",properties:{base:{type:"string"},base_generation:{type:["string","null"]},base_revision:{type:"string"},head:{type:"string"},head_generation:{type:["string","null"]},head_revision:{type:"string"},reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","base","head","base_revision","head_revision","reason","retryable"],type:"object"},BranchSymbolChangeV1:{oneOf:[{additionalProperties:!1,properties:{change:{const:"added",type:"string"},symbol:{$ref:"#/$defs/BranchSymbolV1"}},required:["change","symbol"],type:"object"},{additionalProperties:!1,properties:{change:{const:"removed",type:"string"},symbol:{$ref:"#/$defs/BranchSymbolV1"}},required:["change","symbol"],type:"object"},{additionalProperties:!1,properties:{base:{$ref:"#/$defs/BranchSymbolV1"},change:{const:"changed",type:"string"},head:{$ref:"#/$defs/BranchSymbolV1"}},required:["change","base","head"],type:"object"}]},BranchSymbolV1:{additionalProperties:!1,description:"A symbol in one branch's sealed generation.",properties:{content_digest:{type:"string"},file:{type:"string"},file_identity:{type:"string"},file_occurrence_id:{type:"string"},kind:{type:"string"},name:{type:"string"},qualified_name:{type:"string"},symbol_identity:{type:"string"},symbol_occurrence_id:{type:"string"}},required:["symbol_identity","symbol_occurrence_id","file_identity","file_occurrence_id","name","qualified_name","kind","file","content_digest"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitReadCompleteV1:gj,GitReadPartialV1:gC,GitReadUnavailableV1:gT,GitResultLimitV1:gO,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/BranchDiffCompleteV1"},{$ref:"#/$defs/BranchDiffPartialV1"},{$ref:"#/$defs/BranchDiffUnavailableV1"},{$ref:"#/$defs/BranchDiffReferenceUnavailableV1"}],title:"BranchDiffResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{description:"Continuation cursor returned as `next_cursor` by the preceding page\nwith the same `limit`.",type:["string","null"]},limit:{description:"Maximum local refs to return (default: 100, at most 128).",format:"uint32",minimum:0,type:["integer","null"]}},title:"BranchListSurfaceRequestV1",type:"object"},{$defs:{BranchListPageV1:{additionalProperties:!1,properties:{examined:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint",minimum:0,type:"integer"},next_cursor:{type:["string","null"]},reason:{anyOf:[{$ref:"#/$defs/GitReferenceLimitV1"},{type:"null"}]},snapshot_count:{format:"uint",minimum:0,type:"integer"},snapshots:{items:{$ref:"#/$defs/BranchSnapshotEntryV1"},type:"array"},status:{$ref:"#/$defs/GitPageStatusV1"}},required:["status","snapshot_count","examined","limit","snapshots"],type:"object"},BranchReadUnavailableV1:{additionalProperties:!1,description:"A local branch read refused before any snapshot was taken.",properties:{reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","reason","retryable"],type:"object"},BranchSnapshotEntryV1:{additionalProperties:!1,properties:{branch:{type:"string"},source_revision:{type:"string"},source_tree:{type:"string"}},required:["branch","source_revision","source_tree"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitPageStatusV1:gx,GitReadUnavailableV1:gT,GitReferenceLimitV1:{enum:["reference_limit"],type:"string"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/BranchListPageV1"},{$ref:"#/$defs/BranchReadUnavailableV1"}],title:"BranchListResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{branch:{description:"Exact local branch name to search.",type:"string"},cursor:{description:"Authenticated continuation cursor returned by the preceding exact\nbranch-search page.",type:["string","null"]},limit:{description:"Maximum number of results to return (default: 10, at most 500).",format:"uint32",minimum:0,type:["integer","null"]},query:{description:"Search query string to match against symbol names.",type:"string"}},required:["branch","query"],title:"BranchSearchSurfaceRequestV1",type:"object"},{$defs:{BranchReferenceUnavailableV1:{additionalProperties:!1,description:"The named branch does not resolve to a local commit.",properties:{branch:{type:"string"},reason:{type:"string"},retryable:{type:"boolean"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","branch","reason","retryable"],type:"object"},BranchSearchHitV1:{additionalProperties:!1,properties:{branch:{type:"string"},candidate:{$ref:"#/$defs/RankedCandidate"},code_generation:{type:"string"},kind:{type:["string","null"]},name:{type:["string","null"]},path:{type:["string","null"]},qualified_name:{type:["string","null"]},source_reference:{type:"string"},source_revision:{type:"string"},source_tree:{type:"string"}},required:["candidate","branch","source_reference","source_revision","source_tree","code_generation"],type:"object"},BranchSearchPageV1:{additionalProperties:!1,properties:{branch:{type:"string"},code_generation:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},next_cursor:{type:["string","null"]},reason:{anyOf:[{$ref:"#/$defs/GitResultLimitV1"},{type:"null"}]},results:{items:{$ref:"#/$defs/BranchSearchHitV1"},type:"array"},source_reference:{type:"string"},source_revision:{type:"string"},source_tree:{type:"string"},status:{$ref:"#/$defs/GitPageStatusV1"}},required:["status","branch","source_reference","source_revision","source_tree","code_generation","results"],type:"object"},BranchSearchUnavailableV1:{additionalProperties:!1,description:"No sealed code-index generation answers for the branch's commit.",properties:{branch:{type:"string"},code_generation:{type:["string","null"]},reason:{type:"string"},retryable:{type:"boolean"},source_revision:{type:"string"},status:{$ref:"#/$defs/GitReadUnavailableV1"}},required:["status","branch","source_revision","reason","retryable"],type:"object"},CalibrationProfileId:hi,CandidateContribution:hs,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComponentRevision:hj,EvidenceRole:yC,ExactClass:yT,FileOccurrenceId:gs,FixedPointScore:gc,FreshnessCompatibilityV1:gl,FusedCandidate:gp,GitPageStatusV1:gx,GitReadUnavailableV1:gT,GitResultLimitV1:gO,LogicalCopyClusterId:_i,LogicalEvidenceId:_o,OccurrenceProvenance:_z,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RankedCandidate:{additionalProperties:!1,description:"A fused candidate with its final deterministic ordinal.",properties:{candidate:{$ref:"#/$defs/FusedCandidate"},final_ordinal:{format:"uint32",minimum:0,type:"integer"}},required:["candidate","final_ordinal"],type:"object"},RankingDecision:vp,RankingDecisionKind:vu,RepositoryId:vb,RetrievalAnchorId:vI,RetrievalSourceRoleV1:vC,RetrieverKind:vO,ScoreDomainId:v2,SessionOrThreadId:v7,SourceFreshness:by,SourceInstanceKey:bg,SourceNamespace:bv,SourceOccurrenceId:bb,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/BranchSearchPageV1"},{$ref:"#/$defs/BranchSearchUnavailableV1"},{$ref:"#/$defs/BranchReferenceUnavailableV1"}],title:"BranchSearchResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{qualified_name:{description:"The exact qualified name to look up.",type:"string"}},required:["qualified_name"],title:"ByQualifiedNameSurfaceRequestV1",type:"object"},{$defs:{PrimitiveSymbolLocationV1:_1},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Every indexed symbol sharing one qualified name (overloads, generics,\nseparate impl blocks).",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},title:"ByQualifiedNameResultV1",type:"array"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{from_node_id:{type:"string"},maximum_depth:{default:8,format:"uint32",minimum:0,type:"integer"},to_node_id:{type:"string"}},required:["from_node_id","to_node_id"],title:"CallChainPrimitiveRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{edge_kinds:{items:{type:"string"},type:"array"},node_ids:{items:{type:"string"},type:"array"}},required:["node_ids","edge_kinds"],title:"CallChainPrimitiveResult",type:"object"},{$defs:{NativeIntegrationTransactionId:_T},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["transaction_id"],title:"NativeIntegrationCancelSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{from_ref:{description:"Starting git ref (commit, branch, tag).",type:"string"},to_ref:{description:"Ending git ref (commit, branch, tag).",type:"string"}},required:["from_ref","to_ref"],title:"ChangelogSurfaceRequestV1",type:"object"},{$defs:{ChangelogCompleteV1:{additionalProperties:!1,properties:{base_generation:{type:"string"},changed_file_count:{format:"uint",minimum:0,type:"integer"},changed_files:{items:{type:"string"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},from_ref:{type:"string"},head_generation:{type:"string"},status:{$ref:"#/$defs/GitReadCompleteV1"},symbol_changes_coverage:{$ref:"#/$defs/SymbolChangesCompleteV1"},symbols_added:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_modified:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},to_ref:{type:"string"}},required:["status","from_ref","to_ref","changed_file_count","changed_files","base_generation","head_generation","symbols_added","symbols_removed","symbols_modified","symbol_changes_coverage"],type:"object"},ChangelogPartialV1:{additionalProperties:!1,description:"The tree diff without symbol changes: the refs are not both exact local\nbranches with sealed generations.",properties:{changed_file_count:{format:"uint",minimum:0,type:"integer"},changed_files:{items:{type:"string"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},from_ref:{type:"string"},status:{$ref:"#/$defs/GitReadPartialV1"},symbol_changes_coverage:{$ref:"#/$defs/SymbolChangesUnavailableV1"},symbols_added:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_modified:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},symbols_removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},to_ref:{type:"string"}},required:["status","from_ref","to_ref","changed_file_count","changed_files","symbols_added","symbols_removed","symbols_modified","symbol_changes_coverage"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitComparedSymbolV1:gy,GitReadCompleteV1:gj,GitReadPartialV1:gC,GitReadUnavailableV1:gT,GitToolErrorKindV1:gW,GitToolErrorV1:gM,GitToolFailureV1:gN,GitToolOperationV1:gz,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,SymbolChangesCompleteV1:{additionalProperties:!1,properties:{status:{$ref:"#/$defs/GitReadCompleteV1"}},required:["status"],type:"object"},SymbolChangesUnavailableV1:bV},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ChangelogCompleteV1"},{$ref:"#/$defs/ChangelogPartialV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"ChangelogResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of cycles to report, largest first (default: 25, max:\n200). The response always states the total detected and how many were\nomitted.",format:"uint32",minimum:0,type:["integer","null"]},member_limit:{description:"Maximum member files listed per reported cycle (default: 12, max:\n200). Each entry states its true member_count and\nomitted_member_count.",format:"uint32",minimum:0,type:["integer","null"]}},title:"CircularSurfaceRequestV1",type:"object"},{$defs:{CircularCycleV1:{additionalProperties:!1,description:"One reported file cycle: the members that fit the member bound, plus the\ncomponent's true size so the omission is stated rather than hidden.",properties:{member_count:{format:"uint64",minimum:0,type:"integer"},members:{items:{type:"string"},type:"array"},omitted_member_count:{format:"uint64",minimum:0,type:"integer"}},required:["members","member_count","omitted_member_count"],type:"object"},CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycle_count:{format:"uint64",minimum:0,type:"integer"},cycles:{items:{$ref:"#/$defs/CircularCycleV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint64",minimum:0,type:"integer"},member_limit:{format:"uint64",minimum:0,type:"integer"},omitted_cycle_count:{format:"uint64",minimum:0,type:"integer"},reported_cycle_count:{format:"uint64",minimum:0,type:"integer"}},required:["cycle_count","reported_cycle_count","omitted_cycle_count","limit","member_limit","cycles"],title:"CircularResultV1",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{maximum_depth:{default:3,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},node_id:{type:"string"},resolve_trait_dispatch:{default:!0,type:"boolean"},scope:{$ref:"#/$defs/CodeQueryScope",default:{generation:"code-generation:unpinned-latest.v1",path_prefix:null}}},required:["node_id"],title:"CodeCalleesSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,SymbolPrimitiveRecord:bI,SymbolRelationRecord:bx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolRelationRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{maximum_depth:{default:3,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},node_id:{type:"string"},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}}},required:["node_id"],title:"CodeCallersSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,SymbolRelationRecord:bx,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolRelationRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},node_id:{type:"string"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["node_id","scope","meta"],title:"CodeNavigationSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ExactTechnicalTermKindV1:yO,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kind:{anyOf:[{$ref:"#/$defs/ExactTechnicalTermKindV1"},{type:"null"}]},literal:{type:"string"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["literal","scope","meta"],title:"CodeExactOccurrenceSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeOccurrenceRecord:hP,CodeSearchChunkId:hR,ExactOccurrenceRecord:{additionalProperties:!1,properties:{matched_kind:{$ref:"#/$defs/ExactTechnicalTermKindV1"},matched_literal:{type:"string"},occurrence:{$ref:"#/$defs/CodeOccurrenceRecord"}},required:["occurrence","matched_kind","matched_literal"],type:"object"},ExactTechnicalTermKindV1:yO,FileOccurrenceId:gs,SourceSpan:b$,SymbolOccurrenceId:bq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/ExactOccurrenceRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeFacetDimension:hh,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{dimension:{$ref:"#/$defs/CodeFacetDimension"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["dimension","scope","meta"],title:"CodeFacetSurfaceRequest",type:"object"},{$defs:{CodeFacetDimension:hh,CodeFacetRecord:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},dimension:{$ref:"#/$defs/CodeFacetDimension"},value:{type:"string"}},required:["dimension","value","count"],type:"object"},CodeGenerationId:hy},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/CodeFacetRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ImplementationSelector:{oneOf:[{properties:{name:{type:"string"},selector:{const:"trait",type:"string"}},required:["selector","name"],type:"object"},{properties:{name:{type:"string"},selector:{const:"method",type:"string"}},required:["selector","name"],type:"object"}]},ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}},selector:{$ref:"#/$defs/ImplementationSelector"}},required:["selector"],title:"CodeImplementationsSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,ImplementationRecord:{additionalProperties:!1,description:"One implementation match with its exact source: the implementing\nimpl/class block (methods included) for a trait selector, or the function\nbody for a method selector.",properties:{body:{type:"string"},dispatch_from:{description:"Trait or interface node a trait-selector match was reached through.",type:["string","null"]},edge_kind:{type:"string"},symbol:{$ref:"#/$defs/SymbolPrimitiveRecord"}},required:["symbol","edge_kind","body"],type:"object"},PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/ImplementationRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeLexicalField:{description:"Typed code fields accepted by the generation-owned lexical authority.",enum:["symbol_name","qualified_name","path","signature","documentation","body_text","preamble_text","exact_term","subtoken"],type:"string"},CodeLexicalFieldFilter:{additionalProperties:!1,properties:{field:{$ref:"#/$defs/CodeLexicalField"},include:{type:"boolean"}},required:["field","include"],type:"object"},CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Serializable adapter DTO for the request-local phrase query view.\n\nThe callable application request deliberately keeps its sanitized query\nnon-serializable. The owning runtime supplies the exact sanitizer\nrevisions when converting this transport DTO.",properties:{field_filters:{default:[],items:{$ref:"#/$defs/CodeLexicalFieldFilter"},type:"array"},fuzzy_budget:{default:0,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},phrases:{items:{type:"string"},type:"array"},query:{type:"string"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["query","phrases","scope","meta"],title:"CodePhraseSearchSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeOccurrenceRecord:hP,CodeSearchChunkId:hR,FileOccurrenceId:gs,LexicalOccurrenceRecord:{additionalProperties:!1,properties:{matched_phrases:{items:{type:"string"},type:"array"},matched_terms:{items:{type:"string"},type:"array"},occurrence:{$ref:"#/$defs/CodeOccurrenceRecord"},score_micros:{format:"uint64",minimum:0,type:"integer"}},required:["occurrence","score_micros","matched_phrases","matched_terms"],type:"object"},SourceSpan:b$,SymbolOccurrenceId:bq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/LexicalOccurrenceRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{is_async:{type:["boolean","null"]},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},params:{default:[],items:{type:"string"},type:"array"},returns:{type:["string","null"]},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}}},title:"CodeSignatureSearchSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{lazy_index_ignored_dependencies:{type:"boolean"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},query:{type:"string"},scope:{$ref:"#/$defs/SymbolGraphScope"}},required:["query","scope","lazy_index_ignored_dependencies","meta"],title:"CodeSymbolSearchSurfaceRequest",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,CodeGenerationId:hy,CodeQueryScope:hV,ResultProjection:vP,RetrievalOrder:vx},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/CallableCodeSurfaceMeta"},scope:{$ref:"#/$defs/CodeQueryScope"}},required:["scope","meta"],title:"CodeTimelineSurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeTimelineRecord:{additionalProperties:!1,properties:{file_count:{format:"uint64",minimum:0,type:"integer"},generation:{$ref:"#/$defs/CodeGenerationId"},indexed_at:{$ref:"#/$defs/UtcMicros"},symbol_count:{format:"uint64",minimum:0,type:"integer"}},required:["generation","indexed_at","file_count","symbol_count"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Generation-bound page returned by every callable code query. Coverage,\nomissions, scoring, and terminal state remain in the enclosing\n[`crate::result::RetrievalEvidence`].",properties:{generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/CodeTimelineRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},query_fallback:{description:"Independently hashed exact/lexical/graph subpayload. Callers preserve it\nbyte-for-byte rather than interpreting it, so the public schema admits\nthe canonical JSON it carries without re-declaring its internals."},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["generation","items"],title:"CodeQueryPage",type:"object"},{$defs:{CallableCodeSurfaceMeta:ho,ResultProjection:vP,RetrievalOrder:vx,SymbolGraphScope:bR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{maximum_depth:{default:5,format:"uint32",minimum:0,type:"integer"},meta:{$ref:"#/$defs/CallableCodeSurfaceMeta",default:{cursor:null,order:"source_position",projection:"evidence"}},node_id:{type:"string"},scope:{$ref:"#/$defs/SymbolGraphScope",default:{path_prefix:null}}},required:["node_id"],title:"CodeTypeHierarchySurfaceRequest",type:"object"},{$defs:{CodeGenerationId:hy,CodeGraphReadFreshnessV1:hg,PrimitiveSupportGap:_Y,SymbolPrimitiveRecord:bI,TypeHierarchyRecord:{additionalProperties:!1,properties:{depth:{format:"uint32",minimum:0,type:"integer"},edge_kind:{type:"string"},parent_node_id:{type:"string"},symbol:{$ref:"#/$defs/SymbolPrimitiveRecord"}},required:["symbol","parent_node_id","edge_kind","depth"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Bounded semantic result shared by the compatibility surfaces. Rendering,\ntransport envelopes, and MCP content blocks remain outside this contract.",properties:{freshness:{$ref:"#/$defs/CodeGraphReadFreshnessV1"},generation:{$ref:"#/$defs/CodeGenerationId"},items:{items:{$ref:"#/$defs/TypeHierarchyRecord"},type:"array"},next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},related_edge_count:{format:"uint64",minimum:0,type:["integer","null"]},support_gaps:{items:{$ref:"#/$defs/PrimitiveSupportGap"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]},truncated:{type:"boolean"}},required:["generation","freshness","items","truncated","support_gaps"],title:"SymbolGraphPage",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{staged_only:{description:"If true, compare pinned HEAD with immutable staged index blobs. The\ndefault compares HEAD with captured working-tree bytes, including\nuntracked files: a staged edit undone in the working tree cancels out.",type:["boolean","null"]}},title:"CommitContextSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CommitCategoryV1:{description:"The commit category the changed file roles suggest.",enum:["feature/fix (source + tests)","feature/fix/refactor","test","chore/docs/config"],type:"string"},CommitContextSummaryV1:{additionalProperties:!1,properties:{changed_files:{items:{$ref:"#/$defs/CommitFileRoleV1"},type:"array"},comparison:{anyOf:[{$ref:"#/$defs/GitContextComparisonV1"},{type:"null"}]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},recent_commits:{items:{type:"string"},type:"array"},source_coverage:{anyOf:[{$ref:"#/$defs/GitContextSourceCoverageV1"},{type:"null"}]},suggested_category:{anyOf:[{$ref:"#/$defs/CommitCategoryV1"},{type:"null"}],description:"Absent when the worktree has no changes."},summary:{type:"string"},symbols_by_role:{additionalProperties:!1,properties:{config:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"},docs:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"},source:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"},test:{items:{$ref:"#/$defs/CommitSymbolEntryV1"},type:"array"}},type:"object"}},required:["changed_files","symbols_by_role","recent_commits","summary"],type:"object"},CommitFileRoleV1:{additionalProperties:!1,properties:{comparison:{anyOf:[{$ref:"#/$defs/GitContextFileComparisonV1"},{type:"null"}]},file:{type:"string"},role:{$ref:"#/$defs/GitFileRoleV1"},symbols:{format:"uint",minimum:0,type:"integer"}},required:["file","role","symbols"],type:"object"},CommitSymbolEntryV1:{anyOf:[{$ref:"#/$defs/CommitSymbolV1"},{$ref:"#/$defs/ConfigSummaryV1"}]},CommitSymbolV1:{additionalProperties:!1,properties:{change:{anyOf:[{$ref:"#/$defs/GitDeclarationChangeKindV1"},{type:"null"}]},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},source_side:{anyOf:[{$ref:"#/$defs/GitContextSourceSideV1"},{type:"null"}]}},required:["name","kind","file","line"],type:"object"},ConfigSummaryKindV1:hT,ConfigSummaryV1:hO,GitChangeKindV1:gh,GitContextComparisonV1:gg,GitContextFileComparisonV1:{additionalProperties:!1,properties:{after_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},before_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},change:{$ref:"#/$defs/GitChangeKindV1"},previous_file:{type:["string","null"]}},required:["change"],type:"object"},GitContextSourceConsistencyV1:{oneOf:[{enum:["immutable_blobs"],type:"string"},{const:"per_file_worktree_capture",description:"Each file is checked around its bounded read; this is not an atomic\nsnapshot of the entire working tree.",type:"string"}]},GitContextSourceCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},consistency:{$ref:"#/$defs/GitContextSourceConsistencyV1"},gaps:{items:{$ref:"#/$defs/GitContextSourceGapV1"},type:"array"},git:{$ref:"#/$defs/GitCoverageV1"}},required:["complete","git","gaps","consistency"],type:"object"},GitContextSourceGapV1:{additionalProperties:!1,properties:{file:{type:"string"},reason:{type:"string"}},required:["file","reason"],type:"object"},GitContextSourceSideV1:{enum:["before","after"],type:"string"},GitCoverageV1:gv,GitDeclarationChangeKindV1:{enum:["added","removed","modified","signature_changed","visibility_changed","renamed","ambiguous_overload"],type:"string"},GitDegradationV1:gb,GitFileRoleV1:gS,GitOidV1:gq,GitToolErrorKindV1:gW,GitToolErrorV1:gM,GitToolFailureV1:gN,GitToolOperationV1:gz,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/CommitContextSummaryV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"CommitContextResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},node_kind:{description:"Filter by node kind (default: every kind).",type:["string","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"ComplexitySurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComplexityAnalysisV1:hx,ComplexityReportEntryV1:{additionalProperties:!1,properties:{branches:{format:"uint32",minimum:0,type:["integer","null"]},complexity_analysis:{$ref:"#/$defs/ComplexityAnalysisV1"},cyclomatic_complexity:{description:"The counters are `None` when `complexity_analysis` reports the bounded\nwalk did not cover the body.",format:"uint32",minimum:0,type:["integer","null"]},fan_in:{format:"uint64",minimum:0,type:"integer"},fan_out:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},lines:{format:"uint32",minimum:0,type:"integer"},loops:{format:"uint32",minimum:0,type:["integer","null"]},max_nesting:{format:"uint32",minimum:0,type:["integer","null"]},name:{type:"string"},score:{format:"uint64",minimum:0,type:"integer"}},required:["id","name","kind","file","line","lines","complexity_analysis","fan_out","fan_in","score"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{formula:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},note:{type:"string"},ranking:{items:{$ref:"#/$defs/ComplexityReportEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["formula","note","result_count","ranking"],title:"ComplexityReportV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exactly one of `path` or `glob` names the files to query.",properties:{glob:{description:"Glob pattern to match multiple config files (e.g. '**/Cargo.toml').\nMutually exclusive with 'path'.",type:["string","null"]},key:{description:"Dot-separated key path (e.g. 'package.version',\n'dependencies.tokio.version').",type:"string"},path:{description:"Project-relative path to a single config file (e.g. 'Cargo.toml').\nMutually exclusive with 'glob'.",type:["string","null"]}},required:["key"],title:"ConfigSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ConfigKeyFoundV1:{additionalProperties:!1,properties:{file:{type:"string"},key:{type:"string"},line:{description:"The first line whose text starts with the key's leaf segment.",format:"uint32",minimum:0,type:["integer","null"]},value:!0},required:["file","key","value"],type:"object"},ConfigKeyMissingV1:{additionalProperties:!1,description:"`value` is always null and `found` always false; both stay on the wire\nso a missing key reads the same as it always has.",properties:{file:{type:"string"},found:{type:"boolean"},key:{type:"string"},value:{type:"null"}},required:["file","key","value","found"],type:"object"},ConfigMatchV1:{anyOf:[{$ref:"#/$defs/ConfigParseErrorV1"},{$ref:"#/$defs/ConfigKeyMissingV1"},{$ref:"#/$defs/ConfigKeyFoundV1"}],description:"One queried config file: the file's parse error, the key's absence, or the\nkey's value and defining line.\n\nThe variants are distinguished by their exact field sets, so each one\ndenies unknown fields and the most specific shapes are tried first."},ConfigParseErrorV1:{additionalProperties:!1,properties:{error:{type:"string"},file:{type:"string"}},required:["file","error"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{description:"Files where the key was found or that failed to parse.",format:"uint",minimum:0,type:"integer"},matches:{items:{$ref:"#/$defs/ConfigMatchV1"},type:"array"}},required:["match_count","matches"],title:"ConfigResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{default:null,description:"The previous page's `next_cursor`, valid only with the same `limit`.",type:["string","null"]},limit:{format:"uint",minimum:0,type:"integer"}},required:["limit"],title:"ConfigurationAuditRequestV1",type:"object"},{$defs:{ActorId:fb,ConfigurationAuditEvent:{additionalProperties:!1,description:"Append-only audit record. `target_commitment` is event-scoped and cannot be\njoined across audit events; a caller must be separately authorized before\nany canonical target is resolved by the store/application layer.",properties:{actor_id:{$ref:"#/$defs/ActorId"},base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},event_id:{$ref:"#/$defs/ConfigurationAuditEventId"},event_kind:{$ref:"#/$defs/ConfigurationAuditEventKindV1"},idempotency_key:{anyOf:[{$ref:"#/$defs/ConfigurationIdempotencyKey"},{type:"null"}]},occurred_at:{$ref:"#/$defs/UtcMicros"},operation_digest:{$ref:"#/$defs/ManifestDigest"},receipt_id:{anyOf:[{$ref:"#/$defs/ConfigurationReceiptId"},{type:"null"}]},result_revision_id:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},safe_reason_code:{type:["string","null"]},target_commitment:{$ref:"#/$defs/ManifestDigest"}},required:["event_id","event_kind","actor_id","base_revision_id","operation_digest","target_commitment","occurred_at"],type:"object"},ConfigurationAuditEventId:{description:"Strongly typed canonical identity: `ConfigurationAuditEventId`.",type:"string"},ConfigurationAuditEventKindV1:{enum:["dry_run_created","applied","rejected","expired","activation_failed","rollback_dry_run_created","rollback_applied","recovered"],type:"string"},ConfigurationIdempotencyKey:hE,ConfigurationReceiptId:hW,ConfigurationRevisionId:hM,ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{events:{items:{$ref:"#/$defs/ConfigurationAuditEvent"},type:"array"},next_cursor:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]}},required:["events"],title:"ConfigurationAuditPage",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AnalyzerEnvironmentVariable:fV,AnalyzerExecutableId:fR,AnalyzerExecutableReferenceV1:fq,AnalyzerLanguageId:fI,AnalyzerLanguageSelectionV1:fx,AnalyzerPrivacyClassV1:fj,AnalyzerResourceLimitsV1:fC,AnalyzerRestartPolicyV1:fT,AnalyzerSettingsV1:fO,AnalyzerStructuredValueV1:fE,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,AutomationBackendV1:fL,AutomationHostModeV1:fU,AutomationSettingsV1:fZ,AutomationTaskSetV1:fQ,AutomationTaskSettingsV1:fX,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CodeIndexWorkerSelectionV1:hw,ConfigurationDirectMutationRequestV1:{oneOf:[{properties:{key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},operation:{const:"set",type:"string"},value:{$ref:"#/$defs/ConfigurationValueV1"}},required:["operation","layer","key","value"],type:"object"},{properties:{key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},operation:{const:"unset",type:"string"}},required:["operation","layer","key"],type:"object"}]},ConfigurationIdempotencyKey:hE,ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ConfigurationValueV1:hz,ContextScoutConfigurationLimitsV1:hB,ContextScoutConfigurationModeV1:hK,ContextScoutConfigurationStateV1:hJ,ContextScoutConfiguredModelPathV1:hZ,ContextScoutIntentKindV1:h6,ContextScoutIntentSettingsV1:h3,ContextScoutSettingsV1:yn,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DecisionEngineSettingsV1:yb,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,IntentQuestionSettingsV1:gB,IntentWindowSettingsV1:gK,LcmSummarizerExecutableV1:g9,LcmSummarizerExecutablesV1:g5,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,QueryCollectionId:vd,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SettingKey:ba,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkContentLocationClassV1:$u,WorkEffortClassV1:$y,WorkEgressPolicy:$g,WorkExecutableBindingV1:$b,WorkExecutableCapabilityV1:$$,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExpertiseCategoryV1:$V,WorkExpertiseConsentV1:$R,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkOrdinalBandV1:$U,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteCandidateV1:Sg,WorkRouteExecutionProfileV1:Sv,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},mutations:{items:{$ref:"#/$defs/ConfigurationDirectMutationRequestV1"},type:"array"}},required:["mutations","expected_revision","idempotency_key"],title:"ConfigurationBatchRequestV1",type:"object"},{$defs:{AccessPolicyDigest:f_,ConfigurationReceiptId:hW,ConfigurationRevisionId:hM,ConfigurationSettlementAuthorityV1:{additionalProperties:!1,description:"Original authorization evidence pinned to a durable configuration effect.\nA retry reauthorizes access separately without replacing these fields.",properties:{policy_digest:{$ref:"#/$defs/AccessPolicyDigest"},policy_epoch:{format:"uint64",minimum:0,type:"integer"},revalidated_at:{$ref:"#/$defs/UtcMicros"}},required:["policy_epoch","policy_digest","revalidated_at"],type:"object"},ConfigurationSnapshotId:hN,ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},created_at:{$ref:"#/$defs/UtcMicros"},effective_deadline_at:{$ref:"#/$defs/UtcMicros"},operation_digest:{$ref:"#/$defs/ManifestDigest"},receipt_id:{$ref:"#/$defs/ConfigurationReceiptId"},result_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},settlement_authority:{$ref:"#/$defs/ConfigurationSettlementAuthorityV1"},snapshot_id:{$ref:"#/$defs/ConfigurationSnapshotId"}},required:["receipt_id","base_revision_id","result_revision_id","snapshot_id","operation_digest","settlement_authority","created_at","effective_deadline_at"],title:"ConfigurationMutationReceipt",type:"object"},{$defs:{SettingKey:ba},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{key:{$ref:"#/$defs/SettingKey"}},required:["key"],title:"ConfigurationGetRequestV1",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AnalyzerEnvironmentVariable:fV,AnalyzerExecutableId:fR,AnalyzerExecutableReferenceV1:fq,AnalyzerLanguageId:fI,AnalyzerLanguageSelectionV1:fx,AnalyzerPrivacyClassV1:fj,AnalyzerResourceLimitsV1:fC,AnalyzerRestartPolicyV1:fT,AnalyzerSettingsV1:fO,AnalyzerStructuredValueV1:fE,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,AutomationBackendV1:fL,AutomationHostModeV1:fU,AutomationSettingsV1:fZ,AutomationTaskSetV1:fQ,AutomationTaskSettingsV1:fX,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CandidateDispositionV1:{enum:["winning","overridden","rejected","defaulted"],type:"string"},CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CodeIndexWorkerSelectionV1:hw,ConfigurationCandidateV1:{additionalProperties:!1,description:"Resolution provenance is intentionally distinct from behavior. Moving the\nsame winner between layers can change this material without changing the\neffective behavior digest.",properties:{disposition:{$ref:"#/$defs/CandidateDispositionV1"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},safe_reason:{type:["string","null"]}},required:["layer","revision_id","disposition"],type:"object"},ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,ConfigurationValueV1:hz,ContextScoutConfigurationLimitsV1:hB,ContextScoutConfigurationModeV1:hK,ContextScoutConfigurationStateV1:hJ,ContextScoutConfiguredModelPathV1:hZ,ContextScoutIntentKindV1:h6,ContextScoutIntentSettingsV1:h3,ContextScoutSettingsV1:yn,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DecisionEngineSettingsV1:yb,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,IntentQuestionSettingsV1:gB,IntentWindowSettingsV1:gK,LcmSummarizerExecutableV1:g9,LcmSummarizerExecutablesV1:g5,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,QueryCollectionId:vd,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SettingKey:ba,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkContentLocationClassV1:$u,WorkEffortClassV1:$y,WorkEgressPolicy:$g,WorkExecutableBindingV1:$b,WorkExecutableCapabilityV1:$$,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExpertiseCategoryV1:$V,WorkExpertiseConsentV1:$R,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkOrdinalBandV1:$U,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteCandidateV1:Sg,WorkRouteExecutionProfileV1:Sv,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{candidates:{items:{$ref:"#/$defs/ConfigurationCandidateV1"},type:"array"},effective_behavior_digest:{$ref:"#/$defs/ManifestDigest"},effective_value:{$ref:"#/$defs/ConfigurationValueV1"},key:{$ref:"#/$defs/SettingKey"},resolution_provenance_digest:{$ref:"#/$defs/ManifestDigest"},revision_id:{$ref:"#/$defs/ConfigurationRevisionId",description:"Current configuration revision accepted by mutation `expected_revision` CAS."},snapshot_id:{$ref:"#/$defs/ConfigurationSnapshotId",description:"Content identity of the fully resolved configuration snapshot."}},required:["key","effective_value","revision_id","snapshot_id","effective_behavior_digest","resolution_provenance_digest","candidates"],title:"ResolvedSetting",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Typed input for the configuration list read through the daemon\ninvocation boundary.",title:"ConfigurationListRequestV1",type:"object"},{$defs:{RestartRequirementV1:{enum:["none","analyzer_restart","daemon_restart"],type:"string"},SettingKey:ba,SettingSensitivityV1:{enum:["public","sensitive"],type:"string"},SettingSummary:{properties:{key:{$ref:"#/$defs/SettingKey"},restart_requirement:{$ref:"#/$defs/RestartRequirementV1"},sensitivity:{$ref:"#/$defs/SettingSensitivityV1"}},required:["key","sensitivity","restart_requirement"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/SettingSummary"},title:"Array_of_SettingSummary",type:"array"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"ConfigurationObservedStateRequestV1",type:"object"},{$defs:{ActivationDriftV1:{enum:["current","never_activated","pending_restart","activation_failed"],type:"string"},ComponentConfigurationState:{properties:{activation_error_code:{type:["string","null"]},component:{type:"string"},desired_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},drift:{$ref:"#/$defs/ActivationDriftV1"},last_working_revision_id:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},observed_revision_id:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},restart_required:{type:"boolean"}},required:["component","desired_revision_id","restart_required","drift"],type:"object"},ConfigurationRevisionId:hM},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/ComponentConfigurationState"},title:"Array_of_ComponentConfigurationState",type:"array"},{$defs:{ChangePlanId:hu,ConfigurationIdempotencyKey:hE,ConfigurationRevisionId:hM,ManifestDigest:_l},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},operation_digest:{$ref:"#/$defs/ManifestDigest"},plan_id:{$ref:"#/$defs/ChangePlanId"}},required:["plan_id","expected_base_revision_id","operation_digest","idempotency_key"],title:"ConfigurationProtectedApplyRequestV1",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,ConfigurationRevisionId:hM,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedChange:{description:"The protected configuration operation set. Ordinary scalar mutations are\nintentionally absent; they activate directly after validation.",oneOf:[{properties:{kind:{const:"bind_source",type:"string"},value:{$ref:"#/$defs/ScopeSourceBinding"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"rebind_source",type:"string"},value:{$ref:"#/$defs/ScopeSourceBinding"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"unbind_source",type:"string"},value:{properties:{binding_id:{$ref:"#/$defs/SourceBindingId"}},required:["binding_id"],type:"object"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"upsert_access_rule",type:"string"},value:{$ref:"#/$defs/ScopeAccessRule"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"remove_access_rule",type:"string"},value:{properties:{rule_id:{$ref:"#/$defs/AccessRuleId"}},required:["rule_id"],type:"object"}},required:["kind","value"],type:"object"},{properties:{kind:{const:"replace_work_topology_policy",type:"string"},value:{$ref:"#/$defs/WorkTopologyPolicyV1"}},required:["kind","value"],type:"object"}]},ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{change:{$ref:"#/$defs/ProtectedChange"},expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"}},required:["change","expected_revision"],title:"ConfigurationProtectedPreviewRequestV1",type:"object"},{$defs:{AccessPolicyDigest:f_,ActorId:fb,ChangePlanId:hu,ConfigurationRevisionId:hM,ManifestDigest:_l,RedactedConfigurationChangeV1:{additionalProperties:!1,properties:{after_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},before_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},operation:{$ref:"#/$defs/ScopeControlOperationV1"},setting_key:{$ref:"#/$defs/SettingKey"}},required:["setting_key","operation"],type:"object"},ScopeControlOperationV1:vK,SettingKey:ba,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Immutable dry-run result. It contains no raw locator, secret, target\nidentity, or plaintext configuration value.",properties:{actor_id:{$ref:"#/$defs/ActorId"},authorization_policy_digest:{$ref:"#/$defs/AccessPolicyDigest"},base_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"},created_at:{$ref:"#/$defs/UtcMicros"},expires_at:{$ref:"#/$defs/UtcMicros"},membership_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},operation_digest:{$ref:"#/$defs/ManifestDigest"},plan_id:{$ref:"#/$defs/ChangePlanId"},policy_epoch:{format:"uint64",minimum:0,type:"integer"},redacted_changes:{items:{$ref:"#/$defs/RedactedConfigurationChangeV1"},type:"array"},resolved_scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["plan_id","actor_id","base_revision_id","operation_digest","resolved_scope_digest","authorization_policy_digest","policy_epoch","expires_at","created_at","redacted_changes"],title:"ProtectedChangePlan",type:"object"},{$defs:{ConfigurationRevisionId:hM,RollbackModeV1:{enum:["all_or_nothing","partial"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{mode:{$ref:"#/$defs/RollbackModeV1"},target_revision_id:{$ref:"#/$defs/ConfigurationRevisionId"}},required:["target_revision_id","mode"],title:"ConfigurationRollbackPreviewRequestV1",type:"object"},{$defs:{AccessRuleId:fv,ActorId:fb,AnalyzerEnvironmentVariable:fV,AnalyzerExecutableId:fR,AnalyzerExecutableReferenceV1:fq,AnalyzerLanguageId:fI,AnalyzerLanguageSelectionV1:fx,AnalyzerPrivacyClassV1:fj,AnalyzerResourceLimitsV1:fC,AnalyzerRestartPolicyV1:fT,AnalyzerSettingsV1:fO,AnalyzerStructuredValueV1:fE,AuthorityRef:fM,AutomaticWorktreeGcV1:fF,AutomationBackendV1:fL,AutomationHostModeV1:fU,AutomationSettingsV1:fZ,AutomationTaskSetV1:fQ,AutomationTaskSettingsV1:fX,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CodeIndexWorkerSelectionV1:hw,ConfigurationIdempotencyKey:hE,ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ConfigurationValueV1:hz,ContextScoutConfigurationLimitsV1:hB,ContextScoutConfigurationModeV1:hK,ContextScoutConfigurationStateV1:hJ,ContextScoutConfiguredModelPathV1:hZ,ContextScoutIntentKindV1:h6,ContextScoutIntentSettingsV1:h3,ContextScoutSettingsV1:yn,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DecisionEngineSettingsV1:yb,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,IntentQuestionSettingsV1:gB,IntentWindowSettingsV1:gK,LcmSummarizerExecutableV1:g9,LcmSummarizerExecutablesV1:g5,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,QueryCollectionId:vd,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RuleEffect:vD,ScopeAccessRule:vG,ScopeAccessSubjectV1:vB,ScopeControlOperationV1:vK,ScopeSourceBinding:v1,SensitiveFilesystemLocatorV1:v4,SettingKey:ba,SourceBindingId:bh,SourceKindV1:b_,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkContentLocationClassV1:$u,WorkEffortClassV1:$y,WorkEgressPolicy:$g,WorkExecutableBindingV1:$b,WorkExecutableCapabilityV1:$$,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExpertiseCategoryV1:$V,WorkExpertiseConsentV1:$R,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkOrdinalBandV1:$U,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteCandidateV1:Sg,WorkRouteExecutionProfileV1:Sv,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Typed revision-CAS input for a configuration write through the daemon\ninvocation boundary.",properties:{expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"},value:{$ref:"#/$defs/ConfigurationValueV1"}},required:["layer","key","value","expected_revision","idempotency_key"],title:"ConfigurationSetRequestV1",type:"object"},{$defs:{ConfigurationIdempotencyKey:hE,ConfigurationLayerIdV1:hA,ConfigurationRevisionId:hM,ProjectId:_4,QueryCollectionId:vd,SettingKey:ba,UserProfileId:bJ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"},key:{$ref:"#/$defs/SettingKey"},layer:{$ref:"#/$defs/ConfigurationLayerIdV1"}},required:["layer","key","expected_revision","idempotency_key"],title:"ConfigurationUnsetRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of literal sites to return (default: 100, max: 1000).",format:"uint32",minimum:0,type:["integer","null"]},struct:{description:"Struct name to search literal sites of (e.g. 'GraphStats', 'Config').",type:"string"}},required:["struct"],title:"ConstructorsSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ConstructorFieldCoverageV1:{description:"Whether a literal site's field lists are complete relative to the\nstruct's graph definition.",enum:["complete","unknown"],type:"string"},ConstructorResolutionReasonV1:{enum:["ambiguous_simple_name","syntax_only_simple_name"],type:"string"},ConstructorResolutionStatusV1:{description:"Syntax alone cannot link same-name types across modules, so every\nresolution is unverified.",enum:["unverified"],type:"string"},ConstructorSiteV1:{additionalProperties:!1,properties:{field_coverage:{$ref:"#/$defs/ConstructorFieldCoverageV1"},fields:{items:{type:"string"},type:"array"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},missing_fields:{items:{type:"string"},type:"array"},update_fields:{items:{type:"string"},type:"array"}},required:["file","line","fields","update_fields","missing_fields","field_coverage"],type:"object"},ConstructorsNotFoundV1:{additionalProperties:!1,properties:{found:{description:"Always `false`: no struct, class, or case class has the name.",type:"boolean"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},message:{type:"string"},sites:{items:{$ref:"#/$defs/ConstructorSiteV1"},type:"array"},struct:{type:"string"}},required:["found","struct","message","match_count","sites"],type:"object"},ConstructorsReportV1:{additionalProperties:!1,properties:{candidate_count:{format:"uint64",minimum:0,type:"integer"},expected_fields:{description:"`None` when the name resolves to more than one definition.",items:{type:"string"},type:["array","null"]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},resolution_reason:{$ref:"#/$defs/ConstructorResolutionReasonV1"},resolution_status:{$ref:"#/$defs/ConstructorResolutionStatusV1"},sites:{items:{$ref:"#/$defs/ConstructorSiteV1"},type:"array"},struct:{type:"string"}},required:["struct","candidate_count","resolution_status","resolution_reason","match_count","sites"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ConstructorsNotFoundV1"},{$ref:"#/$defs/ConstructorsReportV1"}],title:"ConstructorsResultV1"},{$defs:{ContextModeV1:hL},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{budget_tokens:{description:"Cap the ranked sections of the answer at about this many tokens.\nQuotas are fixed shares of the budget. The cut is reported on the result.",format:"uint32",minimum:0,type:["integer","null"]},include_code:{type:["boolean","null"]},include_memory:{type:["boolean","null"]},lexical_anchors:{description:"Exact identifiers or technical terms the answer must be about. Each\nruns as its own lexical route: hits carrying an anchor outrank hits\ncarrying none, exact hits included, every anchor with matches keeps at\nleast its best sites through the lane cap, and `lexical_anchors` in the\nresult reports each anchor's outcome: the sites this result returns\nand, by reason, the admitted sites it could not carry. Bounded and\nvalidated by the retrieval kernel; a\nviolation is a typed request rejection. Identifiers the task names\n(`snake_case`, `camelCase`, `a::b`) are anchored after these.",items:{type:"string"},type:["array","null"]},max_code_blocks:{format:"uint32",minimum:0,type:["integer","null"]},max_nodes:{format:"uint32",minimum:0,type:["integer","null"]},memory_limit:{format:"uint32",minimum:0,type:["integer","null"]},memory_min_trust:{format:"double",type:["number","null"]},mode:{anyOf:[{$ref:"#/$defs/ContextModeV1"},{type:"null"}]},prefer_symbol:{description:"Add a symbol-name lexical route for the identifier-shaped words of the\ntask text.",type:["boolean","null"]},task:{type:"string"}},required:["task"],title:"ContextSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ContextCodeBlockV1:{additionalProperties:!1,properties:{code:{type:"string"},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},node_id:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["node_id","file","start_line","end_line","code"],type:"object"},ContextExtensionPointV1:{additionalProperties:!1,description:"A public trait or interface among the context's selected symbols.",properties:{file:{type:"string"},implementor_count:{format:"uint",minimum:0,type:"integer"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line","implementor_count"],type:"object"},ContextLexicalAnchorV1:hF,ContextModeV1:hL,ContextPlanV1:{additionalProperties:!1,description:"Plan-mode enrichment: where the selected code can be extended and which\ntest files reach it.",properties:{extension_points:{items:{$ref:"#/$defs/ContextExtensionPointV1"},type:"array"},test_files:{description:"Test files calling the selected symbols within two hops; absent when\nno symbol was selected to trace from.",items:{type:"string"},type:["array","null"]}},required:["extension_points"],type:"object"},ContextRelatedOmissionV1:{additionalProperties:!1,description:"Related symbols `context` ranked but did not return.",properties:{omitted:{description:"Ranked related symbols the `max_nodes` cut dropped.",format:"uint",minimum:0,type:"integer"},total:{description:"Distinct related symbols the walk found and ranked.",format:"uint",minimum:0,type:"integer"},total_is_lower_bound:{description:"The neighbor walk stopped at its row limit, so `total` is a lower\nbound.",type:"boolean"}},required:["total","omitted","total_is_lower_bound"],type:"object"},ContextRetrievalPlanV1:{additionalProperties:!1,description:"The retrieval plan `context` executed: which stages ran, what each\nadmitted, and where a budget bounded the answer. Lane-level serving state\nstays in `coverage`.",properties:{code:{$ref:"#/$defs/ContextStageV1",description:"Source bodies for selected symbols, bounded by `max_code_blocks`."},graph:{$ref:"#/$defs/ContextStageV1",description:"Candidates resolved to verified graph symbols."},memory:{$ref:"#/$defs/ContextStageV1",description:"Project memory facts, bounded by `memory_limit`."},related:{$ref:"#/$defs/ContextStageV1",description:"Ranked neighbors of the selected symbols, bounded by `max_nodes`."},search:{$ref:"#/$defs/ContextStageV1",description:"Ranked code-index candidates, bounded by `max_nodes`."}},required:["search","graph","related","code","memory"],type:"object"},ContextRetrievalRouteV1:{description:"Which retrieval route `context` ran.\n\n`name` is the preferred-symbol route. `prose` is the ordinary task\nroute. A caller that omits `prefer_symbol` gets `name` only when the\ntask is one identifier or one `Type.method` / `path::name` token.",enum:["name","prose"],type:"string"},ContextSearchMatchV1:{additionalProperties:!1,properties:{anchor_id:{type:"string"},anchors:{description:"Lexical anchors, the caller's and then the task's identifiers, whose\nroute ranked this match; the anchor receipt counts it as returned.",items:{type:"string"},type:"array"},exact_class:{type:"string"},file:{type:"string"},kind:{type:"string"},name:{type:"string"},qualified_name:{type:"string"},rank:{format:"uint32",minimum:0,type:"integer"},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","name","qualified_name","kind","file","exact_class","rank","utility_micros"],type:"object"},ContextStageV1:{description:"What one `context` stage ran with and kept.",oneOf:[{description:"The request did not ask for this stage.",properties:{state:{const:"not_requested",type:"string"}},required:["state"],type:"object"},{description:"A stage this one reads from produced nothing to work on.",properties:{state:{const:"skipped",type:"string"}},required:["state"],type:"object"},{description:"The stage's authority could not answer.",properties:{state:{const:"unavailable",type:"string"}},required:["state"],type:"object"},{description:"The stage admitted `admitted` entries under `budget`. `truncated` is\ntrue when it stopped at that budget, so more entries may exist.",properties:{admitted:{format:"uint32",minimum:0,type:"integer"},budget:{format:"uint32",minimum:0,type:"integer"},state:{const:"ran",type:"string"},truncated:{type:"boolean"}},required:["state","budget","admitted","truncated"],type:"object"}]},FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LexicalAnchorDropReasonV1:_e,LexicalAnchorDropV1:_t,LocatorDigest:_r,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveLaneCompleteV1:_J,PrimitiveLaneStateV1:{enum:["stale","partial","unavailable"],type:"string"},PrimitiveLaneStatusV1:{anyOf:[{$ref:"#/$defs/PrimitiveLaneCompleteV1"},{properties:{generation:{type:["string","null"]},reason:{type:["string","null"]},status:{$ref:"#/$defs/PrimitiveLaneStateV1"}},required:["status"],type:"object"}]},PrimitiveRecallV1:_Q,PrimitiveSearchCoverageV1:{additionalProperties:!1,properties:{exact:{$ref:"#/$defs/PrimitiveLaneStatusV1"},graph:{$ref:"#/$defs/PrimitiveLaneStatusV1"},lexical:{$ref:"#/$defs/PrimitiveLaneStatusV1"},recall:{$ref:"#/$defs/PrimitiveRecallV1"}},required:["exact","lexical","graph","recall"],type:"object"},PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1,PrimitiveUnavailableEvidenceV1:_0,PrimitiveUnavailableStatusV1:_2,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,TokenBudgetCutV1:bD,TokenBudgetSectionV1:bF,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{code:{items:{$ref:"#/$defs/ContextCodeBlockV1"},type:"array"},code_generation:{type:["string","null"]},coverage:{$ref:"#/$defs/PrimitiveSearchCoverageV1"},freshness:{$ref:"#/$defs/PrimitiveSearchFreshnessV1",description:"Freshness of the served code generation, derived from the typed lane\ncoverage and the daemon scheduler's worktree state."},lexical_anchors:{description:"Outcome of every caller `lexical_anchors` entry, then of each\nidentifier the task names; empty when there are neither.",items:{$ref:"#/$defs/ContextLexicalAnchorV1"},type:"array"},memory_graph_coverage:{anyOf:[{$ref:"#/$defs/FactSearchGraphCoverageV1"},{type:"null"}]},memory_matches:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},memory_matches_error:{type:["string","null"]},mode:{$ref:"#/$defs/ContextModeV1"},oversized_symbols:{description:"Matched symbols whose declaration is larger than one code block.\nTheir code is withheld rather than served as a partial window.",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"},plan:{anyOf:[{$ref:"#/$defs/ContextPlanV1"},{type:"null"}],description:"Present in plan mode when the verified graph answered."},related_omission:{anyOf:[{$ref:"#/$defs/ContextRelatedOmissionV1"},{type:"null"}],description:"Present when related symbols were left out: by the `max_nodes` cut,\nor because the neighbor walk stopped at its row limit."},related_symbols:{description:"Neighbors of `symbols`, ranked before the `max_nodes` cut: best edge\nkind to a selected symbol (calls, implements, extends, `type_of`,\nreturns, receives, uses, annotates, contains), then total degree\ndescending, then qualified name.",items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"},retrieval:{$ref:"#/$defs/ContextRetrievalPlanV1"},route:{$ref:"#/$defs/ContextRetrievalRouteV1"},search_matches:{items:{$ref:"#/$defs/ContextSearchMatchV1"},type:"array"},symbols:{items:{$ref:"#/$defs/PrimitiveSymbolLocationV1"},type:"array"},task:{type:"string"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."},verified_graph_evidence:{anyOf:[{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"},{type:"null"}]}},required:["task","route","mode","freshness","symbols","related_symbols","code","coverage","memory_matches","retrieval"],title:"ContextResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"}},required:["address"],title:"ContextScoutExactAddressRequestV1",type:"object"},{$defs:{ContextScoutLimitsV1:h9,ContextScoutModelOutcomeV1:h8},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{exhausted:{type:"boolean"},last_estimated_cost_microusd:{format:"uint64",minimum:0,type:["integer","null"]},last_input_tokens:{format:"uint64",minimum:0,type:["integer","null"]},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},last_output_tokens:{format:"uint64",minimum:0,type:["integer","null"]},limits:{$ref:"#/$defs/ContextScoutLimitsV1"}},required:["limits","exhausted"],title:"ContextScoutBudgetResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU,ContextScoutWorkV1:yc},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},idempotency_key:{type:"string"},work:{$ref:"#/$defs/ContextScoutWorkV1"}},required:["address","work","idempotency_key"],title:"ContextScoutCancelRequestV1",type:"object"},{$defs:{ContextScoutStoreOutcomeV1:ya},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{outcome:{$ref:"#/$defs/ContextScoutStoreOutcomeV1"}},required:["outcome"],title:"ContextScoutMutationResultV1",type:"object"},{$defs:{ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutRuntimeModeV1:yr,ContextScoutServiceStateV1:yi},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{configured_model:{anyOf:[{$ref:"#/$defs/ContextScoutModelBackendV1"},{type:"null"}]},configured_model_available:{type:"boolean"},deterministic_available:{type:"boolean"},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},mode:{$ref:"#/$defs/ContextScoutRuntimeModeV1"},state:{$ref:"#/$defs/ContextScoutServiceStateV1"}},required:["state","mode","deterministic_available","configured_model_available"],title:"ContextScoutCapabilityResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU,ContextScoutClaimWindowV1:{enum:["idle_window","on_request"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},idempotency_key:{type:"string"},window:{$ref:"#/$defs/ContextScoutClaimWindowV1"}},required:["address","window","idempotency_key"],title:"ContextScoutClaimRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,ContextScoutAddressV1:hU,ContextScoutCategoryV1:hH,ContextScoutClaimHandleV1:hG,ContextScoutDeliveryWindowV1:hY,ContextScoutEvidenceAvailabilityV1:h1,ContextScoutEvidenceProjectionV1:h0,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRouteV1:yt,ContextScoutSessionWindowV1:yo,ContextScoutSuggestionProjectionV1:ys,ContextScoutWorkV1:yc,ManifestDigest:_l,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{claim:{$ref:"#/$defs/ContextScoutClaimHandleV1"},outcome:{const:"claimed",type:"string"},suggestion:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"}},required:["outcome","claim","suggestion"],type:"object"},{properties:{outcome:{const:"empty",type:"string"}},required:["outcome"],type:"object"}],title:"ContextScoutClaimResultV1"},{$defs:{ContextScoutAddressV1:hU,ContextScoutClaimHandleV1:hG,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutWorkV1:yc,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},claim:{$ref:"#/$defs/ContextScoutClaimHandleV1"},delivered_at:{$ref:"#/$defs/UtcMicros"},idempotency_key:{type:"string"},outcome:{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"}},required:["address","claim","delivered_at","outcome","idempotency_key"],title:"ContextScoutDeliveryRequestV1",type:"object"},{$defs:{ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutStoreOutcomeV1:ya,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{outcome:{$ref:"#/$defs/ContextScoutStoreOutcomeV1"},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"}},required:["outcome","receipt"],title:"ContextScoutDeliveryResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},limit:{default:8,format:"uint",minimum:0,type:"integer"}},required:["address"],title:"ContextScoutRecentRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,ContextScoutAddressV1:hU,ContextScoutCategoryV1:hH,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutDeliveryWindowV1:hY,ContextScoutEvidenceAvailabilityV1:h1,ContextScoutEvidenceProjectionV1:h0,ContextScoutFeedbackKindV1:h2,ContextScoutFeedbackV1:h4,ContextScoutLimitsV1:h9,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRecentDeliveryV1:ye,ContextScoutRecentResultV1:{additionalProperties:!1,properties:{configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},deliveries:{items:{$ref:"#/$defs/ContextScoutRecentDeliveryV1"},type:"array"},observed_at:{$ref:"#/$defs/UtcMicros"},omitted:{format:"uint",minimum:0,type:"integer"},pending:{items:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"},type:"array"}},required:["configuration_revision","observed_at","pending","deliveries","omitted"],type:"object"},ContextScoutRouteV1:yt,ContextScoutRuntimeModeV1:yr,ContextScoutServiceStateV1:yi,ContextScoutSessionWindowV1:yo,ContextScoutStatusResultV1:{additionalProperties:!1,properties:{active_suggestions:{format:"uint",minimum:0,type:"integer"},configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},last_delivery_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"},{type:"null"}]},last_feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackKindV1"},{type:"null"}]},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},last_model_receipt:{anyOf:[{$ref:"#/$defs/ContextScoutModelReceiptV1"},{type:"null"}]},last_route:{anyOf:[{$ref:"#/$defs/ContextScoutRouteV1"},{type:"null"}]},last_suppression:{anyOf:[{$ref:"#/$defs/ContextScoutSuppressionV1"},{type:"null"}]},limits:{$ref:"#/$defs/ContextScoutLimitsV1"},mode:{$ref:"#/$defs/ContextScoutRuntimeModeV1"},model_path:{anyOf:[{$ref:"#/$defs/ContextScoutModelBackendV1"},{type:"null"}]},state:{$ref:"#/$defs/ContextScoutServiceStateV1"}},required:["configuration_revision","state","mode","limits","active_suggestions"],type:"object"},ContextScoutSuggestionProjectionV1:ys,ContextScoutSuppressionV1:yd,ContextScoutWorkV1:yc,ManifestDigest:_l,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{recent:{$ref:"#/$defs/ContextScoutRecentResultV1"},status:{$ref:"#/$defs/ContextScoutStatusResultV1"}},required:["status","recent"],title:"ContextScoutExplanationResultV1",type:"object"},{$defs:{ContextScoutAddressV1:hU,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutFeedbackKindV1:h2,ContextScoutFeedbackV1:h4,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},feedback:{$ref:"#/$defs/ContextScoutFeedbackV1"},idempotency_key:{type:"string"},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"}},required:["address","receipt","feedback","idempotency_key"],title:"ContextScoutFeedbackRequestV1",type:"object"},{$defs:{ConfigurationIdempotencyKey:hE,ConfigurationRevisionId:hM,ContextScoutAddressV1:hU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"},expected_revision:{$ref:"#/$defs/ConfigurationRevisionId"},idempotency_key:{$ref:"#/$defs/ConfigurationIdempotencyKey"}},required:["address","expected_revision","idempotency_key"],title:"ContextScoutControlRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,ContextScoutAddressV1:hU,ContextScoutCategoryV1:hH,ContextScoutDeliveryOutcomeV1:hQ,ContextScoutDeliveryReceiptV1:hX,ContextScoutDeliveryWindowV1:hY,ContextScoutEvidenceAvailabilityV1:h1,ContextScoutEvidenceProjectionV1:h0,ContextScoutFeedbackKindV1:h2,ContextScoutFeedbackV1:h4,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRecentDeliveryV1:ye,ContextScoutRouteV1:yt,ContextScoutSessionWindowV1:yo,ContextScoutSuggestionProjectionV1:ys,ContextScoutWorkV1:yc,ManifestDigest:_l,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},deliveries:{items:{$ref:"#/$defs/ContextScoutRecentDeliveryV1"},type:"array"},observed_at:{$ref:"#/$defs/UtcMicros"},omitted:{format:"uint",minimum:0,type:"integer"},pending:{items:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"},type:"array"}},required:["configuration_revision","observed_at","pending","deliveries","omitted"],title:"ContextScoutRecentResultV1",type:"object"},{$defs:{ContextScoutDeliveryOutcomeV1:hQ,ContextScoutFeedbackKindV1:h2,ContextScoutLimitsV1:h9,ContextScoutModelBackendV1:h5,ContextScoutModelOutcomeV1:h8,ContextScoutModelReceiptV1:h7,ContextScoutRouteV1:yt,ContextScoutRuntimeModeV1:yr,ContextScoutServiceStateV1:yi,ContextScoutSuppressionV1:yd},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{active_suggestions:{format:"uint",minimum:0,type:"integer"},configuration_revision:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},maxItems:32,minItems:32,type:"array"},last_delivery_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutDeliveryOutcomeV1"},{type:"null"}]},last_feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackKindV1"},{type:"null"}]},last_model_outcome:{anyOf:[{$ref:"#/$defs/ContextScoutModelOutcomeV1"},{type:"null"}]},last_model_receipt:{anyOf:[{$ref:"#/$defs/ContextScoutModelReceiptV1"},{type:"null"}]},last_route:{anyOf:[{$ref:"#/$defs/ContextScoutRouteV1"},{type:"null"}]},last_suppression:{anyOf:[{$ref:"#/$defs/ContextScoutSuppressionV1"},{type:"null"}]},limits:{$ref:"#/$defs/ContextScoutLimitsV1"},mode:{$ref:"#/$defs/ContextScoutRuntimeModeV1"},model_path:{anyOf:[{$ref:"#/$defs/ContextScoutModelBackendV1"},{type:"null"}]},state:{$ref:"#/$defs/ContextScoutServiceStateV1"}},required:["configuration_revision","state","mode","limits","active_suggestions"],title:"ContextScoutStatusResultV1",type:"object"},{$defs:{CouplingDirectionV1:yp},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{anyOf:[{$ref:"#/$defs/CouplingDirectionV1"},{type:"null"}],description:"fan_in: files depended on by the most others. fan_out: files that\ndepend on the most others (default: fan_in)."},limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"CouplingSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CouplingDirectionV1:yp,CouplingEntryV1:{additionalProperties:!1,properties:{coupled_files:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"}},required:["file","coupled_files"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{$ref:"#/$defs/CouplingDirectionV1"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranking:{items:{$ref:"#/$defs/CouplingEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["direction","result_count","ranking"],title:"CouplingResultV1",type:"object"},{$defs:{DashboardActionV1:{description:"What `tracedecay_dashboard` does.",enum:["start","stop"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{action:{anyOf:[{$ref:"#/$defs/DashboardActionV1"},{type:"null"}],description:'Action to perform (default: "start"). "stop" shuts down a previously\nstarted dashboard if any.'},host:{description:'Loopback host address to bind: 127.0.0.1, localhost, or ::1\n(default: "127.0.0.1"). Wildcard, LAN, public IPs, and other\nhostnames are rejected.',type:["string","null"]},port:{description:"Port to listen on; 0 picks an ephemeral port (default: 7341).",format:"uint16",maximum:65535,minimum:0,type:["integer","null"]}},title:"DashboardSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{host:{type:"string"},port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},status:{const:"started",type:"string"},url:{type:"string"}},required:["status","url","host","port"],type:"object"},{additionalProperties:!1,description:"A dashboard that was already bound when `start` was asked again.",properties:{host:{type:"string"},port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_host:{type:"string"},requested_port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_port_honored:{description:"Whether the bound port is the one asked for (always true for 0).",type:"boolean"},status:{const:"already_running",type:"string"},url:{type:"string"}},required:["status","url","host","port","requested_host","requested_port","requested_port_honored"],type:"object"},{additionalProperties:!1,description:"The bound server is shutting down.",properties:{host:{type:"string"},port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_host:{type:"string"},requested_port:{format:"uint16",maximum:65535,minimum:0,type:"integer"},requested_port_honored:{description:"Whether the bound port is the one asked for (always true for 0).",type:"boolean"},status:{const:"stopping",type:"string"},url:{type:"string"}},required:["status","url","host","port","requested_host","requested_port","requested_port_honored"],type:"object"},{additionalProperties:!1,properties:{previous_url:{type:"string"},status:{const:"stopped",type:"string"}},required:["status","previous_url"],type:"object"},{additionalProperties:!1,properties:{status:{const:"not_running",type:"string"}},required:["status"],type:"object"}],title:"DashboardResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_public:{description:"When true, do NOT exclude pub items. Default false.",type:["boolean","null"]},kinds:{description:'Node kinds to check (default: ["function", "method"]).',items:{type:"string"},type:["array","null"]},limit:{description:"Maximum symbols to return (default: 100, max: 1000).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter reported symbols to files under this directory path (e.g.\n'crates/tracedecay-mcp'). Omit for the entire codebase.",type:["string","null"]}},title:"DeadCodeSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DeadCodeSymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},signature:{type:["string","null"]}},required:["id","name","kind","file","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{dead_code_count:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},symbols:{items:{$ref:"#/$defs/DeadCodeSymbolV1"},type:"array"}},required:["dead_code_count","symbols"],title:"DeadCodeResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of chains to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]}},title:"DependencyDepthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DependencyDepthChainV1:{additionalProperties:!1,properties:{chain:{items:{type:"string"},type:"array"},depth:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"}},required:["file","depth","chain"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`ideal_depth` is `ceil(log2(file_count))`.",properties:{chains:{items:{$ref:"#/$defs/DependencyDepthChainV1"},type:"array"},depth_score:{format:"double",type:"number"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ideal_depth:{format:"uint64",minimum:0,type:"integer"},max_depth:{format:"uint64",minimum:0,type:"integer"}},required:["max_depth","ideal_depth","depth_score","chains"],title:"DependencyDepthResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Addresses indexed symbols by node id or by qualified name; the node id\nwins when both are present.",properties:{node_id:{description:"Look up a single node by its ID instead of qualified_name.",type:["string","null"]},qualified_name:{description:"The exact, case-sensitive qualified name to look up. A bare short name\ndoes not match; resolve it with find_exact_symbol first.",type:["string","null"]}},title:"SymbolSelectorSurfaceRequestV1",type:"object"},{$defs:{DeriveAnnotationV1:{additionalProperties:!1,properties:{evidence_class:{$ref:"#/$defs/DeriveEvidenceClassV1"},name:{type:"string"},unavailable_fields:{items:{type:"string"},type:"array"}},required:["name","evidence_class","unavailable_fields"],type:"object"},DeriveEvidenceClassV1:{description:"How a derive name is known: read from the declaration's attributes, not\nfrom macro expansion.",enum:["syntax_exact"],type:"string"},DerivesSymbolV1:{additionalProperties:!1,properties:{derives:{items:{$ref:"#/$defs/DeriveAnnotationV1"},type:"array"},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"}},required:["node_id","name","qualified_name","kind","file","line","derives"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Derive annotations of every addressed symbol; empty when no symbol matched.",items:{$ref:"#/$defs/DerivesSymbolV1"},title:"DerivesResultV1",type:"array"},{$defs:{DiagnoseSeverityFilterV1:{description:"Compiler severity the diagnose report keeps.",enum:["error","warning","all"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cargo_output:{description:"Raw stderr text from `cargo check` / `cargo clippy` / `rustc`.",type:"string"},include_callers:{description:"Attach up to 5 callers per diagnostic (default: true).",type:["boolean","null"]},max_diagnostics:{description:"Cap on diagnostics in the response (default: 50, at most 500).",format:"uint32",minimum:0,type:["integer","null"]},severity:{anyOf:[{$ref:"#/$defs/DiagnoseSeverityFilterV1"},{type:"null"}],description:"Filter by severity (default: all)."}},required:["cargo_output"],title:"DiagnoseSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DiagnoseItemV1:{additionalProperties:!1,properties:{callers:{description:"Absent when the request turned caller attachment off.",items:{$ref:"#/$defs/DiagnoseSymbolV1"},type:["array","null"]},code:{type:["string","null"]},column:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},message:{type:"string"},node:{anyOf:[{$ref:"#/$defs/DiagnoseSymbolV1"},{type:"null"}]},severity:{$ref:"#/$defs/DiagnoseSeverityV1"}},required:["severity","message","file","line","column"],type:"object"},DiagnosePublicationV1:{description:"Outcome of publishing the parsed diagnostics into the managed store.",oneOf:[{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"skipped",type:"string"},unresolved:{items:{type:"string"},type:["array","null"]}},required:["status","reason"],type:"object"},{additionalProperties:!1,properties:{cleared:{format:"uint64",minimum:0,type:"integer"},generation:{type:"string"},inserted:{format:"uint64",minimum:0,type:"integer"},publication_revision:{format:"uint64",minimum:0,type:"integer"},rejected:{items:{type:"string"},type:"array"},status:{const:"published",type:"string"},unresolved:{items:{type:"string"},type:"array"}},required:["status","generation","publication_revision","inserted","cleared","unresolved","rejected"],type:"object"},{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"failed",type:"string"}},required:["status","reason"],type:"object"}]},DiagnoseSeverityV1:{description:"Severity of one parsed compiler diagnostic.",enum:["error","warning","note","help"],type:"string"},DiagnoseSymbolV1:{additionalProperties:!1,description:"The graph symbol a diagnostic line falls in, or one of its callers.",properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},kind:{type:"string"},line:{description:"One-based display line.",format:"uint32",minimum:0,type:"integer"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["node_id","name","kind","qualified_name","file","line","start_line","end_line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{diagnostics:{items:{$ref:"#/$defs/DiagnoseItemV1"},type:"array"},diagnostics_parsed:{format:"uint64",minimum:0,type:"integer"},diagnostics_returned:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},mapped_to_node:{format:"uint64",minimum:0,type:"integer"},published:{$ref:"#/$defs/DiagnosePublicationV1"},truncated:{type:"boolean"},unmapped:{format:"uint64",minimum:0,type:"integer"}},required:["diagnostics_parsed","diagnostics_returned","mapped_to_node","unmapped","truncated","published","diagnostics"],title:"DiagnoseResultV1",type:"object"},{$defs:{DiagnosticsPrimitiveScope:{oneOf:[{enum:["workspace"],type:"string"},{additionalProperties:!1,properties:{package:{type:"string"}},required:["package"],type:"object"},{additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],type:"object"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{default:null,type:["string","null"]},maximum_diagnostics:{format:"uint32",minimum:0,type:"integer"},scope:{$ref:"#/$defs/DiagnosticsPrimitiveScope"}},required:["scope","maximum_diagnostics"],title:"DiagnosticsPrimitiveRequest",type:"object"},{$defs:{CodeGenerationId:hy,CommitId:hq,ComponentVersion:hC,ContentDigest:hD,DiagnosticEvidenceClassV1:{description:"Evidence class for one diagnostic record. Evidence class is part of\ncanonical diagnostic identity.",oneOf:[{const:"observed_current",description:"Directly observed against the exact clean generation it names.",type:"string"},{const:"producer_reported",description:"Reported by the cataloged producer for the exact clean generation.",type:"string"},{const:"derived_structural",description:"Derived from TraceDecay structural/graph analysis of the generation.",type:"string"},{const:"unknown_unsupported",description:"The evidence class cannot be established; the record is retained for\naudit but must not be treated as current truth.",type:"string"}]},DiagnosticPrimitiveRecord:{additionalProperties:!1,properties:{diagnostic:{$ref:"#/$defs/GenerationDiagnosticV1"},logical_path:{type:"string"}},required:["logical_path","diagnostic"],type:"object"},DiagnosticProducerKindV1:{description:"The cataloged producer kinds that may publish durable diagnostics.\nRuntime, storage, migration,\nconfiguration, session, or daemon-health findings without a truthful\nsource range are Doctor or application findings and never become\n`GenerationDiagnosticV1` records.",enum:["upstream_compiler","language_server","tracedecay_structural","tracedecay_graph_integrity","tracedecay_policy","tracedecay_code_health","generation_consistency","authorized_external_analyzer"],type:"string"},DiagnosticProvenanceV1:{additionalProperties:!1,description:"Producer provenance for one diagnostic. Diagnostic identity includes\nproducer provenance: identical findings from the same logical producer and\nrevision collapse; findings from distinct producers remain distinct.",properties:{analyzer_revision:{$ref:"#/$defs/ComponentVersion"},configuration_revision:{$ref:"#/$defs/ComponentVersion"},producer:{$ref:"#/$defs/ProviderId"},producer_kind:{$ref:"#/$defs/DiagnosticProducerKindV1"},sanitization_receipt:{anyOf:[{$ref:"#/$defs/SanitizationReceiptId"},{type:"null"}]}},required:["producer_kind","producer","analyzer_revision","configuration_revision"],type:"object"},DiagnosticRecordStateV1:{description:"Current-vs-stale typing for a durable diagnostic record. Publication is\nversion-monotone: a newer clean generation clears the prior publication\ndeterministically, and stale findings cannot cross snapshots.\nStale and historical records remain queryable through\napplication APIs but are excluded from active publication.",oneOf:[{description:"Current for exactly the clean generation named by the record.",properties:{kind:{const:"current",type:"string"}},required:["kind"],type:"object"},{description:"A clean generation completed and deterministically removed this\nfinding (resolution, deletion, source-revision drift, or content or\ngeneration change).",properties:{cleared_in_generation:{$ref:"#/$defs/CodeGenerationId"},kind:{const:"cleared",type:"string"}},required:["kind","cleared_in_generation"],type:"object"}]},DiagnosticSeverityV1:y$,FileOccurrenceId:gs,GenerationDiagnosticV1:{additionalProperties:!1,description:"One durable, generation-bound diagnostic record. Its diagnostic payload,\nscope, and producer provenance form observation identity; the display\nmessage remains sanitized product data.",properties:{code:{description:"Stable producer diagnostic code (for example `E0308`).",type:"string"},collected_at:{$ref:"#/$defs/UtcMicros",description:"Time the server first accepted this evidence observation. Compiler\noutput does not carry a trustworthy producer capture time, and an exact\nsemantic replay retains the first accepted value."},content_digest:{$ref:"#/$defs/ContentDigest",description:"Content digest of the attached file inside the generation."},diagnostic_anchor:{$ref:"#/$defs/RetrievalAnchorId",description:"Retrieval anchor addressing this record. The code index's\n`GenerationDiagnosticAttachmentV1::diagnostic_anchor` points here."},evidence_class:{$ref:"#/$defs/DiagnosticEvidenceClassV1"},file_occurrence_id:{$ref:"#/$defs/FileOccurrenceId",description:"Canonical file identity the diagnostic attaches to."},generation_id:{$ref:"#/$defs/CodeGenerationId",description:"The immutable clean code-intelligence generation this record is bound\nto. Findings never cross generations."},message:{description:"Sanitized display message; bounded by [`MAX_DIAGNOSTIC_MESSAGE_BYTES`].",type:"string"},message_digest:{$ref:"#/$defs/ManifestDigest",description:"Integrity digest over the sanitized message."},provenance:{$ref:"#/$defs/DiagnosticProvenanceV1"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},repository:{$ref:"#/$defs/RepositoryId"},severity:{$ref:"#/$defs/DiagnosticSeverityV1"},source_revision:{anyOf:[{$ref:"#/$defs/CommitId"},{type:"null"}]},span:{$ref:"#/$defs/SourceSpan",description:"Range encoding inside the sanitized file (byte range; mutable line\nnumbers are never identity)."},state:{$ref:"#/$defs/DiagnosticRecordStateV1",description:"Current-vs-stale typing; publication is version-monotone."},symbol_occurrence_id:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}],description:"Enclosing symbol occurrence, when exact attachment is possible."},worktree:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["diagnostic_anchor","generation_id","repository","file_occurrence_id","content_digest","span","code","severity","message","message_digest","provenance","evidence_class","collected_at","state"],type:"object"},ManifestDigest:_l,ProviderId:vo,RefId:vm,RepositoryId:vb,RetrievalAnchorId:vI,SanitizationReceiptId:{description:"Strongly typed canonical identity: `SanitizationReceiptId`.",type:"string"},SourceSpan:b$,SymbolOccurrenceId:bq,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{clean_generation:{type:"boolean"},diagnostics:{items:{$ref:"#/$defs/DiagnosticPrimitiveRecord"},type:"array"},findings_cleared:{type:"boolean"},generation_id:{$ref:"#/$defs/CodeGenerationId"},next_cursor:{type:["string","null"]}},required:["generation_id","clean_generation","findings_cleared","diagnostics"],title:"DiagnosticsPrimitiveResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{budget_tokens:{description:"Cap the symbol, test, and co-change sections at about this many tokens.",format:"uint32",minimum:0,type:["integer","null"]},depth:{description:"Maximum impact traversal depth (default: 2, at most 10).",format:"uint32",minimum:0,type:["integer","null"]},files:{description:"Files to inspect prospectively. All indexed declarations in these files\nare candidates; this does not select exact Git-changed declarations.",items:{type:"string"},type:"array"}},required:["files"],title:"DiffContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hf,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GitContextComparisonV1:gg,GitContextSymbolV1:g_,GitOidV1:gq,IncompatibleCallSiteV1:{additionalProperties:!1,description:"A call site whose argument count cannot invoke the new parameter list.",properties:{arguments:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","file","line","arguments"],type:"object"},MissingCoChangePartnerV1:_w,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,SignatureEditStatusV1:{description:"How a modified function's parameter list compares with HEAD.",enum:["contract_change"],type:"string"},SignatureEditV1:{additionalProperties:!1,description:"A Rust free function whose parameter count differs from HEAD.",properties:{file:{type:"string"},incompatible:{items:{$ref:"#/$defs/IncompatibleCallSiteV1"},type:"array"},new_parameters:{format:"uint32",minimum:0,type:["integer","null"]},old_parameters:{format:"uint32",minimum:0,type:["integer","null"]},status:{$ref:"#/$defs/SignatureEditStatusV1"},symbol:{type:"string"}},required:["symbol","file","status","incompatible"],type:"object"},TestGateV1:{additionalProperties:!1,description:"Whether tests reach the symbols in a diff's blast radius.\n\n`pass` and exit 0 when every counted symbol is reached. `fail` and exit 4\nname the ones that are not. `incomplete` and exit 0 mean the caller walk\nstopped before that absence is known.",properties:{exit_code:{format:"uint8",maximum:255,minimum:0,type:"integer"},untested:{items:{type:"string"},type:"array"},verdict:{type:"string"}},required:["verdict","exit_code","untested"],type:"object"},TokenBudgetCutV1:bD,TokenBudgetSectionV1:bF},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{affected_tests:{items:{type:"string"},type:"array"},changed_files:{items:{type:"string"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},comparison:{anyOf:[{$ref:"#/$defs/GitContextComparisonV1"},{type:"null"}]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},impact_complete:{description:"False when the impact walk stopped at its depth or budget with callers\nstill unexplored.",type:"boolean"},impacted_symbols:{items:{$ref:"#/$defs/GitContextSymbolV1"},type:"array"},impacted_symbols_count:{format:"uint",minimum:0,type:"integer"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified_symbols:{items:{$ref:"#/$defs/GitContextSymbolV1"},type:"array"},signature_edits:{description:"Rust free functions whose parameter count changed since HEAD, with the\ncall sites that list cannot accept. Omitted when nothing changed.",items:{$ref:"#/$defs/SignatureEditV1"},type:"array"},test_gate:{$ref:"#/$defs/TestGateV1",description:"Symbols in this diff that no test reaches, and the verdict a CLI exits on."},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."}},required:["changed_files","modified_symbols","impacted_symbols_count","impacted_symbols","impact_complete","affected_tests","missing_co_change_partners","test_gate"],title:"DiffContextResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of files in the per-file breakdown, highest node count\nfirst (default: 100, max: 1000). Ignored when summary is true; the\nresponse states total_file_count and omitted_file_count.",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Directory or file path prefix to filter (e.g.\n'src/main/java/com/example'). Omit for entire codebase.",type:["string","null"]},summary:{description:"If true, aggregate counts across all matching files instead of\nper-file breakdown (default: false).",type:["boolean","null"]}},title:"DistributionSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DistributionFileV1:{additionalProperties:!1,properties:{file:{type:"string"},kinds:{items:{$ref:"#/$defs/DistributionKindCountV1"},type:"array"}},required:["file","kinds"],type:"object"},DistributionKindCountV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{type:"string"}},required:["kind","count"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Flattening the tagged view keeps `path_filter` ahead of `mode` on the\nwire; serde cannot deny unknown fields through a flattened member.",oneOf:[{properties:{distribution:{items:{$ref:"#/$defs/DistributionKindCountV1"},type:"array"},mode:{const:"summary",type:"string"},total_kinds:{format:"uint64",minimum:0,type:"integer"}},required:["mode","total_kinds","distribution"],type:"object"},{properties:{file_count:{format:"uint64",minimum:0,type:"integer"},files:{items:{$ref:"#/$defs/DistributionFileV1"},type:"array"},mode:{const:"per_file",type:"string"},omitted_file_count:{format:"uint64",minimum:0,type:"integer"},total_file_count:{format:"uint64",minimum:0,type:"integer"}},required:["mode","file_count","total_file_count","omitted_file_count","files"],type:"object"}],properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},path_filter:{type:["string","null"]}},title:"DistributionResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 50, at most 500).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Directory or file path prefix to filter (e.g. 'src/main'). Omit for\nentire codebase.",type:["string","null"]}},title:"DocCoverageSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DocCoverageFileV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},symbols:{items:{$ref:"#/$defs/DocCoverageSymbolV1"},type:"array"}},required:["file","count","symbols"],type:"object"},DocCoverageSymbolV1:{additionalProperties:!1,properties:{id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},signature:{type:["string","null"]}},required:["id","name","kind","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{complete:{type:"boolean"},file_count:{format:"uint64",minimum:0,type:"integer"},files:{items:{$ref:"#/$defs/DocCoverageFileV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint64",minimum:0,type:"integer"},omitted_count:{format:"uint64",minimum:0,type:"integer"},path_filter:{type:["string","null"]},returned_count:{format:"uint64",minimum:0,type:"integer"},total_undocumented:{format:"uint64",minimum:0,type:"integer"}},required:["total_undocumented","returned_count","omitted_count","complete","limit","file_count","files"],title:"DocCoverageResultV1",type:"object"},{$defs:{DsmShapeV1:yw},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{max_files:{description:"Maximum files in matrix format (default: 30, at most 200).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]},shape:{anyOf:[{$ref:"#/$defs/DsmShapeV1"},{type:"null"}],description:"DSM data shape: stats, clusters, or matrix (default: stats)."}},title:"DsmSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,DsmClusterV1:{additionalProperties:!1,properties:{boundary_edges:{format:"uint64",minimum:0,type:"integer"},directory:{type:"string"},file_count:{format:"uint64",minimum:0,type:"integer"},incoming_edges:{format:"uint64",minimum:0,type:"integer"},internal_edges:{format:"uint64",minimum:0,type:"integer"},outgoing_edges:{format:"uint64",minimum:0,type:"integer"}},required:["directory","file_count","internal_edges","outgoing_edges","incoming_edges","boundary_edges"],type:"object"},DsmMatrixV1:{additionalProperties:!1,properties:{files:{items:{type:"string"},type:"array"},matrix:{items:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},type:"array"},note:{type:"string"}},required:["files","matrix","note"],type:"object"},DsmShapeV1:yw,DsmStatsV1:{additionalProperties:!1,properties:{clusters:{format:"uint64",minimum:0,type:"integer"},density:{format:"double",type:"number"},edges:{format:"uint64",minimum:0,type:"integer"},files:{format:"uint64",minimum:0,type:"integer"},largest_cluster:{format:"uint64",minimum:0,type:"integer"}},required:["files","edges","density","clusters","largest_cluster"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{clusters:{items:{$ref:"#/$defs/DsmClusterV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},matrix:{anyOf:[{$ref:"#/$defs/DsmMatrixV1"},{type:"null"}]},shape:{$ref:"#/$defs/DsmShapeV1"},stats:{$ref:"#/$defs/DsmStatsV1"}},required:["shape","stats","clusters"],title:"DsmResultV1",type:"object"},{$defs:{FactEventId:yz,FactFeedbackActionV1:yD,FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{action:{$ref:"#/$defs/FactFeedbackActionV1"},expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},reason:{type:["string","null"]},source_label:{type:["string","null"]}},required:["fact_id","action"],title:"FactFeedbackRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactFeedbackActionV1:yD,FactFeedbackV1:{additionalProperties:!1,properties:{action:{$ref:"#/$defs/FactFeedbackActionV1"},event_id:{$ref:"#/$defs/FactEventId"},fact_id:{$ref:"#/$defs/FactId"},helpful_count:{format:"uint64",minimum:0,type:"integer"},new_trust_millionths:{format:"uint32",minimum:0,type:"integer"},old_trust_millionths:{format:"uint32",minimum:0,type:"integer"},trust_delta_millionths:{format:"int32",type:"integer"},unhelpful_count:{format:"uint64",minimum:0,type:"integer"}},required:["event_id","fact_id","action","old_trust_millionths","new_trust_millionths","trust_delta_millionths","helpful_count","unhelpful_count"],type:"object"},FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact:{$ref:"#/$defs/FactProjectionV1"},feedback:{$ref:"#/$defs/FactFeedbackV1"}},required:["fact","feedback","commit"],title:"FactFeedbackResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},content:{type:"string"},entities:{default:[],items:{type:"string"},type:"array"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},metadata:{additionalProperties:!0,type:["object","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},source_label:{type:["string","null"]},tags:{default:[],items:{type:"string"},type:"array"},trust:{format:"double",type:["number","null"]}},required:["content"],title:"FactStoreAddRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactStoreAddCommitV1:{oneOf:[{additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},disposition:{const:"added",type:"string"},fact:{$ref:"#/$defs/FactProjectionV1"}},required:["disposition","fact","commit"],type:"object"},{additionalProperties:!1,properties:{closest_fact_id:{$ref:"#/$defs/FactId"},commit:{$ref:"#/$defs/FactCommitReceiptV1"},disposition:{const:"near_duplicate",type:"string"},fact:{$ref:"#/$defs/FactProjectionV1"},similarity_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["disposition","fact","closest_fact_id","similarity_millionths","commit"],type:"object"},{additionalProperties:!1,properties:{closest_fact_id:{$ref:"#/$defs/FactId"},commit:{$ref:"#/$defs/FactCommitReceiptV1"},disposition:{const:"possible_conflict",type:"string"},fact:{$ref:"#/$defs/FactProjectionV1"},similarity_millionths:{format:"uint32",minimum:0,type:"integer"}},required:["disposition","fact","closest_fact_id","similarity_millionths","commit"],type:"object"}]},FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{outcome:{const:"secret_rejected",type:"string"}},required:["outcome"],type:"object"},{additionalProperties:!1,properties:{closest_fact_id:{$ref:"#/$defs/FactId"},fact:{$ref:"#/$defs/FactProjectionV1"},outcome:{const:"normalized_duplicate",type:"string"}},required:["outcome","fact","closest_fact_id"],type:"object"},{additionalProperties:!1,properties:{outcome:{const:"committed",type:"string"},result:{$ref:"#/$defs/FactStoreAddCommitV1"}},required:["outcome","result"],type:"object"}],title:"FactStoreAddResultV1"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},threshold_millionths:{format:"uint32",minimum:0,type:["integer","null"]}},title:"FactStoreContradictRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactContradictionV1:{additionalProperties:!1,properties:{existing_fact:{$ref:"#/$defs/FactV1"},new_content:{type:"string"},score_millionths:{format:"uint32",minimum:0,type:"integer"},why:{type:["string","null"]}},required:["existing_fact","new_content","score_millionths"],type:"object"},FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{contradictions:{items:{$ref:"#/$defs/FactContradictionV1"},type:"array"},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","contradictions"],title:"FactStoreContradictResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Closed public launcher for the automatic Memory Curator.\n\nRun identity, task selection, operations, proposals, approval, and apply\nauthority are deliberately absent and rejected by `deny_unknown_fields`.",properties:{fact_review_limit:{default:24,format:"uint32",maximum:1e3,minimum:1,type:"integer"},min_confidence_millionths:{default:72e4,format:"uint32",maximum:1e6,minimum:0,type:"integer"}},title:"FactStoreCurateRequestV1",type:"object"},{$defs:{AutomationTaskV1:{description:"Automation capability selected after one registered application admission.",enum:["memory_curator","session_reflector","skill_writer","combined_review","user_job"],type:"string"},FactStoreCurateStateV1:{description:"Lifecycle state a `fact_store_curate` receipt reports.",oneOf:[{const:"started",description:"The run was admitted and continues on the daemon.",type:"string"}]},ManifestDigest:_l,RunId:vF},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Receipt of one admitted automatic curation.\n\nThe curator runs on the daemon after this receipt is returned. Its terminal\nis the automation run ledger record for `run_id`, read with\n`automation_run_view`.",properties:{request_digest:{$ref:"#/$defs/ManifestDigest"},run_id:{$ref:"#/$defs/RunId"},state:{$ref:"#/$defs/FactStoreCurateStateV1"},task:{$ref:"#/$defs/AutomationTaskV1"}},required:["run_id","task","request_digest","state"],title:"FactStoreCurateResultV1",type:"object"},{$defs:{FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["fact_id"],title:"FactStoreGetRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactFeedbackActionV1:yD,FactFeedbackDetailsAvailabilityV1:{enum:["available","redacted","unknown"],type:"string"},FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,TrustHistoryEntryV1:{additionalProperties:!1,properties:{action:{$ref:"#/$defs/FactFeedbackActionV1"},details_availability:{$ref:"#/$defs/FactFeedbackDetailsAvailabilityV1"},event_id:{$ref:"#/$defs/FactEventId"},new_trust_millionths:{format:"uint32",minimum:0,type:"integer"},occurred_at:{$ref:"#/$defs/UtcMicros"},old_trust_millionths:{format:"uint32",minimum:0,type:"integer"},reason:{type:["string","null"]},source_label:{type:["string","null"]}},required:["event_id","occurred_at","action","old_trust_millionths","new_trust_millionths","details_availability"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactProjectionV1"},trust_history:{items:{$ref:"#/$defs/TrustHistoryEntryV1"},type:"array"}},required:["fact","trust_history"],title:"FactStoreGetResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},title:"FactStoreListRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{facts:{items:{$ref:"#/$defs/FactProjectionV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","facts"],title:"FactStoreListResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},entity:{type:"string"},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["entity"],title:"FactStoreProbeRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","hits","graph_coverage"],title:"FactStoreProbeResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},entities:{items:{type:"string"},minItems:1,type:"array"},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["entities"],title:"FactStoreReasonRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","hits","graph_coverage"],title:"FactStoreReasonResultV1",type:"object"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},entity:{type:"string"},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["entity"],title:"FactStoreRelatedRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"}},required:["owner","hits","graph_coverage"],title:"FactStoreRelatedResultV1",type:"object"},{$defs:{FactEventId:yz,FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},required:["fact_id"],title:"FactStoreRemoveRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact:{$ref:"#/$defs/FactProjectionV1"},outcome:{const:"removed",type:"string"},remaining_fact_count:{format:"uint64",minimum:0,type:"integer"}},required:["outcome","fact","remaining_fact_count","commit"],type:"object"},{additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactProjectionV1"},outcome:{const:"already_removed",type:"string"},remaining_fact_count:{format:"uint64",minimum:0,type:"integer"}},required:["outcome","fact","remaining_fact_count"],type:"object"}],title:"FactStoreRemoveResultV1"},{$defs:{FactCategoryV1:yA,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{description:"The previous page's `next_after`, valid only with the same parameters.",type:["string","null"]},category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},limit:{format:"uint64",minimum:0,type:["integer","null"]},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},min_trust:{format:"double",type:["number","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},query:{type:"string"}},required:["query"],title:"FactStoreSearchRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitOwnerV1:yM,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactRetrievalTelemetryDegradationV1:{enum:["unavailable","saturated"],type:"string"},FactRetrievalTelemetryV1:{description:"Whether an explicit search recorded retrieval telemetry for its hits.\n\nThe telemetry write is recall bookkeeping, not part of the returned\nevidence: when only that lane is unavailable the search still delivers its\nresult and reports the degradation here instead of refusing the read.",oneOf:[{additionalProperties:!1,description:"The result had no hits, so there was nothing to record.",properties:{kind:{const:"not_applicable",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,description:"The selected store is mounted read-only; recording is never attempted.",properties:{kind:{const:"read_only",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{fact_count:{format:"uint",minimum:0,type:"integer"},kind:{const:"recorded",type:"string"}},required:["kind","fact_count"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"degraded",type:"string"},reason:{$ref:"#/$defs/FactRetrievalTelemetryDegradationV1"}},required:["kind","reason"],type:"object"}]},FactSearchGraphCoverageV1:yG,FactSearchGraphDegradationV1:yB,FactSearchHitV1:yK,FactSearchScoresV1:yJ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Explicit search additionally records retrieval telemetry for its returned\nhits; `retrieval_telemetry` reports whether that recall bookkeeping\nhappened, so a served result can truthfully carry a degraded write lane.",properties:{graph_coverage:{$ref:"#/$defs/FactSearchGraphCoverageV1"},hits:{items:{$ref:"#/$defs/FactSearchHitV1"},type:"array"},next_after:{description:"Opaque continuation, bound to this operation and request.",type:["string","null"]},owner:{$ref:"#/$defs/FactCommitOwnerV1"},retrieval_telemetry:{$ref:"#/$defs/FactRetrievalTelemetryV1"}},required:["owner","hits","graph_coverage","retrieval_telemetry"],title:"FactStoreSearchResultV1",type:"object"},{$defs:{FactEventId:yz,FactId:yF,MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Mark `fact_id` as superseded by `superseded_by`. The old fact leaves the\ndefault retrieval surfaces but stays readable by id through its history;\npayload and trust are never rewritten.",properties:{expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},superseded_by:{$ref:"#/$defs/FactId"}},required:["fact_id","superseded_by"],title:"FactStoreSupersedeRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Outcome of an explicit supersession. `superseded` carries the durable\ncommit receipt of the `Curated { SupersededBy }` lineage event;\n`already_superseded` reports the successor already recorded for the fact.",oneOf:[{additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact_id:{$ref:"#/$defs/FactId"},outcome:{const:"superseded",type:"string"},superseded_by:{$ref:"#/$defs/FactId"}},required:["outcome","fact_id","superseded_by","commit"],type:"object"},{additionalProperties:!1,properties:{fact_id:{$ref:"#/$defs/FactId"},outcome:{const:"already_superseded",type:"string"},superseded_by:{$ref:"#/$defs/FactId"}},required:["outcome","fact_id","superseded_by"],type:"object"}],title:"FactStoreSupersedeResultV1"},{$defs:{FactCategoryV1:yA,FactEventId:yz,FactId:yF,FactSourceLabelPatchV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"set",type:"string"},value:{type:"string"}},required:["kind","value"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"clear",type:"string"}},required:["kind"],type:"object"}]},MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{category:{anyOf:[{$ref:"#/$defs/FactCategoryV1"},{type:"null"}]},content:{type:["string","null"]},entities:{items:{type:"string"},type:["array","null"]},expected_last_event_id:{anyOf:[{$ref:"#/$defs/FactEventId"},{type:"null"}]},fact_id:{$ref:"#/$defs/FactId"},memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},metadata:{additionalProperties:!0,type:["object","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},source_label:{anyOf:[{$ref:"#/$defs/FactSourceLabelPatchV1"},{type:"null"}]},tags:{items:{type:"string"},type:["array","null"]},trust:{format:"double",type:["number","null"]}},required:["fact_id"],title:"FactStoreUpdateRequestV1",type:"object"},{$defs:{FactAssertionId:yE,FactCategoryV1:yA,FactCommitDispositionV1:yW,FactCommitOwnerV1:yM,FactCommitReceiptV1:yN,FactEventId:yz,FactId:yF,FactIdentitySourceResultV1:yL,FactPayloadAccessV1:yU,FactProjectionV1:yH,FactStatusV1:yZ,FactTelemetryV1:yQ,FactV1:yX,LocatorDigest:_r,ProjectId:_4,ProvenanceId:vr,RetrievalAnchorId:vI,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{commit:{$ref:"#/$defs/FactCommitReceiptV1"},fact:{$ref:"#/$defs/FactProjectionV1"},trust_delta_millionths:{format:"int32",type:"integer"}},required:["fact","trust_delta_millionths","commit"],title:"FactStoreUpdateResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Explicit advisory-cycle trigger for one document in the admitted project.",properties:{document_uri:{type:"string"}},required:["document_uri"],title:"FeedbackAdvisoryCycleSurfaceRequestV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,DiagnosticSeverityV1:y$,FeedbackAdvisoryCycleWireV1:{additionalProperties:!1,description:"One canonical cycle result plus whether its durable publication committed.\n\n`published` intentionally remains adjacent to the cycle fields on the\nwire: publication is a property of this exact cycle, not of a page or a\nlater lookup.",properties:{advisory_only:{type:"boolean"},advisory_provider_states:{items:{$ref:"#/$defs/FeedbackAdvisoryProviderStateV1"},type:"array"},affected_tests_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},baseline_states:{items:{$ref:"#/$defs/FeedbackBaselineStateV1"},type:"array"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},durability:{$ref:"#/$defs/FeedbackDurabilityV1"},findings:{items:{$ref:"#/$defs/FeedbackFindingV1"},type:"array"},impact:{anyOf:[{$ref:"#/$defs/FeedbackImpactV1"},{type:"null"}]},impact_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},omitted_findings:{format:"uint64",minimum:0,type:"integer"},policy_digest:{$ref:"#/$defs/ManifestDigest"},provider_states:{items:{$ref:"#/$defs/ProviderEvaluationStateV1"},type:"array"},published:{type:"boolean"},result_id:{$ref:"#/$defs/FeedbackResultId"},returned_findings:{format:"uint64",minimum:0,type:"integer"},scope:{$ref:"#/$defs/FeedbackScopeV1"},termination:{$ref:"#/$defs/FeedbackCycleTerminationV1"},total_findings:{format:"uint64",minimum:0,type:"integer"}},required:["result_id","cycle_id","scope","durability","policy_digest","configuration_digest","termination","provider_states","baseline_states","findings","total_findings","returned_findings","omitted_findings","advisory_only","published"],type:"object"},FeedbackAdvisoryFindingHandleV1:{additionalProperties:!1,description:"One daemon-minted read-handle pair for a finding in the published cycle.",properties:{expansion_handle:{type:["string","null"]},finding_id:{$ref:"#/$defs/FeedbackFindingId"},get_handle:{type:"string"},retrieval_anchor_id:{anyOf:[{$ref:"#/$defs/RetrievalAnchorId"},{type:"null"}]}},required:["finding_id","get_handle"],type:"object"},FeedbackAdvisoryProviderStateV1:yY,FeedbackAdvisoryReadHandlesV1:{additionalProperties:!1,description:"Daemon-minted handles for reads over this exact publication.",properties:{affected_tests_handle:{type:"string"},diagnostics_handle:{type:"string"},impact_handle:{type:"string"},list_handle:{type:"string"}},required:["diagnostics_handle","impact_handle","affected_tests_handle","list_handle"],type:"object"},FeedbackBaselineStateV1:y1,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackCycleTerminationV1:y4,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackDurabilityV1:y5,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingV1:gt,FeedbackImpactStateV1:gr,FeedbackImpactV1:gi,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact advisory-cycle payload serialized by the mounted daemon route.",properties:{cycle:{$ref:"#/$defs/FeedbackAdvisoryCycleWireV1"},finding_handles:{items:{$ref:"#/$defs/FeedbackAdvisoryFindingHandleV1"},type:"array"},read_handles:{anyOf:[{$ref:"#/$defs/FeedbackAdvisoryReadHandlesV1"},{type:"null"}]}},required:["cycle","finding_handles"],title:"FeedbackAdvisoryCycleSurfaceResultV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,DiagnosticSeverityV1:y$,FeedbackAdvisoryProviderStateV1:yY,FeedbackBaselineStateV1:y1,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackCycleResultV1:{additionalProperties:!1,description:"One deterministic result for one trigger. The result represents a\nterminal advisory evaluation and contains no next-action execution hook.",properties:{advisory_only:{type:"boolean"},advisory_provider_states:{items:{$ref:"#/$defs/FeedbackAdvisoryProviderStateV1"},type:"array"},affected_tests_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},baseline_states:{items:{$ref:"#/$defs/FeedbackBaselineStateV1"},type:"array"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},durability:{$ref:"#/$defs/FeedbackDurabilityV1"},findings:{items:{$ref:"#/$defs/FeedbackFindingV1"},type:"array"},impact:{anyOf:[{$ref:"#/$defs/FeedbackImpactV1"},{type:"null"}]},impact_state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]},omitted_findings:{format:"uint64",minimum:0,type:"integer"},policy_digest:{$ref:"#/$defs/ManifestDigest"},provider_states:{items:{$ref:"#/$defs/ProviderEvaluationStateV1"},type:"array"},result_id:{$ref:"#/$defs/FeedbackResultId"},returned_findings:{format:"uint64",minimum:0,type:"integer"},scope:{$ref:"#/$defs/FeedbackScopeV1"},termination:{$ref:"#/$defs/FeedbackCycleTerminationV1"},total_findings:{format:"uint64",minimum:0,type:"integer"}},required:["result_id","cycle_id","scope","durability","policy_digest","configuration_digest","termination","provider_states","baseline_states","findings","total_findings","returned_findings","omitted_findings","advisory_only"],type:"object"},FeedbackCycleTerminationV1:y4,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackDurabilityV1:y5,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingV1:gt,FeedbackImpactStateV1:gr,FeedbackImpactV1:gi,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycle:{$ref:"#/$defs/FeedbackCycleResultV1"}},required:["cycle"],title:"FeedbackDiagnosticsReadResultV1",type:"object"},{$defs:{AnchorExpandResult:{additionalProperties:!1,properties:{anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"}},required:["anchors"],type:"object"},CommitId:hq,DiagnosticSeverityV1:y$,FeedbackCycleId:y2,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingReadV1:ge,FeedbackFindingV1:gt,FeedbackResultId:go,FeedbackScopeV1:gn,FileOccurrenceId:gs,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expansion:{$ref:"#/$defs/AnchorExpandResult"},finding:{$ref:"#/$defs/FeedbackFindingReadV1"}},required:["finding","expansion"],title:"FeedbackExpandResultV1",type:"object"},{$defs:{CommitId:hq,DiagnosticSeverityV1:y$,FeedbackCycleId:y2,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingReadV1:ge,FeedbackFindingV1:gt,FeedbackResultId:go,FeedbackScopeV1:gn,FileOccurrenceId:gs,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{finding:{$ref:"#/$defs/FeedbackFindingReadV1"}},required:["finding"],title:"FeedbackGetResultV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,FeedbackContentIdentityV1:y0,FeedbackCycleId:y2,FeedbackImpactStateV1:gr,FeedbackImpactV1:gi,FeedbackResultId:go,FeedbackScopeV1:gn,FeedbackTargetV1:ga,FileOccurrenceId:gs,HostInstanceId:gL,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical impact projection returned by `feedback_impact`.\n\nThe daemon-side projection owner (usecases) re-exports this type; it lives\nhere so the catalog contribution can register its schema body as the single\nRust-owned wire authority. Results project from an authorized completed\ncycle, and the canonical response wire remains consumable by typed SDKs.",properties:{content_identity:{anyOf:[{$ref:"#/$defs/FeedbackContentIdentityV1"},{type:"null"}]},cycle_id:{$ref:"#/$defs/FeedbackCycleId"},impact:{anyOf:[{$ref:"#/$defs/FeedbackImpactV1"},{type:"null"}]},result_id:{$ref:"#/$defs/FeedbackResultId"},scope:{$ref:"#/$defs/FeedbackScopeV1"},state:{anyOf:[{$ref:"#/$defs/FeedbackImpactStateV1"},{type:"null"}]}},required:["result_id","cycle_id","scope"],title:"CanonicalFeedbackImpactProjectionV1",type:"object"},{$defs:{CommitId:hq,DiagnosticSeverityV1:y$,FeedbackCycleId:y2,FeedbackDiagnosticClassificationV1:y6,FeedbackDiagnosticProducerV1:y3,FeedbackDiagnosticProjectionV1:y9,FeedbackFindingId:y8,FeedbackFindingLifecycleV1:y7,FeedbackFindingReadV1:ge,FeedbackFindingV1:gt,FeedbackResultId:go,FeedbackScopeV1:gn,FileOccurrenceId:gs,ProjectId:_4,ProviderEvaluationStateV1:vi,RepositoryId:vb,RetrievalAnchorId:vI,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{findings:{items:{$ref:"#/$defs/FeedbackFindingReadV1"},type:"array"}},required:["findings"],title:"FeedbackListResultV1",type:"object"},{$defs:{UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"}},required:["observed_at"],title:"FeedbackProximityReadRequestV1",type:"object"},{$defs:{AgentInstanceId:f$,CodeGenerationId:hy,CommitId:hq,FeedbackProximityAccessKindV1:{enum:["read","write"],type:"string"},FeedbackProximityCloneHandleV1:{additionalProperties:!1,properties:{retrieval_anchor_ids:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},source_generation:{$ref:"#/$defs/CodeGenerationId"},source_symbol:{$ref:"#/$defs/SymbolOccurrenceId"}},required:["source_generation","source_symbol","retrieval_anchor_ids"],type:"object"},FeedbackProximityConflictDifferenceV1:{additionalProperties:!1,properties:{difference_digest:{$ref:"#/$defs/ManifestDigest"},file:{$ref:"#/$defs/FileOccurrenceId"},span:{$ref:"#/$defs/SourceSpan"}},required:["file","span","difference_digest"],type:"object"},FeedbackProximityConflictHandleV1:{additionalProperties:!1,properties:{common_base_revision:{$ref:"#/$defs/CommitId"},differences:{items:{$ref:"#/$defs/FeedbackProximityConflictDifferenceV1"},type:"array"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},left_head_revision:{$ref:"#/$defs/CommitId"},right_head_revision:{$ref:"#/$defs/CommitId"}},required:["common_base_revision","left_head_revision","right_head_revision","evidence_digest","differences"],type:"object"},FeedbackProximityEncounterV1:{additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/ProximityCoverageV1"},encounter_id:{$ref:"#/$defs/ManifestDigest"},expires_at:{$ref:"#/$defs/UtcMicros"},interval:{$ref:"#/$defs/FeedbackProximityIntervalV1"},observed_at:{$ref:"#/$defs/UtcMicros"},participants:{items:{$ref:"#/$defs/FeedbackProximityParticipantV1"},type:"array"},relation:{$ref:"#/$defs/FeedbackProximityRelationV1"},scope:{$ref:"#/$defs/FeedbackScopeV1"}},required:["encounter_id","scope","interval","participants","relation","observed_at","expires_at","coverage"],type:"object"},FeedbackProximityIntervalV1:{additionalProperties:!1,properties:{end:{$ref:"#/$defs/UtcMicros"},start:{$ref:"#/$defs/UtcMicros"}},required:["start","end"],type:"object"},FeedbackProximityOmissionV1:{enum:["active_session_limit","session_activity_limit","recent_observation_limit","edited_path_limit","encounter_limit","missing_participant_observation","missing_participant_worktree","missing_participant_revision","missing_code_address","clone_coverage_partial","conflict_evidence_unavailable","code_index_revision_mismatch"],type:"string"},FeedbackProximityParticipantV1:{additionalProperties:!1,properties:{access:{$ref:"#/$defs/FeedbackProximityAccessKindV1"},activity:{$ref:"#/$defs/FeedbackProximityIntervalV1"},address:{$ref:"#/$defs/ProximityAddressV1"},agent_id:{$ref:"#/$defs/AgentInstanceId"},branch_ref:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},head_revision:{anyOf:[{$ref:"#/$defs/CommitId"},{type:"null"}]},source:{$ref:"#/$defs/ObservationSourceIdentityV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]},worktree_root:{type:"string"}},required:["source","agent_id","worktree_root","access","activity","address"],type:"object"},FeedbackProximityReadPageV1:{additionalProperties:!1,properties:{encounters:{items:{$ref:"#/$defs/FeedbackProximityEncounterV1"},type:"array"},expires_at:{$ref:"#/$defs/UtcMicros"},observed_at:{$ref:"#/$defs/UtcMicros"},scope:{$ref:"#/$defs/FeedbackScopeV1"},source_generation:{$ref:"#/$defs/CodeGenerationId"}},required:["scope","source_generation","observed_at","expires_at","encounters"],type:"object"},FeedbackProximityRelationV1:{oneOf:[{additionalProperties:!1,properties:{relation_kind:{const:"code_neighborhood_candidate",type:"string"},warning_class:{$ref:"#/$defs/ProximityWarningClassV1"}},required:["relation_kind","warning_class"],type:"object"},{additionalProperties:!1,properties:{clone_handle:{$ref:"#/$defs/FeedbackProximityCloneHandleV1"},relation_kind:{const:"shared_code_candidate",type:"string"},warning_class:{$ref:"#/$defs/ProximityWarningClassV1"}},required:["relation_kind","warning_class","clone_handle"],type:"object"},{additionalProperties:!1,properties:{relation_kind:{const:"overlapping_edit",type:"string"},warning_class:{$ref:"#/$defs/ProximityWarningClassV1"}},required:["relation_kind","warning_class"],type:"object"},{additionalProperties:!1,properties:{conflict_handle:{$ref:"#/$defs/FeedbackProximityConflictHandleV1"},relation_kind:{const:"confirmed_conflict",type:"string"}},required:["relation_kind","conflict_handle"],type:"object"}]},FeedbackScopeV1:gn,FileOccurrenceId:gs,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProjectId:_4,ProviderId:vo,ProximityAddressV1:{additionalProperties:!1,description:"A privacy-scoped code address. It identifies the coarse changed-code shape\nbut carries no other actor, session, or private-source content.",properties:{file:{$ref:"#/$defs/FileOccurrenceId"},scope:{$ref:"#/$defs/FeedbackScopeV1"},span:{anyOf:[{$ref:"#/$defs/SourceSpan"},{type:"null"}]},symbol:{anyOf:[{$ref:"#/$defs/SymbolOccurrenceId"},{type:"null"}]}},required:["scope","file"],type:"object"},ProximityCoverageV1:{enum:["complete","partial","stale","unavailable","denied","private"],type:"string"},ProximityWarningClassV1:{enum:["same_file","overlapping_range","same_symbol","same_package","same_crate","neighborhood","shared_caller","shared_dependency","shared_test"],type:"string"},RefId:vm,RepositoryId:vb,RetrievalAnchorId:vI,SessionId:v8,SourceSpan:b$,SymbolOccurrenceId:bq,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"complete",type:"string"}},required:["state","page"],type:"object"},{additionalProperties:!1,properties:{page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"complete_zero",type:"string"}},required:["state","page"],type:"object"},{additionalProperties:!1,properties:{omissions:{items:{$ref:"#/$defs/FeedbackProximityOmissionV1"},type:"array"},page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"partial",type:"string"}},required:["state","page","omissions"],type:"object"},{additionalProperties:!1,properties:{omissions:{items:{$ref:"#/$defs/FeedbackProximityOmissionV1"},type:"array"},page:{$ref:"#/$defs/FeedbackProximityReadPageV1"},state:{const:"stale",type:"string"}},required:["state","page","omissions"],type:"object"},{additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"denied",type:"string"}},required:["state","observed_at"],type:"object"},{additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},state:{const:"unavailable",type:"string"}},required:["state","observed_at"],type:"object"}],title:"FeedbackProximityReadResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{field:{description:"Field name. Bare name ('last_sync_at') matches across structs;\nqualified form ('GraphStats::last_sync_at') narrows to one struct's\nfield.",type:"string"},limit:{description:"Maximum sites per kind (default: 200, max: 2000).",format:"uint32",minimum:0,type:["integer","null"]},writes_only:{description:"When true, returns only write_sites and omits reads. Default false.",type:["boolean","null"]}},required:["field"],title:"FieldSitesSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,FieldSiteV1:{additionalProperties:!1,properties:{enclosing:{type:["string","null"]},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},snippet:{type:"string"}},required:["file","line","snippet"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`read_count` and `read_sites` are absent when the request asked for\nwrites only.",properties:{field:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},qualifier:{type:["string","null"]},qualifier_applied:{type:"boolean"},read_count:{format:"uint64",minimum:0,type:["integer","null"]},read_sites:{items:{$ref:"#/$defs/FieldSiteV1"},type:["array","null"]},write_count:{format:"uint64",minimum:0,type:"integer"},write_sites:{items:{$ref:"#/$defs/FieldSiteV1"},type:"array"}},required:["field","qualifier_applied","write_count","write_sites"],title:"FieldSitesResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],title:"FileDependentsPrimitiveRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{dependent_files:{items:{type:"string"},type:"array"},file:{type:"string"}},required:["file","dependent_files"],title:"FileDependentsPrimitiveResult",type:"object"},{$defs:{FilesLayoutV1:gd},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{layout:{anyOf:[{$ref:"#/$defs/FilesLayoutV1"},{type:"null"}],description:"File listing layout: flat (one per line) or grouped by directory\n(default: grouped)."},path:{description:"Filter to files under this directory path.",type:["string","null"]},pattern:{description:"Filter files matching this glob pattern (e.g. '**/*.rs').",type:["string","null"]}},title:"FilesSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexOmittedSourceV1:hb,CodeIndexOmittedSourcesV1:h$,CodeIndexSourceOmissionReasonV1:hS,CodeIndexStalenessStateV1:hk,FilesLayoutV1:gd,IndexedFileV1:{additionalProperties:!1,properties:{bytes:{format:"uint64",minimum:0,type:"integer"},path:{type:"string"},symbols:{format:"uint64",minimum:0,type:"integer"}},required:["path","symbols","bytes"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},files:{items:{$ref:"#/$defs/IndexedFileV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},layout:{$ref:"#/$defs/FilesLayoutV1"},worktree_omitted_sources:{anyOf:[{$ref:"#/$defs/CodeIndexOmittedSourcesV1"},{type:"null"}],description:"Sources the serving snapshot captured for the whole worktree but does\nnot index, unfiltered by `path` or `pattern`."}},required:["count","layout","files"],title:"FilesResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{lazy_index_ignored_dependencies:{description:"Opt in to bounded indexing of ignored dependency entry files when an\nimport hint matches (default: false).",type:["boolean","null"]},limit:{description:"Maximum matches to return (default: 20, max: 200).",format:"uint32",minimum:0,type:["integer","null"]},name:{description:"Exact bare symbol name (no `::`, no glob).",type:"string"}},required:["name"],title:"FindExactSymbolSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,FindExactSymbolMatchV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},qualified_name:{type:"string"},signature:{type:["string","null"]}},required:["id","name","qualified_name","kind","file","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},matches:{items:{$ref:"#/$defs/FindExactSymbolMatchV1"},type:"array"},name:{type:"string"},suggestions:{description:"Nearest indexed bare names when `count` is 0. Empty when the query\nmatched, or when it is not itself a bare identifier.",items:{type:"string"},type:"array"}},required:["name","count","matches"],title:"FindExactSymbolResultV1",type:"object"},{$defs:{GiniMetricV1:gu,GiniScopeV1:gm},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Number of top outliers to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},metric:{anyOf:[{$ref:"#/$defs/GiniMetricV1"},{type:"null"}],description:"Metric to measure inequality for (default: complexity)."},path:{description:"Filter to files under this directory path.",type:["string","null"]},scope:{anyOf:[{$ref:"#/$defs/GiniScopeV1"},{type:"null"}],description:"Aggregate per file or per symbol (default: file)."}},title:"GiniSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GiniMetricV1:gu,GiniOutlierV1:{additionalProperties:!1,properties:{name:{type:"string"},pct_of_max:{format:"double",type:"number"},value:{format:"double",type:"number"}},required:["name","value","pct_of_max"],type:"object"},GiniScopeV1:gm,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},gini:{format:"double",type:"number"},incomplete_complexity_symbols:{description:"Symbols left out because their bounded complexity walk did not cover\nthe body; their counters are lower bounds and measure nothing here.",format:"uint64",minimum:0,type:"integer"},interpretation:{type:"string"},metric:{$ref:"#/$defs/GiniMetricV1"},outliers:{items:{$ref:"#/$defs/GiniOutlierV1"},type:"array"},scope:{$ref:"#/$defs/GiniScopeV1"},total_items:{format:"uint64",minimum:0,type:"integer"}},required:["gini","interpretation","total_items","metric","scope","incomplete_complexity_symbols","outliers"],title:"GiniResultV1",type:"object"},{$defs:{GitIndexPreviewId:gV,ManifestDigest:_l},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Public MCP/CLI request to apply one immutable Git index preview.",properties:{idempotency_key:{type:"string"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/GitIndexPreviewId"}},required:["preview_id","preview_digest","idempotency_key"],title:"GitApplySurfaceRequest",type:"object"},{$defs:{GitIndexPreviewId:gV,GitIndexReceiptId:{description:"Strongly typed canonical identity: `GitIndexReceiptId`.",type:"string"},GitIndexReceiptOutcomeV1:{description:"Terminal outcome a recovery record can prove without re-running a native\nmutation.",enum:["committed","aborted_no_change","needs_inspection"],type:"string"},GitIndexTransactionId:{description:"Strongly typed canonical identity: `GitIndexTransactionId`.",type:"string"},GitIndexTransactionOperationV1:gR,GitOidV1:gq,ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Durable, integrity-protected receipt for one Git index transaction.",properties:{committed_at:{$ref:"#/$defs/UtcMicros"},final_snapshot_captured:{description:"Whether `final_snapshot_digest`, `new_index_tree`, and `new_head` came\nfrom a post-outcome native observation. An unavailable observation is\nvalid only for a terminal outcome that does not claim a commit.",type:"boolean"},final_snapshot_digest:{$ref:"#/$defs/ManifestDigest",description:"Digest of a snapshot that was actually captured after the terminal\nobservation. When `final_snapshot_captured` is false this retains the\nexpected snapshot digest only as a stable schema placeholder; callers\nmust not treat it as an observation."},new_head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},new_index_tree:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_index_tree:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_snapshot_digest:{$ref:"#/$defs/ManifestDigest"},operation:{$ref:"#/$defs/GitIndexTransactionOperationV1"},outcome:{$ref:"#/$defs/GitIndexReceiptOutcomeV1"},preview_id:{$ref:"#/$defs/GitIndexPreviewId"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},receipt_id:{$ref:"#/$defs/GitIndexReceiptId"},selected_hunk_digests:{items:{$ref:"#/$defs/ManifestDigest"},type:"array"},transaction_id:{$ref:"#/$defs/GitIndexTransactionId"}},required:["receipt_id","transaction_id","preview_id","operation","old_snapshot_digest","final_snapshot_digest","final_snapshot_captured","selected_hunk_digests","outcome","committed_at","receipt_digest"],title:"GitIndexTransactionReceiptV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_blame` surface.",properties:{follow_renames:{default:!1,type:"boolean"},max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},path:{type:"string"}},required:["path"],title:"GitBlameSurfaceRequest",type:"object"},{$defs:{GitBlameAvailabilityV1:{description:"Why blame/line provenance is unavailable for a path.",enum:["available","path_not_tracked","unborn_branch","binary_file"],type:"string"},GitBlameLineV1:{additionalProperties:!1,description:"Line provenance for one final (current) line.",properties:{author:{$ref:"#/$defs/GitCommitIdentityV1"},boundary:{description:"True when the origin commit is a history boundary (e.g. shallow root).",type:"boolean"},commit:{$ref:"#/$defs/GitOidV1"},final_line:{description:"1-based line number in the blamed revision.",format:"uint32",minimum:0,type:"integer"},origin_line:{description:"1-based line number in the origin commit.",format:"uint32",minimum:0,type:"integer"},previous:{anyOf:[{$ref:"#/$defs/GitBlamePreviousV1"},{type:"null"}]}},required:["final_line","origin_line","commit","author","boundary"],type:"object"},GitBlamePreviousV1:{additionalProperties:!1,description:"Rename-following evidence for one blamed line (`previous` record).",properties:{commit:{$ref:"#/$defs/GitOidV1"},path:{type:"string"}},required:["commit","path"],type:"object"},GitBlameV1:{additionalProperties:!1,description:"Typed blame result: per-line provenance plus boundary, rename-following,\nand unavailable states.",properties:{availability:{$ref:"#/$defs/GitBlameAvailabilityV1"},coverage:{$ref:"#/$defs/GitCoverageV1"},lines:{items:{$ref:"#/$defs/GitBlameLineV1"},type:"array"},path:{type:"string"},repository:{$ref:"#/$defs/RepositoryId"}},required:["repository","path","lines","availability","coverage"],type:"object"},GitBlobExpectationV1:gf,GitChangeKindV1:gh,GitCommitIdentityV1:{additionalProperties:!1,description:"Author/committer identity and timestamp evidence for one commit.",properties:{at:{$ref:"#/$defs/UtcMicros"},email:{type:"string"},name:{type:"string"}},required:["name","email","at"],type:"object"},GitCommitMetadataV1:{additionalProperties:!1,description:"Bounded commit metadata. The full message is not retained;\n`message_digest` is its canonical digest evidence.",properties:{author:{$ref:"#/$defs/GitCommitIdentityV1"},commit:{$ref:"#/$defs/GitOidV1"},committer:{$ref:"#/$defs/GitCommitIdentityV1"},message_digest:{$ref:"#/$defs/ManifestDigest"},parents:{items:{$ref:"#/$defs/GitOidV1"},type:"array"},subject:{description:"First line of the commit message, bounded at capture.",type:"string"},tree:{$ref:"#/$defs/GitOidV1"}},required:["commit","tree","parents","author","committer","subject","message_digest"],type:"object"},GitCoverageV1:gv,GitDegradationV1:gb,GitDiffScopeV1:{description:"Diff scope: unstaged worktree changes, staged index changes, or an exact\ncommit range. Range diffs are read-only evidence and carry no index\nrelationship, so they cannot mint an applicable `HunkRefV1`.",oneOf:[{properties:{scope:{const:"working_tree",type:"string"}},required:["scope"],type:"object"},{properties:{scope:{const:"staged",type:"string"}},required:["scope"],type:"object"},{properties:{base:{$ref:"#/$defs/GitOidV1"},head:{$ref:"#/$defs/GitOidV1"},scope:{const:"commit_range",type:"string"}},required:["scope","base","head"],type:"object"}]},GitDiffV1:{additionalProperties:!1,description:"Typed diff result for one scope with explicit coverage.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},files:{items:{$ref:"#/$defs/GitFileDiffV1"},type:"array"},repository:{$ref:"#/$defs/RepositoryId"},scope:{$ref:"#/$defs/GitDiffScopeV1"}},required:["repository","scope","files","coverage"],type:"object"},GitFileDiffV1:{additionalProperties:!1,description:"One file's structured diff record: change kind, modes, blob identities,\nbinary/submodule classification, bounded line totals, and hunks.",properties:{binary:{type:"boolean"},change:{$ref:"#/$defs/GitChangeKindV1"},deletions:{format:"uint32",minimum:0,type:["integer","null"]},hunks:{items:{$ref:"#/$defs/GitHunkV1"},type:"array"},insertions:{description:"Inserted/deleted line totals; absent for binary and submodule records.",format:"uint32",minimum:0,type:["integer","null"]},new_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},new_mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},old_blob:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},old_mode:{anyOf:[{$ref:"#/$defs/GitFileModeV1"},{type:"null"}]},original_path:{description:"Source path for a rename or copy.",type:["string","null"]},path:{type:"string"},submodule:{description:"True when the entry is a gitlink (submodule) change.",type:"boolean"}},required:["path","change","binary","submodule","hunks"],type:"object"},GitFileModeV1:g$,GitHeadStateV1:gk,GitHistoryV1:{additionalProperties:!1,description:"Bounded commit history in native traversal order. `truncated` is true\nwhen the capture bound cut the walk; shallow/partial-clone boundaries are\ncoverage degradations, never silently clean.",properties:{commits:{items:{$ref:"#/$defs/GitCommitMetadataV1"},type:"array"},coverage:{$ref:"#/$defs/GitCoverageV1"},repository:{$ref:"#/$defs/RepositoryId"},truncated:{type:"boolean"}},required:["repository","commits","truncated","coverage"],type:"object"},GitHunkPreviewEntryV1:{additionalProperties:!1,description:"One minted hunk selection: the canonical selection digest plus the\n`HunkRef` identity evidence it selects.",properties:{digest:{$ref:"#/$defs/ManifestDigest"},hunk:{$ref:"#/$defs/HunkRefV1"}},required:["digest","hunk"],type:"object"},GitHunkPreviewInputV1:{additionalProperties:!1,description:"Bounded, expiring preview input minted by `git_hunks` from one exact\ndaemon-captured repository snapshot.",properties:{expires_at:{$ref:"#/$defs/UtcMicros"},hunks:{items:{$ref:"#/$defs/GitHunkPreviewEntryV1"},type:"array"},preview_input_id:{$ref:"#/$defs/GitIndexPreviewId"},repository_snapshot_digest:{$ref:"#/$defs/ManifestDigest"}},required:["preview_input_id","repository_snapshot_digest","expires_at","hunks"],type:"object"},GitHunkV1:{additionalProperties:!1,description:"One structured diff hunk. The hunk body is not retained; `patch_digest`\nis the canonical digest of the normalized header plus body lines, which\nis the stable hunk identity evidence.",properties:{new_lines:{format:"uint32",minimum:0,type:"integer"},new_start:{format:"uint32",minimum:0,type:"integer"},old_lines:{format:"uint32",minimum:0,type:"integer"},old_start:{format:"uint32",minimum:0,type:"integer"},patch_digest:{$ref:"#/$defs/ManifestDigest"},section:{description:"Function/section heading from the hunk header when Git emitted one.",type:["string","null"]}},required:["old_start","old_lines","new_start","new_lines","patch_digest"],type:"object"},GitIndexEntryExpectationV1:gP,GitIndexPreviewId:gV,GitOidV1:gq,GitOperationStateV1:gI,GitQueryEnvelopeV1:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitStatusSummaryV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV12:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitDiffV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV13:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitHistoryV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV14:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitBlameV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitQueryEnvelopeV15:{additionalProperties:!1,description:"One typed query result with its merged coverage. `coverage` is the\nadapter-reported coverage plus any query-level degradation (entry-bound\ntruncation); `truncated_by_bound` distinguishes query-level truncation\nfrom adapter-level capture bounds.",properties:{coverage:{$ref:"#/$defs/GitCoverageV1"},truncated_by_bound:{type:"boolean"},value:{$ref:"#/$defs/GitHunkPreviewInputV1"}},required:["value","coverage","truncated_by_bound"],type:"object"},GitStatusSummaryV1:{additionalProperties:!1,description:"Bounded status summary derived from the typed\n[`tracedecay_domain::git::GitStatusV1`]: HEAD and operation state,\nper-class counts, and a bounded sorted sample of changed paths.",properties:{changed_paths:{description:"Sorted, de-duplicated changed paths, truncated at the query entry bound.",items:{type:"string"},type:"array"},conflicted:{format:"uint32",minimum:0,type:"integer"},head:{$ref:"#/$defs/GitHeadStateV1"},ignored:{format:"uint32",minimum:0,type:"integer"},operation:{$ref:"#/$defs/GitOperationStateV1"},repository:{$ref:"#/$defs/RepositoryId"},schema_version:{type:"string"},staged:{format:"uint32",minimum:0,type:"integer"},unstaged:{format:"uint32",minimum:0,type:"integer"},untracked:{format:"uint32",minimum:0,type:"integer"}},required:["repository","head","operation","staged","unstaged","conflicted","untracked","ignored","changed_paths","schema_version"],type:"object"},HunkDirectionV1:gU,HunkRefV1:gH,ManifestDigest:_l,RepositoryId:vb,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Actual payload emitted by each public Git read operation.",oneOf:[{properties:{query:{const:"status",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV1"}},required:["query","result"],type:"object"},{properties:{query:{const:"diff",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV12"}},required:["query","result"],type:"object"},{properties:{query:{const:"history",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV13"}},required:["query","result"],type:"object"},{properties:{query:{const:"blame",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV14"}},required:["query","result"],type:"object"},{properties:{query:{const:"hunks",type:"string"},result:{$ref:"#/$defs/GitQueryEnvelopeV15"}},required:["query","result"],type:"object"}],title:"GitReadResultV1"},{$defs:{GitOidV1:gq,GitSurfaceDiffScopeV1:gA},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_diff` surface.",properties:{base:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},head:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},scope:{$ref:"#/$defs/GitSurfaceDiffScopeV1",default:"working_tree"}},title:"GitDiffSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_history` surface.",properties:{count:{format:"uint32",minimum:0,type:["integer","null"]},first_parent:{default:!1,type:"boolean"},follow:{default:!1,type:"boolean"},max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},path:{type:["string","null"]}},title:"GitHistorySurfaceRequest",type:"object"},{$defs:{GitSurfaceDiffScopeV1:gA},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_hunks` surface.\n\nThe daemon captures exact repository state itself and injects the private\npreview binding after capture, so the public wire carries only the diff\nscope (commit ranges cannot mint applicable hunks).",properties:{max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]},scope:{$ref:"#/$defs/GitSurfaceDiffScopeV1",default:"working_tree"}},title:"GitHunksSurfaceRequest",type:"object"},{$defs:{GitIndexPreviewId:gV,GitIndexTransactionOperationV1:gR,ManifestDigest:_l},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Public MCP/CLI request for one daemon-owned Git index preview.",properties:{operation:{$ref:"#/$defs/GitIndexTransactionOperationV1"},preview_input_id:{anyOf:[{$ref:"#/$defs/GitIndexPreviewId"},{type:"null"}],default:null,description:"Hunk preview input minted by `git_hunks`; required for stage/unstage."},selected_hunk_digests:{default:[],description:"Selection digests drawn from the referenced preview input.",items:{$ref:"#/$defs/ManifestDigest"},type:"array"}},required:["operation"],title:"GitPreviewSurfaceRequest",type:"object"},{$defs:{GitBlobExpectationV1:gf,GitCoverageV1:gv,GitDegradationV1:gb,GitFileModeV1:g$,GitHeadStateV1:gk,GitIndexEntryExpectationV1:gP,GitIndexPreviewDispositionV1:{description:"Whether a captured preview may reach the daemon's native apply path.",oneOf:[{properties:{state:{const:"applicable",type:"string"}},required:["state"],type:"object"},{properties:{reason:{$ref:"#/$defs/GitIndexUnsupportedStateV1"},state:{const:"unsupported",type:"string"}},required:["state","reason"],type:"object"}]},GitIndexPreviewId:gV,GitIndexTransactionOperationV1:gR,GitIndexUnsupportedStateV1:{description:"Why a preview is intentionally read-only. A caller must re-preview after\nresolving the condition; no variant grants a relaxed or partial apply.",enum:["bare_repository","detached_head","unborn_branch","index_lock_present","external_git_driver","unmerged_index","intent_to_add","split_index","sparse_index","unreadable_index","conflicted_working_tree","unreadable_working_tree","in_progress_operation","unsupported_object_format","binary_hunk","submodule","symlink","file_mode_only","rename_or_copy","filters_or_end_of_line","partial_hunk_selection"],type:"string"},GitObjectFormatV1:{description:"Repository object format, derived from object-id length.",enum:["sha1","sha256"],type:"string"},GitOidV1:gq,GitOperationStateV1:gI,HunkDirectionV1:gU,HunkRefV1:gH,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RepositoryIndexSnapshotV1:{additionalProperties:!1,properties:{checksum:{$ref:"#/$defs/ManifestDigest"},state:{$ref:"#/$defs/RepositoryIndexStateV1"},tree_id:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},unmerged_stage_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]}},required:["checksum","state"],type:"object"},RepositoryIndexStateV1:{enum:["clean","staged","unmerged","intent_to_add","split","sparse","unreadable"],type:"string"},RepositoryStateSnapshotV1:{additionalProperties:!1,description:"Immutable content-addressed native repository state. Missing/partial\nevidence remains typed by fields and coverage instead of being upgraded to\na guessed clean snapshot.",properties:{adapter_revision:{description:"Revision of the fixed native adapter that interpreted this state.",type:["string","null"]},attributes_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},captured_at:{$ref:"#/$defs/UtcMicros"},configuration_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},coverage:{$ref:"#/$defs/GitCoverageV1"},filesystem_capabilities_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},git_version:{description:"Exact native Git implementation observed by the fixed adapter. A\nread-only partial snapshot may omit this, but omitted native evidence\nis never mutation eligible.",type:["string","null"]},head:{$ref:"#/$defs/GitHeadStateV1"},index:{$ref:"#/$defs/RepositoryIndexSnapshotV1"},object_format:{$ref:"#/$defs/GitObjectFormatV1"},observation_epoch:{format:"uint64",minimum:0,type:"integer"},operation_state:{$ref:"#/$defs/GitOperationStateV1"},project_id:{$ref:"#/$defs/ProjectId"},refs_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}],description:"Digest of the complete native ref namespace at capture time."},repository_id:{$ref:"#/$defs/RepositoryId"},snapshot_id:{type:"string"},sparse_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},submodule_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},working_tree:{$ref:"#/$defs/RepositoryWorkingTreeSnapshotV1"},worktree_id:{anyOf:[{$ref:"#/$defs/WorktreeId"},{type:"null"}]}},required:["snapshot_id","project_id","repository_id","observation_epoch","object_format","head","index","working_tree","operation_state","captured_at","coverage"],type:"object"},RepositoryWorkingTreeSnapshotV1:{additionalProperties:!1,properties:{ignored_collision_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},state:{$ref:"#/$defs/RepositoryWorkingTreeStateV1"},tracked_digest:{$ref:"#/$defs/ManifestDigest"},untracked_name_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]}},required:["state","tracked_digest"],type:"object"},RepositoryWorkingTreeStateV1:{enum:["clean","tracked_dirty","untracked_only","mixed","conflicted","unreadable"],type:"string"},UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Immutable, content-bound preview for one daemon-serialized index\ntransaction. Applicability is only a precondition: the daemon must capture\nand compare the entire snapshot and every contained `HunkRefV1` again\nimmediately before a native mutation.",properties:{candidate_index_tree:{anyOf:[{$ref:"#/$defs/GitOidV1"},{type:"null"}]},created_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/GitIndexPreviewDispositionV1"},expires_at:{$ref:"#/$defs/UtcMicros"},operation:{$ref:"#/$defs/GitIndexTransactionOperationV1"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/GitIndexPreviewId"},repository_snapshot:{$ref:"#/$defs/RepositoryStateSnapshotV1"},repository_snapshot_digest:{$ref:"#/$defs/ManifestDigest"},selected_hunks:{items:{$ref:"#/$defs/HunkRefV1"},type:"array"}},required:["preview_id","operation","repository_snapshot","repository_snapshot_digest","selected_hunks","disposition","created_at","expires_at","preview_digest"],title:"GitIndexPreviewV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Request shape for the public `git_status` surface.",properties:{max_bytes:{format:"uint64",minimum:0,type:["integer","null"]},max_entries:{format:"uint32",minimum:0,type:["integer","null"]}},title:"GitStatusSurfaceRequest",type:"object"},{$defs:{StackDeliveryWatermarkId:bk,StackSignalId:bP},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The public, transport-neutral request for one durable stack signal.",properties:{expected_watermark_id:{anyOf:[{$ref:"#/$defs/StackDeliveryWatermarkId"},{type:"null"}]},signal_id:{anyOf:[{$ref:"#/$defs/StackSignalId"},{type:"null"}]}},title:"GitHubStackSignalExpandSurfaceRequest",type:"object"},{$defs:{BranchStackRevisionId:f8,GitHubStackSignalEvidenceRefV1:{additionalProperties:!1,description:"Bounded evidence for the exact signal the coordinator authorized.\n\nProvider payloads, paths, commit bodies, and delivery recipients remain\nbehind the durable signal evidence rather than copied to this result.",properties:{github_stack_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},kind:{$ref:"#/$defs/StackSignalKindV1"},native_source:{$ref:"#/$defs/GitHubStackSignalNativeSourceV1"},observed_at:{$ref:"#/$defs/UtcMicros"},signal_id:{$ref:"#/$defs/StackSignalId"},stack_revision_digest:{$ref:"#/$defs/ManifestDigest"},stack_revision_id:{$ref:"#/$defs/BranchStackRevisionId"},state_digest:{$ref:"#/$defs/ManifestDigest"},watermark_id:{$ref:"#/$defs/StackDeliveryWatermarkId"}},required:["signal_id","watermark_id","kind","stack_revision_id","stack_revision_digest","state_digest","observed_at","native_source"],type:"object"},GitHubStackSignalExpandUnavailableV1:{description:"Truthful non-success outcomes for signal expansion.\n\n`Concealed` intentionally combines absent and unauthorized signal handles;\nexposing that distinction would turn this operation into a signal probe.",enum:["concealed","stale","native_evidence_unavailable","authority_unmounted","cancelled"],type:"string"},GitHubStackSignalNativePreviewV1:{additionalProperties:!1,description:"Exact branch pair and native preflight that produced the selected signal.",properties:{destination_ref:{$ref:"#/$defs/RefId"},destination_tip:{$ref:"#/$defs/GitOidV1"},direction:{$ref:"#/$defs/NativeIntegrationDirectionV1"},disposition:{$ref:"#/$defs/NativeIntegrationPreviewDispositionV1"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/NativeIntegrationPreviewId"},source_ref:{$ref:"#/$defs/RefId"},source_tip:{$ref:"#/$defs/GitOidV1"}},required:["preview_id","preview_digest","direction","source_ref","destination_ref","source_tip","destination_tip","disposition"],type:"object"},GitHubStackSignalNativeSourceV1:{oneOf:[{properties:{preview:{$ref:"#/$defs/GitHubStackSignalNativePreviewV1"},source:{const:"preflight",type:"string"}},required:["source","preview"],type:"object"},{properties:{preview:{$ref:"#/$defs/GitHubStackSignalNativePreviewV1"},source:{const:"terminal",type:"string"},terminal:{$ref:"#/$defs/GitHubStackSignalNativeTerminalV1"}},required:["source","preview","terminal"],type:"object"}]},GitHubStackSignalNativeTerminalV1:{additionalProperties:!1,properties:{completed_at:{$ref:"#/$defs/UtcMicros"},final_ref_tip:{$ref:"#/$defs/GitOidV1"},outcome:{$ref:"#/$defs/NativeIntegrationTerminalOutcomeV1"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["transaction_id","receipt_digest","outcome","final_ref_tip","completed_at"],type:"object"},GitOidV1:gq,ManifestDigest:_l,MechanicalIntegrationModeV1:_p,NativeIntegrationDirectionV1:_R,NativeIntegrationPreviewDispositionV1:_q,NativeIntegrationPreviewId:_I,NativeIntegrationTerminalOutcomeV1:_C,NativeIntegrationTransactionId:_T,NativeIntegrationUnavailabilityV1:_O,RefId:vm,StackDeliveryWatermarkId:bk,StackSignalId:bP,StackSignalKindV1:{description:"Durable classification of one GitHub stack transition.",enum:["dependency_ready","actual_conflict","stack_tip_drift","pull_request_drift","ci_evaluated_commit_drift","integration_committed","integration_needs_inspection"],type:"string"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{evidence:{$ref:"#/$defs/GitHubStackSignalEvidenceRefV1"},outcome:{const:"expanded",type:"string"}},required:["outcome","evidence"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},reason:{$ref:"#/$defs/GitHubStackSignalExpandUnavailableV1"}},required:["outcome","reason"],type:"object"}],title:"GitHubStackSignalExpandSurfaceResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"GodClassSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,GodClassEntryV1:{additionalProperties:!1,properties:{fields:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},methods:{format:"uint64",minimum:0,type:"integer"},name:{type:"string"},total_members:{format:"uint64",minimum:0,type:"integer"}},required:["id","name","kind","file","line","methods","fields","total_members"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranking:{items:{$ref:"#/$defs/GodClassEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["result_count","ranking"],title:"GodClassResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{case_sensitive:{description:"Match case-sensitively (default: false = case-insensitive).",type:["boolean","null"]},context_lines:{description:"Lines of surrounding context to include per hit (default: 0, max: 3).",format:"uint32",minimum:0,type:["integer","null"]},fixed_strings:{description:"Treat pattern as a literal string instead of a regex (default: false).",type:["boolean","null"]},max_results:{description:"Maximum number of matching lines to return (default: 50, max: 200).",format:"uint32",minimum:0,type:["integer","null"]},path_glob:{description:"Optional glob restricting which files are searched, matched against\nproject-relative paths (e.g. 'src/**/*.rs').",type:["string","null"]},pattern:{description:"Content to search for. Treated as a regular expression unless\nfixed_strings is true.",type:"string"}},required:["pattern"],title:"GrepSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CoverageCompleteness:yu,CoverageDomainState:ym,EvidenceCoverage:yx,EvidenceDomain:yj,GrepGraphEnrichmentV1:{description:"Whether the verified graph resolved each hit's enclosing symbol. Hits are\nthe lexical answer either way.",oneOf:[{additionalProperties:!1,properties:{enriched:{format:"uint64",minimum:0,type:"integer"},returned:{format:"uint64",minimum:0,type:"integer"},status:{const:"complete",type:"string"}},required:["status","enriched","returned"],type:"object"},{additionalProperties:!1,properties:{detail:{type:"string"},reason_code:{type:"string"},retryable:{type:"boolean"},status:{const:"unavailable",type:"string"}},required:["status","reason_code","retryable","detail"],type:"object"}]},GrepMatchV1:{additionalProperties:!1,properties:{after:{items:{type:"string"},type:"array"},before:{items:{type:"string"},type:"array"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},node_id:{type:["string","null"]},symbol:{description:"The smallest verified graph symbol enclosing the hit.",type:["string","null"]},text:{type:"string"}},required:["file","line","text"],type:"object"},GrepScanOmissionsV1:{additionalProperties:!1,description:"What the bounded scan skipped, by cause; absent when it skipped nothing.",properties:{oversized_files:{description:"Files larger than the interactive scan byte limit.",format:"uint64",minimum:0,type:"integer"},oversized_lines:{description:"Lines longer than the scan line byte limit.",format:"uint64",minimum:0,type:"integer"},unavailable_sources:{description:"Source candidates that could not be read during the scan.",format:"uint64",minimum:0,type:"integer"}},required:["oversized_files","oversized_lines","unavailable_sources"],type:"object"},Omission:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},domain:{$ref:"#/$defs/EvidenceDomain"},reason:{$ref:"#/$defs/OmissionReason"}},required:["domain","count","reason"],type:"object"},OmissionReason:{description:"Safe reason why authorized requested evidence was omitted.",oneOf:[{enum:["budget","redacted","unavailable","unsupported","stale","failed","cancelled","timed_out","conflict"],type:"string"},{const:"macro_body_unparsed",description:"Evidence came from a macro body that was not expanded, so what the\nexpansion defines or calls is not covered.",type:"string"},{const:"import_unmodeled",description:"A caller sits under a `use` whose binding the index could not model\n(a glob in a block or inline module), so whether it calls the target\nis not covered.",type:"string"},{const:"cursor_expired",description:"The continuation cursor can no longer be redeemed (its lifetime ended\nor the snapshot it pages is gone); restart the request without it.",type:"string"},{const:"cursor_foreign",description:"The continuation cursor was issued for another project, worktree, or\nref; redeem it where it was issued.",type:"string"}]},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/EvidenceCoverage"},files_scanned:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_enrichment:{$ref:"#/$defs/GrepGraphEnrichmentV1"},match_count:{format:"uint64",minimum:0,type:"integer"},omissions:{items:{$ref:"#/$defs/Omission"},type:"array"},results:{items:{$ref:"#/$defs/GrepMatchV1"},type:"array"},scan_omissions:{$ref:"#/$defs/GrepScanOmissionsV1"},truncated:{type:"boolean"}},required:["results","match_count","files_scanned","truncated","coverage","omissions","graph_enrichment"],title:"GrepSearchResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{details:{description:"If true, include full dimension breakdown (default: false).",type:["boolean","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]}},title:"HealthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,HealthAcyclicityV1:{additionalProperties:!1,properties:{edges_in_cycles:{format:"uint64",minimum:0,type:"integer"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","edges_in_cycles","source"],type:"object"},HealthCoverageDisciplineV1:{additionalProperties:!1,properties:{score:{format:"double",type:"number"},skip_test_coverage_count:{format:"uint64",minimum:0,type:"integer"},source:{type:"string"},total_fns:{format:"uint64",minimum:0,type:"integer"}},required:["score","skip_test_coverage_count","total_fns","source"],type:"object"},HealthDepthV1:{additionalProperties:!1,properties:{ideal_chain:{format:"uint64",minimum:0,type:"integer"},max_chain:{format:"uint64",minimum:0,type:"integer"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","max_chain","ideal_chain","source"],type:"object"},HealthDimensionsV1:{additionalProperties:!1,properties:{acyclicity:{$ref:"#/$defs/HealthAcyclicityV1"},coverage_discipline:{$ref:"#/$defs/HealthCoverageDisciplineV1"},depth:{$ref:"#/$defs/HealthDepthV1"},equality:{$ref:"#/$defs/HealthEqualityV1"},modularity:{$ref:"#/$defs/HealthModularityV1"},redundancy:{$ref:"#/$defs/HealthRedundancyV1"}},required:["acyclicity","depth","equality","redundancy","modularity","coverage_discipline"],type:"object"},HealthEqualityV1:{additionalProperties:!1,properties:{gini:{format:"double",type:"number"},incomplete_complexity_symbols:{format:"uint64",minimum:0,type:"integer"},interpretation:{type:"string"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","gini","interpretation","incomplete_complexity_symbols","source"],type:"object"},HealthModularityV1:{additionalProperties:!1,properties:{components_after_hub_removal:{format:"uint64",minimum:0,type:"integer"},interpretation:{type:"string"},score:{format:"double",type:"number"},source:{type:"string"}},required:["score","interpretation","components_after_hub_removal","source"],type:"object"},HealthRedundancyV1:{additionalProperties:!1,properties:{dead_count:{format:"uint64",minimum:0,type:"integer"},score:{format:"double",type:"number"},source:{type:"string"},total_fns:{format:"uint64",minimum:0,type:"integer"}},required:["score","dead_count","total_fns","source"],type:"object"},HealthWeightsV1:{additionalProperties:!1,properties:{note:{type:"string"}},required:["note"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"`dimensions` and `weights` are present exactly when the request asked for\n`details`.",properties:{dimensions:{anyOf:[{$ref:"#/$defs/HealthDimensionsV1"},{type:"null"}]},files_analyzed:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},panel:{description:"Measured dimension names, worst score first, then\n`no evidence: name (reason), ...` for the dimensions the scope gave\nnothing to measure. An empty scope reads\n`no evidence: 0 files in scope`.",type:"string"},quality_signal:{description:"Geometric mean of the dimensions, scaled to 0-10000. A breakdown of\n`panel`, not a number to maximize. Dimensions that `panel` lists under\n`no evidence:` enter it at their formula value for an empty\nmeasurement, so it does not summarize such a scope: an empty scope\nreads 10000 and one file reads 0.",format:"uint32",minimum:0,type:"integer"},weights:{anyOf:[{$ref:"#/$defs/HealthWeightsV1"},{type:"null"}]}},required:["quality_signal","files_analyzed"],title:"HealthResultV1",type:"object"},{$defs:{PageRequest:_U,ResultProjection:vP,RetrievalOrder:vx,RetrievalRequestMeta:vj,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{before_cursor:{description:"A prior result's after_cursor. A cursor recorded under another health\ndefinition, or before definitions were recorded, is refused with\n`application.health-delta.definition-mismatch` or\n`application.health-delta.definition-unrecorded`; omit it to record a\nnew baseline.",type:["string","null"]},meta:{$ref:"#/$defs/RetrievalRequestMeta"},path_prefix:{type:["string","null"]}},required:["meta"],title:"HealthDeltaRequest",type:"object"},{$defs:{HealthDeltaCoverageV1:{additionalProperties:!1,properties:{completeness:{description:"`complete` when both points analyzed files, otherwise `unknown`.",type:"string"},denominator:{format:"uint64",minimum:0,type:["integer","null"]},eligible:{description:"Files the `after` point analyzed.",format:"uint64",minimum:0,type:["integer","null"]},visited:{format:"uint64",minimum:0,type:["integer","null"]}},required:["completeness"],type:"object"},HealthDeltaCurrentnessV1:{additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},state:{type:"string"}},required:["state","observed_at"],type:"object"},HealthDeltaPointV1:{additionalProperties:!1,properties:{dimensions:{additionalProperties:{$ref:"#/$defs/HealthDimensionPointV1"},type:"object"},files_analyzed:{format:"uint64",minimum:0,type:"integer"},function_denominator:{format:"uint64",minimum:0,type:"integer"},observed_at:{$ref:"#/$defs/UtcMicros"},quality_signal:{format:"uint32",minimum:0,type:"integer"},watermark:{$ref:"#/$defs/ManifestDigest"}},required:["watermark","observed_at","quality_signal","files_analyzed","function_denominator","dimensions"],type:"object"},HealthDeltaScopeV1:{additionalProperties:!1,properties:{path_prefix:{type:["string","null"]},project_id:{type:["string","null"]},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest"],type:"object"},HealthDimensionDeltaV1:{additionalProperties:!1,properties:{after_denominator:{format:"uint64",minimum:0,type:["integer","null"]},after_ppm:{format:"uint64",minimum:0,type:"integer"},before_denominator:{format:"uint64",minimum:0,type:["integer","null"]},before_ppm:{format:"uint64",minimum:0,type:"integer"},delta_ppm:{format:"int64",type:"integer"},status:{description:"`improved` or `degraded` when the score moved more than 1000 ppm,\notherwise `unchanged`. `no_evidence` when either point's scope gave\nthe dimension nothing to measure, so its scores are formula values.",type:"string"}},required:["before_ppm","after_ppm","delta_ppm","status"],type:"object"},HealthDimensionPointV1:{additionalProperties:!1,properties:{denominator:{format:"uint64",minimum:0,type:["integer","null"]},score_ppm:{format:"uint64",minimum:0,type:"integer"}},required:["score_ppm"],type:"object"},ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{after:{$ref:"#/$defs/HealthDeltaPointV1"},after_cursor:{type:"string"},before:{$ref:"#/$defs/HealthDeltaPointV1"},before_cursor:{type:"string"},coverage:{$ref:"#/$defs/HealthDeltaCoverageV1"},currentness:{$ref:"#/$defs/HealthDeltaCurrentnessV1"},delta:{format:"int64",type:"integer"},dimensions:{additionalProperties:{$ref:"#/$defs/HealthDimensionDeltaV1"},type:"object"},pass:{description:"True when both points analyzed files and quality_signal did not drop.",type:"boolean"},schema_version:{format:"uint32",minimum:0,type:"integer"},scope:{$ref:"#/$defs/HealthDeltaScopeV1"}},required:["schema_version","scope","before","after","before_cursor","after_cursor","pass","delta","dimensions","coverage","currentness"],title:"HealthDeltaResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The health read takes no parameters: it reports one serving status, with no\npage, projection, or temporal selection to make. The page and deadline\ncontrols every surface supplies travel in the dispatch envelope, not here.",title:"HealthReadRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{status:{type:"string"}},required:["status"],title:"HealthReadResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_pending_payloads:{default:!1,description:"Include staged Hermes skill-write payloads (default: false).",type:"boolean"},include_skill_bodies:{default:!1,description:"Include bounded SKILL.md contents (default: false).",type:"boolean"}},title:"HermesSkillBridgeSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,HermesPendingSkillWrite:{properties:{action:{type:["string","null"]},created_at:!0,id:{type:"string"},name:{type:["string","null"]},origin:{type:["string","null"]},payload:!0,source_path:{type:"string"},summary:{type:["string","null"]}},required:["id","source_path"],type:"object"},HermesSkillBridgeContracts:{properties:{discovery_policy:{type:"string"},lifecycle_owner:{type:"string"},mutation_policy:{type:"string"}},required:["lifecycle_owner","mutation_policy","discovery_policy"],type:"object"},HermesSkillBridgeSnapshot:{properties:{agent_home:{type:"string"},archive_count:{format:"uint",minimum:0,type:"integer"},contracts:{$ref:"#/$defs/HermesSkillBridgeContracts"},pending_skill_corrupt_count:{format:"uint",minimum:0,type:"integer"},pending_skill_count:{format:"uint",minimum:0,type:"integer"},pending_skills:{items:{$ref:"#/$defs/HermesPendingSkillWrite"},type:"array"},skill_count:{format:"uint",minimum:0,type:"integer"},skills:{items:{$ref:"#/$defs/HermesSkillSummary"},type:"array"},skills_dir:{type:"string"},usage_record_count:{format:"uint",minimum:0,type:"integer"},usage_records:{additionalProperties:!0,description:"Hermes-owned usage telemetry keyed by skill name, as Hermes wrote it.",type:"object"}},required:["agent_home","skills_dir","skill_count","pending_skill_count","pending_skill_corrupt_count","usage_record_count","archive_count","skills","pending_skills","usage_records","contracts"],type:"object"},HermesSkillSummary:{properties:{body_markdown:{type:["string","null"]},category:{type:["string","null"]},description:{type:["string","null"]},name:{type:"string"},path:{type:"string"},pending_write_ids:{items:{type:"string"},type:"array"},usage:!0},required:["name","path","pending_write_ids"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{bridge:{$ref:"#/$defs/HermesSkillBridgeSnapshot"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","bridge"],title:"HermesSkillBridgeResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,description:"Reset the project's local token counter.",properties:{action:{const:"reset_counter",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,description:"Admit one Hook V2 envelope for the bound project.",properties:{action:{const:"hook_v2_admit",type:"string"},envelope:!0,native_lifecycle:!0,native_session_id:{description:"The host's native session id; it binds only when it hashes to the\nenvelope's protected session.",type:["string","null"]}},required:["action","envelope"],type:"object"},{additionalProperties:!1,description:"Commit a Context Scout delivery receipt for guidance the last\nadmission handed out.",properties:{action:{const:"hook_v2_delivery_receipt",type:"string"},receipt:!0},required:["action","receipt"],type:"object"},{additionalProperties:!1,description:"Acknowledge delivery of an advisory feedback notice.",properties:{action:{const:"hook_v2_feedback_notice_delivery",type:"string"},envelope:!0,feedback_notice:!0},required:["action","envelope","feedback_notice"],type:"object"},{additionalProperties:!1,description:"Land a host transcript in the owning session store.",properties:{action:{const:"ingest_transcript",type:"string"},event_json:{description:"The host's raw hook event, for providers that locate the transcript\nfrom it.",type:["string","null"]},max_new_bytes:{description:"Byte budget for this pass across every scanned source.",format:"uint64",minimum:0,type:["integer","null"]},messages:{description:"One turn the host inlined instead of a source to scan.",items:!0,type:["array","null"]},provider:{type:"string"},session_id:{type:["string","null"]},user_scope:{description:"Land the transcript in the profile's user store instead of the\nproject's.",type:"boolean"}},required:["action","provider","user_scope"],type:"object"},{additionalProperties:!1,description:"Codex `PostCompact` pressure evidence.",properties:{action:{const:"codex_compact",type:"string"},event_json:{type:"string"}},required:["action","event_json"],type:"object"},{additionalProperties:!1,description:"Claude `PostCompact` pressure evidence; `user_scope` routes it to the\nprofile.",properties:{action:{const:"claude_compact",type:"string"},event_json:{type:"string"},user_scope:{type:"boolean"}},required:["action","event_json","user_scope"],type:"object"},{additionalProperties:!1,description:"Cursor `preCompact` pressure evidence.",properties:{action:{const:"cursor_compact",type:"string"},event_json:{type:"string"}},required:["action","event_json"],type:"object"},{additionalProperties:!1,description:"Record a Hermes terminal receipt without a project route.",properties:{action:{const:"hermes_receipt",type:"string"},event:!0},required:["action","event"],type:"object"},{additionalProperties:!1,description:"Admit a native event without a project route into the profile's\nHook V2 ledger.",properties:{action:{const:"hook_v2_profile_admit",type:"string"},admission:!0},required:["action","admission"],type:"object"}],title:"HookRuntimeSurfaceRequestV1"},{$defs:{ContextScoutAddressV1:hU,ContextScoutStoreStatusV1:{enum:["stored","duplicate","superseded","unavailable"],type:"string"},HermesReceiptStatusV1:{oneOf:[{const:"recorded",description:"A terminal receipt was recorded.",type:"string"},{const:"ingested",description:"The turn was marked ingested and no receipt awaits review.",type:"string"},{const:"awaiting_transcript",description:"A receipt awaits a transcript that has not landed yet.",type:"string"}]},HookIngestAdmissionV1:{additionalProperties:!1,description:"The admission authority's verdict on one transcript ingest.",properties:{reason_code:{type:["string","null"]},retryable:{type:"boolean"},status:{description:"The session host-admission status, in its wire spelling.",type:"string"}},required:["status","retryable"],type:"object"},HookOrchestrationAdmissionV1:{description:"Outcome of admitting one hook envelope into the registered orchestrator.",enum:["enqueued","backpressured","unsupported_trigger","unavailable"],type:"string"},HookRuntimeDispositionV1:{description:"How the hook transport should treat a Hook V2 envelope.",oneOf:[{enum:["accepted"],type:"string"},{const:"catchup_required",description:"The published binding no longer authorizes the envelope; the host\nmust catch up before sending again.",type:"string"}]},HookV2RejectionReasonV1:{oneOf:[{const:"admission_identity_conflict",description:"The same event identity previously carried different bytes.",type:"string"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{action:{const:"reset_counter",type:"string"},reset:{type:"boolean"}},required:["action","reset"],type:"object"},{oneOf:[{properties:{context_scout_address:{anyOf:[{$ref:"#/$defs/ContextScoutAddressV1"},{type:"null"}]},disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},feedback_notice:{description:"The advisory `AdvisoryHookLookupNoticeV1` waiting for this\nworktree."},github_stack_signal_available:{type:"boolean"},orchestration:{$ref:"#/$defs/HookOrchestrationAdmissionV1"},ready_guidance:{description:"The hook's `HookReadyGuidanceV1`, when admission claimed one."},status:{const:"accepted",type:"string"}},required:["status","disposition","orchestration","github_stack_signal_available"],type:"object"},{description:"This exact envelope was already admitted; a retry may still receive\nguidance retained before a lost host response.",properties:{context_scout_address:{anyOf:[{$ref:"#/$defs/ContextScoutAddressV1"},{type:"null"}]},disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},ready_guidance:!0,status:{const:"exact_duplicate",type:"string"}},required:["status","disposition"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},reason:{anyOf:[{$ref:"#/$defs/HookV2RejectionReasonV1"},{type:"null"}]},status:{const:"rejected",type:"string"}},required:["status","disposition"],type:"object"},{description:"Idempotency could not be recorded, so nothing was admitted.",properties:{status:{const:"backpressured",type:"string"}},required:["status"],type:"object"},{properties:{status:{const:"unavailable",type:"string"}},required:["status"],type:"object"}],properties:{action:{const:"hook_v2_admit",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"hook_v2_delivery_receipt",type:"string"},status:{$ref:"#/$defs/ContextScoutStoreStatusV1"}},required:["action","status"],type:"object"},{oneOf:[{properties:{status:{const:"stored",type:"string"}},required:["status"],type:"object"},{properties:{status:{const:"unavailable",type:"string"}},required:["status"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"rejected",type:"string"}},required:["status","disposition"],type:"object"}],properties:{action:{const:"hook_v2_feedback_notice_delivery",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"ingest_transcript",type:"string"},admission:{$ref:"#/$defs/HookIngestAdmissionV1"},bytes_consumed:{format:"uint64",minimum:0,type:["integer","null"]},completed:{description:"False when the byte budget left work for a later pass.",type:"boolean"},cursor_advances:{format:"uint64",minimum:0,type:["integer","null"]},cursor_duplicates:{format:"uint64",minimum:0,type:["integer","null"]},deferred_by_byte_cap:{type:["boolean","null"]},deferred_sources:{format:"uint64",minimum:0,type:["integer","null"]},hint_outcomes:{description:"How emitted hook hints settled against the new project activity."},messages_upserted:{format:"uint64",minimum:0,type:"integer"},observation_duplicates:{format:"uint64",minimum:0,type:["integer","null"]},observations_committed:{format:"uint64",minimum:0,type:["integer","null"]},projection_duplicates:{format:"uint64",minimum:0,type:["integer","null"]},projections_completed:{format:"uint64",minimum:0,type:["integer","null"]},projections_skipped:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:"string"},records_quarantined:{format:"uint64",minimum:0,type:["integer","null"]},records_rejected:{format:"uint64",minimum:0,type:["integer","null"]},source_bytes_scanned:{format:"uint64",minimum:0,type:["integer","null"]},status:{type:"string"},user_scope:{type:"boolean"}},required:["action","provider","user_scope","completed","status","admission","messages_upserted"],type:"object"},{anyOf:[{description:"The LCM authority settled the compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},relation_projection_status:!0,retry_status:{type:["string","null"]},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids","relation_projection_status","authority_outcome","committed_state","messages_upserted"],type:"object"},{description:"The LCM authority answered without a compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","authority_outcome","committed_state","summary_nodes_created","summary_node_ids","messages_upserted"],type:"object"},{description:"No compaction ran: the authority is absent, the host supplied nothing\nto compact, or its summaries have no provenance.",properties:{reason:{type:"string"},relation_projection_status:!0,status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids"],type:"object"},{description:"The host event named no session to compact.",properties:{messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"}},required:["status","reason","messages_upserted"],type:"object"}],description:"A compaction hook's outcome. Variants are distinguished by the fields\nthey carry.",properties:{action:{const:"codex_compact",type:"string"}},required:["action"],type:"object"},{anyOf:[{description:"The LCM authority settled the compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},relation_projection_status:!0,retry_status:{type:["string","null"]},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids","relation_projection_status","authority_outcome","committed_state","messages_upserted"],type:"object"},{description:"The LCM authority answered without a compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","authority_outcome","committed_state","summary_nodes_created","summary_node_ids","messages_upserted"],type:"object"},{description:"No compaction ran: the authority is absent, the host supplied nothing\nto compact, or its summaries have no provenance.",properties:{reason:{type:"string"},relation_projection_status:!0,status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids"],type:"object"},{description:"The host event named no session to compact.",properties:{messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"}},required:["status","reason","messages_upserted"],type:"object"}],description:"A compaction hook's outcome. Variants are distinguished by the fields\nthey carry.",properties:{action:{const:"claude_compact",type:"string"}},required:["action"],type:"object"},{anyOf:[{description:"The LCM authority settled the compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},relation_projection_status:!0,retry_status:{type:["string","null"]},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids","relation_projection_status","authority_outcome","committed_state","messages_upserted"],type:"object"},{description:"The LCM authority answered without a compaction.",properties:{authority_outcome:!0,committed_state:!0,messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","authority_outcome","committed_state","summary_nodes_created","summary_node_ids","messages_upserted"],type:"object"},{description:"No compaction ran: the authority is absent, the host supplied nothing\nto compact, or its summaries have no provenance.",properties:{reason:{type:"string"},relation_projection_status:!0,status:{type:"string"},summary_node_ids:{items:{type:"string"},type:"array"},summary_nodes_created:{format:"uint64",minimum:0,type:"integer"}},required:["status","reason","summary_nodes_created","summary_node_ids"],type:"object"},{description:"The host event named no session to compact.",properties:{messages_upserted:{format:"uint64",minimum:0,type:"integer"},reason:{type:"string"},status:{type:"string"}},required:["status","reason","messages_upserted"],type:"object"}],description:"A compaction hook's outcome. Variants are distinguished by the fields\nthey carry.",properties:{action:{const:"cursor_compact",type:"string"}},required:["action"],type:"object"},{additionalProperties:!1,properties:{action:{const:"hermes_receipt",type:"string"},status:{$ref:"#/$defs/HermesReceiptStatusV1"}},required:["action","status"],type:"object"},{oneOf:[{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"accepted",type:"string"}},required:["status","disposition"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"exact_duplicate",type:"string"}},required:["status","disposition"],type:"object"},{properties:{disposition:{$ref:"#/$defs/HookRuntimeDispositionV1"},status:{const:"rejected",type:"string"}},required:["status","disposition"],type:"object"},{properties:{status:{const:"unavailable",type:"string"}},required:["status"],type:"object"}],properties:{action:{const:"hook_v2_profile_admit",type:"string"}},required:["action"],type:"object"}],title:"HookRuntimeResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of hotspots to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]}},title:"HotspotsSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,HotspotV1:{additionalProperties:!1,properties:{churn:{description:"Commits touching `file` in the last 90 days. Absent when git history\ncould not be read; `0` means the file had no commits in that window.",format:"uint64",minimum:0,type:["integer","null"]},file:{type:"string"},id:{type:"string"},incoming:{format:"uint64",minimum:0,type:"integer"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},outgoing:{format:"uint64",minimum:0,type:"integer"},total:{format:"uint64",minimum:0,type:"integer"}},required:["id","name","kind","file","line","incoming","outgoing","total"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},hotspot_count:{format:"uint64",minimum:0,type:"integer"},hotspots:{items:{$ref:"#/$defs/HotspotV1"},type:"array"},unavailable_fields:{description:"Names a measurement this result could not make. `churn` means the\nranking is connectivity alone.",items:{type:"string"},type:"array"}},required:["hotspot_count","hotspots"],title:"HotspotsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{max_depth:{format:"uint32",minimum:0,type:["integer","null"]},node_id:{type:"string"}},required:["node_id"],title:"NodeDepthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ImpactNodeV1:{additionalProperties:!1,properties:{depth:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line","depth"],type:"object"},ImpactRadiusV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},node_count:{format:"uint",minimum:0,type:"integer"},nodes:{items:{$ref:"#/$defs/ImpactNodeV1"},type:"array"},unavailable_fields:{items:{type:"string"},type:"array"}},required:["node_count","complete","unavailable_fields","nodes"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveNotFoundV1:_Z,PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ImpactRadiusV1"},{$ref:"#/$defs/PrimitiveNotFoundV1"}],title:"ImpactResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"InheritanceDepthSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,InheritanceDepthEntryV1:{additionalProperties:!1,properties:{depth:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line","depth"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},ranking:{items:{$ref:"#/$defs/InheritanceDepthEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["result_count","ranking"],title:"InheritanceDepthResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_insert_at`.",properties:{anchor:{type:"string"},before:{default:!1,type:"boolean"},content:{type:"string"},dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},path:{type:"string"},verify:{default:!1,type:"boolean"}},required:["path","anchor","content"],title:"InsertAtSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_insert_at_symbol`.",properties:{content:{type:"string"},dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},position:{default:"after",type:"string"},symbol:{type:"string"},verify:{default:!1,type:"boolean"}},required:["symbol","content"],title:"InsertAtSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},node_kind:{description:"Filter by node kind (e.g. 'class', 'method', 'function', 'interface',\n'enum', 'struct').",type:["string","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"LargestSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,LargestEntryV1:{additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},lines:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["id","name","kind","file","start_line","end_line","lines"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},node_kind_filter:{type:["string","null"]},ranking:{items:{$ref:"#/$defs/LargestEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["result_count","ranking"],title:"LargestResultV1",type:"object"},{$defs:{LcmDescribeTargetV1:{oneOf:[{properties:{kind:{const:"session",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"summary_node",type:"string"},node_id:{type:"string"}},required:["kind","node_id"],type:"object"},{properties:{kind:{const:"external_payload",type:"string"},payload_ref:{type:"string"}},required:["kind","payload_ref"],type:"object"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{provider:{type:"string"},session_id:{type:"string"},target:{anyOf:[{$ref:"#/$defs/LcmDescribeTargetV1"},{type:"null"}]}},required:["provider","session_id"],title:"LcmDescribeRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,CompactLineageEdgeV1:{additionalProperties:!1,properties:{authority:{type:"string"},authorized:{type:"boolean"},kind:{type:"string"},knowledge_at:{format:"int64",type:"integer"},object_anchor_id:{type:"string"},subject_anchor_id:{type:"string"},supporting_anchor_ids:{items:{type:"string"},type:"array"}},required:["kind","subject_anchor_id","object_anchor_id","knowledge_at","authority","authorized","supporting_anchor_ids"],type:"object"},HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmDescribeExternalPayloadV1:{additionalProperties:!1,properties:{byte_count:{format:"uint64",minimum:0,type:"integer"},char_count:{format:"uint64",minimum:0,type:"integer"},content_hash:{type:"string"},content_preview:{type:"string"},created_at:{format:"int64",type:"integer"},kind:{type:"string"},message_id:{type:"string"},metadata_json:{type:["string","null"]},payload_ref:{type:"string"},provider:{type:"string"},session_id:{type:"string"}},required:["payload_ref","provider","session_id","message_id","kind","content_hash","byte_count","char_count","created_at","content_preview"],type:"object"},LcmDescribeSourceOverviewV1:{additionalProperties:!1,properties:{expand_hint:{type:["string","null"]},node_id:{type:["string","null"]},role:{type:["string","null"]},source_kind:{type:"string"},source_ref:{$ref:"#/$defs/LcmSourceRefV1"},source_token_count:{format:"int64",type:["integer","null"]},storage_kind:{anyOf:[{$ref:"#/$defs/LcmStorageKindV1"},{type:"null"}]},store_id:{format:"int64",type:["integer","null"]},summary_token_count:{format:"int64",type:["integer","null"]}},required:["source_kind","source_ref"],type:"object"},LcmDescribeSummaryNodeV1:{additionalProperties:!1,properties:{children:{items:{$ref:"#/$defs/LcmDescribeSourceOverviewV1"},type:"array"},conversation_id:{type:"string"},created_at:{format:"int64",type:"integer"},depth:{format:"int64",type:"integer"},expand_hint:{type:["string","null"]},metadata_json:{type:["string","null"]},node_id:{type:"string"},source_count:{format:"uint",minimum:0,type:"integer"},source_time_end:{format:"int64",type:["integer","null"]},source_time_start:{format:"int64",type:["integer","null"]},source_token_count:{format:"int64",type:"integer"},summary_token_count:{format:"int64",type:"integer"}},required:["node_id","conversation_id","depth","summary_token_count","source_token_count","created_at","source_count","children"],type:"object"},LcmDescriptionV1:{additionalProperties:!1,properties:{external_payload:{anyOf:[{$ref:"#/$defs/LcmDescribeExternalPayloadV1"},{type:"null"}]},external_payload_count:{format:"int64",type:"integer"},first_store_id:{format:"int64",type:["integer","null"]},last_store_id:{format:"int64",type:["integer","null"]},provider:{type:"string"},raw_message_count:{format:"int64",type:"integer"},raw_messages:{items:{$ref:"#/$defs/LcmRawMessageOverviewV1"},type:"array"},session_id:{type:"string"},session_token_estimate:{format:"int64",type:["integer","null"]},summary_node:{anyOf:[{$ref:"#/$defs/LcmDescribeSummaryNodeV1"},{type:"null"}]},summary_node_count:{format:"int64",type:"integer"},summary_nodes:{items:{$ref:"#/$defs/LcmSummaryNodeOverviewV1"},type:"array"},target:{type:"string"},unpublished_message_count:{description:"Raw messages the session's active temporal generation has not\npublished; transcript reads cannot page them yet.",format:"int64",type:"integer"}},required:["target","provider","session_id","raw_message_count","unpublished_message_count","summary_node_count","external_payload_count","raw_messages","summary_nodes"],type:"object"},LcmRawMessageOverviewV1:{additionalProperties:!1,properties:{content_preview:{type:"string"},content_range:{$ref:"#/$defs/LcmContentRangeV1"},message_id:{type:"string"},payload_ref:{type:["string","null"]},role:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:"integer"}},required:["message_id","store_id","role","storage_kind","content_preview","content_range"],type:"object"},LcmRetrievalOutcomeV1:g4,LcmSourceRefV1:g6,LcmStorageKindV1:g3,LcmSummaryNodeOverviewV1:{additionalProperties:!1,properties:{conversation_id:{type:"string"},created_at:{format:"int64",type:"integer"},depth:{format:"int64",type:"integer"},node_id:{type:"string"},source_count:{format:"uint",minimum:0,type:"integer"},summary_preview:{type:"string"}},required:["node_id","conversation_id","depth","summary_preview","source_count","created_at"],type:"object"},LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalFreshnessV1:bA,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},description:{anyOf:[{$ref:"#/$defs/LcmDescriptionV1"},{type:"null"}]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},grain:{type:["string","null"]},lineage:{items:{$ref:"#/$defs/CompactLineageEdgeV1"},type:["array","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},retrieval:{anyOf:[{$ref:"#/$defs/LcmRetrievalOutcomeV1"},{type:"null"}]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},state:{anyOf:[{$ref:"#/$defs/HydrationStateResultV1"},{type:"null"}]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status"],title:"LcmDescribeResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"LcmDoctorRequestV1",type:"object"},{$defs:{LcmAuthorityOutcomeV1:gZ,LcmConvergenceStateV1:gX,LcmConvergenceV1:gY,LcmDoctorFindingKindV1:{enum:["trigger_audit_drift","occurrence_fts_corruption","summary_fts_corruption","missing_anchor","missing_receipt","invalid_generation","multi_active_generation","cursor_chain_absent","cursor_key_absent","ownership_drift","stuck_refresh","stuck_binding","stuck_progress","stuck_receipt","migration_gap","compatibility_drift","relation_graph_unavailable","relation_graph_corruption","relation_graph_cycle","stale_summary_closure"],type:"string"},LcmDoctorFindingV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{$ref:"#/$defs/LcmDoctorFindingKindV1"}},required:["kind","count"],type:"object"},LcmDoctorHealthStatusV1:{enum:["complete","partial","unavailable","locked"],type:"string"},LcmDoctorHealthV1:{additionalProperties:!1,properties:{findings:{items:{$ref:"#/$defs/LcmDoctorFindingV1"},type:"array"},reason:{type:["string","null"]},status:{$ref:"#/$defs/LcmDoctorHealthStatusV1"}},required:["status","findings"],type:"object"},LcmDoctorProjectionStateV1:g1,LcmDoctorProjectionV1:g0,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{authority_outcome:{$ref:"#/$defs/LcmAuthorityOutcomeV1"},health:{anyOf:[{$ref:"#/$defs/LcmDoctorHealthV1"},{type:"null"}]},projection:{anyOf:[{$ref:"#/$defs/LcmDoctorProjectionV1"},{type:"null"}],description:"Absent when the diagnosed store has no refresh worker (profile mounts)."},reason:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"}},required:["status","authority_outcome"],title:"LcmDoctorResultV1",type:"object"},{$defs:{LcmExpandTargetV1:{oneOf:[{properties:{kind:{const:"canonical_occurrence",type:"string"},message_id:{type:"string"}},required:["kind","message_id"],type:"object"},{properties:{kind:{const:"raw_message",type:"string"},store_id:{format:"uint64",minimum:0,type:"integer"}},required:["kind","store_id"],type:"object"},{properties:{kind:{const:"summary_node",type:"string"},node_id:{type:"string"}},required:["kind","node_id"],type:"object"},{properties:{kind:{const:"external_payload",type:"string"},payload_ref:{type:"string"}},required:["kind","payload_ref"],type:"object"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{content_limit:{format:"uint64",minimum:0,type:["integer","null"]},content_offset:{format:"uint64",minimum:0,type:["integer","null"]},cursor:{type:["string","null"]},provider:{type:"string"},session_id:{type:"string"},source_limit:{format:"uint64",minimum:0,type:["integer","null"]},target:{$ref:"#/$defs/LcmExpandTargetV1"}},required:["provider","session_id","target"],title:"LcmExpandRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmExpandedSourceV1:{additionalProperties:!1,properties:{content:{type:"string"},content_range:{anyOf:[{$ref:"#/$defs/LcmContentRangeV1"},{type:"null"}]},content_truncated:{type:"boolean"},raw_message:{anyOf:[{$ref:"#/$defs/LcmRawMessageV1"},{type:"null"}]},raw_message_metadata:{anyOf:[{$ref:"#/$defs/LcmRawMessageMetadataV1"},{type:"null"}]},source_ref:{$ref:"#/$defs/LcmSourceRefV1"},state:{$ref:"#/$defs/HydrationStateResultV1"},summary_node:{anyOf:[{$ref:"#/$defs/LcmSummaryNodeV1"},{type:"null"}]}},required:["source_ref","state","content","content_truncated"],type:"object"},LcmExpansionV1:{additionalProperties:!1,properties:{content:{type:"string"},content_range:{$ref:"#/$defs/LcmContentRangeV1"},from_current_session:{type:["boolean","null"]},kind:{type:"string"},payload_ref:{type:["string","null"]},raw_message:{anyOf:[{$ref:"#/$defs/LcmRawMessageV1"},{type:"null"}]},raw_message_metadata:{anyOf:[{$ref:"#/$defs/LcmRawMessageMetadataV1"},{type:"null"}]},source_pagination:{anyOf:[{$ref:"#/$defs/LcmSourcePaginationV1"},{type:"null"}]},summary_node:{anyOf:[{$ref:"#/$defs/LcmSummaryNodeV1"},{type:"null"}]},summary_sources:{items:{$ref:"#/$defs/LcmExpandedSourceV1"},type:"array"}},required:["kind","content","content_range","summary_sources"],type:"object"},LcmRawMessageMetadataV1:{additionalProperties:!1,properties:{content_hash:{type:"string"},message_id:{type:"string"},metadata_json:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},payload_ref:{type:["string","null"]},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:"integer"},timestamp:{format:"int64",type:["integer","null"]}},required:["provider","message_id","session_id","store_id","role","ordinal","content_hash","storage_kind"],type:"object"},LcmRawMessageV1:g2,LcmRetrievalOutcomeV1:g4,LcmSourcePaginationV1:{additionalProperties:!1,properties:{has_more:{type:"boolean"},remaining_sources:{format:"uint",minimum:0,type:"integer"},returned_sources:{format:"uint",minimum:0,type:"integer"},source_limit:{format:"uint",minimum:0,type:"integer"},total_sources:{format:"uint",minimum:0,type:"integer"}},required:["source_limit","returned_sources","total_sources","has_more","remaining_sources"],type:"object"},LcmSourceRefV1:g6,LcmStorageKindV1:g3,LcmSummaryNodeV1:g8,LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalFreshnessV1:bA,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},expansion:{anyOf:[{$ref:"#/$defs/LcmExpansionV1"},{type:"null"}]},grain:{type:["string","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},retrieval:{anyOf:[{$ref:"#/$defs/LcmRetrievalOutcomeV1"},{type:"null"}]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},state:{anyOf:[{$ref:"#/$defs/HydrationStateResultV1"},{type:"null"}]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status"],title:"LcmExpandResultV1",type:"object"},{$defs:{LcmNodeIdV1:{anyOf:[{type:"string"},{format:"uint64",minimum:0,type:"integer"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{context_max_tokens:{format:"uint64",minimum:0,type:["integer","null"]},cursor:{type:["string","null"]},max_results:{format:"uint64",minimum:0,type:["integer","null"]},max_tokens:{format:"uint64",minimum:0,type:["integer","null"]},node_ids:{items:{$ref:"#/$defs/LcmNodeIdV1"},type:["array","null"]},prompt:{type:"string"},provider:{type:"string"},query:{type:["string","null"]},session_id:{type:"string"}},required:["provider","session_id","prompt"],title:"LcmExpandQueryRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmExpandQueryBudgetV1:{additionalProperties:!1,properties:{requested_max_chars:{format:"uint",minimum:0,type:"integer"},used_chars:{format:"uint",minimum:0,type:"integer"}},required:["requested_max_chars","used_chars"],type:"object"},LcmExpandQueryContextBlockV1:{additionalProperties:!1,properties:{content:{type:"string"},content_range:{$ref:"#/$defs/LcmContentRangeV1"},kind:{type:"string"},node_id:{type:["string","null"]},raw_message:{anyOf:[{$ref:"#/$defs/LcmRawMessageV1"},{type:"null"}]},source_ref:{anyOf:[{$ref:"#/$defs/LcmSourceRefV1"},{type:"null"}]},summary_node:{anyOf:[{$ref:"#/$defs/LcmSummaryNodeV1"},{type:"null"}]}},required:["kind","content","content_range"],type:"object"},LcmExpandQueryMatchV1:{additionalProperties:!1,properties:{kind:{type:"string"},node_id:{type:["string","null"]},snippet:{type:"string"},store_id:{format:"int64",type:["integer","null"]}},required:["kind","snippet"],type:"object"},LcmExpandQueryPaginationV1:{additionalProperties:!1,properties:{has_more:{type:"boolean"},kind:{type:"string"},next_content_offset:{format:"uint64",minimum:0,type:["integer","null"]},node_id:{type:["string","null"]},source_ref:{anyOf:[{$ref:"#/$defs/LcmSourceRefV1"},{type:"null"}]},state:{anyOf:[{$ref:"#/$defs/HydrationStateResultV1"},{type:"null"}]}},required:["kind","has_more"],type:"object"},LcmExpandQuerySynthesisPromptV1:{additionalProperties:!1,properties:{system:{type:"string"},user:{type:"string"},user_prompt_truncated_for_mcp:{type:["boolean","null"]}},required:["system","user"],type:"object"},LcmRawMessageV1:g2,LcmSourceRefV1:g6,LcmStorageKindV1:g3,LcmSummaryNodeV1:g8,LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{answer:{type:["string","null"]},capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},context_blocks:{items:{$ref:"#/$defs/LcmExpandQueryContextBlockV1"},type:"array"},context_budget:{anyOf:[{$ref:"#/$defs/LcmExpandQueryBudgetV1"},{type:"null"}]},context_max_tokens:{format:"uint",minimum:0,type:["integer","null"]},context_pagination:{items:{$ref:"#/$defs/LcmExpandQueryPaginationV1"},type:["array","null"]},context_truncated:{type:["boolean","null"]},contract_truncated:{type:["boolean","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},matches:{items:{$ref:"#/$defs/LcmExpandQueryMatchV1"},type:["array","null"]},max_tokens:{format:"uint",minimum:0,type:["integer","null"]},mcp_response_truncated:{type:["boolean","null"]},mcp_truncation_reason:{type:["string","null"]},needs_synthesis:{type:["boolean","null"]},node_ids:{items:{type:"string"},type:["array","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},prompt:{type:["string","null"]},prompt_truncated_for_mcp:{type:["boolean","null"]},provider:{type:["string","null"]},query:{type:["string","null"]},query_truncated_for_mcp:{type:["boolean","null"]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},synthesis_prompt:{anyOf:[{$ref:"#/$defs/LcmExpandQuerySynthesisPromptV1"},{type:"null"}]},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status","context_blocks"],title:"LcmExpandQueryResultV1",type:"object"},{$defs:{LcmGrepSortV1:{enum:["recency","relevance","hybrid"],type:"string"},LcmRoleV1:{enum:["system","user","assistant","tool","unknown"],type:"string"},LcmSearchScopeV1:{enum:["current","session","all"],type:"string"},MessageRelationshipScopeV1:_m,MessageTypeFilterV1:_f,RetainedTimeFilterV1:vq,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},cursor:{type:["string","null"]},end_time:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},include_summaries:{type:["boolean","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},message_type:{anyOf:[{$ref:"#/$defs/MessageTypeFilterV1"},{type:"null"}]},provider:{type:["string","null"]},query:{type:"string"},relationship_scope:{anyOf:[{$ref:"#/$defs/MessageRelationshipScopeV1"},{type:"null"}]},role:{anyOf:[{$ref:"#/$defs/LcmRoleV1"},{type:"null"}]},scope:{anyOf:[{$ref:"#/$defs/LcmSearchScopeV1"},{type:"null"}]},session_id:{type:["string","null"]},sort:{anyOf:[{$ref:"#/$defs/LcmGrepSortV1"},{type:"null"}]},source:{type:["string","null"]},start_time:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},temporal_mode:{anyOf:[{$ref:"#/$defs/TemporalModeV1"},{type:"null"}]},worktree:{type:["string","null"]}},required:["query"],title:"LcmGrepRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmGrepHitV1:{additionalProperties:!1,properties:{kind:{type:"string"},message_id:{type:["string","null"]},node_id:{type:["string","null"]},provider:{type:"string"},role:{type:["string","null"]},score:{format:"double",type:"number"},session_id:{type:"string"},snippet:{type:"string"},store_id:{format:"int64",type:["integer","null"]}},required:["kind","provider","session_id","snippet","score"],type:"object"},LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},count:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},hits:{items:{$ref:"#/$defs/LcmGrepHitV1"},type:"array"},message_type:{type:["string","null"]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},query:{type:["string","null"]},relationship_scope:{type:["string","null"]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},sort:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status","hits"],title:"LcmGrepResultV1",type:"object"},{$defs:{TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{content_limit:{format:"uint64",minimum:0,type:["integer","null"]},content_offset:{format:"uint64",minimum:0,type:["integer","null"]},cursor:{type:["string","null"]},end_time:{format:"uint64",minimum:0,type:["integer","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},role:{type:["string","null"]},roles:{items:{type:"string"},type:["array","null"]},session_id:{type:"string"},start_time:{format:"uint64",minimum:0,type:["integer","null"]},temporal_mode:{anyOf:[{$ref:"#/$defs/TemporalModeV1"},{type:"null"}]}},required:["session_id"],title:"LcmLoadSessionRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,HydrationStateResultV1:gG,LcmContentRangeV1:gQ,LcmMessageV1:{additionalProperties:!1,properties:{content:{type:"string"},content_hash:{type:["string","null"]},content_range:{$ref:"#/$defs/LcmContentRangeV1"},message_id:{type:"string"},metadata_json:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},payload_ref:{type:["string","null"]},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},storage_kind:{$ref:"#/$defs/LcmStorageKindV1"},store_id:{format:"int64",type:["integer","null"]},timestamp:{format:"int64",type:["integer","null"]}},required:["provider","message_id","session_id","role","ordinal","content","content_range","storage_kind"],type:"object"},LcmStorageKindV1:g3,LcmTemporalFieldsV1:g7,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{capped_sessions:{additionalProperties:{format:"uint",minimum:0,type:"integer"},type:["object","null"]},content_limit:{format:"uint",minimum:0,type:["integer","null"]},content_limit_clamped_from:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},messages:{items:{$ref:"#/$defs/LcmMessageV1"},type:"array"},omitted:{format:"uint64",minimum:0,type:["integer","null"]},provider:{type:["string","null"]},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},temporal:{anyOf:[{$ref:"#/$defs/LcmTemporalFieldsV1"},{type:"null"}]}},required:["status","messages"],title:"LcmLoadSessionResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{deep:{type:["boolean","null"]},provider:{type:["string","null"]},session_id:{type:["string","null"]}},title:"LcmStatusRequestV1",type:"object"},{$defs:{LcmAuthorityOutcomeV1:gZ,LcmConfigStatusV1:{additionalProperties:!1,properties:{compression_boundary_cooldown_seconds:{format:"int64",type:"integer"},fresh_tail_count:{format:"uint",minimum:0,type:"integer"},summary_fan_in:{format:"uint",minimum:0,type:"integer"}},required:["fresh_tail_count","summary_fan_in","compression_boundary_cooldown_seconds"],type:"object"},LcmConvergenceStateV1:gX,LcmConvergenceV1:gY,LcmDagDepthStatusV1:{additionalProperties:!1,properties:{count:{format:"int64",type:"integer"},source_tokens:{format:"int64",type:"integer"},tokens:{format:"int64",type:"integer"}},required:["count","tokens","source_tokens"],type:"object"},LcmDagStatusV1:{additionalProperties:!1,properties:{compression_ratio:{type:"string"},depths:{additionalProperties:{$ref:"#/$defs/LcmDagDepthStatusV1"},type:"object"},total_nodes:{format:"int64",type:"integer"},total_source_tokens:{format:"int64",type:"integer"},total_tokens:{format:"int64",type:"integer"}},required:["total_nodes","total_tokens","total_source_tokens","compression_ratio","depths"],type:"object"},LcmDoctorProjectionStateV1:g1,LcmDoctorProjectionV1:g0,LcmLifecycleStatusV1:{additionalProperties:!1,properties:{current_frontier_store_id:{format:"int64",type:["integer","null"]},current_session_id:{type:["string","null"]},frontier_count:{format:"int64",type:"integer"},last_finalized_frontier_store_id:{format:"int64",type:["integer","null"]},last_finalized_session_id:{type:["string","null"]},lifecycle_state_count:{format:"int64",type:"integer"},maintenance_debt_count:{format:"int64",type:"integer"}},required:["lifecycle_state_count","frontier_count","maintenance_debt_count"],type:"object"},LcmPayloadCoverageStateV1:{enum:["complete","partial"],type:"string"},LcmPayloadCoverageV1:{additionalProperties:!1,properties:{reason:{type:["string","null"]},scanned_files:{format:"int64",type:"integer"},scanned_metadata_refs:{format:"int64",type:"integer"},state:{$ref:"#/$defs/LcmPayloadCoverageStateV1"}},required:["state","scanned_metadata_refs","scanned_files"],type:"object"},LcmPayloadGcStatusV1:{additionalProperties:!1,properties:{grace_seconds:{format:"int64",type:"integer"},last_gc_at:{format:"int64",type:["integer","null"]},last_gc_duration_ms:{format:"uint64",minimum:0,type:["integer","null"]},last_gc_error:{type:["string","null"]},last_gc_status:{type:["string","null"]},last_reaped_bytes:{format:"uint64",minimum:0,type:["integer","null"]},last_reaped_refs:{format:"int64",type:["integer","null"]},next_run_eligible_at:{format:"int64",type:["integer","null"]},reap_missing_metadata_after_seconds:{format:"int64",type:"integer"}},required:["grace_seconds","reap_missing_metadata_after_seconds"],type:"object"},LcmPayloadStatusV1:{additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/LcmPayloadCoverageV1"},externalized_count:{format:"int64",type:"integer"},gc_candidate_count:{format:"int64",type:"integer"},integrity_mismatch_count:{format:"int64",type:["integer","null"]},missing_count:{format:"int64",type:"integer"},missing_placeholder_file_count:{format:"int64",type:"integer"},missing_placeholder_metadata_count:{format:"int64",type:"integer"},orphan_file_bytes:{format:"uint64",minimum:0,type:"integer"},orphan_file_count:{format:"int64",type:"integer"},placeholder_ref_count:{format:"int64",type:"integer"},reclaimable_bytes:{format:"uint64",minimum:0,type:"integer"},reclaimable_bytes_after_grace:{format:"uint64",minimum:0,type:"integer"},referenced_bytes:{format:"uint64",minimum:0,type:"integer"},referenced_count:{format:"int64",type:"integer"},root_contained:{type:"boolean"},tombstoned_count:{format:"int64",type:"integer"},total_bytes:{format:"uint64",minimum:0,type:"integer"},unreferenced_count:{format:"int64",type:"integer"}},required:["coverage","externalized_count","missing_count","unreferenced_count","placeholder_ref_count","missing_placeholder_metadata_count","missing_placeholder_file_count","gc_candidate_count","root_contained","orphan_file_count","tombstoned_count","referenced_count","total_bytes","referenced_bytes","orphan_file_bytes","reclaimable_bytes","reclaimable_bytes_after_grace"],type:"object"},LcmRedactionStatusV1:{additionalProperties:!1,properties:{enabled:{type:"boolean"},lossy_records:{format:"int64",type:"integer"}},required:["enabled","lossy_records"],type:"object"},LcmStatusV1:{additionalProperties:!1,properties:{config:{$ref:"#/$defs/LcmConfigStatusV1"},dag:{$ref:"#/$defs/LcmDagStatusV1"},external_payload_count:{format:"int64",type:"integer"},lifecycle:{$ref:"#/$defs/LcmLifecycleStatusV1"},maintenance_debt_count:{format:"int64",type:"integer"},missing_payload_count:{format:"int64",type:"integer"},payload:{$ref:"#/$defs/LcmPayloadStatusV1"},payload_gc:{$ref:"#/$defs/LcmPayloadGcStatusV1"},raw_message_count:{format:"int64",type:"integer"},redaction:{$ref:"#/$defs/LcmRedactionStatusV1"},schema_version:{format:"int64",type:"integer"},store:{$ref:"#/$defs/LcmStoreStatusV1"},summary_convergence:{$ref:"#/$defs/LcmSummaryConvergenceStatusV1"},summary_node_count:{format:"int64",type:"integer"},unreferenced_payload_count:{format:"int64",type:"integer"}},required:["schema_version","raw_message_count","summary_node_count","external_payload_count","missing_payload_count","unreferenced_payload_count","maintenance_debt_count","store","dag","config","payload","payload_gc","lifecycle","summary_convergence","redaction"],type:"object"},LcmStoreStatusV1:{additionalProperties:!1,properties:{estimated_tokens:{format:"int64",type:"integer"},messages:{format:"int64",type:"integer"},token_estimate:{$ref:"#/$defs/LcmStoreTokenCoverageV1"}},required:["messages","estimated_tokens","token_estimate"],type:"object"},LcmStoreTokenCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},next_after_store_id:{format:"int64",type:["integer","null"]},scanned_messages:{format:"int64",type:"integer"}},required:["complete","scanned_messages"],type:"object"},LcmSummaryConvergenceReasonV1:{additionalProperties:!1,properties:{reason:{type:"string"},session_count:{format:"int64",type:"integer"},state:{$ref:"#/$defs/LcmSummaryConvergenceStateV1"}},required:["state","reason","session_count"],type:"object"},LcmSummaryConvergenceStateV1:{enum:["pending","retryable","current","unavailable","permanent"],type:"string"},LcmSummaryConvergenceStatusV1:{additionalProperties:!1,description:"Retained-session summary convergence queue: disjoint per-state session\ncounts and the reasons parked or failed sessions record.",properties:{current_session_count:{format:"int64",type:"integer"},pending_session_count:{format:"int64",type:"integer"},permanent_session_count:{format:"int64",type:"integer"},reasons:{items:{$ref:"#/$defs/LcmSummaryConvergenceReasonV1"},type:"array"},retryable_session_count:{format:"int64",type:"integer"},unavailable_session_count:{format:"int64",type:"integer"}},required:["pending_session_count","retryable_session_count","current_session_count","unavailable_session_count","permanent_session_count","reasons"],type:"object"},RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{authority_outcome:{anyOf:[{$ref:"#/$defs/LcmAuthorityOutcomeV1"},{type:"null"}]},deep:{type:["boolean","null"]},lcm:{anyOf:[{$ref:"#/$defs/LcmStatusV1"},{type:"null"}]},message:{type:["string","null"]},projection:{anyOf:[{$ref:"#/$defs/LcmDoctorProjectionV1"},{type:"null"}],description:"The store's refresh-worker serving and convergence state. Absent when\nno refresh worker serves the store."},provider:{type:["string","null"]},reason:{type:["string","null"]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"}},required:["status"],title:"LcmStatusResultV1",type:"object"},{$defs:{MemoryScopeV1:_u,ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{memory_scope:{anyOf:[{$ref:"#/$defs/MemoryScopeV1"},{type:"null"}]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]}},title:"MemoryStatusRequestV1",type:"object"},{$defs:{FactCommitOwnerV1:yM,MemoryAlgebraV1:{additionalProperties:!1,properties:{estimated_capacity:{description:"Heuristic D / ln(D) count of bound items one vector can superpose\nbefore cosine similarity degrades. Each fact has its own vector, so\nthis is neither a limit on stored facts nor a recall guarantee.",format:"uint64",minimum:0,type:"integer"},hrr_dim:{description:"Width of each encoded vector.",format:"uint64",minimum:0,type:"integer"},name:{description:"Vector algebra the fact encodings use. Current daemons report `map_c`;\nearlier releases reported `amari_fhrr` for the same encoding.",type:"string"}},required:["name","hrr_dim","estimated_capacity"],type:"object"},MemoryFeedbackFunnelV1:{additionalProperties:!1,properties:{access_count_total:{format:"uint64",minimum:0,type:"integer"},feedback_total:{format:"uint64",minimum:0,type:"integer"},rated_fact_count:{format:"uint64",minimum:0,type:"integer"},retrieval_count_total:{format:"uint64",minimum:0,type:"integer"},retrieved_fact_count:{format:"uint64",minimum:0,type:"integer"},seen_to_feedback_ratio:{format:"uint64",minimum:0,type:["integer","null"]}},required:["retrieval_count_total","access_count_total","retrieved_fact_count","rated_fact_count","feedback_total"],type:"object"},MemoryStatusV1:{additionalProperties:!1,properties:{algebra:{$ref:"#/$defs/MemoryAlgebraV1"},below_default_recall_threshold_count:{format:"uint64",minimum:0,type:"integer"},entity_count:{format:"uint64",minimum:0,type:"integer"},fact_count:{format:"uint64",minimum:0,type:"integer"},feedback_funnel:{$ref:"#/$defs/MemoryFeedbackFunnelV1"},helpful_count:{format:"uint64",minimum:0,type:"integer"},owner:{$ref:"#/$defs/FactCommitOwnerV1"},trust_025_050_count:{format:"uint64",minimum:0,type:"integer"},trust_050_075_count:{format:"uint64",minimum:0,type:"integer"},trust_075_100_count:{format:"uint64",minimum:0,type:"integer"},trust_0_025_count:{format:"uint64",minimum:0,type:"integer"},unhelpful_count:{format:"uint64",minimum:0,type:"integer"}},required:["owner","fact_count","entity_count","algebra","trust_0_025_count","trust_025_050_count","trust_050_075_count","trust_075_100_count","below_default_recall_threshold_count","helpful_count","unhelpful_count","feedback_funnel"],type:"object"},ProjectId:_4},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{memory:{$ref:"#/$defs/MemoryStatusV1"}},required:["memory"],title:"MemoryStatusResultV1",type:"object"},{$defs:{MessageRelationshipScopeV1:_m,MessageTypeFilterV1:_f,ProjectId:_4,RetainedTimeFilterV1:vq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_message_search`.",properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},cursor:{type:["string","null"]},goals:{default:!1,type:"boolean"},include_subagents:{type:["boolean","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},message_type:{anyOf:[{$ref:"#/$defs/MessageTypeFilterV1"},{type:"null"}]},parent_session_id:{type:["string","null"]},project_key:{type:["string","null"]},project_selector:{additionalProperties:!1,description:'Exact registered-project selector. Reads and fact effects run against the\nselected project.\n\nInlined so every request schema advertises the closed selector contract\n(`required: ["project_id"]`, no additional properties) directly on its\n`project_selector` property instead of behind a `$defs` reference, matching\nthe selector shape the MCP dispatch policy promises for selector-accepting\ntools.',properties:{project_id:{$ref:"#/$defs/ProjectId"}},required:["project_id"],type:["object","null"]},provider:{type:["string","null"]},query:{type:["string","null"]},require_fresh:{description:"Freshness precondition: stale or partial coverage returns\n`refresh_required` instead of stored evidence. The read never refreshes.",type:["boolean","null"]},scope:{anyOf:[{$ref:"#/$defs/MessageRelationshipScopeV1"},{type:"null"}]},since:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},until:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},workflow_agent:{type:["string","null"]},workflow_run:{type:["string","null"]},worktree:{type:["string","null"]}},title:"MessageSearchRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,GitScopeV1:gE,HydrationStateResultV1:gG,MessageSearchHitV1:{additionalProperties:!1,properties:{message:{$ref:"#/$defs/SessionMessageV1"},project_id:{type:["string","null"]},root:{type:["string","null"]},score:{format:"double",type:"number"},session:{$ref:"#/$defs/SessionRecordV1"}},required:["session","message","score"],type:"object"},RetainedErrorV1:vV,RetainedNextActionV1:{additionalProperties:!1,properties:{action:{type:"string"},kind:{type:"string"},reason:{type:"string"},tool:{type:"string"}},required:["kind","tool","action","reason"],type:"object"},RetainedOutcomeStatusV1:vR,RetrievalWorkerStatusV1:vT,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionMessageV1:{additionalProperties:!1,properties:{kind:{type:["string","null"]},message_id:{type:"string"},metadata_json:{type:["string","null"]},model:{type:["string","null"]},ordinal:{format:"int64",type:"integer"},provider:{type:"string"},role:{type:"string"},session_id:{type:"string"},source_offset:{format:"int64",type:["integer","null"]},source_path:{type:["string","null"]},text:{type:"string"},timestamp:{format:"int64",type:["integer","null"]},tool_names:{type:["string","null"]}},required:["provider","message_id","session_id","role","ordinal","text"],type:"object"},SessionRecordV1:{additionalProperties:!1,properties:{agent_id:{type:["string","null"]},ended_at:{format:"int64",type:["integer","null"]},is_subagent:{type:"boolean"},metadata_json:{type:["string","null"]},parent_session_id:{type:["string","null"]},parent_tool_use_id:{type:["string","null"]},project_key:{type:"string"},project_path:{type:"string"},provider:{type:"string"},session_id:{type:"string"},started_at:{format:"int64",type:["integer","null"]},title:{type:["string","null"]},transcript_path:{type:["string","null"]}},required:["provider","session_id","project_key","project_path","is_subagent"],type:"object"},SessionSourceCoverageV1:bn,TemporalCoverageOmissionV1:{oneOf:[{properties:{detail:{type:"string"},kind:{const:"root_continuation_unavailable",type:"string"},strict_population:{$ref:"#/$defs/TemporalPopulationCountV1"}},required:["kind","strict_population","detail"],type:"object"}]},TemporalCoverageV1:bO,TemporalExplanationV1:bE,TemporalFreshnessV1:bA,TemporalMetadataV1:{additionalProperties:!1,properties:{anchors:{items:{type:"string"},type:"array"},coverage:{$ref:"#/$defs/TemporalCoverageV1"},coverage_omissions:{items:{$ref:"#/$defs/TemporalCoverageOmissionV1"},type:"array"},explanations:{items:{$ref:"#/$defs/TemporalExplanationV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/TemporalFreshnessV1"},{type:"null"}]},next_cursor:{type:["string","null"]},omissions:{items:{$ref:"#/$defs/TemporalOmissionV1"},type:"array"},source_coverage:{items:{$ref:"#/$defs/SessionSourceCoverageV1"},type:"array"},watermarks:{$ref:"#/$defs/TemporalWatermarksV1"}},required:["anchors","watermarks","coverage","explanations"],type:"object"},TemporalModeV1:bW,TemporalOmissionV1:bM,TemporalPopulationCountV1:{oneOf:[{properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{const:"exact",type:"string"}},required:["kind","count"],type:"object"},{properties:{count:{format:"uint64",minimum:0,type:"integer"},kind:{const:"at_least",type:"string"}},required:["kind","count"],type:"object"}]},TemporalWatermarksV1:bN,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},git_filter:{anyOf:[{$ref:"#/$defs/GitScopeV1"},{type:"null"}]},git_filter_applied:{type:["boolean","null"]},goals:{type:"boolean"},include_subagents:{type:"boolean"},message:{type:["string","null"]},message_type:{type:"string"},next_action:{anyOf:[{$ref:"#/$defs/RetainedNextActionV1"},{type:"null"}]},omitted:{format:"uint64",minimum:0,type:["integer","null"]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},parent_session_id:{type:["string","null"]},project_key:{type:["string","null"]},provider:{type:"string"},query:{type:["string","null"]},refresh_required:{type:"boolean"},requested_provider:{type:["string","null"]},require_fresh:{type:"boolean"},results:{items:{$ref:"#/$defs/MessageSearchHitV1"},type:["array","null"]},scope:{type:"string"},service_status:{anyOf:[{$ref:"#/$defs/RetrievalWorkerStatusV1"},{type:"null"}]},since:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},store_scope:{type:["string","null"]},temporal:{anyOf:[{$ref:"#/$defs/TemporalMetadataV1"},{type:"null"}]},until:{format:"int64",type:["integer","null"]},workflow_agent:{type:["string","null"]},workflow_filter_applied:{type:["boolean","null"]},workflow_run:{type:["string","null"]},workflow_run_parent_session:{type:["string","null"]}},required:["require_fresh","goals","include_subagents","message_type","outcome","provider","refresh_required","scope","status"],title:"MessageSearchResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{path:{type:"string"}},required:["path"],title:"ModuleApiPrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{path:{type:"string"},symbols:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"}},required:["path","symbols"],title:"ModuleApiPrimitiveResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_move_symbol`.",properties:{dest_file:{type:"string"},dry_run:{default:!0,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},symbol:{type:"string"}},required:["symbol","dest_file"],title:"MoveSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_multi_str_replace`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},path:{type:"string"},replacements:{description:"Ordered `[old, new]` pairs, matching the existing MCP tool wire form.",items:{maxItems:2,minItems:2,prefixItems:[{type:"string"},{type:"string"}],type:"array"},type:"array"},verify:{default:!1,type:"boolean"}},required:["path","replacements"],title:"MultiStrReplaceSurfaceRequestV1",type:"object"},{$defs:{NativeIntegrationTransactionId:_T},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{transaction_id:{$ref:"#/$defs/NativeIntegrationTransactionId"}},required:["transaction_id"],title:"NativeIntegrationStatusSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{node_id:{type:"string"}},required:["node_id"],title:"NodeSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComplexityAnalysisV1:hx,NodeDetailsV1:{additionalProperties:!1,properties:{branches:{description:"Exact counters; `None`, and listed in `unavailable_fields`, when\n`complexity_analysis` reports the bounded walk did not cover the body.",format:"uint32",minimum:0,type:["integer","null"]},complexity_analysis:{$ref:"#/$defs/ComplexityAnalysisV1"},cost_to_expand:{$ref:"#/$defs/NodeExpansionCostV1"},cyclomatic_complexity:{format:"uint32",minimum:0,type:["integer","null"]},derives:{items:{type:"string"},type:"array"},docstring:{type:["string","null"]},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},id:{type:"string"},is_async:{type:"boolean"},kind:{type:"string"},loops:{format:"uint32",minimum:0,type:["integer","null"]},max_nesting:{format:"uint32",minimum:0,type:["integer","null"]},name:{type:"string"},qualified_name:{type:"string"},signature:{type:["string","null"]},start_line:{format:"uint32",minimum:0,type:"integer"},unavailable_fields:{items:{type:"string"},type:"array"},visibility:{type:"string"}},required:["id","name","kind","qualified_name","file","start_line","end_line","is_async","derives","visibility","complexity_analysis","cost_to_expand","unavailable_fields"],type:"object"},NodeExpansionCostV1:_A,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveNotFoundV1:_Z,PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/NodeDetailsV1"},{$ref:"#/$defs/PrimitiveNotFoundV1"}],title:"NodeResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One project-scoped horizon for the canonical Observatory and Costs models.",properties:{window_days:{default:14,format:"uint16",maximum:365,minimum:1,type:"integer"}},title:"ObservatoryReadRequestV1",type:"object"},{$defs:{AnalyticsModeReadModelV1:fk,AnalyticsModeV1:fw,ComparisonDispositionV1:hI,CostsReadModelV1:yl,CoverageStateV1:yf,LatencyDistributionReadModelV1:gJ,MetricCalibrationV1:_h,MetricCohortV1:_y,MetricCoverageV1:_g,MetricEvidenceClassV1:__,MetricProvenanceV1:_v,MetricSourceV1:_b,MetricTemporalV1:_$,MetricUncertaintyV1:_S,MetricValueV1:_k,ObservabilityHorizonV1:_W,ObservatoryReadModelV1:_N,PerformanceComparisonReadModelV1:_H,ProviderLatencyReadModelV1:vn,RejectedArgumentAnalyticsV1:vh,RejectedArgumentErrorClassV1:vy,RejectedArgumentGroupV1:vg,RejectedArgumentNameV1:v_,RejectedArgumentSurfaceV1:vv},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical project-scoped observability and costs read models.",properties:{costs:{$ref:"#/$defs/CostsReadModelV1"},observatory:{$ref:"#/$defs/ObservatoryReadModelV1"}},required:["observatory","costs"],title:"ObservatoryReadResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kinds:{items:{type:"string"},type:["array","null"]},limit:{format:"uint32",minimum:0,type:["integer","null"]},source_dir:{type:"string"}},required:["source_dir"],title:"PortOrderSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PortCycleAnchorV1:{additionalProperties:!1,properties:{file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},rationale:{type:["string","null"]}},required:["name","file","line"],type:"object"},PortCycleFileV1:{additionalProperties:!1,properties:{file:{type:"string"},members_in_cycle:{format:"uint",minimum:0,type:"integer"}},required:["file","members_in_cycle"],type:"object"},PortCycleSymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},in_cycle_in_degree:{format:"uint",minimum:0,type:"integer"},in_cycle_out_degree:{format:"uint",minimum:0,type:"integer"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line","in_cycle_out_degree","in_cycle_in_degree"],type:"object"},PortCycleV1:{additionalProperties:!1,properties:{break_point_candidate:{anyOf:[{$ref:"#/$defs/PortCycleAnchorV1"},{type:"null"}]},entry_point:{anyOf:[{$ref:"#/$defs/PortCycleAnchorV1"},{type:"null"}]},files:{items:{$ref:"#/$defs/PortCycleFileV1"},type:"array"},note:{type:"string"},size:{format:"uint",minimum:0,type:"integer"},symbols:{items:{$ref:"#/$defs/PortCycleSymbolV1"},type:"array"}},required:["size","files","symbols","note"],type:"object"},PortOrderLevelV1:{additionalProperties:!1,properties:{description:{type:"string"},level:{format:"uint",minimum:0,type:"integer"},symbols:{items:{$ref:"#/$defs/PortOrderSymbolV1"},type:"array"}},required:["level","description","symbols"],type:"object"},PortOrderSymbolV1:{additionalProperties:!1,properties:{depends_on:{items:{type:"string"},type:["array","null"]},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycles:{items:{$ref:"#/$defs/PortCycleV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},levels:{items:{$ref:"#/$defs/PortOrderLevelV1"},type:"array"},returned:{format:"uint",minimum:0,type:"integer"},source_dir:{type:"string"},total_symbols:{format:"uint",minimum:0,type:"integer"}},required:["source_dir","total_symbols","returned","levels","cycles"],title:"PortOrderResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kinds:{items:{type:"string"},type:["array","null"]},source_dir:{type:"string"},target_dir:{type:"string"}},required:["source_dir","target_dir"],title:"PortStatusSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PortMatchedSymbolV1:{additionalProperties:!1,properties:{name:{type:"string"},source_file:{type:"string"},source_kind:{type:"string"},target_file:{type:"string"},target_kind:{type:"string"}},required:["name","source_kind","target_kind","source_file","target_file"],type:"object"},PortTargetOnlySymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line"],type:"object"},PortUnmatchedSymbolV1:{additionalProperties:!1,properties:{kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","line"],type:"object"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage_percent:{format:"double",type:"number"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},matched:{format:"uint",minimum:0,type:"integer"},matched_symbols:{items:{$ref:"#/$defs/PortMatchedSymbolV1"},type:"array"},source_count:{format:"uint",minimum:0,type:"integer"},source_dir:{type:"string"},target_count:{format:"uint",minimum:0,type:"integer"},target_dir:{type:"string"},target_only:{format:"uint",minimum:0,type:"integer"},target_only_symbols:{items:{$ref:"#/$defs/PortTargetOnlySymbolV1"},type:"array"},unmatched:{format:"uint",minimum:0,type:"integer"},unmatched_by_file:{additionalProperties:{items:{$ref:"#/$defs/PortUnmatchedSymbolV1"},type:"array"},type:"object"}},required:["source_dir","target_dir","source_count","target_count","matched","unmatched","target_only","coverage_percent","unmatched_by_file","matched_symbols","target_only_symbols"],title:"PortStatusResultV1",type:"object"},{$defs:{PrContextViewV1:_G},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{base_ref:{description:"Base branch or ref (default: the matching retained PR base, otherwise\nthe detected repository default branch). A short branch name selects the descendant of its\nlocal and origin tracking tips; use an explicit ref when they diverge.",type:["string","null"]},budget_tokens:{description:"Approximate whole-result JSON token budget for the brief (default: 4000).\nIn symbols view, budgets the existing symbol, test, and module sections.",format:"uint32",minimum:0,type:["integer","null"]},cursor:{description:"Authenticated continuation cursor; accepted only with view `symbols`.",type:["string","null"]},head_ref:{description:"Head branch or ref (default: 'HEAD'). Accepts local branches,\nremote-tracking refs such as origin/topic, full refs, and Git revision\nexpressions.",type:["string","null"]},maximum_symbols:{description:"Maximum symbols returned on a symbols-view page (default: 200, clamped to 1-500).",format:"uint32",minimum:0,type:["integer","null"]},pull_request:{description:"Select a retained PR number for this checkout when several are known.",format:"uint64",minimum:0,type:["integer","null"]},refresh_github:{default:!1,description:"Explicitly refresh the configured matching GitHub PR within the caller\ndeadline. By default, read retained authorized evidence. CI stays retained.",type:"boolean"},view:{$ref:"#/$defs/PrContextViewV1",default:"brief",description:"Compact PR briefing by default; `symbols` requests exact symbol pages."}},title:"PrContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hf,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ConfigSummaryKindV1:hT,ConfigSummaryV1:hO,GitCommitSubjectV1:{additionalProperties:!1,properties:{hash:{type:"string"},subject:{type:"string"}},required:["hash","subject"],type:"object"},GitComparedSymbolV1:gy,GitContextSymbolV1:g_,GitFileChangeStatusV1:{enum:["added","deleted","modified"],type:"string"},GitFileChangeV1:{additionalProperties:!1,properties:{path:{type:"string"},status:{$ref:"#/$defs/GitFileChangeStatusV1"}},required:["path","status"],type:"object"},GitFileRoleV1:gS,GitReadCompleteV1:gj,GitReadPartialV1:gC,GitReadUnavailableV1:gT,GitToolErrorKindV1:gW,GitToolErrorV1:gM,GitToolFailureV1:gN,GitToolOperationV1:gz,MissingCoChangePartnerV1:_w,PrAnalysisCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},direct_call_edges_admitted:{format:"uint",minimum:0,type:"integer"},impact_bytes_admitted:{format:"uint",minimum:0,type:"integer"},impact_nodes_admitted:{format:"uint",minimum:0,type:"integer"},impact_nodes_returned:{format:"uint",minimum:0,type:"integer"},impact_partial:{type:"boolean"},seed_symbols_analyzed:{format:"uint",minimum:0,type:"integer"},symbols_complete:{type:"boolean"},symbols_returned:{format:"uint",minimum:0,type:"integer"}},required:["seed_symbols_analyzed","symbols_returned","symbols_complete","impact_nodes_admitted","impact_nodes_returned","direct_call_edges_admitted","impact_bytes_admitted","impact_partial","complete"],type:"object"},PrContextAreaV1:{additionalProperties:!1,properties:{additions:{format:"uint64",minimum:0,type:"integer"},area:{type:"string"},deletions:{format:"uint64",minimum:0,type:"integer"},files:{format:"uint",minimum:0,type:"integer"}},required:["area","files","additions","deletions"],type:"object"},PrContextBriefBudgetV1:{additionalProperties:!1,properties:{areas_omitted:{format:"uint",minimum:0,type:"integer"},checks_omitted:{format:"uint",minimum:0,type:"integer"},commits_omitted:{format:"uint",minimum:0,type:"integer"},discussions_omitted:{format:"uint",minimum:0,type:"integer"},entry_points_omitted:{format:"uint",minimum:0,type:"integer"},estimated_tokens:{description:"Whole-result JSON byte estimate, divided by four; not a tokenizer count.",format:"uint32",minimum:0,type:"integer"},files_omitted:{format:"uint",minimum:0,type:"integer"},impact_omitted:{format:"uint",minimum:0,type:"integer"},over_budget:{type:"boolean"},quality_omitted:{format:"uint",minimum:0,type:"integer"},requested_tokens:{format:"uint32",minimum:0,type:"integer"}},required:["requested_tokens","estimated_tokens","over_budget","files_omitted","entry_points_omitted","discussions_omitted","checks_omitted","impact_omitted","commits_omitted","areas_omitted","quality_omitted"],type:"object"},PrContextBriefV1:{additionalProperties:!1,properties:{additions:{format:"uint64",minimum:0,type:"integer"},areas:{items:{$ref:"#/$defs/PrContextAreaV1"},type:"array"},base:{type:"string"},base_oid:{type:"string"},budget:{$ref:"#/$defs/PrContextBriefBudgetV1"},changes:{items:{$ref:"#/$defs/PrContextFileV1"},type:"array"},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},deletions:{format:"uint64",minimum:0,type:"integer"},entry_points:{description:"Prioritized places to begin reading the change, with exact revisions.",items:{$ref:"#/$defs/PrContextEntryPointV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}]},graph_analysis:{$ref:"#/$defs/PrContextSourceV1"},head:{type:"string"},head_oid:{type:"string"},hosted:{$ref:"#/$defs/PrContextHostedV1"},impact:{items:{$ref:"#/$defs/PrContextImpactV1"},type:"array"},merge_base:{type:"string"},next_steps:{items:{type:"string"},type:"array"},quality:{items:{$ref:"#/$defs/PrContextQualityV1"},type:"array"},source_analysis:{$ref:"#/$defs/PrContextSourceV1"},view:{$ref:"#/$defs/PrContextViewV1"}},required:["view","base","head","base_oid","head_oid","merge_base","files_changed","additions","deletions","commits","hosted","areas","changes","entry_points","impact","quality","source_analysis","graph_analysis","next_steps","budget"],type:"object"},PrContextCheckV1:{additionalProperties:!1,properties:{conclusion:{type:["string","null"]},evidence_anchor:{type:"string"},failed_step:{type:["string","null"]},head:{type:"string"},locations:{items:{$ref:"#/$defs/PrContextLocationV1"},type:"array"},matches_head:{type:"boolean"},name:{type:"string"},observed_at:{format:"int64",type:"integer"},status:{type:"string"},workflow:{type:"string"}},required:["name","workflow","status","head","matches_head","observed_at","evidence_anchor","locations"],type:"object"},PrContextCompleteV1:{additionalProperties:!1,properties:{added:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},affected_tests:{items:{type:"string"},type:"array"},affected_tests_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},analysis_coverage:{$ref:"#/$defs/PrAnalysisCoverageV1"},base:{type:"string"},base_oid:{type:"string"},changes:{items:{$ref:"#/$defs/GitFileChangeV1"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_generation:{type:"string"},head:{type:"string"},head_oid:{type:"string"},impacted_modules:{items:{type:"string"},type:"array"},impacted_modules_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},merge_base:{type:"string"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},next_cursor:{type:["string","null"]},removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},status:{$ref:"#/$defs/GitReadCompleteV1"},symbol_changes_coverage:{$ref:"#/$defs/PrSymbolChangesCompleteV1"},symbol_page:{$ref:"#/$defs/PrSymbolPageV1"},symbols_added:{format:"uint",minimum:0,type:"integer"},symbols_modified:{format:"uint",minimum:0,type:"integer"},symbols_removed:{format:"uint",minimum:0,type:"integer"},test_files_changed:{items:{type:"string"},type:"array"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."}},required:["status","base","head","base_oid","head_oid","merge_base","graph_generation","commits","files_changed","changes","missing_co_change_partners","symbols_added","symbols_removed","symbols_modified","added","removed","modified","symbol_changes_coverage","symbol_page","analysis_coverage","test_files_changed","affected_tests","affected_tests_coverage","impacted_modules","impacted_modules_coverage"],type:"object"},PrContextDiscussionV1:{additionalProperties:!1,properties:{author:{description:"Provider login when retained; an opaque author anchor is not a login.",type:["string","null"]},body_anchor:{type:["string","null"]},event_at:{description:"Provider activity time in UTC microseconds: comment update/creation or\nreview submission. Absent when not retained or not parseable.",format:"int64",type:["integer","null"]},file:{type:["string","null"]},id:{type:"string"},kind:{type:"string"},lifecycle:{type:"string"},line:{format:"uint64",minimum:0,type:["integer","null"]},matches_head:{type:"boolean"},observed_at:{format:"int64",type:"integer"},review_state:{type:"string"},text:{type:["string","null"]},text_truncated:{type:"boolean"},thread_id:{type:["string","null"]},url:{type:["string","null"]}},required:["id","kind","lifecycle","review_state","text_truncated","observed_at","matches_head"],type:"object"},PrContextEntryPointV1:{additionalProperties:!1,properties:{after_excerpt:{anyOf:[{$ref:"#/$defs/PrContextExcerptV1"},{type:"null"}]},after_signature:{type:["string","null"]},after_signature_truncated:{default:!1,type:"boolean"},before_excerpt:{anyOf:[{$ref:"#/$defs/PrContextExcerptV1"},{type:"null"}]},before_signature:{type:["string","null"]},before_signature_truncated:{default:!1,type:"boolean"},change:{type:"string"},location:{$ref:"#/$defs/PrContextLocationV1"},node_id:{description:"Exact-head graph occurrence accepted by source_body and impact.\nAbsent when graph provenance or declaration matching is unavailable.",type:["string","null"]},reason:{type:"string"},revision:{type:"string"},symbol:{type:"string"}},required:["location","revision","symbol","change","reason"],type:"object"},PrContextExcerptV1:{additionalProperties:!1,properties:{location:{$ref:"#/$defs/PrContextLocationV1"},revision:{type:"string"},text:{type:"string"},truncated:{description:"True when this is only an excerpt of the declaration.",type:"boolean"}},required:["revision","location","text","truncated"],type:"object"},PrContextFileV1:{additionalProperties:!1,properties:{additions:{format:"uint32",minimum:0,type:["integer","null"]},change:{type:"string"},deletions:{format:"uint32",minimum:0,type:["integer","null"]},file:{type:"string"},previous_file:{type:["string","null"]},role:{$ref:"#/$defs/GitFileRoleV1"}},required:["file","change","role"],type:"object"},PrContextGraphPendingV1:{additionalProperties:!1,description:"The git comparison while the verified graph generation is still warming.",properties:{added:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},affected_tests:{items:{type:"string"},type:"array"},affected_tests_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},analysis_coverage:{$ref:"#/$defs/PrAnalysisCoverageV1"},base:{type:"string"},base_oid:{type:"string"},changes:{items:{$ref:"#/$defs/GitFileChangeV1"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_generation:{description:"No verified generation was admitted.",type:["string","null"]},head:{type:"string"},head_oid:{type:"string"},impacted_modules:{items:{type:"string"},type:"array"},impacted_modules_coverage:{$ref:"#/$defs/PrSelectionCoverageV1"},merge_base:{type:"string"},message:{type:"string"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},next_cursor:{type:["string","null"]},status:{$ref:"#/$defs/GitReadPartialV1"},symbol_page:{$ref:"#/$defs/PrSymbolPageV1"},symbols_added:{format:"uint",minimum:0,type:"integer"},symbols_modified:{format:"uint",minimum:0,type:"integer"},test_files_changed:{items:{type:"string"},type:"array"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."},verified_graph_evidence:{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"}},required:["status","message","base","head","base_oid","head_oid","merge_base","commits","files_changed","changes","missing_co_change_partners","symbols_added","symbols_modified","added","modified","symbol_page","analysis_coverage","test_files_changed","affected_tests","affected_tests_coverage","impacted_modules","impacted_modules_coverage","verified_graph_evidence"],type:"object"},PrContextHostedV1:{additionalProperties:!1,properties:{checks:{items:{$ref:"#/$defs/PrContextCheckV1"},type:"array"},checks_total:{format:"uint",minimum:0,type:"integer"},ci_source:{$ref:"#/$defs/PrContextSourceV1"},discussions:{items:{$ref:"#/$defs/PrContextDiscussionV1"},type:"array"},discussions_total:{format:"uint",minimum:0,type:"integer"},pull_request:{anyOf:[{$ref:"#/$defs/PrContextPullRequestV1"},{type:"null"}]},required_checks_known:{description:"A retained CI inventory is not an enumeration of required checks.",type:"boolean"},source:{$ref:"#/$defs/PrContextSourceV1"}},required:["source","ci_source","discussions","checks","discussions_total","checks_total","required_checks_known"],type:"object"},PrContextImpactV1:{additionalProperties:!1,properties:{changed_symbol:{type:"string"},consumer:{type:"string"},consumer_changed:{description:"Whether the consumer's file is in the PR diff; this does not imply\nthat the consumer declaration itself changed.",type:"boolean"},location:{$ref:"#/$defs/PrContextLocationV1"},node_id:{description:"Exact-head consumer occurrence accepted by source_body and impact.",type:["string","null"]},relation:{type:"string"}},required:["changed_symbol","consumer","location","relation","consumer_changed"],type:"object"},PrContextLocationV1:{additionalProperties:!1,properties:{end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"}},required:["file","line","end_line"],type:"object"},PrContextPullRequestV1:{additionalProperties:!1,properties:{description:{description:"Sanitized retained description, when the provider supplied it.",type:["string","null"]},description_truncated:{type:"boolean"},draft:{type:"boolean"},matches_head:{type:"boolean"},number:{format:"uint64",minimum:0,type:"integer"},observed_at:{format:"int64",type:"integer"},observed_head:{type:"string"},state:{type:"string"},title:{type:"string"}},required:["number","title","state","draft","description_truncated","observed_head","observed_at","matches_head"],type:"object"},PrContextQualityV1:{additionalProperties:!1,properties:{observation:{type:"string"},signal:{type:"string"}},required:["signal","observation"],type:"object"},PrContextSourceStateV1:{enum:["ready","partial","stale","unavailable","not_published","denied","not_mounted","ambiguous","not_found"],type:"string"},PrContextSourceV1:{additionalProperties:!1,properties:{detail:{type:"string"},state:{$ref:"#/$defs/PrContextSourceStateV1"}},required:["state","detail"],type:"object"},PrContextSymbolsUnavailableV1:{additionalProperties:!1,description:"The git comparison while exact base/head symbol comparison is unavailable\nor does not describe the verified graph's head generation.",properties:{added:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},base:{type:"string"},base_oid:{type:"string"},changes:{items:{$ref:"#/$defs/GitFileChangeV1"},type:"array"},co_change_unavailable:{anyOf:[{$ref:"#/$defs/CoChangeUnavailableV1"},{type:"null"}],description:"Present when Git history could not be mined for co-change partners."},commits:{items:{$ref:"#/$defs/GitCommitSubjectV1"},type:"array"},files_changed:{format:"uint",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},graph_generation:{type:"string"},head:{type:"string"},head_oid:{type:"string"},merge_base:{type:"string"},message:{type:"string"},missing_co_change_partners:{description:"Files that usually change with a changed file, per bounded Git\nhistory, but are absent from this change set.",items:{$ref:"#/$defs/MissingCoChangePartnerV1"},type:"array"},modified:{items:{$ref:"#/$defs/PrSymbolEntryV1"},type:"array"},next_cursor:{type:["string","null"]},removed:{items:{$ref:"#/$defs/GitComparedSymbolV1"},type:"array"},status:{$ref:"#/$defs/GitReadPartialV1"},symbol_changes_coverage:{$ref:"#/$defs/SymbolChangesUnavailableV1"},symbols_added:{format:"uint",minimum:0,type:"integer"},symbols_modified:{format:"uint",minimum:0,type:"integer"},symbols_removed:{format:"uint",minimum:0,type:"integer"},token_budget:{anyOf:[{$ref:"#/$defs/TokenBudgetCutV1"},{type:"null"}],description:"Budget accounting when the request supplies `budget_tokens`."}},required:["status","message","base","head","base_oid","head_oid","merge_base","graph_generation","commits","files_changed","changes","missing_co_change_partners","symbols_added","symbols_removed","symbols_modified","added","removed","modified","symbol_changes_coverage"],type:"object"},PrContextViewV1:_G,PrCoverageSelectionV1:{enum:["unavailable","deterministic_bounded_prefix"],type:"string"},PrSelectionCoverageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},selection:{$ref:"#/$defs/PrCoverageSelectionV1"}},required:["complete","selection"],type:"object"},PrSymbolChangesCompleteV1:{additionalProperties:!1,properties:{base_generation:{type:"string"},head_generation:{type:"string"},status:{$ref:"#/$defs/GitReadCompleteV1"}},required:["status","base_generation","head_generation"],type:"object"},PrSymbolEntryV1:{anyOf:[{$ref:"#/$defs/GitContextSymbolV1"},{$ref:"#/$defs/ConfigSummaryV1"}]},PrSymbolPageV1:{additionalProperties:!1,properties:{complete:{type:"boolean"},continuation_available:{type:"boolean"},has_more:{type:"boolean"},limit:{format:"uint",minimum:0,type:"integer"},returned:{format:"uint",minimum:0,type:"integer"},selection:{$ref:"#/$defs/PrSymbolSelectionV1"}},required:["limit","returned","has_more","complete","selection","continuation_available"],type:"object"},PrSymbolSelectionV1:{enum:["unavailable","stable_prefix"],type:"string"},PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,PrimitiveUnavailableEvidenceV1:_0,PrimitiveUnavailableStatusV1:_2,SymbolChangesUnavailableV1:bV,TokenBudgetCutV1:bD,TokenBudgetSectionV1:bF},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/PrContextBriefV1"},{$ref:"#/$defs/PrContextCompleteV1"},{$ref:"#/$defs/PrContextSymbolsUnavailableV1"},{$ref:"#/$defs/PrContextGraphPendingV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"PrContextResultV1"},{$defs:{BranchStackEdgeV1:f3,BranchStackId:f9,BranchStackNodeV1:f5,BranchStackRevisionId:f8,BranchStackRevisionV1:f7,BranchStackSourceV1:he,CommitId:hq,ManifestDigest:_l,MechanicalIntegrationModeV1:_p,NativeIntegrationDirectionV1:_R,NativeIntegrationSealedStackSnapshotV1:_x,NativeIntegrationSelectionBindingV1:_j,ProjectId:_4,RefId:vm,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,StackNodeId:bw,WorktreeId:SB,WorktreeInventoryEpoch:SK,WorktreeInventorySnapshotId:SJ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Read-only preflight over one frozen snapshot identity.\n\n`preferred_mode` selects only one of the three fixed mechanical encodings.\nIt cannot change topology, commit order, or the commit set.",properties:{preferred_mode:{anyOf:[{$ref:"#/$defs/MechanicalIntegrationModeV1"},{type:"null"}],default:null},snapshot:{$ref:"#/$defs/NativeIntegrationSealedStackSnapshotV1"}},required:["snapshot"],title:"NativeIntegrationPreflightSurfaceRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{path:{description:"Project path or registered alias to resolve.",type:["string","null"]},project_selector:{additionalProperties:!1,default:null,description:"Registered project id to inspect. Omit to use path or the active\nproject.",properties:{project_id:{description:"Registered project id to query.",type:"string"}},required:["project_id"],type:"object"}},title:"ProjectContextSurfaceRequestV1",type:"object"},{$defs:{PublicCodeProject:va},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One registered project's context, or the registry's typed miss.",oneOf:[{additionalProperties:!1,properties:{aliases:{description:"Alias rows exactly as the registry serializes them.",items:!0,type:"array"},is_active:{type:"boolean"},project:{$ref:"#/$defs/PublicCodeProject"},registry_path:{type:"string"},status:{const:"ok",type:"string"},stores:{description:"Store rows exactly as the registry serializes them.",items:!0,type:"array"}},required:["status","is_active","registry_path","project","aliases","stores"],type:"object"},{additionalProperties:!1,description:"The registry answered and no registered project matches the selector.",properties:{aliases:{items:!0,type:"array"},project:{type:"null"},registry_path:{type:"string"},status:{const:"not_found",type:"string"},stores:{items:!0,type:"array"}},required:["status","registry_path","project","aliases","stores"],type:"object"}],title:"ProjectContextResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum projects to return (default: 25, max: 100).",format:"uint",minimum:0,type:["integer","null"]}},title:"ProjectListSurfaceRequestV1",type:"object"},{$defs:{ProjectRegistryEntry:_6,ProjectRegistrySummary:_3,ProjectRepoGroup:_9,PublicCodeProject:va},$schema:"https://json-schema.org/draft/2020-12/schema",description:"A bounded page of the profile's registered projects.",oneOf:[{additionalProperties:!1,properties:{limit:{format:"uint",minimum:0,type:"integer"},project_tree:{items:{$ref:"#/$defs/ProjectRepoGroup"},type:"array"},projects:{items:{$ref:"#/$defs/PublicCodeProject"},type:"array"},query:{type:["string","null"]},registry_path:{type:"string"},status:{const:"ok",type:"string"},summary:{$ref:"#/$defs/ProjectRegistrySummary"},title:{type:"string"},truncated:{type:"boolean"}},required:["status","title","registry_path","limit","truncated","summary","project_tree","projects"],type:"object"}],title:"ProjectRegistryListingResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum projects to return (default: 10, max: 50).",format:"uint",minimum:0,type:["integer","null"]},query:{description:"Case-insensitive substring query over registry project metadata.",type:"string"}},required:["query"],title:"ProjectSearchSurfaceRequestV1",type:"object"},{$defs:{PageRequest:_U},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{page:{$ref:"#/$defs/PageRequest"},qualified_name:{type:"string"}},required:["qualified_name","page"],title:"QualifiedNamePrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{next_cursor:{description:"Opaque resume token; its bounded string is the public wire form.",type:["string","null"]},symbols:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["symbols"],title:"QualifiedNamePrimitiveResult",type:"object"},{$defs:{RankDirectionV1:vc,RankEdgeKindV1:vl},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{anyOf:[{$ref:"#/$defs/RankDirectionV1"},{type:"null"}],description:"Edge direction: 'incoming' ranks targets (default, e.g.\nmost-implemented interface), 'outgoing' ranks sources (e.g. class that\nimplements the most interfaces)."},edge_kind:{$ref:"#/$defs/RankEdgeKindV1",description:"The relationship type to rank by (e.g. 'implements' to find\nmost-implemented interfaces)."},limit:{description:"Maximum number of results to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},node_kind:{description:"Optional filter for node kind (e.g. 'interface', 'class', 'trait',\n'function', 'method').",type:["string","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},required:["edge_kind"],title:"RankSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RankDirectionV1:vc,RankEdgeKindV1:vl,RankEntryV1:{additionalProperties:!1,properties:{count:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line","count"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{direction:{$ref:"#/$defs/RankDirectionV1"},edge_kind:{$ref:"#/$defs/RankEdgeKindV1"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},node_kind_filter:{type:["string","null"]},ranking:{items:{$ref:"#/$defs/RankEntryV1"},type:"array"},result_count:{format:"uint64",minimum:0,type:"integer"}},required:["edge_kind","direction","result_count","ranking"],title:"RankResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{limit:{description:"Maximum number of cycles to return (default: 10, at most 100).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path (e.g. 'src/main/java').",type:["string","null"]}},title:"RecursionSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RecursionCycleV1:{additionalProperties:!1,description:"One call cycle; `chain` repeats its first symbol at the end.",properties:{chain:{items:{$ref:"#/$defs/RecursionSymbolV1"},type:"array"},length:{format:"uint64",minimum:0,type:"integer"}},required:["length","chain"],type:"object"},RecursionSymbolV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","kind","file","line"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cycle_count:{format:"uint64",minimum:0,type:"integer"},cycles:{items:{$ref:"#/$defs/RecursionCycleV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."}},required:["cycle_count","cycles"],title:"RecursionResultV1",type:"object"},{$defs:{CommitId:hq,ProjectId:_4,ProviderId:vo,RedundancyScopeV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"repository",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"path",type:"string"},path:{type:"string"}},required:["kind","path"],type:"object"},{additionalProperties:!1,properties:{changed_paths:{items:{type:"string"},type:"array"},head_commit_id:{$ref:"#/$defs/CommitId"},kind:{const:"pull_request",type:"string"},provider:{$ref:"#/$defs/ProviderId"},pull_request_id:{type:"string"}},required:["kind","provider","pull_request_id","head_commit_id","changed_paths"],type:"object"}]},RepositoryId:vb,SimilarMatchClassV1:bc},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{type:["string","null"]},family_limit:{description:"Preferred family page size, 1 through 100.",format:"uint32",maximum:100,minimum:1,type:"integer"},include_generated_paths:{type:"boolean"},match_classes:{items:{$ref:"#/$defs/SimilarMatchClassV1"},type:"array"},member_limit:{description:"Members listed per family, at least 2.",format:"uint32",minimum:2,type:"integer"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},scope:{$ref:"#/$defs/RedundancyScopeV1"},work_limit:{description:"Clone-index work budget for this page, 3 through 10000. A page that\nexhausts it reports partial coverage.",format:"uint32",maximum:1e4,minimum:3,type:"integer"}},required:["project_id","repository_id","match_classes","scope","include_generated_paths","family_limit","member_limit","work_limit"],title:"RedundancySurfaceRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ManifestDigest:_l,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,ProjectId:_4,RedundancyCoverageV1:{oneOf:[{additionalProperties:!1,properties:{examined_families:{format:"uint",minimum:0,type:"integer"},examined_members:{format:"uint",minimum:0,type:"integer"},status:{const:"complete",type:"string"}},required:["status","examined_families","examined_members"],type:"object"},{additionalProperties:!1,properties:{examined_families:{format:"uint",minimum:0,type:"integer"},examined_members:{format:"uint",minimum:0,type:"integer"},reason:{$ref:"#/$defs/RedundancyPartialReasonV1"},status:{const:"partial",type:"string"}},required:["status","reason","examined_families","examined_members"],type:"object"}]},RedundancyFamilyV1:{additionalProperties:!1,properties:{family:{$ref:"#/$defs/SimilarFamilyV1"},generated_members:{items:{$ref:"#/$defs/SymbolOccurrenceId"},type:"array"},reviewable_source_bytes:{format:"uint64",minimum:0,type:"integer"},total_member_count:{format:"uint",minimum:0,type:"integer"}},required:["family","total_member_count","reviewable_source_bytes","generated_members"],type:"object"},RedundancyPartialReasonV1:{enum:["family_limit","work_limit"],type:"string"},RedundancyRankingV1:{enum:["reviewable_source_bytes"],type:"string"},RepositoryId:vb,SimilarFamilyV1:bd,SimilarMatchClassV1:bc,SimilarOccurrenceV1:bl,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/RedundancyCoverageV1"},families:{items:{$ref:"#/$defs/RedundancyFamilyV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},next_cursor:{type:["string","null"]},ranked_by:{$ref:"#/$defs/RedundancyRankingV1"},source_generation:{$ref:"#/$defs/CodeGenerationId"}},required:["source_generation","ranked_by","families","coverage"],title:"RedundancyResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,title:"RemoteStatusSurfaceRequestV1",type:"object"},{$defs:{AuthorityEpoch:{description:"Monotonic epoch of the writer authority for a shard.",format:"uint64",minimum:0,type:"integer"},BrainId:f1,BrainNodeId:{description:"Strongly typed canonical identity: `BrainNodeId`.",type:"string"},CurrentRemoteAuthorityStateV1:{description:"Truthful authority lookup state. Missing evidence is never represented as\nan available authority or a successful empty response.",oneOf:[{properties:{state:{const:"available",type:"string"},value:{$ref:"#/$defs/CurrentRemoteAuthorityV1"}},required:["state","value"],type:"object"},{properties:{state:{const:"partial",type:"string"},value:{properties:{known_fence:{anyOf:[{$ref:"#/$defs/RemoteWriterFenceV1"},{type:"null"}]},missing:{items:{$ref:"#/$defs/RemoteAuthorityUnavailableReasonV1"},type:"array",uniqueItems:!0},observed_at:{$ref:"#/$defs/UtcMicros"}},required:["missing","observed_at"],type:"object"}},required:["state","value"],type:"object"},{properties:{state:{const:"unavailable",type:"string"},value:{properties:{observed_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/RemoteAuthorityUnavailableReasonV1"}},required:["reason","observed_at"],type:"object"}},required:["state","value"],type:"object"}]},CurrentRemoteAuthorityV1:{additionalProperties:!1,description:"Authenticated current authority for a mutable shard.",properties:{credential_revision:{description:"Revision of the authority node's current enrollment credential.",format:"uint64",minimum:0,type:"integer"},fence:{$ref:"#/$defs/RemoteWriterFenceV1"},observed_at:{$ref:"#/$defs/UtcMicros"}},required:["fence","credential_revision","observed_at"],type:"object"},DoctorCoverageCompletenessV1:yk,ProjectionGenerationId:_5,RemoteAuthorityUnavailableReasonV1:{oneOf:[{enum:["registry_unavailable","placement_unknown","authority_unreachable","authority_authentication_failed","caller_authentication_failed","enrollment_expired","enrollment_revoked","insufficient_capability","scope_mismatch","fence_unverified","protocol_incompatible"],type:"string"},{const:"writer_authority_unpublished",description:"The RemoteNode store has never had a writer authority published for\nthis Brain, so no capture, replay, query, or failover can bind to one.",type:"string"}]},RemoteListenerReadV1:{enum:["serving","disabled","degraded"],type:"string"},RemoteOperationalReadinessV1:{enum:["unconfigured","partial","ready","recovery_required"],type:"string"},RemoteOperationalStatusV1:{additionalProperties:!1,properties:{authority:{$ref:"#/$defs/CurrentRemoteAuthorityStateV1"},enrollment_configured:{type:"boolean"},failover_in_progress:{type:"boolean"},observed_at:{$ref:"#/$defs/UtcMicros"},readiness:{$ref:"#/$defs/RemoteOperationalReadinessV1"},recovery_required:{type:"boolean"},replay_coverage_complete:{type:"boolean"},spool:{$ref:"#/$defs/RemoteSpoolOperationalStatusV1"}},required:["readiness","enrollment_configured","authority","spool","replay_coverage_complete","failover_in_progress","recovery_required","observed_at"],type:"object"},RemoteSpoolOperationalStatusV1:{additionalProperties:!1,properties:{has_sequence_gap:{type:"boolean"},pending_count:{format:"uint64",minimum:0,type:"integer"},quarantined_count:{format:"uint64",minimum:0,type:"integer"}},required:["pending_count","quarantined_count","has_sequence_gap"],type:"object"},RemoteWriterFenceV1:{additionalProperties:!1,description:"The complete single-writer identity for one mutable shard.",properties:{authority_epoch:{$ref:"#/$defs/AuthorityEpoch"},authority_node_id:{$ref:"#/$defs/BrainNodeId"},brain_id:{$ref:"#/$defs/BrainId"},generation_id:{$ref:"#/$defs/ProjectionGenerationId"},placement_revision:{format:"uint64",minimum:0,type:"integer"},shard_id:{$ref:"#/$defs/ShardId"}},required:["brain_id","shard_id","generation_id","placement_revision","authority_epoch","authority_node_id"],type:"object"},ShardId:{description:"Strongly typed canonical identity: `ShardId`.",type:"string"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Typed read of the Remote Brain operational plane as observed from the\nmounted daemon authorities. Every operator surface (Doctor, CLI, MCP,\ndashboard) reads this one shape; `Unavailable` is reserved for a genuinely\nunmounted or unreadable authority, never a rendering shortcut.",oneOf:[{properties:{coverage:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},kind:{const:"observed",type:"string"},listener:{$ref:"#/$defs/RemoteListenerReadV1"},status:{$ref:"#/$defs/RemoteOperationalStatusV1"}},required:["kind","listener","status","coverage"],type:"object"},{properties:{kind:{const:"unconfigured",type:"string"}},required:["kind"],type:"object"},{properties:{kind:{const:"unavailable",type:"string"}},required:["kind"],type:"object"}],title:"RemoteOperationalStatusReadV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{new_name:{type:["string","null"]},node_id:{type:"string"}},required:["node_id"],title:"RenamePreviewPrimitiveRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveNotFoundV1:_Z,PrimitiveSearchFreshnessV1:_X,PrimitiveSymbolLocationV1:_1,RenamePreviewNodeV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},qualified_name:{type:"string"},snippet:{type:["string","null"]}},required:["id","name","qualified_name","kind","file","line"],type:"object"},RenamePreviewPrimitiveResultV1:{additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},new_name:{type:["string","null"]},node:{$ref:"#/$defs/RenamePreviewNodeV1"},note:{type:"string"},read_only:{type:"boolean"},reference_count:{format:"uint",minimum:0,type:"integer"},references:{items:{$ref:"#/$defs/RenamePreviewReferenceV1"},type:"array"},symbol:{type:"string"},text_only_matches:{items:{$ref:"#/$defs/RenamePreviewTextOnlyMatchV1"},type:"array"}},required:["read_only","note","symbol","node","reference_count","references","text_only_matches"],type:"object"},RenamePreviewReferenceV1:{additionalProperties:!1,properties:{edge_kind:{type:"string"},file:{type:"string"},from_kind:{type:"string"},from_name:{type:"string"},from_node_id:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},snippet:{type:["string","null"]}},required:["from_node_id","from_name","from_kind","edge_kind","file","line"],type:"object"},RenamePreviewTextOnlyMatchV1:{additionalProperties:!1,properties:{file:{type:"string"},note:{type:"string"},text_only_count:{format:"uint",minimum:0,type:"integer"}},required:["file","text_only_count","note"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/RenamePreviewPrimitiveResultV1"},{$ref:"#/$defs/PrimitiveNotFoundV1"}],title:"RenamePreviewPrimitiveOutcomeV1"},{$defs:{ManifestDigest:_l,RenamePreviewAcceptanceV1:{additionalProperties:!1,description:"Exact preview material an apply must echo. Preview calls omit this value;\napply rejects any mismatch before publishing a file.",properties:{graph_revision:{$ref:"#/$defs/ManifestDigest"},plan_digest:{$ref:"#/$defs/ManifestDigest"},preview_digest:{$ref:"#/$defs/ManifestDigest"},preview_id:{$ref:"#/$defs/ManifestDigest"},repository_revision:{default:null,type:["string","null"]}},required:["preview_id","preview_digest","plan_digest","graph_revision"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_rename_symbol`.\n\nThe five identity fields consume the preview's exact symbol identity; the\nflattened control consumes its exact candidate-state digest.",properties:{accepted_preview:{anyOf:[{$ref:"#/$defs/RenamePreviewAcceptanceV1"},{type:"null"}],description:"Exact output identity from the accepted dry-run preview. Required when\n`dry_run=false` and omitted when computing a preview."},dry_run:{default:!0,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},file:{type:"string"},idempotency_key:{type:["string","null"]},kind:{type:"string"},new_name:{type:"string"},node_id:{description:"Canonical `SymbolOccurrenceId` returned by `tracedecay_rename_preview`.",type:"string"},old_name:{type:"string"},qualified_name:{type:"string"},verify:{default:!0,type:"boolean"}},required:["node_id","qualified_name","kind","file","old_name","new_name"],title:"RenameSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_replace_symbol`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},new_source:{type:"string"},symbol:{type:"string"},verify:{default:!1,type:"boolean"}},required:["symbol","new_source"],title:"ReplaceSymbolSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{handle:{description:"The required `handle` argument copied exactly from a truncated MCP\nresponse envelope.",type:"string"},max_chars:{description:"Maximum characters requested for this page. Values above the safe\nresponse-frame budget are clamped.",format:"uint64",minimum:1,type:["integer","null"]},offset:{default:0,description:"Character offset into the immutable stored response (default: 0). Use\nthe prior page's next_offset.",format:"uint64",minimum:0,type:["integer","null"]}},required:["handle"],title:"RetrieveSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,RetrieveHandleExpiredV1:{additionalProperties:!1,description:"The record expired and was removed.",properties:{content:{description:"Always null: the expired content was removed.",type:["string","null"]},created_at:{format:"int64",type:"integer"},expired:{description:"Always `true`.",type:"boolean"},expires_at:{format:"int64",type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},handle:{type:"string"},message:{type:"string"},reason_code:{type:"string"},retry_instruction:{type:"string"},retryable:{type:"boolean"}},required:["handle","expired","reason_code","message","retryable","retry_instruction","created_at","expires_at"],type:"object"},RetrieveHandleMissingV1:{additionalProperties:!1,description:"No record exists under the handle in this project's store.",properties:{content:{description:"Always null: nothing is stored under the handle.",type:["string","null"]},expired:{description:"Always null: an absent record has no expiry to report.",type:["boolean","null"]},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},handle:{type:"string"},message:{type:"string"},reason_code:{type:"string"},retry_instruction:{type:"string"},retryable:{type:"boolean"}},required:["handle","reason_code","message","retryable","retry_instruction"],type:"object"},RetrievedPageV1:{additionalProperties:!1,description:"One page of the stored response, sized so its response frame fits the\nresponse budget.",properties:{content:{type:"string"},created_at:{format:"int64",type:"integer"},expired:{description:"Always `false`: a page is only served from a live record.",type:"boolean"},expires_at:{format:"int64",type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},handle:{type:"string"},has_more:{type:"boolean"},next_offset:{description:"Where the next page starts; absent on the last page.",format:"uint64",minimum:0,type:["integer","null"]},offset:{format:"uint64",minimum:0,type:"integer"},original_chars:{format:"uint64",minimum:0,type:"integer"},total_chars:{format:"uint64",minimum:0,type:"integer"}},required:["handle","expired","original_chars","total_chars","offset","has_more","created_at","expires_at","content"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/RetrievedPageV1"},{$ref:"#/$defs/RetrieveHandleMissingV1"},{$ref:"#/$defs/RetrieveHandleExpiredV1"}],description:"What a retrieve found under the handle.",title:"RetrieveResultV1"},{$defs:{TestProfileV1:{description:"The cargo profile an affected-test run builds with.",enum:["debug","release"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{changed_paths:{description:"Explicit manifest of project-relative file paths used to compute\naffected tests.",items:{type:"string"},type:"array"},max_tests:{description:"Cap on tests dispatched in a single invocation, 1 through 500\n(default: 100).",format:"uint64",maximum:500,minimum:1,type:["integer","null"]},profile:{anyOf:[{$ref:"#/$defs/TestProfileV1"},{type:"null"}],description:"Cargo profile (default: debug)."},timeout_secs:{description:"Maximum wall time in seconds before the cargo subprocess is killed,\n1 through 300 (default: 300).",format:"uint64",maximum:300,minimum:1,type:["integer","null"]}},required:["changed_paths"],title:"RunAffectedTestsSurfaceRequestV1",type:"object"},{$defs:{AffectedTestErrorV1:{additionalProperties:!1,description:"Why a run failed or was refused.",properties:{kind:{type:"string"},message:{type:"string"},operation:{type:"string"}},required:["kind","operation","message"],type:"object"},AffectedTestOutcomeV1:{additionalProperties:!1,description:"One observed libtest outcome.",properties:{covers_source_ids:{description:"Graph symbols this test was selected to cover.",items:{type:"string"},type:"array"},passed:{type:"boolean"},test:{type:"string"}},required:["test","passed","covers_source_ids"],type:"object"},AffectedTestRunV1:{additionalProperties:!1,description:"A dispatched run, completed or failed, with what it observed.",properties:{dispatched_tests:{items:{type:"string"},type:"array"},error:{anyOf:[{$ref:"#/$defs/AffectedTestErrorV1"},{type:"null"}],description:"Present when the run did not complete."},exit_code:{format:"int32",type:["integer","null"]},failed:{format:"uint64",minimum:0,type:"integer"},ignored:{description:"Dispatched tests libtest reported as ignored.",format:"uint64",minimum:0,type:"integer"},passed:{format:"uint64",minimum:0,type:"integer"},results:{items:{$ref:"#/$defs/AffectedTestOutcomeV1"},type:"array"},stderr_tail:{type:"string"},stdout_tail:{type:"string"},terminal:{$ref:"#/$defs/ManagedTestTerminalV1"},total_observed:{format:"uint64",minimum:0,type:"integer"},truncated:{description:"More affected tests existed than `max_tests` admitted.",type:"boolean"}},required:["passed","failed","ignored","total_observed","dispatched_tests","truncated","results","stderr_tail","stdout_tail","terminal"],type:"object"},AffectedTestsNotRunV1:{additionalProperties:!1,description:"No test was dispatched: nothing covers the change, or the request was\nrefused before a run began.",properties:{error:{anyOf:[{$ref:"#/$defs/AffectedTestErrorV1"},{type:"null"}]},failed:{description:"Always 0.",format:"uint64",minimum:0,type:"integer"},note:{type:["string","null"]},passed:{description:"Always 0.",format:"uint64",minimum:0,type:"integer"},results:{description:"Always empty.",items:{$ref:"#/$defs/AffectedTestOutcomeV1"},type:"array"}},required:["passed","failed","results"],type:"object"},CancellationObservation:hn,CancellationStage:ha,Deadline:yv,ManagedTestTerminalV1:{additionalProperties:!1,description:"The managed test-run operation the run was recorded under.",properties:{operation_id:{type:"string"},receipt:{$ref:"#/$defs/OperationReceipt"},result_tool:{description:"The tool that reads the recorded results back.",type:"string"},session_id:{description:"The requesting session the run is recorded against; null when the\nrequest carried no session.",type:["string","null"]}},required:["operation_id","result_tool","receipt"],type:"object"},OperationBudgetUsage:_D,OperationReceipt:_F,OperationTermination:_L,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AffectedTestRunV1"},{$ref:"#/$defs/AffectedTestsNotRunV1"}],title:"RunAffectedTestsResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{authority_audit:{default:!1,description:"Run the exhaustive observation-authority audit and include\nauthority_audit_ok (true = audit ran and passed, false = audit ran and\nfailed, null = audit did not run or finish), authority_audit_reason\n(typed: authority_invariant_failed, authority_store_unavailable,\nauthority_store_missing, authority_audit_not_run,\nauthority_audit_budget_exceeded), and\nauthority_audit_error (observed detail) in database telemetry. Also\nincludes session-temporal health. Default false.",type:"boolean"},doctor_report:{default:!1,description:"Include the daemon-owned canonical Doctor report and typed per-table\ngrowth evidence. Default false.",type:"boolean"},session_ingest_health:{default:!1,description:"Include Cursor transcript-ingest health from the daemon-retained\nproject session authority. Default false.",type:"boolean"},session_temporal_health:{default:!1,description:"Include session-temporal health without the authority audit. Default\nfalse.",type:"boolean"},startup_health:{default:!1,description:"Ask a connection's first request for only the daemon-mounted database\nintegrity telemetry, for post-update startup validation; the daemon\ncore answers that probe before a project owner exists, and a project\nowner's snapshot already carries the same telemetry. Default false.",type:"boolean"}},title:"RuntimeSurfaceRequestV1",type:"object"},{$defs:{DoctorCoverageCompletenessV1:yk,DoctorCoverageStatementV1:{description:"A bounded, human-readable coverage statement plus its completeness.",properties:{completeness:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},statement:{type:"string"}},required:["completeness","statement"],type:"object"},DoctorEvidenceRefV1:{description:"A typed reference to one piece of evidence Doctor composed into a finding.\n\nThe `family` records which audited input surface produced the evidence, so\na finding may cross-cite evidence from more than one family without losing\nprovenance.",properties:{family:{$ref:"#/$defs/DoctorFindingFamilyV1"},reference:{$ref:"#/$defs/DoctorEvidenceReferenceV1"}},required:["family","reference"],type:"object"},DoctorEvidenceReferenceV1:{description:"Durable, non-disclosing reference to one owning-authority evidence\nrecord (for example a `FeedbackFindingId`, configuration revision, or\nruntime read coverage anchor). Doctor stores the reference only; the\nowning authority remains the single source of the record.",type:"string"},DoctorEvidenceStateV1:{description:"Exact Doctor evidence states.\n\nMissing, partial, or unknown truth never becomes healthy or clean. Only\n[`DoctorEvidenceStateV1::HealthyCompleteCoverage`] asserts a healthy result,\nand only when its finding carries complete coverage (see\n[`DoctorFindingV1::new`]).",oneOf:[{const:"unsupported",description:"The owning authority does not support this evidence on this platform.",type:"string"},{const:"absent",description:"The evidence source is supported but produced nothing.",type:"string"},{const:"stale",description:"The evidence exists but is behind the current generation/watermark.",type:"string"},{const:"degraded",description:"The evidence proves a degraded but observed condition.",type:"string"},{const:"partial",description:"Only part of the evidence was observed.",type:"string"},{const:"unknown",description:"The evidence state could not be determined.",type:"string"},{const:"denied",description:"Authorization to read the evidence was denied.",type:"string"},{const:"healthy_complete_coverage",description:"The evidence proves a healthy condition with complete coverage.",type:"string"}]},DoctorFamilyConsultationV1:{description:"Whether a family was consulted from an observed source or is unavailable.",oneOf:[{description:"A source produced observed evidence for this family.",properties:{status:{const:"consulted",type:"string"}},required:["status"],type:"object"},{description:"Complete family coverage was unavailable. Storage may still carry\nfindings from resolved producers when an independent producer failed.",properties:{reason:{$ref:"#/$defs/DoctorFamilyUnavailableReasonV1"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},DoctorFamilyCoverageV1:{description:"The consultation status of one finding family within a report.",properties:{consultation:{$ref:"#/$defs/DoctorFamilyConsultationV1"},family:{$ref:"#/$defs/DoctorFindingFamilyV1"}},required:["family","consultation"],type:"object"},DoctorFamilyUnavailableReasonV1:{description:"Why complete coverage of a finding family was unavailable.",oneOf:[{const:"unwired",description:"No source port is wired for this family in this composition.",type:"string"},{const:"unsupported",description:"The source is unsupported on this build/platform.",type:"string"},{const:"absent",description:"The source is supported but produced nothing.",type:"string"},{const:"denied",description:"The source read was denied.",type:"string"},{const:"unknown",description:"The source state could not be determined.",type:"string"},{const:"unavailable",description:"The source could not be reached. Named separately from `Unknown`: the\nsource is identified and its unreachability is an observation, not an\nundetermined state.",type:"string"},{const:"reset_required",description:"The source must be rebuilt before it can be read again.",type:"string"},{const:"corrupt",description:"The source was read and found corrupt.",type:"string"}]},DoctorFindingFamilyV1:{description:"Stable Doctor finding families.\n\nThe initial list covers advisory findings from\nBrain, Explorer, Loom, Code, and Observatory, plus the daemon\ncore doctor checks (graph quick-check, temporal health, configuration\ndrift, code-index mount state, session ingest).\nEach family maps to one audited typed input surface. The set is kept small\nand honest; new families are added through a future versioned enum rather\nthan by widening the meaning of an existing variant.",oneOf:[{const:"advisory",description:"advisory/scout findings (GitHub review, CI localization,\nproximity, context scout): `crate::advisory` / domain feedback.",type:"string"},{const:"configuration",description:"Desired-versus-effective configuration and compatibility drift from\n`ProjectConfigurationRuntime` / `ConfigurationControlPlane`.",type:"string"},{const:"storage_runtime",description:"Store, graph, and temporal runtime health plus migration coverage\n(`RuntimeReadOperationV1` health family, `StoreRuntimeClientLease`).",type:"string"},{const:"storage",description:"Storage retention, size, and efficiency over canonical observability\nread models. Distinct from [`Self::StorageRuntime`] health: this\nfamily surfaces over-budget stores, identity-drift orphans, incident\ndebris, and retention backlog. The typed\nsubclass vocabulary is [`DoctorStorageFindingKindV1`].",type:"string"},{const:"language_server",description:"Language-server / analyzer engine status from the LSP gateway's\n`AnalyzerState`.",type:"string"},{const:"code_index",description:"Code index mount state (mounted, indexing, stale, unmounted,\nincompatible, parked).",type:"string"},{const:"observability",description:"Denominator-safe measurement and telemetry health from analytics,\naccounting read models, and session ingest.",type:"string"},{const:"memory",description:"Retained daemon memory as the resident-memory inventory reports it:\nRSS against the admission limit and pressure line, and each retained\nowner's bytes.",type:"string"}]},DoctorFindingV1:{description:"One canonical Doctor finding.\n\nA finding pins its diagnosis `family`, its evidence `state`, the typed\nevidence it composed, and a coverage statement. Construction enforces the\ninvariants that keep unknown/partial evidence from collapsing into a\nhealthy or clean result.",properties:{coverage:{$ref:"#/$defs/DoctorCoverageStatementV1"},evidence:{items:{$ref:"#/$defs/DoctorEvidenceRefV1"},type:"array"},family:{$ref:"#/$defs/DoctorFindingFamilyV1"},state:{$ref:"#/$defs/DoctorEvidenceStateV1"}},required:["family","state","evidence","coverage"],type:"object"},DoctorReportCoverageV1:{description:"The report-wide coverage statement: which families were consulted versus\nunavailable, plus an overall completeness and a bounded human statement.",properties:{completeness:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},families:{items:{$ref:"#/$defs/DoctorFamilyCoverageV1"},type:"array"},statement:{$ref:"#/$defs/DoctorCoverageStatementV1"}},required:["families","completeness","statement"],type:"object"},DoctorReportEntryV1:{description:"One entry in a Doctor report: a canonical finding plus, for the storage\nfamily, its typed subclass. The subclass is present only for storage findings\n(a non-storage entry never carries one).",properties:{finding:{$ref:"#/$defs/DoctorFindingV1"},storage_kind:{anyOf:[{$ref:"#/$defs/DoctorStorageFindingKindV1"},{type:"null"}]}},required:["finding"],type:"object"},DoctorReportV1:{description:"One composed Doctor report.\n\nThe report carries one or more entries per family (findings are never merged\nby label) plus a coverage statement that enumerates every family consulted\nversus unavailable. Severity (the finding's evidence state) and evidence\nquality (coverage completeness) are kept as separate dimensions: a degraded\nfinding with complete coverage does not weaken report completeness, and only\ngenuinely complete coverage with every finding healthy makes the whole report\nassert health.",properties:{coverage:{$ref:"#/$defs/DoctorReportCoverageV1"},entries:{items:{$ref:"#/$defs/DoctorReportEntryV1"},type:"array"}},required:["entries","coverage"],type:"object"},DoctorStorageFindingKindV1:{description:"Typed subclasses of the [`DoctorFindingFamilyV1::Storage`] finding family.\n\nThe storage family never reports a silent overage: each subclass names one\nobservable retention/size condition Doctor surfaces over canonical size\nobservability read models. The set is closed and grows only through a future\nversioned enum, never by widening an existing subclass.",oneOf:[{const:"over_budget_store",description:"A store exceeds its owner-configured soft size budget.",type:"string"},{const:"orphan_store",description:"A store whose project identity no longer resolves to a live repository\nroot (identity-drift orphan), reported with age and size.",type:"string"},{const:"incident_debris_present",description:"Recovery/corruption artifacts are present beside a store and awaiting\ndeletion.",type:"string"},{const:"retention_backlog",description:"Retention-eligible rows or stores are past their window and awaiting\noffload/collection.",type:"string"},{const:"table_growth",description:"Per-table SQLite payload growth observed between two retained\nwatermarks, including baseline and unavailable measurement states.",type:"string"},{const:"schema_convergence_incomplete",description:"A store whose background schema convergence (the authority-invariant\naudit and projection retry re-arming that follow admission) has not\ncompleted: it is still pending, still running, or stopped on a failure.\nThe daemon serves meanwhile, so this is the surface that says which\nstore has not converged and why.",type:"string"},{const:"wal_checkpoint_pinned",description:"A store whose WAL checkpoint cannot restart the log because a reader\nstill holds a read slot past the checkpoint fence: a wedged reader of\nthis daemon or another process, named in the evidence. Writes run\nuntil the WAL reaches its ceiling, then wait.",type:"string"}]},LanguageServerAnalyzerStateV1:{description:"State of one analyzer as the daemon owner holds it.\n\n`Inactive` is the one state the aggregate never takes: the language has no\nfiles in the project, so Doctor does not grade it, but `lsp servers` still\nlists it from this same read so both surfaces share one authority.",enum:["ready","available","refreshing","disabled","unavailable","crashed","inactive"],type:"string"},LanguageServerAnalyzerV1:{description:"Live state of one analyzer the daemon resolved for the current project.\n\n`LanguageServerStateV1` is the aggregate the finding is graded on; this is\nthe per-analyzer evidence behind it, so an operator learns *which*\nexecutable is missing and how to install it, resolved by the daemon\nprocess (the only PATH that matters, since the daemon spawns analyzers)\nrather than by whichever shell ran the CLI.",properties:{command:{description:"The configured executable, after any operator command override.",type:"string"},detail:{description:"The owner's last recorded error for this analyzer, when one exists.",type:["string","null"]},executable_found:{description:"Whether the daemon process finds `command` on its own PATH. For an\nactive analyzer `state` is the finer verdict (a rustup proxy whose\ntoolchain lacks the component is found yet `Unavailable`); for an\ninactive one this is the only availability evidence.",type:"boolean"},install:{description:"The first install command the adapter advertises, when one exists.",type:["string","null"]},language:{description:"Adapter language (`typescript`, `rust`, …).",type:"string"},state:{$ref:"#/$defs/LanguageServerAnalyzerStateV1"}},required:["language","command","state","executable_found"],type:"object"},LanguageServerReadV1:{description:"One live read from the daemon language-server/analyzer owner.",oneOf:[{description:"The owner observed all project-active analyzer states.",properties:{analyzers:{default:[],description:"Every analyzer the owner resolved, active or not; the aggregate\n`state` covers the active ones only.",items:{$ref:"#/$defs/LanguageServerAnalyzerV1"},type:"array"},coverage:{$ref:"#/$defs/DoctorCoverageCompletenessV1"},kind:{const:"observed",type:"string"},state:{$ref:"#/$defs/LanguageServerStateV1"}},required:["kind","state","coverage"],type:"object"},{description:"Language-server inspection is unsupported on this build/platform.",properties:{kind:{const:"unsupported",type:"string"}},required:["kind"],type:"object"},{description:"No project-active analyzer is configured. The owner's inactive\nanalyzers are still carried so `lsp servers` can list them.",properties:{analyzers:{default:[],items:{$ref:"#/$defs/LanguageServerAnalyzerV1"},type:"array"},kind:{const:"absent",type:"string"}},required:["kind"],type:"object"},{description:"Authorization to inspect analyzer state was denied.",properties:{kind:{const:"denied",type:"string"}},required:["kind"],type:"object"},{description:"Analyzer state could not be determined.",properties:{kind:{const:"unknown",type:"string"}},required:["kind"],type:"object"}]},LanguageServerStateV1:{description:"Aggregate state of the project-active language-server analyzers.",oneOf:[{const:"ready",description:"Every active analyzer is ready.",type:"string"},{const:"available",description:"At least one analyzer is installed but has not produced a ready snapshot.",type:"string"},{const:"refreshing",description:"At least one analyzer is currently refreshing/indexing.",type:"string"},{const:"disabled",description:"At least one project analyzer is disabled.",type:"string"},{const:"unavailable",description:"At least one project analyzer executable is unavailable.",type:"string"},{const:"crashed",description:"At least one analyzer process crashed.",type:"string"}]},RuntimeDoctorReportV1:{description:"The daemon's canonical Doctor report as this route could read it.",oneOf:[{additionalProperties:!1,properties:{kind:{const:"observed",type:"string"},language_servers:{$ref:"#/$defs/LanguageServerReadV1"},report:{$ref:"#/$defs/DoctorReportV1"},schema_convergences:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},table_growth_evidence:{items:{$ref:"#/$defs/TableGrowthDoctorEvidenceV1"},type:"array"}},required:["kind","report","table_growth_evidence","schema_convergences","language_servers"],type:"object"},{additionalProperties:!1,description:"The reader is mounted and the read failed.",properties:{kind:{const:"unknown",type:"string"},language_servers:{$ref:"#/$defs/LanguageServerReadV1"},schema_convergences:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},table_growth_evidence:{items:{$ref:"#/$defs/TableGrowthDoctorEvidenceV1"},type:"array"}},required:["kind","table_growth_evidence","schema_convergences","language_servers"],type:"object"},{additionalProperties:!1,description:"No Doctor reader is mounted on this route.",properties:{kind:{const:"unsupported",type:"string"},language_servers:{$ref:"#/$defs/LanguageServerReadV1"},schema_convergences:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},table_growth_evidence:{items:{$ref:"#/$defs/TableGrowthDoctorEvidenceV1"},type:"array"}},required:["kind","table_growth_evidence","schema_convergences","language_servers"],type:"object"}]},SchemaConvergenceFindingV1:vL,SchemaConvergenceStageV1:vU,SchemaConvergenceStateV1:vH,StorageByteSizeV1:{description:"A byte size measurement. A newtype keeps sizes from being confused with\ncounts, ratios, or timestamps in the read models and producers.",format:"uint64",minimum:0,type:"integer"},StoreKeyV1:{description:"Logical name of one owner-profile store (for example `sessions.db`,\n`graph.db`, or `projects/proj_x`). Never an absolute on-disk path.",type:"string"},TableGrowthDoctorEvidenceV1:{description:"Contract-independent evidence ready to wrap in a future `TableGrowth`\nStorage finding once that generated-contract variant is available.",oneOf:[{properties:{current_bytes:{$ref:"#/$defs/StorageByteSizeV1"},current_observed_at:{$ref:"#/$defs/UtcMicros"},growth_bytes:{$ref:"#/$defs/StorageByteSizeV1"},kind:{const:"significant_growth",type:"string"},previous_bytes:{$ref:"#/$defs/StorageByteSizeV1"},previous_observed_at:{$ref:"#/$defs/UtcMicros"},store:{$ref:"#/$defs/StoreKeyV1"},table:{$ref:"#/$defs/TableNameV1"}},required:["kind","store","table","previous_bytes","current_bytes","growth_bytes","previous_observed_at","current_observed_at"],type:"object"},{properties:{kind:{const:"baseline_established",type:"string"},observed_at:{$ref:"#/$defs/UtcMicros"},store:{$ref:"#/$defs/StoreKeyV1"},tables_observed:{format:"uint64",minimum:0,type:"integer"}},required:["kind","store","observed_at","tables_observed"],type:"object"},{properties:{current_bytes:{$ref:"#/$defs/StorageByteSizeV1"},kind:{const:"table_baseline_pending",type:"string"},observed_at:{$ref:"#/$defs/UtcMicros"},store:{$ref:"#/$defs/StoreKeyV1"},table:{$ref:"#/$defs/TableNameV1"}},required:["kind","store","table","current_bytes","observed_at"],type:"object"},{properties:{kind:{const:"unsupported",type:"string"},store:{$ref:"#/$defs/StoreKeyV1"}},required:["kind","store"],type:"object"},{properties:{kind:{const:"denied",type:"string"},store:{$ref:"#/$defs/StoreKeyV1"}},required:["kind","store"],type:"object"},{properties:{kind:{const:"unknown",type:"string"},reason:{$ref:"#/$defs/TableGrowthUnavailableReasonV1"},store:{$ref:"#/$defs/StoreKeyV1"}},required:["kind","store","reason"],type:"object"}]},TableGrowthUnavailableReasonV1:{description:"Why a per-table payload-growth measurement is unavailable.",oneOf:[{const:"not_yet_measured",description:"No maintenance pass has measured this store yet.",type:"string"},{const:"reader_unavailable",description:"No reader could be leased within the measurement's wait.",type:"string"},{const:"deadline_exceeded",description:"The `dbstat` walk was interrupted by its deadline.",type:"string"},{const:"cancelled",description:"The `dbstat` walk was cancelled.",type:"string"},{const:"storage_corrupt",description:"The store reported corruption.",type:"string"},{const:"storage_infrastructure",description:"The store failed with an infrastructure error.",type:"string"},{const:"storage_other",description:"The store failed for another reason.",type:"string"},{const:"invalid_table_name",description:"`dbstat` named a table that is not a valid table identifier.",type:"string"},{const:"clock_regressed",description:"The previous watermark is later than the current measurement.",type:"string"},{const:"exceeds_measurement_budget",description:"The store is larger than the `dbstat` walk can cover within its\ndeadline.",type:"string"}]},TableNameV1:{description:"A physical table name inside a store, used for per-table growth telemetry.",type:"string"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Process, database, and session-observation telemetry for the running\ndaemon, with the sections the request opted into.",properties:{captured_at:{description:"Unix epoch seconds.",format:"uint64",minimum:0,type:"integer"},cursor_session_ingest:!0,cursor_session_placeholder_paths:{items:{type:"string"},type:["array","null"]},database:{description:"Store telemetry, with the authority-audit verdict when it ran."},doctor_report:{anyOf:[{$ref:"#/$defs/RuntimeDoctorReportV1"},{type:"null"}]},host_os:{type:"string"},process:{description:"Cached process sample."},session_temporal_health:!0,tracedecay_version:{type:"string"}},required:["captured_at","tracedecay_version","host_os","process","database"],title:"RuntimeResultV1",type:"object"},{$defs:{SearchLexicalAliasV1:{additionalProperties:!1,description:"One named query-time vocabulary alias.",properties:{alternative:{maxLength:128,type:"string"},strict_query:{maxLength:128,type:"string"}},required:["strict_query","alternative"],type:"object"},SearchLexicalFieldFilterV1:{additionalProperties:!1,properties:{field:{$ref:"#/$defs/SearchLexicalFieldV1"},include:{type:"boolean"}},required:["field","include"],type:"object"},SearchLexicalFieldV1:{description:"A lexical posting field a search may include or exclude.",enum:["symbol_name","qualified_name","path","signature","documentation","body_text","preamble_text","exact_term","subtoken"],type:"string"},SearchLexicalProximityV1:{additionalProperties:!1,description:"Ordered terms that must occur in one field within `maximum_gap`\nintervening tokens of each other.",properties:{maximum_gap:{format:"uint32",maximum:8,minimum:0,type:"integer"},terms:{items:{type:"string"},maxItems:8,minItems:2,type:"array"}},required:["terms","maximum_gap"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{description:"Authenticated opaque continuation returned as next_cursor. Repeat the same query and lexical options with it.",type:["string","null"]},lazy_index_ignored_dependencies:{description:"Opt in to bounded indexing of ignored dependency entry files when an import hint matches (default: false).",type:["boolean","null"]},lexical_aliases:{description:"Named query-time vocabulary aliases. The strict query always ranks first. Alias-only hits follow it with the strict query, alternative, and configured-vocabulary reason disclosed.",items:{$ref:"#/$defs/SearchLexicalAliasV1"},maxItems:8,type:["array","null"]},lexical_anchors:{description:"Exact identifiers or technical terms (e.g. 'reserve_stock', 'Foo::bar', 'E0308') that the answer must be about. Each is ranked through the lexical lane as its own route: a hit carrying an anchor outranks every hit that carries none, exact hits included, every anchor with matches keeps at least its best sites through the lane cap, and `lexical_anchors` in the response reports each anchor's outcome (`matched` rows, `admitted` sites this response returns, `dropped` admitted sites it could not carry with the reason, `unmatched`, or `not_served`). Ranked retrieval, not exhaustive grep (use tracedecay_grep for that). Each result names the routes that ranked it. At most 8 anchors, each one whitespace-free term of at most 128 bytes, no repeats.",items:{type:"string"},maxItems:8,type:["array","null"]},lexical_field_filters:{description:"Include or exclude lexical symbol_name, qualified_name, path, signature, documentation, body_text, preamble_text, exact_term, or subtoken fields.",items:{$ref:"#/$defs/SearchLexicalFieldFilterV1"},maxItems:9,type:["array","null"]},lexical_phrases:{description:"Exact lexical phrases to rank through n-gram candidate pruning.",items:{type:"string"},maxItems:4,type:["array","null"]},lexical_proximities:{description:"Ordered lexical terms that must occur within the bounded intervening-token gap.",items:{$ref:"#/$defs/SearchLexicalProximityV1"},maxItems:4,type:["array","null"]},limit:{description:"Maximum number of results to return (default: 10)",format:"uint64",minimum:0,type:["integer","null"]},prefer_symbol:{description:"Add a lexical route restricted to symbol-name matches for the identifier-shaped words of the query. Omitted, it runs when the query is name-shaped (at least half its content words are identifiers such as 'getUserById' or 'Foo::bar'); true forces it, false suppresses it. `query_route` in the response reports the decision and its margin. Query words such as class/struct/function/find/explain are ignored; 'Foo::bar' and 'Foo.bar' contribute 'bar'.",type:["boolean","null"]},query:{description:"Search query string to match against symbol names",type:"string"}},required:["query"],title:"SearchSurfaceRequestV1",type:"object"},{$defs:{ApplicationProblemDetailV1:fA,CalibrationProfileId:hi,CandidateContribution:hs,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComponentRevision:hj,ContextLexicalAnchorV1:hF,DaemonServiceUnitObservationV1:y_,DiagnosticsSearchedTsconfigV1:yS,EvidenceRole:yC,ExactClass:yT,FileOccurrenceId:gs,FixedPointScore:gc,FreshnessCompatibilityV1:gl,FusedCandidate:gp,LexicalAnchorDropReasonV1:_e,LexicalAnchorDropV1:_t,LogicalCopyClusterId:_i,LogicalEvidenceId:_o,OccurrenceProvenance:_z,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveLaneCompleteV1:_J,PrimitiveRecallV1:_Q,PrimitiveSearchFreshnessV1:_X,PrimitiveUnavailableEvidenceV1:_0,PrimitiveUnavailableStatusV1:_2,RankingDecision:vp,RankingDecisionKind:vu,RepositoryId:vb,RetrievalAnchorId:vI,RetrievalSourceRoleV1:vC,RetrieverKind:vO,ScoreDomainId:v2,SearchCompleteV1:{additionalProperties:!1,properties:{code_generation:{type:"string"},coverage:{$ref:"#/$defs/SearchCoverageV1"},external_import_hint:{anyOf:[{$ref:"#/$defs/SearchExternalImportHintV1"},{type:"null"}]},freshness:{$ref:"#/$defs/PrimitiveSearchFreshnessV1",description:"Freshness of the served code generation, derived from the typed lane\ncoverage and the daemon scheduler's worktree state."},lexical_anchors:{description:"Outcome of every caller `lexical_anchors` entry, beside the routes.",items:{$ref:"#/$defs/ContextLexicalAnchorV1"},type:["array","null"]},lexical_routes:{description:"Every lexical route fused into this page; present only when a route\nbeyond the strict query ran or ranked a result.",items:{$ref:"#/$defs/SearchLexicalRouteV1"},type:["array","null"]},next_cursor:{description:"Authenticated continuation for the next page; null on the last page.",type:["string","null"]},query_fallback_digest:{type:"string"},query_route:{anyOf:[{$ref:"#/$defs/SearchQueryRouteV1"},{type:"null"}],description:"Which lane the query's shape selected, and its margin."},results:{items:{$ref:"#/$defs/SearchResultRowV1"},type:"array"},scope_prefix:{description:"The session's scope prefix. Ranked candidates carry no file path, so\nthe scope is reported and not applied.",type:["string","null"]},scope_prefix_applied:{type:["boolean","null"]},verified_graph_evidence:{anyOf:[{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"},{type:"null"}]}},required:["freshness","code_generation","query_fallback_digest","coverage","results"],type:"object"},SearchCoverageV1:{additionalProperties:!1,description:"Per-lane recall of one search, so a full-recall answer is told apart from\none produced while a lane was down.",properties:{exact:{$ref:"#/$defs/SearchLaneStatusV1"},graph:{$ref:"#/$defs/SearchLaneStatusV1"},lexical:{$ref:"#/$defs/SearchLaneStatusV1"},recall:{$ref:"#/$defs/PrimitiveRecallV1"}},required:["exact","lexical","graph","recall"],type:"object"},SearchDisplayUnavailableV1:{description:"Why a ranked candidate's display metadata was not hydrated: the answering\ngeneration no longer matches the request (`stale`), its record is\nincompatible or does not bind the candidate (`incompatible`, `invalid`),\nthe read failed (`internal`), the hydration budget was spent\n(`budget_exceeded`), or the request was cancelled (`cancelled`).",enum:["stale","incompatible","invalid","internal","budget_exceeded","cancelled"],type:"string"},SearchExternalImportCandidatesV1:{additionalProperties:!1,properties:{candidates:{items:{$ref:"#/$defs/SearchExternalImportV1"},type:"array"},evidence:{type:"string"},message:{type:"string"},resolution_status:{type:"string"},suggested_action:{type:"string"}},required:["message","evidence","resolution_status","candidates","suggested_action"],type:"object"},SearchExternalImportHintV1:{anyOf:[{$ref:"#/$defs/SearchExternalImportCandidatesV1"},{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"}],description:"Advisory evidence that a sparse search matched external-module imports,\nor why that evidence could not be read."},SearchExternalImportV1:{additionalProperties:!1,properties:{import_file:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},module:{type:"string"},symbol:{description:"The imported name; null for a whole-module import.",type:["string","null"]}},required:["module","import_file","line"],type:"object"},SearchLaneStateV1:{description:"A lane that did not serve the current complete generation. A partial\nlane names its generation and reason when it has them, null otherwise.",oneOf:[{additionalProperties:!1,properties:{generation:{type:"string"},status:{const:"stale",type:"string"}},required:["status","generation"],type:"object"},{additionalProperties:!1,properties:{generation:{type:["string","null"]},reason:{type:["string","null"]},status:{const:"partial",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},SearchLaneStatusV1:{anyOf:[{$ref:"#/$defs/PrimitiveLaneCompleteV1"},{$ref:"#/$defs/SearchLaneStateV1"}]},SearchLexicalAlternativeReasonV1:{description:"Why the lexical lane tried a configured alternative.",enum:["configured_vocabulary_alias"],type:"string"},SearchLexicalRouteV1:{description:"One lexical route fused into the page, with its display label.",oneOf:[{additionalProperties:!1,description:"The caller's strict lexical query.",properties:{label:{type:"string"},route:{const:"query",type:"string"}},required:["route","label"],type:"object"},{additionalProperties:!1,description:"One caller-supplied exact identifier or term.",properties:{anchor:{type:"string"},label:{type:"string"},route:{const:"anchor",type:"string"}},required:["route","anchor","label"],type:"object"},{additionalProperties:!1,description:"Identifier-shaped tokens of the query, restricted to symbol names.",properties:{label:{type:"string"},route:{const:"preferred_symbol",type:"string"},tokens:{items:{type:"string"},type:"array"}},required:["route","tokens","label"],type:"object"},{additionalProperties:!1,description:"Identifier and path components recovered from the strict query.",properties:{label:{type:"string"},route:{const:"identifier_split",type:"string"},strict_query:{type:"string"},terms:{items:{type:"string"},type:"array"}},required:["route","strict_query","terms","label"],type:"object"},{additionalProperties:!1,description:"A configured query-time vocabulary alternative.",properties:{alternative:{type:"string"},label:{type:"string"},reason:{$ref:"#/$defs/SearchLexicalAlternativeReasonV1"},route:{const:"alias",type:"string"},strict_query:{type:"string"}},required:["route","strict_query","alternative","reason","label"],type:"object"}]},SearchQueryRouteDeciderV1:{description:"Who chose the query route: the query-shape gate or the caller's\n`prefer_symbol`.",enum:["query_shape","caller"],type:"string"},SearchQueryRouteKindV1:{description:"Which lexical lane the query's shape selected.",oneOf:[{const:"name",description:"The symbol-name route ran beside the strict query.",type:"string"},{const:"prose",description:"The strict query ran without the symbol-name route.",type:"string"}]},SearchQueryRouteV1:{additionalProperties:!1,description:"The query-shape routing decision behind a page.",properties:{decided_by:{$ref:"#/$defs/SearchQueryRouteDeciderV1"},margin:{description:"Distance from the name gate in [-0.5, 0.5]: the share of the query's\ncontent words that are identifier-shaped, minus one half. The gate\nselects `name` at or above 0. Reported when the caller decided too.\nIt describes query shape only and is not an answerability signal.",format:"double",type:"number"},route:{$ref:"#/$defs/SearchQueryRouteKindV1"}},required:["route","margin","decided_by"],type:"object"},SearchResultDisplayV1:{additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},qualified_name:{type:"string"}},required:["name","qualified_name","kind","path"],type:"object"},SearchResultRowV1:{additionalProperties:!1,description:"One ranked candidate with its generation-bound display metadata.",properties:{candidate:{$ref:"#/$defs/FusedCandidate"},display:{anyOf:[{$ref:"#/$defs/SearchResultDisplayV1"},{type:"null"}]},display_unavailable:{anyOf:[{$ref:"#/$defs/SearchDisplayUnavailableV1"},{type:"null"}],description:"Why `display` is absent from this ranked candidate."},final_ordinal:{format:"uint32",minimum:0,type:"integer"},lexical_routes:{description:"The lexical routes that ranked this candidate.",items:{$ref:"#/$defs/SearchRouteMatchV1"},type:["array","null"]},node_id:{description:"The graph symbol to read with `tracedecay_source_body`.",type:["string","null"]}},required:["candidate","final_ordinal"],type:"object"},SearchRouteMatchV1:{additionalProperties:!1,description:"One route that ranked a candidate, named by its route label.",properties:{matched_terms:{items:{type:"string"},type:"array"},route:{type:"string"},score_micros:{format:"uint64",minimum:0,type:"integer"},spelling_variants:{items:{$ref:"#/$defs/SearchSpellingVariantV1"},type:"array"}},required:["route","score_micros","matched_terms"],type:"object"},SearchSpellingVariantV1:{additionalProperties:!1,properties:{alternative:{type:"string"},query:{type:"string"}},required:["query","alternative"],type:"object"},SearchUnavailableV1:{additionalProperties:!1,properties:{code_generation:{type:["string","null"]},coverage:{$ref:"#/$defs/SearchCoverageV1"},detail:{anyOf:[{$ref:"#/$defs/ApplicationProblemDetailV1"},{type:"null"}],description:"Present when indexing is parked: its cause, remedy, and wake retry."},freshness:{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},query_fallback_digest:{description:"Always null: no fallback subpayload was produced.",type:["string","null"]},reason:{type:"string"},results:{description:"Always empty: no generation answered.",items:{$ref:"#/$defs/SearchResultRowV1"},type:"array"},status:{$ref:"#/$defs/PrimitiveUnavailableStatusV1"},verified_graph_evidence:{anyOf:[{$ref:"#/$defs/PrimitiveUnavailableEvidenceV1"},{type:"null"}]}},required:["freshness","results","status","reason","coverage"],type:"object"},SessionOrThreadId:v7,SourceFreshness:by,SourceInstanceKey:bg,SourceNamespace:bv,SourceOccurrenceId:bb,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/SearchCompleteV1"},{$ref:"#/$defs/SearchUnavailableV1"}],description:"What a search served: a ranked page, or the typed reason no generation\ncould answer.",title:"SearchResultV1"},{$defs:{PageRequest:_U,ResultProjection:vP,RetrievalOrder:vx,RetrievalRequestMeta:vj,SessionId:v8,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{meta:{$ref:"#/$defs/RetrievalRequestMeta"},session_id:{$ref:"#/$defs/SessionId"}},required:["session_id","meta"],title:"SessionLookupRequest",type:"object"},{$defs:{RetrievalAnchorId:vI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"}},required:["anchors"],title:"SessionLookupResult",type:"object"},{$defs:{SessionRefreshFrontierV1:{additionalProperties:!1,properties:{committed_through:{format:"uint64",minimum:0,type:"integer"},observed_through:{format:"uint64",minimum:0,type:"integer"}},required:["observed_through","committed_through"],type:"object"},SessionRefreshGrainV1:{enum:["occurrence","logical_message","turn","session","thread","agent","summary"],type:"string"},SessionRefreshScopeV1:{description:"Session-store owner one refresh is bound to.\n\nThe caller selects the already-mounted project or profile authority. Exact\nprofile, project, repository, worktree, branch, store, and root identities\nstay daemon-owned and are resolved from that authority during admission.",oneOf:[{additionalProperties:!1,properties:{kind:{const:"project",type:"string"}},required:["kind"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"profile",type:"string"}},required:["kind"],type:"object"}]},SessionRefreshSessionV1:{additionalProperties:!1,properties:{id:{type:"string"}},required:["id"],type:"object"},SessionRefreshSourceV1:{additionalProperties:!1,properties:{scope:{type:"string"}},required:["scope"],type:"object"},SessionRefreshTargetV1:{additionalProperties:!1,properties:{frontier:{$ref:"#/$defs/SessionRefreshFrontierV1"},grain:{$ref:"#/$defs/SessionRefreshGrainV1"},temporal_mode:{$ref:"#/$defs/TemporalModeV1"}},required:["temporal_mode","grain","frontier"],type:"object"},TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact route-selected session-refresh request body.\n\nEach current route selects the action itself; `scope` selects the mounted\nsession-store owner. Project-scoped requests are served under project-open\nadmission, profile-scoped requests by the authenticated profile authority.",properties:{handle:{type:["string","null"]},scope:{$ref:"#/$defs/SessionRefreshScopeV1"},session:{$ref:"#/$defs/SessionRefreshSessionV1"},source:{$ref:"#/$defs/SessionRefreshSourceV1"},target:{$ref:"#/$defs/SessionRefreshTargetV1"}},required:["scope","session","source","target"],title:"SessionRefreshActionRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionRefreshFrontierResultV1:be,SessionRefreshProgressV1:bt,SessionRefreshReceiptV1:br,SessionRefreshTerminalStateResultV1:bi,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalModeV1:bW,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{accepted_at:{format:"int64",type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},handle:{type:["string","null"]},operation_id:{type:["string","null"]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},progress:{anyOf:[{$ref:"#/$defs/SessionRefreshProgressV1"},{type:"null"}]},receipt:{anyOf:[{$ref:"#/$defs/SessionRefreshReceiptV1"},{type:"null"}]},scope:{type:"string"},tool:{type:"string"}},required:["outcome","scope","tool"],title:"SessionRefreshBeginResultV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionRefreshFrontierResultV1:be,SessionRefreshProgressV1:bt,SessionRefreshReceiptV1:br,SessionRefreshTerminalStateResultV1:bi,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalModeV1:bW,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{accepted_at:{format:"int64",type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},handle:{type:["string","null"]},operation_id:{type:["string","null"]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},progress:{anyOf:[{$ref:"#/$defs/SessionRefreshProgressV1"},{type:"null"}]},receipt:{anyOf:[{$ref:"#/$defs/SessionRefreshReceiptV1"},{type:"null"}]},scope:{type:"string"},tool:{type:"string"}},required:["outcome","scope","tool"],title:"SessionRefreshCancelResultV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hm,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,SessionCoverageIntervalV1:v6,SessionCoverageReasonV1:v3,SessionCoverageRequestV1:v9,SessionCoverageStateV1:v5,SessionRefreshFrontierResultV1:be,SessionRefreshProgressV1:bt,SessionRefreshReceiptV1:br,SessionRefreshTerminalStateResultV1:bi,SessionSourceCoverageV1:bn,TemporalCoverageV1:bO,TemporalModeV1:bW,UtcMicros:bZ,ValidCoverageIntervalV1:bQ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},outcome:{$ref:"#/$defs/RetainedOutcomeStatusV1"},progress:{anyOf:[{$ref:"#/$defs/SessionRefreshProgressV1"},{type:"null"}]},receipt:{anyOf:[{$ref:"#/$defs/SessionRefreshReceiptV1"},{type:"null"}]},scope:{type:"string"},tool:{type:"string"}},required:["outcome","scope","tool"],title:"SessionRefreshStatusResultV1",type:"object"},{$defs:{RetainedTimeFilterV1:vq,SessionGitRefV1:{enum:["branch","worktree","commit"],type:"string"},SessionGitRelationV1:{enum:["produced","observed","all"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{git_ref:{$ref:"#/$defs/SessionGitRefV1"},limit:{format:"uint64",minimum:0,type:["integer","null"]},relation:{anyOf:[{$ref:"#/$defs/SessionGitRelationV1"},{type:"null"}]},since:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},until:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},value:{type:"string"}},required:["git_ref","value"],title:"SessionsForRequestV1",type:"object"},{$defs:{CorrelationIndexCountModeV1:{enum:["presence_only"],type:"string"},CorrelationIndexV1:{additionalProperties:!1,properties:{backfill_watermark:{format:"int64",type:["integer","null"]},commit_count:{format:"uint64",minimum:0,type:["integer","null"]},commits_present:{type:"boolean"},count_mode:{$ref:"#/$defs/CorrelationIndexCountModeV1"},generation:{type:["string","null"]},projection_available:{type:"boolean"},source_watermark:{type:["string","null"]},span_count:{format:"uint64",minimum:0,type:["integer","null"]},spans_present:{type:"boolean"}},required:["projection_available","spans_present","commits_present","count_mode"],type:"object"},RetainedOutcomeStatusV1:vR,SessionCorrelationHitV1:{additionalProperties:!1,properties:{branch:{type:["string","null"]},commit_sha:{type:["string","null"]},committed_at:{format:"int64",type:["integer","null"]},confidence:{format:"int64",type:["integer","null"]},event_count:{format:"int64",type:"integer"},evidence:{type:["string","null"]},evidence_message_id:{type:["string","null"]},first_ts:{format:"int64",type:["integer","null"]},last_ts:{format:"int64",type:["integer","null"]},provider:{type:"string"},relation:{type:["string","null"]},session_id:{type:"string"},sources:{items:{type:"string"},type:"array"},span_count:{format:"int64",type:"integer"},span_overlap_kind:{type:["string","null"]},worktree:{type:["string","null"]}},required:["provider","session_id","event_count","span_count","sources"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},git_ref:{type:["string","null"]},index:{anyOf:[{$ref:"#/$defs/CorrelationIndexV1"},{type:"null"}]},index_empty:{type:["boolean","null"]},message:{type:["string","null"]},observed_count:{format:"uint",minimum:0,type:["integer","null"]},observed_sessions:{items:{$ref:"#/$defs/SessionCorrelationHitV1"},type:["array","null"]},problem_code:{type:["string","null"]},relation:{type:["string","null"]},results:{items:{$ref:"#/$defs/SessionCorrelationHitV1"},type:"array"},since:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"},until:{format:"int64",type:["integer","null"]},value:{type:["string","null"]}},required:["count","results","status"],title:"SessionsForResultV1",type:"object"},{$defs:{NodeExpansionCostV1:_A,SymbolSignatureV1:{additionalProperties:!1,properties:{cost_to_expand:{$ref:"#/$defs/NodeExpansionCostV1"},docstring:{type:["string","null"]},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},is_async:{type:"boolean"},kind:{type:"string"},name:{type:"string"},node_id:{type:"string"},qualified_name:{type:"string"},signature:{type:["string","null"]},start_line:{format:"uint32",minimum:0,type:"integer"},unavailable_fields:{items:{type:"string"},type:"array"},visibility:{type:"string"}},required:["node_id","name","qualified_name","kind","visibility","is_async","file","start_line","end_line","cost_to_expand","unavailable_fields"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/SymbolSignatureV1"},title:"Array_of_SymbolSignatureV1",type:"array"},{$defs:{ProjectId:_4,RepositoryId:vb,SimilarMatchClassV1:bc,SimilarTargetV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"symbol_occurrence",type:"string"},symbol_occurrence_id:{$ref:"#/$defs/SymbolOccurrenceId"}},required:["kind","symbol_occurrence_id"],type:"object"},{additionalProperties:!1,properties:{kind:{const:"source_range",type:"string"},path:{type:"string"},span:{$ref:"#/$defs/SourceSpan"}},required:["kind","path","span"],type:"object"}]},SourceSpan:b$,SymbolOccurrenceId:bq},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{type:["string","null"]},match_classes:{items:{$ref:"#/$defs/SimilarMatchClassV1"},type:"array"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},result_limit:{description:"Preferred result page size.",format:"uint32",minimum:0,type:"integer"},target:{$ref:"#/$defs/SimilarTargetV1"},work_limit:{format:"uint32",minimum:0,type:"integer"}},required:["project_id","repository_id","target","match_classes","result_limit","work_limit"],title:"SimilarSurfaceRequestV1",type:"object"},{$defs:{CodeGenerationId:hy,CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ManifestDigest:_l,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,ProjectId:_4,RepositoryId:vb,SimilarCoverageV1:{oneOf:[{additionalProperties:!1,properties:{status:{const:"complete",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{status:{const:"partial",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,properties:{minimum_tokens:{format:"uint32",minimum:0,type:"integer"},status:{const:"excluded_too_small",type:"string"}},required:["status","minimum_tokens"],type:"object"},{additionalProperties:!1,properties:{maximum_bytes:{format:"uint64",minimum:0,type:"integer"},maximum_tokens:{format:"uint32",minimum:0,type:"integer"},status:{const:"excluded_too_large",type:"string"}},required:["status","maximum_tokens","maximum_bytes"],type:"object"},{additionalProperties:!1,properties:{status:{const:"excluded_incomplete_tokenization",type:"string"}},required:["status"],type:"object"}]},SimilarFamilyV1:bd,SimilarMatchClassV1:bc,SimilarOccurrenceV1:bl,SourceSpan:b$,SymbolOccurrenceId:bq,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/SimilarCoverageV1"},families:{items:{$ref:"#/$defs/SimilarFamilyV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},source:{$ref:"#/$defs/SimilarOccurrenceV1"},source_generation:{$ref:"#/$defs/CodeGenerationId"}},required:["source","families","source_generation","coverage"],title:"SimilarResultV1",type:"object"},{$defs:{ManagedSkillState:_c},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_body:{default:!1,description:"If true, include each skill's body_markdown in the list response\n(default: false).",type:"boolean"},state:{anyOf:[{$ref:"#/$defs/ManagedSkillState"},{type:"null"}],description:"Optional managed-skill lifecycle state filter."}},title:"SkillListSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,ManagedSkillMaterializationScope:_n,ManagedSkillMetadata:_a,ManagedSkillProvenance:_s,ManagedSkillSource:_d,ManagedSkillState:_c,SkillImprovementRecommendation:bp,SkillInstallTarget:bu,SkillListEntryV1:{additionalProperties:!1,properties:{body_markdown:{description:"Present only when the request asked for bodies.",type:["string","null"]},improvement_recommendation:{anyOf:[{$ref:"#/$defs/SkillImprovementRecommendation"},{type:"null"}]},metadata:{$ref:"#/$defs/ManagedSkillMetadata"},stale_recommendation:{anyOf:[{$ref:"#/$defs/SkillStaleRecommendation"},{type:"null"}]},support_file_count:{format:"uint",minimum:0,type:"integer"},support_file_paths:{items:{type:"string"},type:"array"},usage_summary:{$ref:"#/$defs/SkillUsageRecord"}},required:["metadata","support_file_count","support_file_paths","usage_summary"],type:"object"},SkillStaleRecommendation:bm,SkillUsageRecord:bf},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{count:{format:"uint",minimum:0,type:"integer"},profile_root:{type:"string"},skills:{items:{$ref:"#/$defs/SkillListEntryV1"},type:"array"},status:{$ref:"#/$defs/AutomationReadStatusV1"}},required:["status","profile_root","count","skills"],title:"SkillListResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{id:{description:"Managed skill id to read.",type:"string"},include_support_files:{default:!1,description:"Include support-file byte payloads. Default false; the response still\nlists each path and byte length.",type:"boolean"}},required:["id"],title:"SkillViewSurfaceRequestV1",type:"object"},{$defs:{AutomationReadStatusV1:fH,ManagedSkill:{properties:{body_markdown:{type:"string"},metadata:{$ref:"#/$defs/ManagedSkillMetadata"},support_files:{items:{$ref:"#/$defs/ManagedSupportFile"},type:"array"}},required:["metadata","body_markdown","support_files"],type:"object"},ManagedSkillMaterializationScope:_n,ManagedSkillMetadata:_a,ManagedSkillProvenance:_s,ManagedSkillSource:_d,ManagedSkillState:_c,ManagedSupportFile:{properties:{bytes:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},path:{type:"string"}},required:["path","bytes"],type:"object"},SkillImprovementRecommendation:bp,SkillInstallTarget:bu,SkillStaleRecommendation:bm,SkillSupportFileSummaryV1:{additionalProperties:!1,properties:{byte_len:{format:"uint",minimum:0,type:"integer"},path:{type:"string"}},required:["path","byte_len"],type:"object"},SkillUsageRecord:bf},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{improvement_recommendation:{anyOf:[{$ref:"#/$defs/SkillImprovementRecommendation"},{type:"null"}]},profile_root:{type:"string"},skill:{$ref:"#/$defs/ManagedSkill",description:"The skill package; `support_files` is empty unless the request\nincluded them."},stale_recommendation:{anyOf:[{$ref:"#/$defs/SkillStaleRecommendation"},{type:"null"}]},status:{$ref:"#/$defs/AutomationReadStatusV1"},support_file_summaries:{items:{$ref:"#/$defs/SkillSupportFileSummaryV1"},type:"array"},support_files_included:{type:"boolean"},usage_summary:{$ref:"#/$defs/SkillUsageRecord"}},required:["status","profile_root","skill","usage_summary","support_files_included","support_file_summaries"],title:"SkillViewResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{node_id:{type:"string"}},required:["node_id"],title:"SourceBodyPrimitiveRequest",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{body:{type:"string"},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},node_id:{type:"string"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["node_id","file","start_line","end_line","body"],title:"SourceBodyPrimitiveResult",type:"object"},{$defs:{ManifestDigest:_l,UseCaseId:bK},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",oneOf:[{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},confirm:{default:!1,type:"boolean"},disposition:{const:"inspect",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition"],type:"object"},{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},committed_state:{$ref:"#/$defs/ManifestDigest"},confirm:{default:!1,type:"boolean"},disposition:{const:"confirm_committed",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition","committed_state"],type:"object"},{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},confirm:{default:!1,type:"boolean"},disposition:{const:"confirm_unchanged",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition"],type:"object"},{additionalProperties:!1,description:"Exact public input accepted by `tracedecay_source_edit_reconcile`.",properties:{attempt_idempotency_key:{type:"string"},confirm:{default:!1,type:"boolean"},disposition:{const:"acknowledge_partial",type:"string"},effect_id:{type:"string"},idempotency_key:{type:"string"},input_digest:{type:"string"},observed_state:{$ref:"#/$defs/ManifestDigest"},original_operation:{$ref:"#/$defs/UseCaseId"}},required:["original_operation","effect_id","idempotency_key","attempt_idempotency_key","input_digest","disposition","observed_state"],type:"object"}],title:"SourceEditReconcileSurfaceRequestV1",type:"object"},{$defs:{FileOccurrenceId:gs,GitOidV1:gq,PageRequest:_U,ResultProjection:vP,RetrievalOrder:vx,RetrievalRequestMeta:vj,SourceSpan:b$,TemporalModeV1:bW,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{additionalProperties:!1,description:"Read an exact byte span from the current indexed file occurrence.",properties:{file:{$ref:"#/$defs/FileOccurrenceId",description:"Canonical file occurrence from `code_exact_occurrence` at\n`items[].occurrence.file`; a logical path is not a file occurrence identity."},meta:{$ref:"#/$defs/RetrievalRequestMeta"},span:{$ref:"#/$defs/SourceSpan"}},required:["file","span","meta"],type:"object"},{additionalProperties:!1,description:"Read a bounded range of whole lines from an immutable Git revision.",properties:{end_line:{description:"One-based last line, inclusive. Large ranges are clipped with `next_line`.",format:"uint32",minimum:0,type:"integer"},file:{description:"Canonical repository-relative path in that revision.",type:"string"},revision:{$ref:"#/$defs/GitOidV1",description:"Full lowercase commit OID; mutable names and abbreviations are refused."},start_line:{description:"One-based first line, inclusive.",format:"uint32",minimum:0,type:"integer"}},required:["revision","file","start_line","end_line"],type:"object"}],title:"SourceLinesRequest"},{$defs:{GitOidV1:gq,RetrievalAnchorId:vI,SourceReference:{additionalProperties:!1,properties:{anchor:{$ref:"#/$defs/RetrievalAnchorId"},span:{$ref:"#/$defs/SourceSpan"}},required:["anchor","span"],type:"object"},SourceSpan:b$},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{additionalProperties:!1,properties:{body:{type:["string","null"]},file:{type:["string","null"]},references:{items:{$ref:"#/$defs/SourceReference"},type:"array"}},required:["references"],type:"object"},{additionalProperties:!1,properties:{blob_oid:{$ref:"#/$defs/GitOidV1"},body:{type:"string"},end_line:{format:"uint32",minimum:0,type:"integer"},file:{type:"string"},next_line:{description:"First unread line within the requested range. Keep the original\nrevision, file, and requested end line when continuing.",format:"uint32",minimum:0,type:["integer","null"]},revision:{$ref:"#/$defs/GitOidV1"},span:{$ref:"#/$defs/SourceSpan"},start_line:{format:"uint32",minimum:0,type:"integer"}},required:["file","revision","blob_oid","start_line","end_line","span","body"],type:"object"}],title:"SourceLinesResult"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],title:"SourceOutlinePrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bI},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"},symbols:{items:{$ref:"#/$defs/SymbolPrimitiveRecord"},type:"array"}},required:["file","symbols"],title:"SourceOutlinePrimitiveResult",type:"object"},{$defs:{BranchStackEdgeV1:f3,BranchStackId:f9,BranchStackNodeV1:f5,BranchStackRevisionId:f8,CommitId:hq,ManifestDigest:_l,NativeIntegrationDirectionV1:_R,NativeIntegrationSelectionDeclarationV1:{description:"Explicit caller declaration for one native-integration selection.\n\nDeclared stacks contain the visible nodes and edges, while the daemon\nderives canonical order and the revision digest through the domain\nconstructor. Callers cannot submit either derived field.",oneOf:[{additionalProperties:!1,properties:{binding:{additionalProperties:!1,properties:{destination_node_id:{$ref:"#/$defs/StackNodeId"},direction:{$ref:"#/$defs/NativeIntegrationDirectionV1"},edges:{items:{$ref:"#/$defs/BranchStackEdgeV1"},type:"array"},nodes:{items:{$ref:"#/$defs/BranchStackNodeV1"},type:"array"},revision_id:{$ref:"#/$defs/BranchStackRevisionId"},source_node_id:{$ref:"#/$defs/StackNodeId"},stack_id:{$ref:"#/$defs/BranchStackId"}},required:["stack_id","revision_id","nodes","edges","source_node_id","destination_node_id","direction"],type:"object"},kind:{const:"declared_stack_edge",type:"string"}},required:["kind","binding"],type:"object"},{additionalProperties:!1,properties:{binding:{additionalProperties:!1,properties:{destination_ref:{$ref:"#/$defs/RefId"},proposal_digest:{$ref:"#/$defs/ManifestDigest"},source_ref:{$ref:"#/$defs/RefId"}},required:["proposal_digest","source_ref","destination_ref"],type:"object"},kind:{const:"independent_branch",type:"string"}},required:["kind","binding"],type:"object"}]},ProjectId:_4,RefId:vm,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,StackNodeId:bw,WorktreeId:SB,WorktreeInventoryEpoch:SK,WorktreeInventorySnapshotId:SJ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact caller-supplied identity frozen by `stack_snapshot`.\n\nThis proof binds the exact authorized `ProjectId`, `RepositoryId`, source\nand destination worktree/ref identity, frozen inventory, scope/grant/policy\nrevisions, and one declared-edge or independent-branch selection. Paths,\nfree-form SHA values, branch display names, and provider topology remain\nunrepresentable.",properties:{authorized_scope_set_digest:{$ref:"#/$defs/ManifestDigest"},authorized_scope_set_id:{$ref:"#/$defs/ScopeSetId"},authorized_scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},destination:{$ref:"#/$defs/ResolvedScope"},grant_digest:{$ref:"#/$defs/ManifestDigest"},inventory_epoch:{$ref:"#/$defs/WorktreeInventoryEpoch"},inventory_snapshot_id:{$ref:"#/$defs/WorktreeInventorySnapshotId"},policy_digest:{$ref:"#/$defs/ManifestDigest"},selection:{$ref:"#/$defs/NativeIntegrationSelectionDeclarationV1"},source:{$ref:"#/$defs/ResolvedScope"}},required:["source","destination","authorized_scope_set_id","authorized_scope_set_revision","authorized_scope_set_digest","inventory_snapshot_id","inventory_epoch","selection","grant_digest","policy_digest"],title:"NativeIntegrationStackSnapshotSurfaceRequest",type:"object"},{$defs:{CodeIndexReadinessTargetV1:{description:"The readiness a status caller can wait for.",oneOf:[{const:"fresh",description:"A sealed complete generation serves exact and lexical reads for the\ncurrent source: `code_index_freshness.status` is `current`.",type:"string"},{const:"ready",description:"`fresh`, and the generation's native code graph also serves.",type:"string"},{const:"graph_ready",description:"A published generation's native code graph serves and no convergence\npark is set, whatever the source freshness. Waiting for it never\nsweeps the source, so it cannot arm the reconcile it would observe.",type:"string"}]},CodeIndexReadinessWaitV1:{additionalProperties:!1,description:"`tracedecay_status` `wait_for`: hold the status read until the worktree\nreaches `state`, for at most the caller's `timeout_ms`.",properties:{state:{$ref:"#/$defs/CodeIndexReadinessTargetV1"},timeout_ms:{format:"uint64",minimum:0,type:"integer"}},required:["state","timeout_ms"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{admission_only:{default:!1,description:"Report only that the project route is admitted, reading no graph,\nindex, or session state. Default false.",type:"boolean"},include_branch_diagnostics:{default:!1,description:"Full tracked-branch diagnostic list. Default false.",type:"boolean"},include_session_ingest:{default:!1,description:"Session-ingest health. Default false.",type:"boolean"},include_staleness:{default:!1,description:"Git staleness object. Default false.",type:"boolean"},include_storage_health:{default:!1,description:"Storage-health snapshot. Default false.",type:"boolean"},wait_for:{anyOf:[{$ref:"#/$defs/CodeIndexReadinessWaitV1"},{type:"null"}],description:"Hold the status read until the code index reaches `state` (`fresh`:\nstatus `current`; `ready`: also native graph serving; `graph_ready`: a\npublished generation's native graph serves, whatever the freshness),\nfor at most `timeout_ms`. The payload's `wait` reports `reached`,\n`timed_out` with `last_state`, or `unavailable` with `reason`."}},title:"StatusSurfaceRequestV1",type:"object"},{$defs:{CodeCloneIndexBudgetsV1:{description:"Fixed automatic clone-discovery limits.",properties:{minimum_body_tokens:{format:"uint64",minimum:0,type:"integer"}},required:["minimum_body_tokens"],type:"object"},CodeCloneIndexCoverageV1:{description:"Coverage retained by one clone-index artifact or in-progress successor.\n\nCounts are `None` until the clone artifact has observed the corresponding\ndenominator. A complete empty repository reports `Some(0)`, which keeps a\ndesigned zero distinct from unavailable coverage.",properties:{conservative_normalized_bodies:{description:"Eligible bodies with a conservative exact posting.",format:"uint64",minimum:0,type:["integer","null"]},eligible_source_bodies:{description:"Source bodies admitted for automatic clone discovery.",format:"uint64",minimum:0,type:["integer","null"]},exact_postings:{description:"Conservative and rename-normalized exact posting rows.",format:"uint64",minimum:0,type:["integer","null"]},excluded_incomplete_tokenization_bodies:{description:"Bodies excluded because conservative tokenization was incomplete.",format:"uint64",minimum:0,type:["integer","null"]},excluded_too_large_bodies:{description:"Bodies excluded because they exceed the automatic-discovery token maximum.",format:"uint64",minimum:0,type:["integer","null"]},excluded_too_small_bodies:{description:"Bodies excluded because they are below the automatic-discovery minimum.",format:"uint64",minimum:0,type:["integer","null"]},payloads_reused:{description:"Current payload occurrences reused from the preceding generation.",format:"uint64",minimum:0,type:["integer","null"]},rename_normalized_bodies:{description:"Eligible bodies with a complete rename-normalized exact posting.",format:"uint64",minimum:0,type:["integer","null"]},rename_partial_bodies:{description:"Eligible bodies whose rename normalization is partial.",format:"uint64",minimum:0,type:["integer","null"]},rename_unsupported_bodies:{description:"Eligible bodies whose language has no rename normalization.",format:"uint64",minimum:0,type:["integer","null"]},source_bodies:{description:"Clone body occurrences observed in the sealed lexical source.",format:"uint64",minimum:0,type:["integer","null"]},unique_payloads:{description:"Distinct content-addressed payloads retained by the artifact.",format:"uint64",minimum:0,type:["integer","null"]}},type:"object"},CodeCloneIndexObservationV1:{description:"Generation-pinned clone-index evidence shared by non-error readiness states.",properties:{artifact_format_revision:{format:"uint32",minimum:0,type:["integer","null"]},budgets:{$ref:"#/$defs/CodeCloneIndexBudgetsV1"},conservative_normalization_revision:{format:"uint16",maximum:65535,minimum:0,type:"integer"},coverage:{$ref:"#/$defs/CodeCloneIndexCoverageV1"},generation_id:{type:"string"},rename_normalization_revision:{format:"uint16",maximum:65535,minimum:0,type:"integer"},resources:{$ref:"#/$defs/CodeCloneIndexResourcesV1"},source_revision:{type:["string","null"]}},required:["generation_id","conservative_normalization_revision","rename_normalization_revision","coverage","budgets","resources"],type:"object"},CodeCloneIndexResourcesV1:{description:"Measured resources and update accounting for one clone-index generation.",properties:{bytes_on_disk:{description:"Durable artifact bytes.",format:"uint64",minimum:0,type:["integer","null"]},changed_symbol_update_micros:{description:"Latest observed source-edit arrival through clone-ready publication.",format:"uint64",minimum:0,type:["integer","null"]},peak_scratch_memory_bytes:{description:"Largest measured clone-row serialization scratch during the build.",format:"uint64",minimum:0,type:["integer","null"]},stale_invalidations:{description:"Prior clone payload bindings invalidated by the latest publication.",format:"uint64",minimum:0,type:["integer","null"]}},type:"object"},CodeCloneIndexStatusV1:{description:"Clone readiness, independent from lexical and graph serving.",oneOf:[{description:"The sealed lexical artifact or its clone rows cannot be read.",properties:{reason:{type:"string"},state:{const:"unavailable",type:"string"}},required:["state","reason"],type:"object"},{description:"Some clone evidence is readable, but required postings are missing.",properties:{observation:{$ref:"#/$defs/CodeCloneIndexObservationV1"},omission_reasons:{items:{type:"string"},type:"array"},state:{const:"partial",type:"string"}},required:["state","observation","omission_reasons"],type:"object"},{description:"Required exact postings cover every eligible body.",properties:{observation:{$ref:"#/$defs/CodeCloneIndexObservationV1"},state:{const:"ready",type:"string"}},required:["state","observation"],type:"object"},{description:"The artifact is readable but belongs to a superseded source generation.",properties:{observation:{$ref:"#/$defs/CodeCloneIndexObservationV1"},reason:{type:"string"},state:{const:"stale",type:"string"}},required:["state","observation","reason"],type:"object"}]},CodeGraphServingReadinessV1:{description:"Interactive graph-serving state for the latest sealed generation.\n\nA sealed generation can expose truthful census statistics before its graph\nprojection is ready to serve queries, so readiness is reported separately.",oneOf:[{description:"No graph-serving authority exists for this worktree or generation.",properties:{reason:{type:"string"},state:{const:"unavailable",type:"string"}},required:["state","reason"],type:"object"},{description:"The sealed generation exists, but graph activation has not completed.",properties:{state:{const:"pending",type:"string"}},required:["state"],type:"object"},{description:"Graph activation completed without a serving projection.",properties:{reason:{type:"string"},state:{const:"refused",type:"string"}},required:["state","reason"],type:"object"},{description:"The verified graph projection is installed, but the engine or catalog\nits reads need is not resident: it is still being built, or it was\nreleased for memory. Graph reads answer the retryable warming state\nand restore it.",properties:{reason:{type:"string"},state:{const:"warming",type:"string"}},required:["state","reason"],type:"object"},{description:"The verified graph projection is installed for interactive reads.",properties:{state:{const:"ready",type:"string"}},required:["state"],type:"object"}]},CodeIndexBuildBlockedReasonV1:h_,CodeIndexBuildPhaseV1:{description:"The durable build phase whose committed boundary the dashboard is reading.\n\nA phase is not inferred from scheduler state. The mounted registry publishes\nthe exact phase that owns the active generation.",oneOf:[{enum:["source_scan","relational_preparation","bulk_commit","index_build","verification","ready"],type:"string"},{const:"graph_publication",description:"Text serving is built and the pass that sealed the generation is\nstill publishing its native graph.",type:"string"}]},CodeIndexBuildProgressV1:{description:"The latest committed progress boundary for one active code-index generation.\n\nEvery count is scoped to `generation_id`. The snapshot never includes a\nstaged page: work is reported only after the batch that owns it commits.",properties:{blocked_reason:{anyOf:[{$ref:"#/$defs/CodeIndexBuildBlockedReasonV1"},{type:"null"}],description:"Reason the active generation cannot currently advance, when known."},committed_chunks:{description:"Search chunks committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},committed_imports:{description:"Import evidence rows committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},committed_pages:{description:"Source pages committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},committed_payload_bytes:{description:"Payload bytes committed to the artifact database.",format:"uint64",minimum:0,type:"integer"},completed_files:{description:"Authenticated sealed-source file boundary completed by committed work.",format:"uint64",minimum:0,type:"integer"},completed_lexical_units:{description:"Authenticated lexical-span boundary completed by committed work, in the\nsealed source's own advance unit.\n\nThe unit is the source's, not this surface's: a sealed-layout source\nadvances over the files-array byte span, while a published or\npartitioned source advances over file ordinals because its file records\nare not a contiguous byte range at all. Both are monotone and share the\ndenominator below, so completion and the derived estimate are truthful;\nnaming them bytes was not, and a consumer that multiplied this by an\naverage file size was wrong by orders of magnitude (issue #1205).",format:"uint64",minimum:0,type:"integer"},current_batch_pages:{description:"Source pages in the batch currently being processed.",format:"uint64",minimum:0,type:"integer"},current_batch_payload_bytes:{description:"Sealed payload bytes in the batch currently being processed.",format:"uint64",minimum:0,type:"integer"},daemon_incarnation:{description:"Durable daemon-authority epoch that produced this snapshot.\n\nThis orders snapshots across daemon restarts without relying on wall\nclock time.",format:"uint64",minimum:0,type:"integer"},elapsed_micros:{description:"Monotonic elapsed time for this process's active generation build.",format:"uint64",minimum:0,type:"integer"},estimated_remaining_seconds:{description:"Estimated remaining build duration, absent without a truthful rate.",format:"uint64",minimum:0,type:["integer","null"]},files_per_second:{description:"Rolling committed-file throughput, absent until it is established.",format:"double",type:["number","null"]},generation_id:{description:"Exact generation receiving the committed build work.",type:"string"},last_commit_latency_micros:{description:"Duration of the last committed SQLite batch, when one exists.",format:"uint64",minimum:0,type:["integer","null"]},last_progress_micros:{description:"Unix-epoch timestamp of the last durable progress publication.",format:"int64",type:"integer"},lexical_units_per_second:{description:"Rolling committed lexical-span throughput in units per second, absent\nuntil it is established. Not a byte rate; see\n[`Self::completed_lexical_units`].",format:"double",type:["number","null"]},phase:{$ref:"#/$defs/CodeIndexBuildPhaseV1",description:"Durable pipeline phase that published this snapshot."},producer_incarnation:{description:"Registry-minted scheduler incarnation within one daemon.\n\nA worktree retirement/remount creates a new value. `progress_epoch` is\ncomparable only when both incarnation fields match.",format:"uint64",minimum:0,type:"integer"},progress_epoch:{description:"Monotonic publication epoch for replacing delayed progress reads.",format:"uint64",minimum:0,type:"integer"},sealed_source_digest:{description:"Identity of the sealed source whose authenticated bounds define progress.",type:"string"},total_files:{description:"Authenticated sealed-source file bound for this generation.",format:"uint64",minimum:0,type:"integer"},total_lexical_units:{description:"Authenticated lexical-span bound for this generation, in the same unit\nas [`Self::completed_lexical_units`].",format:"uint64",minimum:0,type:"integer"}},required:["generation_id","daemon_incarnation","producer_incarnation","progress_epoch","sealed_source_digest","phase","committed_pages","committed_chunks","committed_imports","committed_payload_bytes","completed_files","total_files","completed_lexical_units","total_lexical_units","current_batch_pages","current_batch_payload_bytes","elapsed_micros","last_progress_micros"],type:"object"},CodeIndexConvergenceParkedV1:hv,CodeIndexFreshnessCoverageV1:{description:"Coverage of one freshness read. Distinct from [`CodeIndexStalenessStateV1`]:\na generation can be fresh and still omit hook-hint counts, or unverified\nwhile the ladder would otherwise say ready.\n\n`Unobserved` is only the constructed default. A projected read never emits\nit, so an absent observation cannot be mistaken for `complete`.",oneOf:[{enum:["unobserved","complete","partial_refresh_in_progress","partial_artifact_restore","partial_source_verification","partial_unverified_restore","partial_hook_hint_overflow"],type:"string"},{const:"partial_omitted_sources",description:"The sealed generation is fresh for every source it can index, and\n[`CodeIndexWorktreeFreshnessV1::omitted_sources`] names the sources it\ncannot. Waiting cannot change it.",type:"string"}]},CodeIndexGenerationRecoveryServingV1:{description:"Serving disposition of an incompatible generation during recovery.",enum:["preserved","refused"],type:"string"},CodeIndexGenerationRecoveryV1:{description:"Recovery state for a durable generation sealed under a different production\nowner configuration.",properties:{incompatibilities:{description:"Stable owner-input reason codes reported by the code-index authority.",items:{type:"string"},type:"array"},incompatible_generation_id:{description:"Generation retired from incremental reuse.",type:"string"},serving:{$ref:"#/$defs/CodeIndexGenerationRecoveryServingV1",description:"Whether the prior generation may continue serving while its replacement\nbuilds under the current configuration."}},required:["incompatible_generation_id","incompatibilities","serving"],type:"object"},CodeIndexOmittedSourceV1:hb,CodeIndexOmittedSourcesV1:h$,CodeIndexReadinessWaitOutcomeV1:{description:"How a `wait_for` status read ended. The status payload beside it is read\nafter the wait ends.",oneOf:[{properties:{outcome:{const:"reached",type:"string"}},required:["outcome"],type:"object"},{description:"The caller's budget elapsed; `last_state` is the last observed\n`code_index_freshness.status`.",properties:{last_state:{type:"string"},outcome:{const:"timed_out",type:"string"}},required:["outcome","last_state"],type:"object"},{description:"Waiting cannot reach the target: no scheduler is mounted, graph\nserving was refused, convergence is parked, or the request ended.",properties:{outcome:{const:"unavailable",type:"string"},reason:{type:"string"}},required:["outcome","reason"],type:"object"}]},CodeIndexRestoreProgressV1:{description:"Bounded authentication work required to restore one immutable lexical\nartifact as a serving reader.\n\nThe unit is a fixed restore check, not bytes or build work. Completed\nchecks are published only after they pass. `authenticated_remaining` is\nalways `authenticated_total - authenticated_completed`, so a caller can\ndistinguish bounded cold restore from an unbounded rebuild.",properties:{artifact_digest:{description:"Whole-file content address from the durable artifact descriptor.",type:"string"},authenticated_completed:{description:"Successfully completed authentication checks.",format:"uint64",minimum:0,type:"integer"},authenticated_remaining:{description:"Checks that have not completed yet.",format:"uint64",minimum:0,type:"integer"},authenticated_total:{description:"Fixed number of authentication checks for this restore.",format:"uint64",minimum:0,type:"integer"},generation_id:{description:"Generation whose lexical serving seat is being restored.",type:"string"}},required:["generation_id","artifact_digest","authenticated_completed","authenticated_total","authenticated_remaining"],type:"object"},CodeIndexSourceOmissionReasonV1:hS,CodeIndexStalenessStateV1:hk,CodeIndexWorktreeFreshnessV1:{description:"Freshness/generation state for one mounted worktree.\n\n`Deserialize` is part of the wire contract: the CLI status command decodes\nexactly this type back out of the daemon's `tracedecay_status` response,\nkeeping one authority for the freshness shape.",properties:{clone_index:{anyOf:[{$ref:"#/$defs/CodeCloneIndexStatusV1"},{type:"null"}],description:"Clone readiness from the same sealed lexical artifact."},code_graph_serving:{anyOf:[{$ref:"#/$defs/CodeGraphServingReadinessV1"},{type:"null"}],description:"Whether that generation's verified graph projection can serve reads."},coverage:{$ref:"#/$defs/CodeIndexFreshnessCoverageV1",description:"Whether this read covers the complete mounted scheduler state."},generation_recovery:{anyOf:[{$ref:"#/$defs/CodeIndexGenerationRecoveryV1"},{type:"null"}],description:"One-shot owner-configuration recovery currently replacing an\nincompatible durable generation."},hook_hint_count:{description:"Pending hook-hint count, when cheaply available.",format:"uint64",minimum:0,type:["integer","null"]},last_reconcile_micros:{description:"Last reconcile observation time (microseconds since the Unix epoch).",format:"int64",type:["integer","null"]},latest_generation_id:{description:"Latest sealed generation identity, when a complete generation exists.",type:["string","null"]},omitted_sources:{anyOf:[{$ref:"#/$defs/CodeIndexOmittedSourcesV1"},{type:"null"}],description:"Sources the serving snapshot captured but does not index, when any."},parked:{anyOf:[{$ref:"#/$defs/CodeIndexConvergenceParkedV1"},{type:"null"}],description:"Deterministic contract violation currently parking background\nconvergence, when one is observed. `staleness_state` reads `parked`\nwhile this is set and no generation serves."},progress:{anyOf:[{$ref:"#/$defs/CodeIndexBuildProgressV1"},{type:"null"}],description:"Latest committed progress for the active generation, if one is mounted."},rebuild_in_flight:{description:"Whether the exact scheduler route owns a reconcile pass or has a\npending wake. A stale seated generation with this false is stalled,\nnot in a routine rebuild window.",type:"boolean"},repository_id:{description:"Stable repository identity resolved by the scheduler.",type:["string","null"]},restore_progress:{anyOf:[{$ref:"#/$defs/CodeIndexRestoreProgressV1"},{type:"null"}],description:"Bounded immutable-artifact restore work currently in flight. This is\nseparate from build progress because restore commits no index data."},sealed_at_micros:{description:"Time the complete generation was durably sealed.",format:"int64",type:["integer","null"]},snapshot_content_identity:{description:"Content identity of the complete source snapshot.",type:["string","null"]},source_reference:{description:"Exact source reference captured by the sealed generation.",type:["string","null"]},source_revision:{description:"Exact source revision captured by the sealed generation.",type:["string","null"]},staleness_state:{anyOf:[{$ref:"#/$defs/CodeIndexStalenessStateV1"},{type:"null"}],description:"Staleness-ladder state from the last scheduler execution. `fresh` means\nthe scheduler most recently observed a fresh source; the status read\ndoes not probe the worktree to revalidate that observation."},worktree_id:{description:"Stable worktree identity resolved by the scheduler.",type:["string","null"]},worktree_root:{description:"Display path of the mounted worktree root.",type:"string"}},required:["worktree_root","rebuild_in_flight","coverage"],type:"object"},LcmConvergenceStateV1:gX,LcmConvergenceV1:gY,LcmDoctorProjectionStateV1:g1,LcmDoctorProjectionV1:g0,NativeHostIdentityV1:{enum:["claude_code","cursor_desktop","cursor_cloud","codex","hermes","kiro","cline","roo_code","kilo","kimi_code","open_code","pi","factory_droid"],type:"string"},ProjectStatusV1:{additionalProperties:!1,properties:{active_branch:{type:["string","null"]},branch_diagnostics:!0,branch_drifted:{type:["boolean","null"]},branch_mismatch:{anyOf:[{$ref:"#/$defs/StatusBranchMismatchV1"},{type:"null"}]},branch_resolution:{type:["string","null"]},branch_warnings:{items:{type:"string"},type:["array","null"]},code_index_freshness:{$ref:"#/$defs/StatusCodeIndexFreshnessV1"},code_index_freshness_warning:{type:["string","null"]},current_branch:{type:["string","null"]},git_staleness:{anyOf:[{$ref:"#/$defs/StatusGitStalenessV1"},{type:"null"}]},github_source:{description:"The checkout's GitHub source as its advisory owner observed it."},graph_statistics:{description:"The exact-scope sealed-generation census."},hook_replay:{$ref:"#/$defs/StatusHookReplayV1",description:"The daemon's drain of this project's hook spools, as its last sweep\nleft it."},live_branch:{type:["string","null"]},memory:{$ref:"#/$defs/StatusMemoryV1"},parent_branch:{type:["string","null"]},project_root:{type:"string"},reset_required_stores:{description:"Registered stores this binary serves only as a typed reset-required\nrefusal, each with the command that resets it.",items:{$ref:"#/$defs/StoreResetRequiredV1"},type:"array"},retrieval_serving:{anyOf:[{$ref:"#/$defs/StatusRetrievalServingV1"},{type:"null"}],description:"Whether exact-scope retrieval can serve, when the census authority is\nattached."},schema_convergence:{$ref:"#/$defs/StatusSchemaConvergenceV1"},scope_prefix:{type:["string","null"]},server:{description:"The serving MCP server's request counters."},serving_branch:{type:["string","null"]},session_git_evidence:{$ref:"#/$defs/StatusSessionGitEvidenceV1",description:"The session↔Git evidence `tracedecay_sessions_for` and the\nbranch/commit session filters read."},session_history_catch_up:!0,session_ingest:!0,session_projection:{$ref:"#/$defs/LcmDoctorProjectionV1",description:"The project session projection's serving state, the same reading\n`tracedecay_lcm_doctor` reports."},storage_health:!0,tracked_branch_count:{format:"uint",minimum:0,type:["integer","null"]},wait:{anyOf:[{$ref:"#/$defs/CodeIndexReadinessWaitOutcomeV1"},{type:"null"}]}},required:["project_root","graph_statistics","memory","schema_convergence","reset_required_stores","code_index_freshness","github_source","session_projection","session_git_evidence","hook_replay"],type:"object"},ResidentMemoryHolderReadV1:{description:"One worktree holding a retained owner's memory, and what it holds: a\ngeneration id, or an LSP session id.",properties:{holding:{type:"string"},worktree_id:{type:"string"}},required:["worktree_id","holding"],type:"object"},RetrievalWorkerStatusV1:vT,SchemaConvergenceFindingV1:vL,SchemaConvergenceStageV1:vU,SchemaConvergenceStateV1:vH,StatusAdmissionV1:{additionalProperties:!1,properties:{project_admitted:{type:"boolean"},project_root:{type:"string"},scope_prefix:{type:["string","null"]},server:{description:"The serving MCP server's request counters."}},required:["project_admitted","project_root"],type:"object"},StatusBranchMismatchV1:{additionalProperties:!1,properties:{git_branch:{type:["string","null"]},indexed_branch:{type:["string","null"]},serving_branch:{type:["string","null"]}},type:"object"},StatusCodeIndexFreshnessV1:{description:"The code-index freshness of the served worktree, labeled the way readiness\nwaits report their last state.",oneOf:[{additionalProperties:!1,properties:{status:{const:"current",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"stale",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"restoring",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"warming",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,properties:{status:{const:"parked",type:"string"},worktree:{$ref:"#/$defs/CodeIndexWorktreeFreshnessV1"}},required:["status","worktree"],type:"object"},{additionalProperties:!1,description:"The last code-index mount failed; explicit reconciliation can retry it.",properties:{message:{type:"string"},remediation:{type:"string"},status:{const:"mount_failed",type:"string"}},required:["status","message","remediation"],type:"object"},{additionalProperties:!1,properties:{reason:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StatusGitStalenessUnavailableV1:{oneOf:[{const:"no_sealed_generation",description:"No complete generation has sealed for the worktree yet.",type:"string"},{const:"sealed_generation_has_no_commit",description:"The sealed generation captured no commit, as in an unborn repository.",type:"string"},{const:"git_head_unreadable",description:"The worktree's checked-out commit could not be read.",type:"string"}]},StatusGitStalenessV1:{description:"The sealed generation's Git watermark, the commit its source snapshot was\ncaptured from, against the worktree's checked-out commit.",oneOf:[{additionalProperties:!1,description:"HEAD is the commit the sealed generation was built from.",properties:{status:{const:"current",type:"string"},watermark:{type:"string"}},required:["status","watermark"],type:"object"},{additionalProperties:!1,description:"HEAD has moved off the commit the sealed generation was built from.",properties:{head:{type:"string"},status:{const:"stale",type:"string"},watermark:{type:"string"}},required:["status","watermark","head"],type:"object"},{additionalProperties:!1,description:"No watermark or no HEAD to compare it with.",properties:{reason:{$ref:"#/$defs/StatusGitStalenessUnavailableV1"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StatusHookReplayFailureV1:{additionalProperties:!1,description:"One hook spool the last replay sweep could not drain.",properties:{cause:{type:"string"},host:{$ref:"#/$defs/NativeHostIdentityV1"},spool:{$ref:"#/$defs/StatusHookReplaySpoolV1"}},required:["host","spool","cause"],type:"object"},StatusHookReplaySpoolV1:{oneOf:[{const:"records",description:"The host's spooled hook events.",type:"string"},{const:"delivery_receipts",description:"The host's hook delivery receipts.",type:"string"},{const:"pending_work",description:"The producer work the host's admission ledger still owes.",type:"string"}]},StatusHookReplayV1:{description:"The daemon's hook spool drain for one project.",oneOf:[{additionalProperties:!1,description:"No replay consumer drains this project's hook spools in this daemon.",properties:{status:{const:"unowned",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The replay consumer has not finished its first sweep.",properties:{status:{const:"starting",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The last sweep drained every hook spool it found.",properties:{status:{const:"drained",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The spools drained, but producer work they admitted waits for the\nproject's hook orchestrator to mount. The work stays owed and runs\nonce it does; nothing has failed.",properties:{status:{const:"waiting",type:"string"},waiting:{items:{$ref:"#/$defs/StatusHookReplayFailureV1"},type:"array"}},required:["status","waiting"],type:"object"},{additionalProperties:!1,description:"The last sweep could not drain these spools. Their records stay\ndurable and the next sweep retries them.",properties:{failures:{items:{$ref:"#/$defs/StatusHookReplayFailureV1"},type:"array"},status:{const:"failed",type:"string"}},required:["status","failures"],type:"object"}]},StatusMemoryOwnerV1:{additionalProperties:!1,properties:{bytes:{format:"uint64",minimum:0,type:["integer","null"]},content_digest:{type:["string","null"]},holders:{items:{$ref:"#/$defs/ResidentMemoryHolderReadV1"},type:"array"},idle_seconds:{format:"uint64",minimum:0,type:"integer"},kind:{type:"string"},measured:{type:"boolean"},project_id:{type:"string"},protected:{type:"boolean"}},required:["project_id","kind","holders","measured","idle_seconds","protected"],type:"object"},StatusMemoryPressureV1:{enum:["unobserved","nominal","over_budget"],type:"string"},StatusMemoryReservationV1:{additionalProperties:!1,properties:{bytes:{format:"uint64",minimum:0,type:"integer"},component:{type:"string"}},required:["component","bytes"],type:"object"},StatusMemoryV1:{additionalProperties:!1,description:"The daemon's memory admission and resident accounting as one project sees it.",properties:{high_watermark_bytes:{format:"uint64",minimum:0,type:"integer"},idle_window_seconds:{format:"uint64",minimum:0,type:"integer"},limit_bytes:{format:"uint64",minimum:0,type:"integer"},low_watermark_bytes:{format:"uint64",minimum:0,type:"integer"},owners:{description:"This project's retained owners; other projects' belong to the\ndaemon-wide Doctor inventory.",items:{$ref:"#/$defs/StatusMemoryOwnerV1"},type:"array"},psi_some_avg10:{format:"double",type:["number","null"]},reservations:{description:"`reserved_bytes` per component, largest first.",items:{$ref:"#/$defs/StatusMemoryReservationV1"},type:"array"},reserved_bytes:{description:"Bytes admitted work has reserved daemon-wide: the admission model of\nin-flight builds and decodes, not a measurement.",format:"uint64",minimum:0,type:"integer"},resident_bytes:{description:"Observed admission occupancy: anonymous/shared process pages plus swap,\nconstrained by shared cgroup headroom. This is not raw process RSS.",format:"uint64",minimum:0,type:["integer","null"]},retained_bytes:{format:"uint64",minimum:0,type:"integer"},shed_order:{items:{type:"string"},type:"array"},status:{$ref:"#/$defs/StatusMemoryPressureV1"},unattributed_bytes:{description:"Raw process RSS from the last successful canonical sample minus the\ndaemon-wide measured `retained_bytes`, saturating at zero. Unlike\n`resident_bytes`, this excludes swap and shared cgroup pressure. Work in\nflight, runtime allocations, SQLite page caches, and allocator-held pages\ncan contribute. `None` until a resident sample has been published.",format:"uint64",minimum:0,type:["integer","null"]},unmeasured_owners:{format:"uint",minimum:0,type:"integer"}},required:["status","limit_bytes","high_watermark_bytes","low_watermark_bytes","idle_window_seconds","shed_order","retained_bytes","unmeasured_owners","reserved_bytes","reservations","owners"],type:"object"},StatusRetrievalServingV1:{oneOf:[{additionalProperties:!1,description:"A sealed complete generation serves the exact worktree. The ages tell a\nroutine rebuild window from a wedged route.",properties:{condition:{anyOf:[{$ref:"#/$defs/StatusServingConditionV1"},{type:"null"}]},freshness:{$ref:"#/$defs/StatusServingFreshnessV1"},last_reconcile_age_seconds:{format:"int64",type:["integer","null"]},seated_generation_age_seconds:{format:"int64",type:["integer","null"]},status:{const:"serving",type:"string"}},required:["status","freshness"],type:"object"},{additionalProperties:!1,description:"The census answered and nothing is servable yet.",properties:{reason:{type:"string"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StatusSchemaConvergenceStateV1:{enum:["completed","in_progress","retrying","degraded"],type:"string"},StatusSchemaConvergenceV1:{additionalProperties:!1,properties:{findings:{items:{$ref:"#/$defs/SchemaConvergenceFindingV1"},type:"array"},status:{$ref:"#/$defs/StatusSchemaConvergenceStateV1"}},required:["status","findings"],type:"object"},StatusServingConditionV1:{enum:["artifact_restore","source_verification","rebuilding","stalled"],type:"string"},StatusServingFreshnessV1:{enum:["current","restoring","last_complete_stale","unknown"],type:"string"},StatusSessionGitEvidenceUnavailableV1:{oneOf:[{const:"session_store_denied",description:"This request holds no project session store.",type:"string"},{const:"read_failed",description:"The session store refused the evidence read.",type:"string"}]},StatusSessionGitEvidenceV1:{description:"The project's session↔Git evidence generation.",oneOf:[{additionalProperties:!1,description:"A convergence pass installed this generation.",properties:{backfill_watermark:{format:"int64",type:["integer","null"]},commit_count:{format:"uint64",minimum:0,type:"integer"},generation:{type:"string"},source_watermark:{type:"string"},span_count:{format:"uint64",minimum:0,type:"integer"},status:{const:"recorded",type:"string"}},required:["status","generation","source_watermark","span_count","commit_count"],type:"object"},{additionalProperties:!1,description:"No convergence pass has written evidence for this project yet.",properties:{backfill_watermark:{format:"int64",type:["integer","null"]},status:{const:"unrecorded",type:"string"}},required:["status"],type:"object"},{additionalProperties:!1,description:"The evidence could not be read.",properties:{message:{type:["string","null"]},reason:{$ref:"#/$defs/StatusSessionGitEvidenceUnavailableV1"},status:{const:"unavailable",type:"string"}},required:["status","reason"],type:"object"}]},StoreResetRequiredV1:{description:"A persisted store the daemon keeps mounted in a typed reset-required state\ninstead of refusing to serve: every read against it returns the typed\nrefusal, stores that admit keep serving, and `remedy` is the exact command\nthe operator runs to reset it.",properties:{authority:{type:"string"},found_version:{format:"int64",type:["integer","null"]},reason:{type:"string"},remedy:{type:"string"},required_version:{format:"int64",type:["integer","null"]},store:{type:"string"}},required:["store","authority","reason","remedy"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/StatusAdmissionV1"},{$ref:"#/$defs/ProjectStatusV1"}],description:"`tracedecay_status` for an `admission_only` read, or the project's status.",title:"StatusResultV1"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_details:{default:!1,type:"boolean"}},title:"StorageStatusPrimitiveRequest",type:"object"},{$defs:{StorageStatusHistoryPointV1:{additionalProperties:!1,properties:{database_bytes:{format:"uint64",minimum:0,type:"integer"},observed_at:{format:"int64",type:"integer"}},required:["observed_at","database_bytes"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{database_bytes:{format:"uint64",minimum:0,type:["integer","null"]},details:{items:{type:"string"},type:"array"},freelist_pages:{default:null,format:"uint64",minimum:0,type:["integer","null"]},history:{default:[],items:{$ref:"#/$defs/StorageStatusHistoryPointV1"},type:"array"},history_coverage:{default:null,type:["string","null"]},page_count:{default:null,format:"uint64",minimum:0,type:["integer","null"]},page_size_bytes:{default:null,format:"uint32",minimum:0,type:["integer","null"]},project_id:{default:null,type:["string","null"]},read_only:{type:"boolean"},status:{type:"string"},store_path:{default:null,type:["string","null"]}},required:["status","read_only","details"],title:"StorageStatusPrimitiveResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact public input accepted by `tracedecay_str_replace`.",properties:{dry_run:{default:!1,type:"boolean"},expected_state:{description:"Exact `preview_digest`/`expected_state` returned by the dry run. Apply\nre-resolves the typed plan and rejects any candidate-state drift.",type:["string","null"]},idempotency_key:{type:["string","null"]},new_str:{type:"string"},old_str:{type:"string"},path:{type:"string"},verify:{default:!1,type:"boolean"}},required:["path","old_str","new_str"],title:"StrReplaceSurfaceRequestV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{description:"Source file path to find test coverage for.",type:["string","null"]},node_id:{description:"Specific node ID to find test coverage for (alternative to file).",type:["string","null"]}},title:"TestMapSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,TestMapSourceCoverageV1:{additionalProperties:!1,properties:{source_file:{type:"string"},source_id:{type:"string"},source_line:{format:"uint32",minimum:0,type:"integer"},source_name:{type:"string"},tests:{items:{$ref:"#/$defs/TestMapTestV1"},type:"array"}},required:["source_name","source_id","source_file","source_line","tests"],type:"object"},TestMapTestV1:{additionalProperties:!1,properties:{attribution_depth:{format:"uint32",minimum:0,type:"integer"},test_file:{type:"string"},test_line:{format:"uint32",minimum:0,type:"integer"},test_name:{type:"string"}},required:["test_name","test_file","test_line","attribution_depth"],type:"object"},TestMapUncoveredV1:{additionalProperties:!1,properties:{file:{type:"string"},id:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["id","name","file","line"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{coverage:{items:{$ref:"#/$defs/TestMapSourceCoverageV1"},type:"array"},covered_symbols:{format:"uint64",minimum:0,type:"integer"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},test_files:{items:{type:"string"},type:"array"},uncovered:{items:{$ref:"#/$defs/TestMapUncoveredV1"},type:"array"},uncovered_symbols:{format:"uint64",minimum:0,type:"integer"}},required:["covered_symbols","uncovered_symbols","test_files","coverage","uncovered"],title:"TestMapResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The admitted project selects the retained managed test run, so this exact\nrequest intentionally carries no caller-selectable scope or identity.",title:"TestResultsSurfaceRequestV1",type:"object"},{$defs:{CancellationObservation:hn,CancellationStage:ha,CodeGenerationId:hy,CommitId:hq,Deadline:yv,OperationBudgetUsage:_D,OperationReceipt:_F,OperationTermination:_L,TestResultProjectionV1:{additionalProperties:!1,description:"One result emitted by the daemon-managed test-run authority.",properties:{passed:{type:"boolean"},test:{type:"string"}},required:["test","passed"],type:"object"},UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Exact retained managed-test-run projection returned by `test_results`.\n\nThe daemon resolves the admitted project, reads its newest durable managed\nrun, and verifies that the run's head and code generation are current\nbefore it serializes this payload. `result_offset` and `available_results`\nretain the authoritative page position. The outcome fields (`finished_at`,\n`exit_code`, the counts, `termination`, `receipt`) are present only after\nthe managed run terminates.",properties:{available_results:{format:"uint64",minimum:0,type:"integer"},code_generation_id:{anyOf:[{$ref:"#/$defs/CodeGenerationId"},{type:"null"}]},completed:{format:"uint64",minimum:0,type:"integer"},exit_code:{format:"int32",type:["integer","null"]},failed:{format:"uint64",minimum:0,type:["integer","null"]},finished_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},head_commit_id:{anyOf:[{$ref:"#/$defs/CommitId"},{type:"null"}]},ignored:{format:"uint64",minimum:0,type:["integer","null"]},operation_id:{type:"string"},passed:{format:"uint64",minimum:0,type:["integer","null"]},receipt:{anyOf:[{$ref:"#/$defs/OperationReceipt"},{type:"null"}]},result_offset:{format:"uint64",minimum:0,type:"integer"},results:{items:{$ref:"#/$defs/TestResultProjectionV1"},type:"array"},session_id:{description:"The session the run was requested by; null when the request named none.",type:["string","null"]},started_at:{$ref:"#/$defs/UtcMicros"},termination:{anyOf:[{$ref:"#/$defs/OperationTermination"},{type:"null"}]},total:{format:"uint64",minimum:0,type:["integer","null"]}},required:["operation_id","started_at","results","completed","result_offset","available_results"],title:"TestResultsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{include_tested:{description:"Include already-tested functions in results (default: false).",type:["boolean","null"]},limit:{description:"Maximum number of results to return (default: 20, at most 200).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory path.",type:["string","null"]}},title:"TestRiskSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,ComplexityAnalysisV1:hx,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,TestAttributionMethodV1:{description:"How a source symbol's static test evidence was attributed.",enum:["none","direct_unit","closure"],type:"string"},TestRiskAttributionSummaryV1:{additionalProperties:!1,properties:{cli_entry_attributed:{format:"uint64",minimum:0,type:"integer"},closure_attributed:{format:"uint64",minimum:0,type:"integer"},depth:{format:"uint64",minimum:0,type:"integer"},direct_unit_attributed:{format:"uint64",minimum:0,type:"integer"},public_api_attributed:{format:"uint64",minimum:0,type:"integer"},total_attributed:{format:"uint64",minimum:0,type:"integer"},trait_resolved_attributed:{format:"uint64",minimum:0,type:"integer"}},required:["depth","direct_unit_attributed","closure_attributed","trait_resolved_attributed","public_api_attributed","cli_entry_attributed","total_attributed"],type:"object"},TestRiskBucketSummaryV1:{additionalProperties:!1,properties:{attributed:{format:"uint64",minimum:0,type:"integer"},excluded:{format:"uint64",minimum:0,type:"integer"},orphan_entry:{format:"uint64",minimum:0,type:"integer"},reachable_unattributed:{format:"uint64",minimum:0,type:"integer"}},required:["attributed","reachable_unattributed","orphan_entry","excluded"],type:"object"},TestRiskConfidenceV1:{description:"What the reported coverage percentage bounds.",enum:["static_lower_bound"],type:"string"},TestRiskEntryV1:{additionalProperties:!1,properties:{attribution_depth:{format:"uint64",minimum:0,type:["integer","null"]},attribution_method:{$ref:"#/$defs/TestAttributionMethodV1"},churn:{format:"uint64",minimum:0,type:"integer"},complexity:{description:"`None` when `complexity_analysis` reports the bounded walk did not\ncover the body; `risk` then weighs the lower-bound counters.",format:"uint32",minimum:0,type:["integer","null"]},complexity_analysis:{$ref:"#/$defs/ComplexityAnalysisV1"},fan_in:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"},has_test:{type:"boolean"},id:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"},risk:{format:"double",type:"number"}},required:["id","name","file","line","complexity_analysis","fan_in","has_test","attribution_method","risk","churn"],type:"object"},TestRiskSummaryV1:{additionalProperties:!1,properties:{attribution:{$ref:"#/$defs/TestRiskAttributionSummaryV1"},buckets:{$ref:"#/$defs/TestRiskBucketSummaryV1"},confidence:{$ref:"#/$defs/TestRiskConfidenceV1"},confidence_note:{type:"string"},coverage_pct:{format:"double",type:"number"},skipped:{format:"uint64",minimum:0,type:"integer"},tested:{format:"uint64",minimum:0,type:"integer"},top_risk_unattributed:{type:"string"},top_risk_untested:{type:"string"},total_functions:{format:"uint64",minimum:0,type:"integer"}},required:["total_functions","tested","skipped","coverage_pct","top_risk_untested","top_risk_unattributed","attribution","buckets","confidence","confidence_note"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},risks:{items:{$ref:"#/$defs/TestRiskEntryV1"},type:"array"},summary:{$ref:"#/$defs/TestRiskSummaryV1"}},required:["risks","summary"],title:"TestRiskResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{kinds:{items:{type:"string"},type:["array","null"]},limit:{format:"uint32",minimum:0,type:["integer","null"]},path:{type:["string","null"]}},title:"TodosSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,TodoMarkerV1:{additionalProperties:!1,properties:{enclosing:{type:["string","null"]},file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},text:{type:"string"}},required:["kind","file","line","text"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{by_kind:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},type:"object"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},markers:{items:{$ref:"#/$defs/TodoMarkerV1"},type:"array"},match_count:{format:"uint",minimum:0,type:"integer"}},required:["match_count","by_kind","markers"],title:"TodosResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{ecosystem:{description:"Filter findings to one ecosystem ('rust' or 'typescript'). Every\necosystem section is still reported, so the scope of the answer stays\nvisible.",type:["string","null"]},limit:{description:"Maximum unmounted files to return (default: 200, max: 2000). The\nresponse always states the true total and how many rows were omitted.",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter findings to files under this directory path (e.g. 'src/daemon').\nThe whole project is still walked, reachability is not a per-directory\nquestion.",type:["string","null"]}},title:"UnmountedFilesSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,UnmountedEcosystemStatusV1:{description:"Whether an ecosystem was audited, absent, or recognised but unmodelled.",enum:["audited","partial","not_present","unsupported"],type:"string"},UnmountedEcosystemV1:{additionalProperties:!1,properties:{blind_spots:{items:{type:"string"},type:"array"},ecosystem:{type:"string"},entry_point_count:{format:"uint64",minimum:0,type:"integer"},excluded_path_globs:{items:{type:"string"},type:"array"},mounted_file_count:{format:"uint64",minimum:0,type:"integer"},note:{type:["string","null"]},package_count:{format:"uint64",minimum:0,type:"integer"},scanned_file_count:{format:"uint64",minimum:0,type:"integer"},status:{$ref:"#/$defs/UnmountedEcosystemStatusV1"},unclaimed_file_count:{format:"uint64",minimum:0,type:"integer"},unmounted_file_count:{format:"uint64",minimum:0,type:"integer"},verdict:{type:"string"}},required:["ecosystem","status","package_count","entry_point_count","scanned_file_count","mounted_file_count","unclaimed_file_count","unmounted_file_count","verdict","blind_spots","excluded_path_globs"],type:"object"},UnmountedFileV1:{additionalProperties:!1,properties:{ecosystem:{type:"string"},file:{type:"string"},manifest:{type:"string"},nearest_mounted_parent:{type:["string","null"]},package:{type:"string"},suggested_declaration:{type:["string","null"]}},required:["file","ecosystem","package","manifest"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{complete:{type:"boolean"},ecosystem:{type:["string","null"]},ecosystems:{items:{$ref:"#/$defs/UnmountedEcosystemV1"},type:"array"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},limit:{format:"uint64",minimum:0,type:"integer"},omitted_count:{format:"uint64",minimum:0,type:"integer"},path:{type:["string","null"]},returned_count:{format:"uint64",minimum:0,type:"integer"},unmounted:{items:{$ref:"#/$defs/UnmountedFileV1"},type:"array"},unmounted_file_count:{format:"uint64",minimum:0,type:"integer"}},required:["unmounted_file_count","returned_count","omitted_count","complete","ecosystems","limit","unmounted"],title:"UnmountedFilesResultV1",type:"object"},{$defs:{UnsafePatternKindV1:bB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{exclude_tests:{description:"When true, skips files whose path looks like a test (default: false).",type:["boolean","null"]},kinds:{description:"Subset of patterns to search. Default (or an empty list): every kind.",items:{$ref:"#/$defs/UnsafePatternKindV1"},type:["array","null"]},limit:{description:"Maximum number of matches to return (default: 200, max: 2000).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Filter to files under this directory (relative to project root).",type:["string","null"]}},title:"UnsafePatternsSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:h_,CodeIndexConvergenceParkedV1:hv,CodeIndexStalenessStateV1:hk,CoverageCompleteness:yu,PrimitiveFreshnessStateV1:_B,PrimitiveIndexingStateV1:_K,PrimitiveSearchFreshnessV1:_X,UnsafePatternFileOmissionV1:{additionalProperties:!1,description:"One scanned file whose sites are not reported as verified matches.",properties:{cause:{$ref:"#/$defs/UnsafePatternOmissionCauseV1"},file:{type:"string"},reason:{$ref:"#/$defs/UnsafePatternOmissionReasonV1"},withheld_match_count:{description:"Sites of the requested kinds found in the file and withheld.",format:"uint64",minimum:0,type:"integer"}},required:["file","reason","cause","withheld_match_count"],type:"object"},UnsafePatternKindV1:bB,UnsafePatternMatchV1:{additionalProperties:!1,properties:{enclosing:{type:["string","null"]},file:{type:"string"},in_test:{type:"boolean"},kind:{$ref:"#/$defs/UnsafePatternKindV1"},line:{format:"uint32",minimum:0,type:"integer"},snippet:{type:"string"}},required:["kind","file","line","snippet","in_test"],type:"object"},UnsafePatternOmissionCauseV1:{description:"What prevented the file from being classified.",oneOf:[{const:"syntax_errors",description:"The Rust grammar parsed the file with error nodes. Valid Rust it only\npartly parses (heavy `macro_rules!`) lands here.",type:"string"}]},UnsafePatternOmissionReasonV1:{description:"Why a file's risky-pattern sites are withheld from the verified result.",oneOf:[{const:"test_scope_unclassified",description:"Whether a site is test-only cannot be decided for this file.",type:"string"}]}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{by_kind:{additionalProperties:{format:"uint64",minimum:0,type:"integer"},description:"Match count per pattern kind, keyed by its wire spelling.",type:"object"},coverage:{$ref:"#/$defs/CoverageCompleteness",description:"`partial` exactly when `omissions` names a file whose sites are withheld."},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},match_count:{format:"uint64",minimum:0,type:"integer"},matches:{items:{$ref:"#/$defs/UnsafePatternMatchV1"},type:"array"},omissions:{items:{$ref:"#/$defs/UnsafePatternFileOmissionV1"},type:"array"}},required:["match_count","by_kind","matches","coverage","omissions"],title:"UnsafePatternsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{agent_label:{type:["string","null"]},branch:{type:["string","null"]},commit:{type:["string","null"]},limit:{format:"uint64",minimum:0,type:["integer","null"]},run_id:{type:["string","null"]},session_id:{type:["string","null"]},worktree:{type:["string","null"]}},title:"WorkflowsRequestV1",type:"object"},{$defs:{GitScopeV1:gE,RetainedErrorV1:vV,RetainedOutcomeStatusV1:vR,WorkflowAgentV1:{additionalProperties:!1,properties:{agent_id:{type:"string"},agent_label:{type:"string"},agent_session_id:{type:["string","null"]},ended_ts:{format:"int64",type:["integer","null"]},model:{type:["string","null"]},phase:{type:["string","null"]},run_id:{type:"string"},started_ts:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/WorkflowStatusV1"},tokens:{format:"int64",type:"integer"},transcript_path:{type:["string","null"]}},required:["run_id","agent_label","agent_id","status"],type:"object"},WorkflowCoverageV1:{enum:["complete","conclusive","bounded_prefix"],type:"string"},WorkflowQueryModeV1:{enum:["session","git_scope","run","agent"],type:"string"},WorkflowRunV1:{additionalProperties:!1,properties:{agent_count:{format:"int64",type:"integer"},description:{type:["string","null"]},ended_ts:{format:"int64",type:["integer","null"]},name:{type:["string","null"]},parent_session_id:{type:"string"},phase_json:{type:["string","null"]},result_summary:{type:["string","null"]},run_id:{type:"string"},started_ts:{format:"int64",type:["integer","null"]},status:{$ref:"#/$defs/WorkflowStatusV1"}},required:["run_id","parent_session_id","status"],type:"object"},WorkflowStatusV1:{enum:["running","completed","failed","unknown"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{agent:{anyOf:[{$ref:"#/$defs/WorkflowAgentV1"},{type:"null"}]},agent_count:{format:"int64",type:["integer","null"]},agent_label:{type:["string","null"]},agents:{items:{$ref:"#/$defs/WorkflowAgentV1"},type:["array","null"]},agents_complete:{type:["boolean","null"]},agents_coverage:{anyOf:[{$ref:"#/$defs/WorkflowCoverageV1"},{type:"null"}]},agents_returned:{format:"uint",minimum:0,type:["integer","null"]},count:{format:"uint",minimum:0,type:["integer","null"]},error:{anyOf:[{$ref:"#/$defs/RetainedErrorV1"},{type:"null"}]},found:{type:["boolean","null"]},git_filter:{anyOf:[{$ref:"#/$defs/GitScopeV1"},{type:"null"}]},lookup_complete:{type:["boolean","null"]},lookup_coverage:{anyOf:[{$ref:"#/$defs/WorkflowCoverageV1"},{type:"null"}]},message:{type:["string","null"]},mode:{anyOf:[{$ref:"#/$defs/WorkflowQueryModeV1"},{type:"null"}]},run:{anyOf:[{$ref:"#/$defs/WorkflowRunV1"},{type:"null"}]},run_id:{type:["string","null"]},runs:{items:{$ref:"#/$defs/WorkflowRunV1"},type:["array","null"]},session_id:{type:["string","null"]},status:{$ref:"#/$defs/RetainedOutcomeStatusV1"}},required:["status"],title:"WorkflowsResultV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Confirmation names the exact inspection digest, not a worktree id alone.",properties:{inspection_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target","inspection_digest"],title:"WorktreeCleanupConfirmRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target"],title:"WorktreeCleanupInspectRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target","confirmation_digest"],title:"WorktreeCleanupReconcileRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,UtcMicros:bZ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Removal carries both proofs so a stale confirmation cannot be replayed\nagainst another inspection of the same opaque worktree identity.",properties:{confirmation_digest:{$ref:"#/$defs/ManifestDigest"},confirmed_at:{$ref:"#/$defs/UtcMicros"},inspection_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target","inspection_digest","confirmed_at","confirmation_digest"],title:"WorktreeCleanupRemoveRequestV1",type:"object"},{$defs:{ManifestDigest:_l,NativeWorktreeTargetV1:_E,ProjectId:_4,RepositoryId:vb,ScopeSetId:vX,ScopeSetRevision:vY,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"},target:{$ref:"#/$defs/NativeWorktreeTargetV1"}},required:["scope_set_id","scope_set_revision","scope_set_digest","target"],title:"WorktreeInventoryRequestV1",type:"object"},{$defs:{ActorId:fb,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Issues a short-lived, version-bound task-opening token.\n\nIdentity, scope, authority revisions, issuance time, and expiry are all\nsupplied by the admitted daemon request. The caller supplies only the\nbearer, destination session, exact task version, and enrolled recipient\nprincipal it intends to authorize.",properties:{recipient_actor_id:{$ref:"#/$defs/ActorId"},session_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"},token:{type:"string"},version:{format:"uint64",minimum:0,type:"integer"}},required:["token","session_id","task_id","version","recipient_actor_id"],title:"IssueTaskHandoffRequestV1",type:"object"},{$defs:{ManifestDigest:_l,TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Flat public receipt for a committed task-handoff issue.\n\nThe complete binding remains inside the daemon authority. Publishing only\nthese exact identifiers avoids turning mutable grant and policy internals\ninto a second public wire authority.",properties:{expires_at:{$ref:"#/$defs/UtcMicros"},issued_at:{$ref:"#/$defs/UtcMicros"},issued_request_id:{type:"string"},session_id:{type:"string"},task_id:{$ref:"#/$defs/TaskId"},token_digest:{$ref:"#/$defs/ManifestDigest"},version:{format:"uint64",minimum:0,type:"integer"}},required:["token_digest","issued_request_id","session_id","task_id","version","issued_at","expires_at"],title:"IssueTaskHandoffResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:'Enumerates the handoff tokens this caller could redeem in one session.\n\nThe two `open_*` operations redeem a bearer the caller already holds; they\ncannot answer "what has been handed to me and not yet taken up". This one\ncan, and it does so without any bearer: the request carries no token, and\nthe result carries only digests.',properties:{session_id:{type:"string"}},required:["session_id"],title:"ListTaskHandoffsRequestV1",type:"object"},{$defs:{FeedbackFindingId:y8,HandoffOpenKindV1:{enum:["investigation","task"],type:"string"},HandoffOpenTargetV1:{oneOf:[{properties:{finding_id:{$ref:"#/$defs/FeedbackFindingId"},kind:{const:"investigation",type:"string"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"}},required:["kind","finding_id","owner_version_digest"],type:"object"},{properties:{kind:{const:"task",type:"string"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"},task_id:{$ref:"#/$defs/TaskId"},version:{format:"uint64",minimum:0,type:"integer"}},required:["kind","task_id","version","owner_version_digest"],type:"object"}]},ListedTaskHandoffV1:{additionalProperties:!1,description:"One handoff token, projected for public reading.\n\nMirrors [`IssueTaskHandoffResultV1`]'s doctrine: the complete binding stays\ninside the daemon authority, and only these identifiers cross the wire. No\nbearer secret exists to leak here. The authority never stored one, and the\nissuer's grant identity and policy digests stay concealed.",properties:{consumed_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],description:"Set only when `state` is `consumed`."},expires_at:{$ref:"#/$defs/UtcMicros"},issued_at:{$ref:"#/$defs/UtcMicros"},issued_request_id:{type:"string"},kind:{$ref:"#/$defs/HandoffOpenKindV1"},session_id:{type:"string"},state:{$ref:"#/$defs/TaskHandoffTokenStateV1"},target:{$ref:"#/$defs/HandoffOpenTargetV1"},token_digest:{$ref:"#/$defs/ManifestDigest"}},required:["token_digest","issued_request_id","session_id","kind","target","issued_at","expires_at","state"],type:"object"},ManifestDigest:_l,TaskHandoffTokenStateV1:{description:"Where one enumerated token stands at the observed instant.",oneOf:[{const:"open",description:"Not yet redeemed, and not yet expired: the live frontier.",type:"string"},{const:"consumed",description:"Redeemed. Single-use, so it can never be redeemed again.",type:"string"},{const:"expired",description:"Its window closed with no redemption. A dropped handoff, which is\nexactly the fact a frontier exists to surface.",type:"string"}]},TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The handoff-token frontier for one session.",properties:{consumed_count:{format:"uint32",minimum:0,type:"integer"},expired_count:{format:"uint32",minimum:0,type:"integer"},handoffs:{items:{$ref:"#/$defs/ListedTaskHandoffV1"},type:"array"},observed_at:{$ref:"#/$defs/UtcMicros",description:"The instant the states below were decided at. Without it, `open` and\n`expired` are claims with no clock behind them."},open_count:{format:"uint32",minimum:0,type:"integer"},truncated:{description:"True when the enumeration ceiling was reached, so the counts describe a\nprefix of the frontier rather than all of it.",type:"boolean"}},required:["observed_at","handoffs","open_count","consumed_count","expired_count","truncated"],title:"ListTaskHandoffsResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{session_id:{type:"string"},token:{type:"string"}},required:["token","session_id"],title:"OpenInvestigationHandoffRequestV1",type:"object"},{$defs:{FeedbackFindingId:y8,HandoffOpenReceiptV1:gD,InvestigationHandoffSurfaceV1:{additionalProperties:!1,properties:{finding_id:{$ref:"#/$defs/FeedbackFindingId"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"}},required:["finding_id","owner_version_digest"],type:"object"},ManifestDigest:_l,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{receipt:{$ref:"#/$defs/HandoffOpenReceiptV1"},surface:{$ref:"#/$defs/InvestigationHandoffSurfaceV1"}},required:["surface","receipt"],title:"OpenInvestigationHandoffResultV1",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{session_id:{type:"string"},token:{type:"string"}},required:["token","session_id"],title:"OpenTaskHandoffRequestV1",type:"object"},{$defs:{HandoffOpenReceiptV1:gD,ManifestDigest:_l,TaskHandoffSurfaceV1:{additionalProperties:!1,properties:{task_id:{$ref:"#/$defs/TaskId"},version:{format:"uint64",minimum:0,type:"integer"}},required:["task_id","version"],type:"object"},TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{receipt:{$ref:"#/$defs/HandoffOpenReceiptV1"},surface:{$ref:"#/$defs/TaskHandoffSurfaceV1"}},required:["surface","receipt"],title:"OpenTaskHandoffResultV1",type:"object"},{$defs:{ManifestDigest:_l,MultiRootContinuationV1:_P,MultiRootOperationV1:{description:"Closed federated read families. The family is typed while its existing\noperation-specific request remains the canonical JSON payload owned by that\napplication surface.",oneOf:[{properties:{kind:{const:"work",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"git",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"feedback",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"impact",type:"string"},request:!0},required:["kind","request"],type:"object"},{properties:{kind:{const:"query",type:"string"},request:!0},required:["kind","request"],type:"object"}]},RootGenerationV1:vM,RootScopeOutcomeV1_for_Nullable_RootGenerationV1:vN,RootScopeOutcomeV1_for_Nullable_string:vz,ScopeOutcome_for_Nullable_RootGenerationV1:vJ,ScopeOutcome_for_Nullable_string:vZ,ScopePartialReasonV1:vQ,ScopeSetId:vX,ScopeSetRevision:vY,ScopeUnavailableReasonV1:v0},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"External federated request bound to one persisted scope-set revision and\ndigest. Query/order digests and root generations are server-derived.",properties:{continuation:{anyOf:[{$ref:"#/$defs/MultiRootContinuationV1"},{type:"null"}]},operation:{$ref:"#/$defs/MultiRootOperationV1"},page:{format:"uint64",minimum:0,type:"integer"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"}},required:["scope_set_id","scope_set_revision","scope_set_digest","operation","page"],title:"MultiRootExecuteRequestV1",type:"object"},{$defs:{ManifestDigest:_l,MultiRootContinuationV1:_P,RootGenerationV1:vM,RootScopeOutcomeV1_for_Array_of_AnyValue:{additionalProperties:!1,description:"One typed outcome pinned to the digest of an exact resolved root.",properties:{outcome:{$ref:"#/$defs/ScopeOutcome_for_Array_of_AnyValue"},scope_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope_digest","outcome"],type:"object"},RootScopeOutcomeV1_for_Nullable_RootGenerationV1:vN,RootScopeOutcomeV1_for_Nullable_string:vz,ScopeOutcome_for_Array_of_AnyValue:{description:"Truthful outcome for one authorized root or an aggregate over roots.\n\n`Denied` and `Unavailable` carry no value and therefore cannot be confused\nwith a successful empty result.",oneOf:[{properties:{outcome:{const:"exact",type:"string"},value:{items:!0,type:"array"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"partial",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopePartialReasonV1"},value:{items:!0,type:"array"}},required:["value","reason"],type:"object"}},required:["outcome","value"],type:"object"},{properties:{outcome:{const:"denied",type:"string"}},required:["outcome"],type:"object"},{properties:{outcome:{const:"unavailable",type:"string"},value:{properties:{reason:{$ref:"#/$defs/ScopeUnavailableReasonV1"}},required:["reason"],type:"object"}},required:["outcome","value"],type:"object"}]},ScopeOutcome_for_Nullable_RootGenerationV1:vJ,ScopeOutcome_for_Nullable_string:vZ,ScopePartialReasonV1:vQ,ScopeSetId:vX,ScopeSetRevision:vY,ScopeUnavailableReasonV1:v0},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Federated page preserving each root outcome and aggregate partial truth.",properties:{aggregate:{$ref:"#/$defs/ScopeOutcome_for_Array_of_AnyValue"},continuation:{anyOf:[{$ref:"#/$defs/MultiRootContinuationV1"},{type:"null"}]},roots:{items:{$ref:"#/$defs/RootScopeOutcomeV1_for_Array_of_AnyValue"},type:"array"},scope_set_digest:{$ref:"#/$defs/ManifestDigest"},scope_set_id:{$ref:"#/$defs/ScopeSetId"},scope_set_revision:{$ref:"#/$defs/ScopeSetRevision"}},required:["scope_set_id","scope_set_revision","scope_set_digest","roots","aggregate"],title:"MultiRootQueryPageV1_for_AnyValue",type:"object"},{$defs:{ProjectId:_4,RegisteredRootSelectorV1:{additionalProperties:!1,description:"Exact registered-root selector accepted by scope-set CAS.",properties:{project_id:{$ref:"#/$defs/ProjectId"},root:{type:"string"}},required:["project_id","root"],type:"object"},ScopeSetId:vX,ScopeSetRevision:vY},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Canonical external selector for creating or updating an authorized scope\nset. Every member names one exact registered root; project-only selection\ncannot silently widen to an active or first-mounted graph.",properties:{expected_revision:{anyOf:[{$ref:"#/$defs/ScopeSetRevision"},{type:"null"}]},roots:{items:{$ref:"#/$defs/RegisteredRootSelectorV1"},type:"array"},scope_set_id:{$ref:"#/$defs/ScopeSetId"}},required:["scope_set_id","roots"],title:"MultiRootScopeSetCasRequestV1",type:"object"},{$defs:{ActorId:fb,AuthorizedRoot:fN,AuthorizedScopeSet:fz,BrainId:f1,ManifestDigest:_l,MultiRootScopeSetCasStatusV1:{enum:["applied","conflict"],type:"string"},ProjectId:_4,RefId:vm,RegisteredRootLocatorV1:vf,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,SharedProfileStoreLocatorV1:bs,UserProfileId:bJ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set:{anyOf:[{$ref:"#/$defs/AuthorizedScopeSet"},{type:"null"}]},status:{$ref:"#/$defs/MultiRootScopeSetCasStatusV1"}},required:["status"],title:"MultiRootScopeSetCasResultV1",type:"object"},{$defs:{ScopeSetId:vX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{scope_set_id:{$ref:"#/$defs/ScopeSetId"}},required:["scope_set_id"],title:"MultiRootScopeSetReadRequestV1",type:"object"},{$defs:{ActorId:fb,AuthorizedRoot:fN,AuthorizedScopeSet:fz,BrainId:f1,ManifestDigest:_l,ProjectId:_4,RefId:vm,RegisteredRootLocatorV1:vf,RepositoryId:vb,ResolvedScope:vw,ScopeSetId:vX,ScopeSetRevision:vY,SharedProfileStoreLocatorV1:bs,UserProfileId:bJ,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/AuthorizedScopeSet"},{type:"null"}],title:"Nullable_AuthorizedScopeSet"},{$defs:{AcceptWorkProposalDispositionV1:{description:"The accept-proposal operation can commit acceptance only.",enum:["accepted"],type:"string"},CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCommandId:$p,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/AcceptWorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],title:"AcceptWorkProposalRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,BrainId:f1,CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkGraphChangeV1:$j,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductEventPayloadV1:$1,WorkProductEventV1:$0,WorkProductGraphV1:$4,WorkProductProfileScopeV1:$9,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{event:{$ref:"#/$defs/WorkProductEventV1"},replayed:{type:"boolean"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["event","verified_graph_version","replayed"],title:"WorkProductMutationReceiptV1",type:"object"},{$defs:{AttemptId:fW,CoverageStateV1:yf,DuplicateEffectOutcomeV1:yP,DuplicateEffortKindV1:yV,ProjectionGenerationId:_5,QuantityEvidenceClassV1:vs,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkDuplicateAdjudicationEvidenceV1:$m,WorkDuplicateAdjudicationQuantitiesV1:$f,WorkTopologyGenerationRefV1:SE},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},evidence:{$ref:"#/$defs/WorkDuplicateAdjudicationEvidenceV1"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]},first_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},occurred_at:{$ref:"#/$defs/UtcMicros"},quantities:{$ref:"#/$defs/WorkDuplicateAdjudicationQuantitiesV1"},reason:{type:"string"},second_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},verdict:{$ref:"#/$defs/DuplicateEffortKindV1"}},required:["first_attempt","second_attempt","evidence","verdict","quantities","reason","command_id","occurred_at"],title:"WorkDuplicateAdjudicationCommandV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,CoverageStateV1:yf,DuplicateEffectOutcomeV1:yP,DuplicateEffortKindV1:yV,ManifestDigest:_l,ProjectionGenerationId:_5,QuantityEvidenceClassV1:vs,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkDuplicateAdjudicationCommandV1:{additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},evidence:{$ref:"#/$defs/WorkDuplicateAdjudicationEvidenceV1"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]},first_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},occurred_at:{$ref:"#/$defs/UtcMicros"},quantities:{$ref:"#/$defs/WorkDuplicateAdjudicationQuantitiesV1"},reason:{type:"string"},second_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},verdict:{$ref:"#/$defs/DuplicateEffortKindV1"}},required:["first_attempt","second_attempt","evidence","verdict","quantities","reason","command_id","occurred_at"],type:"object"},WorkDuplicateAdjudicationEvidenceV1:$m,WorkDuplicateAdjudicationQuantitiesV1:$f,WorkDuplicateAdjudicationReceiptV1:{additionalProperties:!1,properties:{actor_id:{$ref:"#/$defs/ActorId"},adjudication_ref:{$ref:"#/$defs/ManifestDigest"},canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},command:{$ref:"#/$defs/WorkDuplicateAdjudicationCommandV1"},revision:{format:"uint64",minimum:0,type:"integer"}},required:["command","revision","actor_id","canonical_input_digest","adjudication_ref"],type:"object"},WorkTopologyGenerationRefV1:SE},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{outcome:{const:"appended",type:"string"},receipt:{$ref:"#/$defs/WorkDuplicateAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"},{properties:{outcome:{const:"replayed",type:"string"},receipt:{$ref:"#/$defs/WorkDuplicateAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"}],title:"WorkDuplicateAdjudicationAppendOutcomeV1"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,WorkAttemptIdentityV1:b6,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{adjudication_id:{type:"string"},attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},command_id:{$ref:"#/$defs/WorkCommandId"},detection_horizon_micros:{format:"uint64",minimum:0,type:"integer"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]}},required:["adjudication_id","attempt","detection_horizon_micros","command_id"],title:"AdjudicateWorkLeakCommandV1",type:"object"},{$defs:{AdjudicateWorkLeakCommandV1:{additionalProperties:!1,properties:{adjudication_id:{type:"string"},attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},command_id:{$ref:"#/$defs/WorkCommandId"},detection_horizon_micros:{format:"uint64",minimum:0,type:"integer"},expected_revision:{format:"uint64",minimum:0,type:["integer","null"]}},required:["adjudication_id","attempt","detection_horizon_micros","command_id"],title:"AdjudicateWorkLeakCommandV1",type:"object"},AttemptId:fW,CoverageStateV1:yf,LeakOwnerClassV1:{enum:["work","workflow","git","delivery","unknown"],type:"string"},ManifestDigest:_l,RunId:vF,TaskId:bT,UtcMicros:bZ,VerifiedWorkLeakEvidenceV1:{additionalProperties:!1,description:"Exact result of one scan by the canonical lease/process/effect/placement/\ndelivery evidence owner. Evidence references are opaque local anchors;\ntheir owning records remain behind normal authorization.",properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},coverage:{$ref:"#/$defs/CoverageStateV1"},detection_horizon_micros:{format:"uint64",minimum:0,type:"integer"},evidence_refs:{items:{type:"string"},type:"array"},kind:{$ref:"#/$defs/WorkExecutionLeakKindV1"},owner_class:{$ref:"#/$defs/LeakOwnerClassV1"},recovery:{$ref:"#/$defs/WorkExecutionLeakRecoveryV1"},scan_completed_at:{$ref:"#/$defs/UtcMicros"},scan_started_at:{$ref:"#/$defs/UtcMicros"}},required:["attempt","kind","recovery","owner_class","coverage","detection_horizon_micros","scan_started_at","scan_completed_at","evidence_refs"],type:"object"},WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkExecutionLeakKindV1:{enum:["lease_after_terminal","attempt_without_live_owner","effect_unknown_past_deadline","missing_worktree_binding","unbounded_delivery","none","unknown"],type:"string"},WorkExecutionLeakRecoveryV1:{enum:["not_required","pending","recovered","failed","unknown"],type:"string"},WorkLeakAdjudicationReceiptV1:{additionalProperties:!1,properties:{canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},command:{$ref:"#/$defs/AdjudicateWorkLeakCommandV1"},evidence:{$ref:"#/$defs/VerifiedWorkLeakEvidenceV1"},revision:{format:"uint64",minimum:0,type:"integer"},scan_deadline:{$ref:"#/$defs/UtcMicros",description:"Daemon/request-owned deadline that bounded the source scan."}},required:["command","revision","evidence","scan_deadline","canonical_input_digest"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{outcome:{const:"appended",type:"string"},receipt:{$ref:"#/$defs/WorkLeakAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"},{properties:{outcome:{const:"replayed",type:"string"},receipt:{$ref:"#/$defs/WorkLeakAdjudicationReceiptV1"}},required:["outcome","receipt"],type:"object"}],title:"WorkLeakAdjudicationOutcomeV1"},{$defs:{CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RetrievalAnchorId:vI,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCommandId:$p,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","based_on_version","mutation"],title:"AdmitWorkExecutionRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AutomaticWorktreeGcV1:fF,BrainId:f1,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CatalogGenerationId:hp,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,RetrievalAnchorId:vI,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkGraphChangeV1:$j,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductEventPayloadV1:$1,WorkProductEventV1:$0,WorkProductGraphV1:$4,WorkProductMutationReceiptV1:$3,WorkProductProfileScopeV1:$9,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTopologyPolicyV1:SA,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Execution admission together with the immutable provider snapshot licensed\nby the accepted proposal and current configuration authority.",properties:{execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},mutation:{$ref:"#/$defs/WorkProductMutationReceiptV1"}},required:["mutation","execution_snapshot"],title:"AdmittedWorkExecutionV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementKindV1:$B,WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{occurred_at:{$ref:"#/$defs/UtcMicros"},retention_eligible_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],default:null,description:"When retention makes this placement eligible for a fresh cleanup\npreflight. Eligibility is not delete authority."},run_id:{$ref:"#/$defs/RunId"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","target","occurred_at"],title:"AdmitWorkPlacementCommand",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One run's durable placement relation.",properties:{authority_version:{format:"uint64",minimum:0,type:"integer"},blockers:{items:{$ref:"#/$defs/WorkPlacementBlockerV1"},type:"array",uniqueItems:!0},identity:{$ref:"#/$defs/WorkPlacementIdentityV1"},retention_eligible_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}],description:"When retention makes this placement *eligible* for a fresh cleanup\npreflight. Eligibility is not delete authority."},state:{$ref:"#/$defs/WorkPlacementStateV1"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["identity","target","state","authority_version","transitioned_at","blockers"],title:"WorkPlacementV1",type:"object"},{$defs:{CommitId:hq,RefId:vm,WorkEffectStateV1:$h,WorkJobBaseV1:{additionalProperties:!1,description:"The source revision every attempt in the job starts from.",properties:{commit:{$ref:"#/$defs/CommitId"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]}},required:["commit"],type:"object"},WorkJobKeyV1:$z,WorkJobNameV1:{description:"A job name: `[a-z0-9-]`, 1 to 48 bytes. Identities derive from it.",type:"string"},WorkJobSynthesisV1:{additionalProperties:!1,properties:{instructions:{type:"string"},output_name:{$ref:"#/$defs/WorkflowOutputName"},task:{$ref:"#/$defs/WorkJobKeyV1",description:"The synthesis attempt runs under this task's run and execution snapshot."}},required:["task","output_name","instructions"],type:"object"},WorkJobTaskV1:{additionalProperties:!1,properties:{instructions:{type:"string"},key:{$ref:"#/$defs/WorkJobKeyV1"},placement:{$ref:"#/$defs/WorkPlacementTargetV1"},title:{type:"string"}},required:["key","title","instructions","placement"],type:"object"},WorkPlacementKindV1:$B,WorkPlacementTargetV1:$J,WorkflowOutputName:SD},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One guided job: the tasks to run in parallel, where each runs, and the\nsynthesis that reviews them.",properties:{base:{$ref:"#/$defs/WorkJobBaseV1"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},job:{$ref:"#/$defs/WorkJobNameV1"},synthesis:{$ref:"#/$defs/WorkJobSynthesisV1"},tasks:{items:{$ref:"#/$defs/WorkJobTaskV1"},type:"array"},title:{type:"string"}},required:["job","title","base","effect_state","tasks","synthesis"],title:"AdvanceWorkJobRequestV1",type:"object"},{$defs:{ActorId:fb,AdmittedWorkExecutionV1:{additionalProperties:!1,description:"Execution admission together with the immutable provider snapshot licensed\nby the accepted proposal and current configuration authority.",properties:{execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},mutation:{$ref:"#/$defs/WorkProductMutationReceiptV1"}},required:["mutation","execution_snapshot"],type:"object"},ApplicationExecutionFailureClassV1:{description:"Stable non-retryable class for an admitted execution failure.",enum:["denied","malformed_output","permanent"],type:"string"},ApplicationProblemDetailV1:fA,ApplicationProblemKind:{description:"Stable problem-code taxonomy for request failures and admitted terminals.",enum:["invalid_request","not_found_or_not_authorized","conflict","partial_effect","stale","unsupported","unavailable","execution_failed","reset_required","saturated","cancelled","timed_out"],type:"string"},ApplicationProblemRecord:{additionalProperties:!1,description:"Stable application problem record shared verbatim by every adapter.",properties:{cancellation_stage:{$ref:"#/$defs/RequiredNullable3"},code:{type:"string"},committed_receipt:{$ref:"#/$defs/RequiredNullable2",description:"A committed effect is present only for an admitted partial effect.\nThe nullable field is always serialized: omitting it would create a\ncompatibility/default path that could hide a missing receipt."},coverage:{anyOf:[{$ref:"#/$defs/EvidenceCoverage"},{type:"null"}]},detail:{$ref:"#/$defs/RequiredNullable",description:"The structured facts `message` is rendered from, when the problem has\nany. Always serialized so a client never mistakes an omitted detail\nfor a problem without one."},details:{items:{$ref:"#/$defs/SafeDiagnostic"},type:"array"},diagnostic:{anyOf:[{$ref:"#/$defs/SafeDiagnostic"},{type:"null"}]},execution_failure_classification:{$ref:"#/$defs/RequiredNullable5"},kind:{$ref:"#/$defs/ApplicationProblemKind"},legal_actions:{items:{$ref:"#/$defs/LegalAction"},type:"array"},message:{type:"string"},owning_layer:{$ref:"#/$defs/ProblemOwningLayer"},request_id:{type:"string"},retry:{$ref:"#/$defs/RetryDirective"},retry_after_millis:{format:"uint64",minimum:0,type:["integer","null"]},retry_scope:{anyOf:[{$ref:"#/$defs/RetryScope"},{type:"null"}]},retryable:{type:"boolean"},revision:{format:"uint32",minimum:0,type:"integer"},terminality:{$ref:"#/$defs/ProblemTerminality"},trace_id:{type:"string"},unavailable_classification:{$ref:"#/$defs/RequiredNullable4"}},required:["revision","kind","code","message","detail","committed_receipt","owning_layer","terminality","retryable","retry","cancellation_stage","unavailable_classification","execution_failure_classification","request_id","trace_id","details","legal_actions"],type:"object"},ApplicationUnavailableClassV1:{description:"Stable reason an application authority is unavailable.",enum:["authority","backend_unavailable","backend_disconnected","backend_retryable"],type:"string"},AttemptId:fW,AutomaticWorktreeGcV1:fF,BrainId:f1,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CancellationStage:ha,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CatalogGenerationId:hp,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CoverageCompleteness:yu,CoverageDomainState:ym,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,DaemonServiceUnitObservationV1:y_,DiagnosticsSearchedTsconfigV1:yS,EffectClass:yR,EffectReceipt:yq,EffectTermination:yI,EvidenceCoverage:yx,EvidenceDomain:yj,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LegalAction:{description:"Bounded action an adapter may offer without inferring executable authority.",enum:["correct_request","reauthorize","refresh","retry","reconcile","reset","restart_without_cursor","contact_administrator"],type:"string"},LocatorDigest:_r,ManifestDigest:_l,ProblemOwningLayer:{description:"Layer that owns resolving the problem rather than merely presenting it.",enum:["adapter","application","runtime","port"],type:"string"},ProblemTerminality:{description:"Whether the problem occurred before admission or is an admitted terminal.",enum:["pre_admission","admitted_terminal"],type:"string"},ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,RequiredNullable:{anyOf:[{$ref:"#/$defs/ApplicationProblemDetailV1"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable2:{anyOf:[{$ref:"#/$defs/EffectReceipt"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable3:{anyOf:[{$ref:"#/$defs/CancellationStage"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable4:{anyOf:[{$ref:"#/$defs/ApplicationUnavailableClassV1"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},RequiredNullable5:{anyOf:[{$ref:"#/$defs/ApplicationExecutionFailureClassV1"},{type:"null"}],description:"Unlike `Option`, this wrapper distinguishes an explicit JSON `null`\nfrom an omitted field. New terminal-state fields must be present on every\nrecord so a missing committed receipt cannot be mistaken for `None`."},ResolvedScope:vw,RetrievalAnchorId:vI,RetryDirective:{description:"Safe adapter-independent retry instruction. Adapters preserve it verbatim.",enum:["never","same_request","after_delay","after_revalidate","after_reconcile"],type:"string"},RetryScope:{description:"Request identity boundary within which a retry remains valid.",enum:["same_request","same_operation","fresh_request"],type:"string"},ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SafeDiagnostic:{additionalProperties:!1,description:"Sanitized detail that may cross the application boundary.",properties:{code:{type:"string"},message:{type:"string"}},required:["code","message"],type:"object"},SensitiveFilesystemLocatorV1:v4,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UseCaseId:bK,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkGraphChangeV1:$j,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkJobIdentitiesV1:{additionalProperties:!1,properties:{operation:{$ref:"#/$defs/WorkflowOperationRef"},synthesis:{$ref:"#/$defs/WorkAttemptIdentityV1"},tasks:{items:{$ref:"#/$defs/WorkJobTaskIdentitiesV1"},type:"array"}},required:["operation","tasks","synthesis"],type:"object"},WorkJobKeyV1:$z,WorkJobStateV1:{oneOf:[{additionalProperties:!1,description:"The call's deadline floor arrived with work left; call again now.",properties:{state:{const:"advancing",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"Nothing can move until providers, routing, or capacity progress.",properties:{on:{items:{$ref:"#/$defs/WorkJobWaitV1"},type:"array"},state:{const:"waiting",type:"string"}},required:["state","on"],type:"object"},{additionalProperties:!1,description:"The chain stopped at `step`. `problem` is the record the step's own\noperation produced, or a guided refusal naming the job-level cause.",properties:{problem:{$ref:"#/$defs/ApplicationProblemRecord"},state:{const:"refused",type:"string"},step:{$ref:"#/$defs/WorkJobStepV1"}},required:["state","step","problem"],type:"object"},{additionalProperties:!1,properties:{sources:{items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"},state:{const:"completed",type:"string"},synthesis:{$ref:"#/$defs/WorkAttemptV1"}},required:["state","sources","synthesis"],type:"object"}]},WorkJobStepRecordV1:{additionalProperties:!1,description:"A step this call executed, with its operation's own effect receipt.",properties:{receipt:{$ref:"#/$defs/EffectReceipt"},request_id:{type:"string"},result:{$ref:"#/$defs/WorkJobStepResultV1"},step:{$ref:"#/$defs/WorkJobStepV1"}},required:["step","request_id","receipt","result"],type:"object"},WorkJobStepResultV1:{description:"Every arm is an existing Work operation's own output.",oneOf:[{properties:{result:{const:"graph",type:"string"},value:{$ref:"#/$defs/WorkProductMutationReceiptV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"execution",type:"string"},value:{$ref:"#/$defs/AdmittedWorkExecutionV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"placement",type:"string"},value:{$ref:"#/$defs/WorkPlacementV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"attempt",type:"string"},value:{$ref:"#/$defs/WorkAttemptV1"}},required:["result","value"],type:"object"},{properties:{result:{const:"synthesis",type:"string"},value:{$ref:"#/$defs/WorkSynthesisAttemptV1"}},required:["result","value"],type:"object"}]},WorkJobStepV1:{description:"One existing Work operation the guided job runs. There is deliberately no\narm that advances a job, so a step can never recurse into the guided path.",oneOf:[{additionalProperties:!1,properties:{step:{const:"create_task",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"accept_proposal",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"admit_execution",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"admit_placement",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"start_source",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"},{additionalProperties:!1,properties:{step:{const:"await_sources",type:"string"}},required:["step"],type:"object"},{additionalProperties:!1,properties:{step:{const:"synthesize",type:"string"}},required:["step"],type:"object"},{additionalProperties:!1,properties:{step:{const:"await_synthesis",type:"string"}},required:["step"],type:"object"},{additionalProperties:!1,properties:{step:{const:"release_placement",type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"}},required:["step","task"],type:"object"}]},WorkJobTaskIdentitiesV1:{additionalProperties:!1,properties:{key:{$ref:"#/$defs/WorkJobKeyV1"},proposal_id:{$ref:"#/$defs/ProposalId"},source:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["key","proposal_id","source"],type:"object"},WorkJobWaitV1:{oneOf:[{additionalProperties:!1,description:"The proposal route abstained, as it does while routing warms.",properties:{reason:{type:"string"},task:{$ref:"#/$defs/WorkJobKeyV1"},wait:{const:"proposal_route",type:"string"}},required:["wait","task","reason"],type:"object"},{additionalProperties:!1,properties:{identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"},wait:{const:"attempt",type:"string"}},required:["wait","identity","state"],type:"object"},{additionalProperties:!1,description:"The registered topology has no free attempt slot for this task.",properties:{problem:{$ref:"#/$defs/ApplicationProblemRecord"},task:{$ref:"#/$defs/WorkJobKeyV1"},wait:{const:"capacity",type:"string"}},required:["wait","task","problem"],type:"object"}]},WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkMilestoneV1:$L,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J,WorkPlacementV1:$Z,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductEventPayloadV1:$1,WorkProductEventV1:$0,WorkProductGraphV1:$4,WorkProductMutationReceiptV1:$3,WorkProductProfileScopeV1:$9,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRestartReasonV1:Sm,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkSynthesisAttemptV1:{description:"The typed outcome of a synthesis request: an admitted attempt, or the\nsealed unsynthesized set when synthesis could not truthfully begin.",oneOf:[{additionalProperties:!1,description:"The admitted synthesis attempt and everything it is accountable to.",properties:{attempt:{$ref:"#/$defs/WorkAttemptV1",description:"The leased (or idempotently replayed) synthesis attempt."},draft:{$ref:"#/$defs/WorkflowSynthesisDraft",description:"The citation obligation, complete by construction: the draft cites\nevery citable source digest and is verified downstream by\n[`crate::workflow_synthesis::verify_workflow_synthesis_draft`]."},groups:{description:"Disagreement structure over the succeeded sources.",items:{$ref:"#/$defs/WorkSynthesisEvidenceGroupV1"},type:"array"},source_set:{$ref:"#/$defs/WorkSynthesisSourceSetV1",description:"The sealed source envelopes the attempt was admitted against."},synthesis:{const:"admitted",type:"string"},uncited:{description:"Sources preserved without citations: failures, unknowns, and\nartifact-less successes, in the caller's requested order.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["synthesis","attempt","source_set","groups","draft","uncited"],type:"object"},{properties:{refusal:{$ref:"#/$defs/WorkSynthesisRefusalV1"},sources:{$ref:"#/$defs/WorkSynthesisSourceSetV1"},synthesis:{const:"unsynthesized",type:"string"}},required:["synthesis","sources","refusal"],type:"object"}]},WorkSynthesisEvidenceGroupV1:Sq,WorkSynthesisRefusalV1:SI,WorkSynthesisSourceEnvelopeV1:Sx,WorkSynthesisSourceOutcomeV1:Sj,WorkSynthesisSourceSetV1:SC,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowSynthesisDraft:SH,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"What one call did and where the job now stands.",properties:{job:{$ref:"#/$defs/WorkJobIdentitiesV1",description:"The derived identities, so the advanced operations can target them."},performed:{description:"Only the steps this call executed, in order.",items:{$ref:"#/$defs/WorkJobStepRecordV1"},type:"array"},state:{$ref:"#/$defs/WorkJobStateV1"}},required:["job","performed","state"],title:"AdvanceWorkJobResultV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_id"],title:"WorkAttemptStatusRequestV1",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",properties:{actual_route:{anyOf:[{$ref:"#/$defs/WorkProviderRouteV1"},{type:"null"}]},artifacts:{items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},cancellation:{$ref:"#/$defs/WorkCancellationStateV1"},execution:{$ref:"#/$defs/WorkExecutionEnvelopeV1"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},lease:{$ref:"#/$defs/WorkLeaseFenceV1"},progress:{anyOf:[{$ref:"#/$defs/WorkAttemptProgressV1"},{type:"null"}]},projection_binding:{$ref:"#/$defs/WorkAttemptProjectionBindingV1"},recovery:{$ref:"#/$defs/WorkRecoveryStateV1"},requested_route:{$ref:"#/$defs/WorkProviderRouteV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"},terminal:{anyOf:[{$ref:"#/$defs/WorkTerminalEvidenceV1"},{type:"null"}]}},required:["identity","projection_binding","execution","lease","state","artifacts","cancellation","recovery","requested_route"],title:"WorkAttemptV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkCancellationRequestId:$d},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},occurred_at:{$ref:"#/$defs/UtcMicros"},request_id:{$ref:"#/$defs/WorkCancellationRequestId"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_id","request_id","occurred_at"],title:"CancelWorkAttemptCommand",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{new_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"},observed_at:{$ref:"#/$defs/UtcMicros"},old_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","old_version","new_version","observed_at"],title:"WorkProposalComparisonRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProposalId:_8,ProviderId:vo,RetrievalAnchorId:vI,RunId:vF,TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkEvidenceRootV1:{additionalProperties:!1,properties:{item:{$ref:"#/$defs/WorkItemV1"},links:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},proposal_decisions:{items:{$ref:"#/$defs/WorkProposalDecisionV1"},type:"array"},relation_replan_decisions:{items:{$ref:"#/$defs/WorkRelationReplanDecisionV1"},type:"array"},relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["verified_version","item","relations","proposal_decisions","relation_replan_decisions","links"],type:"object"},VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkItemInputV1:$M,WorkItemV1:$N,WorkProductRelationV1:$5,WorkProposalComparisonEffectV1:{oneOf:[{const:"advisory_only",description:"Comparison is evidence only. There is no apply edge from this result.",type:"string"}]},WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{added_evidence:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},added_relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},effect:{$ref:"#/$defs/WorkProposalComparisonEffectV1"},item_changed:{type:"boolean"},new:{$ref:"#/$defs/VerifiedWorkEvidenceRootV1"},old:{$ref:"#/$defs/VerifiedWorkEvidenceRootV1"},removed_evidence:{items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},removed_relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","old","new","added_relations","removed_relations","added_evidence","removed_evidence","item_changed","effect"],title:"WorkProposalComparisonV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},plan:{$ref:"#/$defs/WorkPlanV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","initiative","plan","milestone","item","mutation"],title:"CreateWorkTaskRequestV1",type:"object"},{$defs:{WorkAttemptListCursorV1:b9},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{cursor:{anyOf:[{$ref:"#/$defs/WorkAttemptListCursorV1"},{type:"null"}],default:null},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],title:"WorkAttemptListRequestV1",type:"object"},{$defs:{AttemptId:fW,ManifestDigest:_l,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptStateV1:$t,WorkEffectStateV1:$h,WorkExecutionSpanV1:{additionalProperties:!1,properties:{admitted_projection_sequence:{description:"Durable Work projection sequence under which execution was admitted.",format:"uint64",minimum:0,type:"integer"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},ended_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},started_at:{$ref:"#/$defs/UtcMicros"},state:{$ref:"#/$defs/WorkAttemptStateV1"},terminal_evidence_digest:{anyOf:[{$ref:"#/$defs/ManifestDigest"},{type:"null"}]},wall_micros:{description:"Present only when both owner instants form a valid non-negative span.",format:"uint64",minimum:0,type:["integer","null"]}},required:["identity","admitted_projection_sequence","state","effect_state","started_at"],type:"object"},WorkExecutionTimingCoverageV1:{oneOf:[{additionalProperties:!1,properties:{coverage:{const:"complete",type:"string"}},required:["coverage"],type:"object"},{additionalProperties:!1,properties:{coverage:{const:"partial",type:"string"},invalid_terminal_span:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},missing_dispatch:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["coverage","missing_dispatch","invalid_terminal_span"],type:"object"}]},WorkObservedExecutionOrderBasisV1:{enum:["terminal_observed_at_then_admitted_projection_sequence_then_attempt_identity"],type:"string"},WorkObservedExecutionV1:{additionalProperties:!1,properties:{admitted_projection_sequence:{format:"uint64",minimum:0,type:"integer"},evidence_digest:{$ref:"#/$defs/ManifestDigest"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},observed_at:{$ref:"#/$defs/UtcMicros"},ordinal:{description:"One-based order assigned after sorting the durable terminal instants.",format:"uint32",minimum:0,type:"integer"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["ordinal","identity","admitted_projection_sequence","observed_at","state","evidence_digest"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,properties:{attempt_coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},observed_order:{items:{$ref:"#/$defs/WorkObservedExecutionV1"},type:"array"},order_basis:{$ref:"#/$defs/WorkObservedExecutionOrderBasisV1"},spans:{items:{$ref:"#/$defs/WorkExecutionSpanV1"},type:"array"},state:{const:"listed",type:"string"},timing_coverage:{$ref:"#/$defs/WorkExecutionTimingCoverageV1"}},required:["state","spans","observed_order","order_basis","attempt_coverage","timing_coverage"],type:"object"}],title:"WorkExecutionHistoryV1"},{$defs:{ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkExpertiseCategoryV1:$V,WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{evidence_not_before:{$ref:"#/$defs/UtcMicros",description:"Evidence before this owner-supplied horizon is excluded as stale."},expertise_categories:{description:"Categories for which the returned context will be used ephemerally.",items:{$ref:"#/$defs/WorkExpertiseCategoryV1"},type:"array",uniqueItems:!0},limit:{format:"uint32",minimum:0,type:"integer"},observed_at:{$ref:"#/$defs/UtcMicros"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["selection","task_id","verified_version","evidence_not_before","expertise_categories","limit","observed_at"],title:"WorkExperienceRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProposalId:_8,ProviderId:vo,RetrievalAnchorId:vI,RunId:vF,SessionId:v8,TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptEvidenceRecordV1:b4,WorkAttemptIdentityV1:b6,WorkAttemptProviderOutcomeV1:b7,WorkAttemptReceiptV1:$e,WorkAttemptStreamChannelV1:$r,WorkAttemptStreamSummaryV1:$i,WorkExperienceApplicabilityV1:{enum:["same_accepted_route","same_milestone"],type:"string"},WorkExperienceCandidateV1:{additionalProperties:!1,properties:{applicability:{description:"Separate declared applicability facts. This is intentionally not a\nscore and candidates remain in canonical TaskId order.",items:{$ref:"#/$defs/WorkExperienceApplicabilityV1"},type:"array",uniqueItems:!0},attempt_receipts:{description:"Exact receipts for accepted successful attempts whose sealed provider\nevidence and declared artifacts establish reusable observed work. The\nidentity is also the canonical `work_retrieve_evidence` drill target.",items:{$ref:"#/$defs/WorkAttemptReceiptV1"},type:"array"},evidence:{description:"Exact anchored evidence establishing that this is observed experience.",items:{$ref:"#/$defs/TaskEvidenceLinkV1"},type:"array"},item:{$ref:"#/$defs/WorkItemV1"}},required:["item","evidence","attempt_receipts","applicability"],type:"object"},WorkExperienceCoverageV1:{oneOf:[{additionalProperties:!1,properties:{coverage:{const:"unavailable",type:"string"}},required:["coverage"],type:"object"},{additionalProperties:!1,properties:{applicable:{format:"uint32",minimum:0,type:"integer"},coverage:{const:"complete",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"},stale_excluded:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","applicable","stale_excluded"],type:"object"},{additionalProperties:!1,properties:{applicable:{format:"uint32",minimum:0,type:"integer"},coverage:{const:"partial",type:"string"},omitted_by_limit:{format:"uint32",minimum:0,type:"integer"},returned:{format:"uint32",minimum:0,type:"integer"},stale_excluded:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","applicable","stale_excluded","omitted_by_limit"],type:"object"}]},WorkExpertiseAuthorizationV1:{oneOf:[{additionalProperties:!1,properties:{availability:{const:"available",type:"string"},categories:{items:{$ref:"#/$defs/WorkExpertiseCategoryV1"},type:"array",uniqueItems:!0},durability:{$ref:"#/$defs/WorkExpertiseContextDurabilityV1"},expires_at:{$ref:"#/$defs/UtcMicros"},pin:{$ref:"#/$defs/WorkExpertiseConsentPinV1"}},required:["availability","categories","expires_at","pin","durability"],type:"object"},{additionalProperties:!1,properties:{availability:{const:"unavailable",type:"string"},legal_actions:{items:{$ref:"#/$defs/WorkExpertiseLegalActionV1"},type:"array",uniqueItems:!0},pin:{$ref:"#/$defs/WorkExpertiseConsentPinV1"},reasons:{items:{$ref:"#/$defs/WorkExpertiseUnavailableReasonV1"},type:"array",uniqueItems:!0}},required:["availability","reasons","legal_actions","pin"],type:"object"}]},WorkExpertiseCategoryV1:$V,WorkExpertiseConsentPinV1:{additionalProperties:!1,properties:{configuration_digest:{$ref:"#/$defs/ManifestDigest"},configuration_revision:{$ref:"#/$defs/ConfigurationRevisionId"},configuration_snapshot:{$ref:"#/$defs/ConfigurationSnapshotId"},provenance_digest:{$ref:"#/$defs/ManifestDigest"}},required:["configuration_revision","configuration_snapshot","configuration_digest","provenance_digest"],type:"object"},WorkExpertiseContextDurabilityV1:{oneOf:[{const:"ephemeral_only",description:"Context is returned for this read only and cannot establish evidence,\nrouting, proposal acceptance, execution admission, or completion.",type:"string"}]},WorkExpertiseLegalActionV1:{enum:["grant_user_consent","grant_project_consent","renew_user_consent","renew_project_consent","allow_requested_categories"],type:"string"},WorkExpertiseUnavailableReasonV1:{enum:["user_consent_disabled","project_consent_disabled","user_consent_not_yet_effective","project_consent_not_yet_effective","user_consent_expired","project_consent_expired","requested_category_not_allowed"],type:"string"},WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkItemInputV1:$M,WorkItemV1:$N,WorkProviderAvailabilityV1:So,WorkProviderBackendV1:Sn,WorkProviderFallbackRecordV1:Sa,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{candidates:{items:{$ref:"#/$defs/WorkExperienceCandidateV1"},type:"array"},coverage:{$ref:"#/$defs/WorkExperienceCoverageV1"},evidence_not_before:{$ref:"#/$defs/UtcMicros"},expertise:{$ref:"#/$defs/WorkExpertiseAuthorizationV1"},observed_at:{$ref:"#/$defs/UtcMicros"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["task_id","verified_version","evidence_not_before","observed_at","expertise","candidates","coverage"],title:"WorkExperienceV1",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,ProposalId:_8,RepositoryId:vb,TaskId:bT,UtcMicros:bZ,WorkEvidenceFrontierV1:$v,WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Read-only proposal generation over one exact current product graph.",properties:{live_git_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}],default:null},occurred_at:{$ref:"#/$defs/UtcMicros"},proposal_id:{$ref:"#/$defs/ProposalId"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","proposal_id","occurred_at"],title:"GenerateProposalRequest",type:"object"},{$defs:{ConfigurationRevisionId:hM,ManifestDigest:_l,PolicyIdentifierV1:{description:"A bounded, canonical identifier owned by the policy input schema.\n\nIt represents immutable references only; it is never a path, display\nlabel, provider account, branch name, or native object identifier.",type:"string"},ProposalId:_8,ProviderId:vo,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCalibratedSizingV1:{additionalProperties:!1,description:"Calibrated sizing. Emitted ONLY when support >= floor. Every field is\nnamed separately (Plan 06); `support_floor` carries the governing floor\ninto the record.",properties:{band:{$ref:"#/$defs/WorkOrdinalBandV1",description:"The sizing band itself: the stronger of the route's declared effort and\nthe derived shape magnitude, widened when the cohort error is high."},cohort:{description:"Identity of the cohort the sizing was calibrated over: the top-ranked\nroute id. Sizing from one cohort is never reused for another.",type:"string"},drift_valid:{description:"False when the cohort contains incomparable or stale observations, so a\nconsumer can refuse a sizing that drifted rather than silently trust it.",type:"boolean"},error:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Observed adverse-outcome band over the cohort. An ordinal band, never a\nrate and never a probability."},horizon:{$ref:"#/$defs/UtcMicros",description:"Latest comparable observation in the cohort. Nothing after\n`evaluated_at` contributes, so the horizon never runs ahead of the input."},support:{description:"Count of comparable in-cohort outcomes backing this sizing.",format:"uint32",minimum:0,type:"integer"},support_floor:{description:"The floor that governed this emission, carried so replay shows which\nfloor applied rather than assuming the current constant.",format:"uint32",minimum:0,type:"integer"}},required:["cohort","horizon","support","support_floor","error","drift_valid","band"],type:"object"},WorkCalibrationEvidenceV1:{additionalProperties:!1,description:"Raw calibration values and their exact decision provenance.\n\nNo rate, probability, or composite score is derived here. Consumers see\nthe authority-supplied outcome rows, categorical uncertainty, and exact\ndenominator counts that produced the proposal's existing calibrated sizing.",properties:{cohort_route:{type:["string","null"]},comparable_outcomes:{format:"uint32",minimum:0,type:"integer"},eligible_route_count:{format:"uint32",minimum:0,type:"integer"},incomparable_outcomes:{format:"uint32",minimum:0,type:"integer"},provenance:{$ref:"#/$defs/WorkCalibrationProvenanceV1"},raw_outcomes:{items:{$ref:"#/$defs/WorkPriorOutcomeV1"},type:"array"},routes_with_outcomes:{format:"uint32",minimum:0,type:"integer"},uncertainty:{$ref:"#/$defs/WorkCalibrationUncertaintyV1"}},required:["raw_outcomes","eligible_route_count","routes_with_outcomes","comparable_outcomes","incomparable_outcomes","uncertainty","provenance"],type:"object"},WorkCalibrationProvenanceV1:{additionalProperties:!1,properties:{configuration_digest:{$ref:"#/$defs/ManifestDigest"},configuration_revision:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},evaluated_at:{$ref:"#/$defs/UtcMicros"},evaluator_id:{type:"string"},evaluator_revision:{format:"uint64",minimum:0,type:"integer"},input_digest:{$ref:"#/$defs/ManifestDigest"},local_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}]}},required:["evaluator_id","evaluator_revision","input_digest","configuration_digest","evaluated_at"],type:"object"},WorkCalibrationUncertaintyV1:{enum:["supported","sparse","stale","incomparable"],type:"string"},WorkDecompositionProposalV1:{additionalProperties:!1,description:"A one-level decomposition proposal. Never recursive: a deeper split is a\nseparate sequenced capability, not something this evaluator may invent.",properties:{candidates:{description:"The proposed sketches, ordinal ascending from 0.",items:{$ref:"#/$defs/WorkSubtaskSketchV1"},type:"array"},rationale:{description:"Why the proposal was emitted, in the same ordered reason vocabulary the\ndecision uses.",items:{$ref:"#/$defs/WorkProposalReasonV1"},type:"array"}},required:["candidates","rationale"],type:"object"},WorkEvidenceFrontierV1:$v,WorkFrontierComparisonV1:{description:"Recorded relation between the two supplied frontiers. `Incomparable` means\nat least one side was absent; it is not collapsed into agreement.",enum:["agree","disagree","incomparable"],type:"string"},WorkOrdinalBandV1:$U,WorkPriorOutcomeV1:{additionalProperties:!1,description:"Cohort denominator. APPLICATION-supplied, never worker-supplied.\n\nA worker cannot widen its own calibration cohort, so a route cannot earn\ncalibrated sizing by reporting its own successes.",properties:{accepted:{description:"Whether the produced work was accepted.",type:"boolean"},escaped_defect:{description:"Whether a defect escaped review.",type:"boolean"},observed_at:{$ref:"#/$defs/UtcMicros",description:"When the outcome was observed. Outcomes later than `evaluated_at` are\nINCOMPARABLE and are excluded from support rather than trusted."},rework:{description:"Whether the accepted work required rework.",type:"boolean"},route_id:{description:"The route this outcome belongs to. May name a retired route; only\noutcomes matching the top-ranked route form the sizing cohort.",type:"string"},terminal:{$ref:"#/$defs/WorkPriorTerminalV1",description:"How the attempt terminated."}},required:["route_id","accepted","rework","escaped_defect","terminal","observed_at"],type:"object"},WorkPriorTerminalV1:{description:"How a prior attempt on a route ended. Recorded, never inferred.",enum:["succeeded","failed","timed_out","cancelled"],type:"string"},WorkProposalActionV1:{description:"The explicit command the decision recommends next. A recommendation never\nexecutes; each action names a separate version-checked application command.",enum:["proceed_to_acceptance","hold_for_dependencies","admit_execution","replan"],type:"string"},WorkProposalDecisionV1:{additionalProperties:!1,description:"One explained, replayable work-loop decision.",properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},configuration_revision:{anyOf:[{$ref:"#/$defs/ConfigurationRevisionId"},{type:"null"}]},decomposition:{anyOf:[{$ref:"#/$defs/WorkDecompositionProposalV1"},{type:"null"}],description:"One-level decomposition sketch, present only when more than one\ndependency is unresolved."},deterministic_fallback:{description:"True when the recommendation is the declared deterministic baseline\nselected because the evidence cannot support a stronger claim.",type:"boolean"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},evaluator_id:{$ref:"#/$defs/PolicyIdentifierV1"},evaluator_revision:{format:"uint64",minimum:0,type:"integer"},frontier_comparison:{$ref:"#/$defs/WorkFrontierComparisonV1"},input_digest:{$ref:"#/$defs/ManifestDigest"},live_git_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}],description:"The live Git frontier, returned exactly as supplied."},local_evidence:{anyOf:[{$ref:"#/$defs/WorkEvidenceFrontierV1"},{type:"null"}],description:"The local code/session frontier, returned exactly as supplied."},ordered_reason_codes:{items:{$ref:"#/$defs/WorkProposalReasonV1"},type:"array"},policy_digest:{$ref:"#/$defs/ManifestDigest"},policy_revision:{format:"uint64",minimum:0,type:"integer"},recommended_action:{anyOf:[{$ref:"#/$defs/WorkProposalActionV1"},{type:"null"}]},route_plan:{anyOf:[{$ref:"#/$defs/WorkRoutePlanV1"},{type:"null"}],description:"The explained route plan. Present on every evaluation that reached the\ngates, including the one that found no eligible route."},shape:{anyOf:[{$ref:"#/$defs/WorkTaskShapeV1"},{type:"null"}],description:"Derived task shape. Absent on the invalid, cancelled, and deadline\nshort-circuits, where no planner claim is licensed."},sizing:{anyOf:[{$ref:"#/$defs/WorkCalibratedSizingV1"},{type:"null"}],description:"Calibrated sizing, present only when in-cohort support reached the\ngoverning floor. Absence is a recorded fact, never a fabricated estimate."},task_id:{$ref:"#/$defs/TaskId"}},required:["evaluator_id","evaluator_revision","input_digest","task_id","based_on_version","policy_revision","policy_digest","configuration_digest","disposition","deterministic_fallback","ordered_reason_codes","frontier_comparison"],type:"object"},WorkProposalDispositionV1:{description:"Exactly one disposition per decision.",enum:["allow","deny","abstain","indeterminate"],type:"string"},WorkProposalReasonV1:{enum:["invalid_request","request_cancelled","deadline_exceeded","frontier_agreement","frontier_disagreement","frontier_incomparable","task_accepted","runtime_coverage_partial","runtime_coverage_unavailable","terminal_evidence_observed","execution_in_flight","proposal_accepted","dependencies_unresolved","ready","insufficient_calibration_support","route_budget_exceeded","route_content_location_refused","route_evidence_sparse","route_evidence_stale","human_override_applied","no_eligible_routes","deterministic_baseline_selected"],type:"string"},WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRankedRouteV1:{additionalProperties:!1,description:"Ranked route. Dimensions stay SEPARATE. No scalar score field is permitted here.",properties:{autonomy:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Autonomy fitness, echoed unmerged."},correctness:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Correctness fitness, echoed so the ranking can be audited without the input."},cost:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Cost fitness, oriented so `Highest` is best-fitting."},evidence_quality:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Evidence-quality fitness, echoed unmerged."},latency:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Latency fitness, oriented so `Highest` is best-fitting."},rank:{description:"Position in the ranking, ascending from 1.",format:"uint32",minimum:0,type:"integer"},route_id:{description:"The ranked route's identity.",type:"string"},sensitive_data_fitness:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Sensitive-data fitness, echoed unmerged."}},required:["rank","route_id","correctness","sensitive_data_fitness","latency","cost","autonomy","evidence_quality"],type:"object"},WorkRouteDecisionV1:S_,WorkRouteExclusionV1:{additionalProperties:!1,description:"One refused route and the single reason that refused it. Exclusion is\nrecorded rather than silent so a missing route is always explained.",properties:{reason:{$ref:"#/$defs/WorkProposalReasonV1",description:"The first limit the route failed, in the declared exclusion order."},route_id:{description:"The refused route's identity.",type:"string"}},required:["route_id","reason"],type:"object"},WorkRoutePlanV1:{additionalProperties:!1,description:"The explained route plan for one decision. Recommends; never dispatches.",properties:{coverage:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Fraction-free ordinal coverage of the cohort evidence over the ranked set."},deterministic_baseline:{description:"The declared deterministic baseline, selected when evidence cannot support a\nstronger claim. Always names a route that survived exclusion, or None when none did.",type:["string","null"]},exclusions:{description:"Every refused route with its reason, in supplied order.",items:{$ref:"#/$defs/WorkRouteExclusionV1"},type:"array"},human_override_applied:{description:"True only when a recorded human override named a route that survived\nexclusion. An excluded or unknown override leaves ranking untouched.",type:"boolean"},ranked:{description:"Surviving routes in total, deterministic order, rank ascending from 1.",items:{$ref:"#/$defs/WorkRankedRouteV1"},type:"array"},uncertainty:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Widens on sparse / stale / incomparable evidence."}},required:["ranked","exclusions","coverage","uncertainty","human_override_applied"],type:"object"},WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkSubtaskSketchV1:{additionalProperties:!1,description:"One level only (Q3). Read-only sketch; accepting it stays a separate version-checked command.",properties:{ordinal:{description:"Position in the proposal, ascending from 0. Stable across replays of the\nsame input.",format:"uint32",minimum:0,type:"integer"},shape:{$ref:"#/$defs/WorkTaskShapeKindV1",description:"Kind the sketch would carry if it were accepted as its own task."},summary:{description:"What the sketch covers, phrased from the declared counts alone.",type:"string"}},required:["ordinal","summary","shape"],type:"object"},WorkTaskShapeKindV1:{description:"Kind of work the snapshot facts describe. Derived only from facts already in\nthe input; `Unclassified` when those facts do not distinguish a kind.",enum:["investigation","change","synthesis","unclassified"],type:"string"},WorkTaskShapeV1:{additionalProperties:!1,description:"The derived shape of the task: what kind of work it is and how large the\ndeclared dependency and evidence counts make it.",properties:{band:{$ref:"#/$defs/WorkOrdinalBandV1",description:"Magnitude band derived from the declared dependency and evidence counts."},kind:{$ref:"#/$defs/WorkTaskShapeKindV1",description:"Kind derived from the gate booleans and counts. No new discovery."}},required:["kind","band"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"A canonical product proposal and the exact verified graph that licensed it.\n\n`proposal` can be moved directly into a `DecideWorkProposalRequestV1`;\ncallers use `verified_graph_version` to construct that mutation's CAS pin.",properties:{calibration:{$ref:"#/$defs/WorkCalibrationEvidenceV1"},decision:{$ref:"#/$defs/WorkProposalDecisionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["proposal","verified_graph_version","decision","calibration"],title:"GeneratedWorkProposal",type:"object"},{$defs:{WorkAttemptListCursorV1:b9},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One authority-scoped artifact hydration request, paged like the attempt\nlist and pinned to the same verified topology generation.",properties:{cursor:{anyOf:[{$ref:"#/$defs/WorkAttemptListCursorV1"},{type:"null"}],default:null},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],title:"WorkArtifactHydrationRequestV1",type:"object"},{$defs:{AttemptId:fW,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProviderId:vo,RunId:vF,SessionId:v8,TaskId:bT,UtcMicros:bZ,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptArtifactsV1:{additionalProperties:!1,description:"The artifacts and evidence one attempt declared.",properties:{artifacts:{description:"Every artifact reference the attempt declared, in its canonical\nstored order. References carry digest and byte length; bytes are\nnever part of this read.",items:{$ref:"#/$defs/WorkArtifactRefV1"},type:"array"},evidence:{$ref:"#/$defs/WorkAttemptEvidenceStateV1"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["identity","artifacts","evidence"],type:"object"},WorkAttemptEvidenceRecordV1:b4,WorkAttemptEvidenceStateV1:{description:"Whether an attempt's terminal evidence has been sealed. An attempt that\nhas not reported an outcome yet is a typed state, not a missing record.",oneOf:[{additionalProperties:!1,description:"The attempt has not sealed terminal evidence yet.",properties:{state:{const:"pending",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The sealed terminal evidence record, exactly as it was written.",properties:{record:{$ref:"#/$defs/WorkAttemptEvidenceRecordV1"},state:{const:"sealed",type:"string"}},required:["state","record"],type:"object"}]},WorkAttemptIdentityV1:b6,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptProviderOutcomeV1:b7,WorkAttemptStreamChannelV1:$r,WorkAttemptStreamSummaryV1:$i,WorkAttemptTopologyBindingV1:$o,WorkProviderAvailabilityV1:So,WorkProviderBackendV1:Sn,WorkProviderFallbackRecordV1:Sa,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One authority-scoped artifact hydration read. Absence of any Work in\nscope is a typed state, distinct from an authorized-but-empty page.",oneOf:[{additionalProperties:!1,description:"No Work exists in this authority scope, so there is no attempt set to\nhydrate. Concealed scopes never reach this state: they are refused as\nnot-found-or-not-authorized before any read.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"One page of attempt artifact sets under the verified topology\nsnapshot.",properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptArtifactsV1"},type:"array"},coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},state:{const:"hydrated",type:"string"},topology:{$ref:"#/$defs/WorkAttemptTopologyBindingV1"}},required:["state","topology","attempts","coverage"],type:"object"}],title:"WorkArtifactHydrationV1"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptTopologyBindingV1:$o,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One authority-scoped attempt-list read. Absence of any Work in scope is a\ntyped state, distinct from an authorized-but-empty page.",oneOf:[{additionalProperties:!1,description:"No Work exists in this authority scope, so there is no attempt set to\npage. Concealed scopes never reach this state: they are refused as\nnot-found-or-not-authorized before any read.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"One page of durable attempts under the verified topology snapshot.",properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"},coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},state:{const:"listed",type:"string"},topology:{$ref:"#/$defs/WorkAttemptTopologyBindingV1"}},required:["state","topology","attempts","coverage"],type:"object"}],title:"WorkAttemptListV1"},{$defs:{AcceptWorkTaskRequestV1:{additionalProperties:!1,properties:{evidence_by_criterion:{additionalProperties:{type:"string"},type:"object"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","evidence_by_criterion","mutation"],type:"object"},ActorId:fb,AddWorkTaskRequestV1:{additionalProperties:!1,properties:{item:{$ref:"#/$defs/WorkItemV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","item","mutation"],type:"object"},AdmitWorkExecutionRequestV1:{additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","based_on_version","mutation"],type:"object"},ApplyWorkRelationReplanRequestV1:{additionalProperties:!1,properties:{mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal_id:{$ref:"#/$defs/ProposalId"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal_id","mutation"],type:"object"},AttemptId:fW,CatalogGenerationId:hp,ConfigurationRevisionId:hM,CreateWorkProductRequestV1:{additionalProperties:!1,properties:{initial_graph:{$ref:"#/$defs/WorkProductGraphV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","initial_graph","mutation"],type:"object"},CreateWorkTaskRequestV1:{additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},plan:{$ref:"#/$defs/WorkPlanV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","initiative","plan","milestone","item","mutation"],type:"object"},DecideWorkProposalRequestV1:{additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],type:"object"},DecideWorkRelationReplanRequestV1:{additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],type:"object"},LinkAcceptedWorkAttemptRequestV1:{additionalProperties:!1,properties:{based_on_version:{format:"uint64",minimum:0,type:"integer"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["selection","task_id","based_on_version","identity","mutation"],type:"object"},ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RecordWorkHandoffRequestV1:{additionalProperties:!1,properties:{handoff:{$ref:"#/$defs/WorkHandoffV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","handoff","mutation"],type:"object"},RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductGraphV1:$4,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",description:"Closed public mutation surface for the Work-product graph authority.",oneOf:[{properties:{mutation:{const:"create",type:"string"},request:{$ref:"#/$defs/CreateWorkProductRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"add_task",type:"string"},request:{$ref:"#/$defs/AddWorkTaskRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"create_task",type:"string"},request:{$ref:"#/$defs/CreateWorkTaskRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"decide_proposal",type:"string"},request:{$ref:"#/$defs/DecideWorkProposalRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"decide_relation_replan",type:"string"},request:{$ref:"#/$defs/DecideWorkRelationReplanRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"apply_relation_replan",type:"string"},request:{$ref:"#/$defs/ApplyWorkRelationReplanRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"accept_task",type:"string"},request:{$ref:"#/$defs/AcceptWorkTaskRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"admit_execution",type:"string"},request:{$ref:"#/$defs/AdmitWorkExecutionRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"link_accepted_attempt",type:"string"},request:{$ref:"#/$defs/LinkAcceptedWorkAttemptRequestV1"}},required:["mutation","request"],type:"object"},{properties:{mutation:{const:"record_handoff",type:"string"},request:{$ref:"#/$defs/RecordWorkHandoffRequestV1"}},required:["mutation","request"],type:"object"}],title:"WorkProductMutationRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlReasonV1:S$},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_authority_version:{default:null,description:'The authority version the caller read. Absent means "no control row was\npublished yet"; a mismatch is a conflict, never an overwrite.',format:"uint64",minimum:0,type:["integer","null"]},occurred_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/WorkRunControlReasonV1"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","reason","occurred_at"],title:"PauseWorkRunCommand",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlAuthorityV1:Sb,WorkRunControlReasonV1:S$,WorkRunControlStateV1:SS,WorkRunDeadlineCheckpointV1:Sk},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One run's durable control aggregate.",properties:{authority:{$ref:"#/$defs/WorkRunControlAuthorityV1"},deadline:{$ref:"#/$defs/WorkRunDeadlineCheckpointV1"},fenced_attempts:{description:'The exact attempts that were live when the current state published.\nEmpty means "none were live", never "we did not look".',items:{$ref:"#/$defs/AttemptId"},type:"array"},reason:{anyOf:[{$ref:"#/$defs/WorkRunControlReasonV1"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},state:{$ref:"#/$defs/WorkRunControlStateV1"},task_id:{$ref:"#/$defs/TaskId"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","run_id","state","authority","deadline","transitioned_at","fenced_attempts"],title:"WorkRunControlV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementKindV1:$B,WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{occurred_at:{$ref:"#/$defs/UtcMicros"},run_id:{$ref:"#/$defs/RunId"},target:{$ref:"#/$defs/WorkPlacementTargetV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","target","occurred_at"],title:"WorkPlacementPreflightRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementObservationV1:{additionalProperties:!1,description:'What was actually observed at the target, in counts rather than prose.\n\nCounts are measurements: a zero is "we looked and found none", and\n`readable: false` is the separate state for "we could not look". Collapsing\nthem would let an unreadable target read as a clean one.',properties:{active_holder:{description:"Whether another admitted placement already holds this target.",type:"boolean"},dirty_tracked_paths:{description:"Tracked paths that differ from the index or HEAD.",format:"uint32",minimum:0,type:"integer"},network_required:{description:"Whether the declared network-free placement would require network.",type:"boolean"},observed_at:{$ref:"#/$defs/UtcMicros"},readable:{description:"Whether the target could be read at all.",type:"boolean"},unique_commits:{description:'Commits in the target reachable from nowhere else.\n\n`None` means reachability was not measured, and it blocks removal\nexactly as a positive count does: an unmeasured target is "unknown"\nand is retained rather than assumed worthless. Only removal consults\nthis; admission does not.',format:"uint32",minimum:0,type:["integer","null"]},untracked_paths:{description:"Untracked paths present in the target.",format:"uint32",minimum:0,type:"integer"}},required:["dirty_tracked_paths","untracked_paths","readable","active_holder","network_required","observed_at"],title:"WorkPlacementObservationV1",type:"object"},WorkPlacementTargetV1:$J},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One placement preflight reading: what was asked for, what was seen, and\nexactly what blocks it.",properties:{blockers:{items:{$ref:"#/$defs/WorkPlacementBlockerV1"},type:"array",uniqueItems:!0},identity:{$ref:"#/$defs/WorkPlacementIdentityV1"},observation:{$ref:"#/$defs/WorkPlacementObservationV1"},target:{$ref:"#/$defs/WorkPlacementTargetV1"}},required:["identity","target","observation","blockers"],title:"WorkPlacementPreflightV1",type:"object"},{$defs:{RunId:vF,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id"],title:"WorkPlacementStatusRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J,WorkPlacementV1:$Z},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One placement reading. Absence is a state, not an empty placement.",oneOf:[{additionalProperties:!1,description:"No placement was ever admitted for this run.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The durable placement relation.",properties:{placement:{$ref:"#/$defs/WorkPlacementV1"},state:{const:"placed",type:"string"}},required:["state","placement"],type:"object"}],title:"WorkPlacementReadingV1"},{$defs:{AttemptId:fW,CoverageStateV1:yf,DuplicateEffectOutcomeV1:yP,DuplicateEffortKindV1:yV,QuantityEvidenceClassV1:vs,RunId:vF,TaskId:bT,WorkAttemptIdentityV1:b6,WorkDuplicateAdjudicationQuantitiesV1:$f},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Operator judgment before the owning Work authority binds exact current\ngenerations, relation revision, command identity, and observation time.",properties:{first_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},quantities:{$ref:"#/$defs/WorkDuplicateAdjudicationQuantitiesV1"},reason:{type:"string"},second_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},verdict:{$ref:"#/$defs/DuplicateEffortKindV1"}},required:["first_attempt","second_attempt","verdict","quantities","reason"],title:"PrepareWorkDuplicateAdjudicationRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductChangeDraftV1:{description:"Operator-selected graph change before the owning Work authority binds the\ncurrent verified head and revision authorities.",oneOf:[{properties:{change:{const:"add_task",type:"string"},item:{$ref:"#/$defs/WorkItemV1"}},required:["change","item"],type:"object"},{properties:{change:{const:"create_task",type:"string"},initiative:{$ref:"#/$defs/WorkInitiativeV1"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"}},required:["change","initiative","plan","milestone","item"],type:"object"},{properties:{change:{const:"decide_proposal",type:"string"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["change","proposal","disposition"],type:"object"},{properties:{change:{const:"decide_relation_replan",type:"string"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["change","proposal","disposition"],type:"object"},{properties:{change:{const:"apply_relation_replan",type:"string"},proposal_id:{$ref:"#/$defs/ProposalId"}},required:["change","proposal_id"],type:"object"},{properties:{change:{const:"accept_task",type:"string"},evidence_by_criterion:{additionalProperties:{type:"string"},type:"object"},task_id:{$ref:"#/$defs/TaskId"}},required:["change","task_id","evidence_by_criterion"],type:"object"},{properties:{change:{const:"admit_execution",type:"string"},task_id:{$ref:"#/$defs/TaskId"}},required:["change","task_id"],type:"object"},{properties:{change:{const:"link_accepted_attempt",type:"string"},identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},task_id:{$ref:"#/$defs/TaskId"}},required:["change","task_id","identity"],type:"object"},{properties:{change:{const:"record_handoff",type:"string"},handoff:{$ref:"#/$defs/WorkHandoffV1"}},required:["change","handoff"],type:"object"}]},WorkProductEventEvidenceV1:$Y,WorkProductSelectionScopeV1:$7,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Read-only preparation input. Authority identities, clocks, and revision\npins are deliberately absent because the backend owns them.",properties:{causation_event_id:{type:["string","null"]},change:{$ref:"#/$defs/WorkProductChangeDraftV1"},evidence:{items:{$ref:"#/$defs/WorkProductEventEvidenceV1"},type:"array"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","change","evidence"],title:"PrepareWorkProductMutationRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_authority_version:{format:"uint64",minimum:0,type:"integer"},occurred_at:{$ref:"#/$defs/UtcMicros"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","expected_authority_version","occurred_at"],title:"ReleaseWorkPlacementCommand",type:"object"},{$defs:{UtcMicros:bZ},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{occurred_at:{$ref:"#/$defs/UtcMicros"}},required:["occurred_at"],title:"ResumeWorkAttemptsCommand",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"What restart recovery did to each open attempt.\n\nThis report never claims that a provider resumed. An attempt in\n`recovery_required` remains fenced under its original identity. This report\ndoes not authorize another launch; an explicit `retry_attempt` must verify\nthe exact recovery fence and effect safety before it can atomically admit a\nnew identity.",properties:{cancelled:{description:"Attempts whose in-flight cancellation was completed during recovery.",items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"},recovery_required:{description:"Attempts fenced onto a new epoch and awaiting an explicit recovery\ndecision.",items:{$ref:"#/$defs/WorkAttemptV1"},type:"array"}},required:["recovery_required","cancelled"],title:"WorkAttemptRecoveryReportV1",type:"object"},{$defs:{RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlReasonV1:S$},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expected_authority_version:{format:"uint64",minimum:0,type:"integer"},occurred_at:{$ref:"#/$defs/UtcMicros"},reason:{$ref:"#/$defs/WorkRunControlReasonV1"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","reason","expected_authority_version","occurred_at"],title:"ResumeWorkRunCommand",type:"object"},{$defs:{AttemptId:fW,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProjectId:_4,ProviderId:vo,RepositoryId:vb,RunId:vF,SessionId:v8,TaskId:bT,TemporalModeV1:bW,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAttemptIdentityV1:b6,WorkEvidenceContinuationV1:$_,WorkEvidenceExpansionSelectorV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"anchor",type:"string"},link_id:{type:"string"}},required:["kind","link_id"],type:"object"},{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},kind:{const:"task_session",type:"string"}},required:["kind","attempt"],type:"object"}]},WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7,WorkTaskSessionContinuationV1:ST},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One TaskId-rooted read. The exact Work graph identity remains mandatory on\ncontinuation and expansion requests, so neither an anchor nor a cursor is\nauthority by possession.",properties:{continuation:{anyOf:[{$ref:"#/$defs/WorkEvidenceContinuationV1"},{type:"null"}],default:null},expansion:{anyOf:[{$ref:"#/$defs/WorkEvidenceExpansionSelectorV1"},{type:"null"}],default:null},observed_at:{$ref:"#/$defs/UtcMicros"},page_size:{format:"uint32",minimum:0,type:"integer"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"},task_id:{$ref:"#/$defs/TaskId"},temporal:{$ref:"#/$defs/TemporalModeV1"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["selection","task_id","verified_version","temporal","page_size","observed_at"],title:"WorkEvidenceRetrieveRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ObservationSourceIdentityV1:_M,ProposalId:_8,ProviderId:vo,RetrievalAnchorId:vI,RunId:vF,SessionId:v8,SessionRetrievalBudgetAccountingV1:{additionalProperties:!1,description:"The ceiling and count behind a budget refusal.\n\n`stage` names which budget refused; this is what tells an oversized request\napart from a read whose cost was mis-sized for it. The ceiling value also\ndistinguishes the resources inside one stage: a record read that stopped at\n1024 hit the item count, one that stopped at 16 MiB hit the byte total, so\nthe kernel's resource spelling stays in the kernel instead of becoming a\nsecond wire vocabulary to keep in step.",properties:{limit:{format:"uint64",minimum:0,type:"integer"},observed:{$ref:"#/$defs/SessionRetrievalBudgetObservationV1"}},required:["limit","observed"],type:"object"},SessionRetrievalBudgetObservationV1:{description:"What a refusing budget boundary had counted.\n\nBoth variants are exact. A bounded read never counts the rows it declined to\nread, so an exhausted read reports what it consumed and that storage held\nmore, never a total it would have to run the refused scan to learn.",oneOf:[{additionalProperties:!1,description:"The request asked for more units than the admitted maximum.",properties:{observation:{const:"requested",type:"string"},units:{format:"uint64",minimum:0,type:"integer"}},required:["observation","units"],type:"object"},{additionalProperties:!1,description:"The read consumed its whole budget and storage still held more.",properties:{observation:{const:"consumed_with_more_available",type:"string"},units:{format:"uint64",minimum:0,type:"integer"}},required:["observation","units"],type:"object"}]},SessionRetrievalBudgetStageV1:bo,SessionRetrievalStructuralRefusalV1:{oneOf:[{additionalProperties:!1,properties:{kind:{type:"string"},maximum:{format:"uint",minimum:0,type:"integer"},observed:{format:"uint",minimum:0,type:"integer"},refusal:{const:"cursor_manifest_limit_exceeded",type:"string"}},required:["refusal","kind","observed","maximum"],type:"object"},{additionalProperties:!1,properties:{accounting:{anyOf:[{$ref:"#/$defs/SessionRetrievalBudgetAccountingV1"},{type:"null"}],description:"Present when the refusing boundary keeps a counter. A request-shape\ncheck has none and reports `None` rather than inventing numbers."},refusal:{const:"budget_exhausted",type:"string"},stage:{$ref:"#/$defs/SessionRetrievalBudgetStageV1"}},required:["refusal","stage"],type:"object"}]},TaskEvidenceLinkV1:bj,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAnchorHydrationV1:{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},content:{items:{type:"string"},type:"array"},continuation:{type:["string","null"]},coverage:{$ref:"#/$defs/WorkEvidenceCoverageStateV1"},exact_anchors:{items:{$ref:"#/$defs/RetrievalAnchorId"},type:"array"},freshness:{$ref:"#/$defs/WorkEvidenceFreshnessV1"},redacted:{type:"boolean"}},required:["anchor_id","exact_anchors","content","coverage","freshness","redacted"],type:"object"},WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptEvidenceRecordV1:b4,WorkAttemptIdentityV1:b6,WorkAttemptProviderOutcomeV1:b7,WorkAttemptReceiptV1:$e,WorkAttemptStreamChannelV1:$r,WorkAttemptStreamSummaryV1:$i,WorkEvidenceContinuationV1:$_,WorkEvidenceCoverageStateV1:{enum:["complete","partial","unknown"],type:"string"},WorkEvidenceCoverageV1:{additionalProperties:!1,properties:{hydrated:{format:"uint32",minimum:0,type:"integer"},omitted:{format:"uint32",minimum:0,type:"integer"},selected:{format:"uint32",minimum:0,type:"integer"},state:{$ref:"#/$defs/WorkEvidenceCoverageStateV1"}},required:["state","selected","hydrated","omitted"],type:"object"},WorkEvidenceFreshnessV1:{enum:["current","stale","unknown"],type:"string"},WorkEvidenceOmissionReasonV1:{oneOf:[{enum:["limit_reached","pending","not_found_or_not_authorized","unavailable","reset_required","stale","cancelled","timed_out","redacted"],type:"string"},{additionalProperties:!1,properties:{structural_refusal:{$ref:"#/$defs/SessionRetrievalStructuralRefusalV1"}},required:["structural_refusal"],type:"object"}]},WorkEvidenceOmissionV1:{additionalProperties:!1,properties:{reason:{$ref:"#/$defs/WorkEvidenceOmissionReasonV1"},relation:{type:"string"}},required:["relation","reason"],type:"object"},WorkEvidenceSourceV1:{oneOf:[{additionalProperties:!1,properties:{kind:{const:"attempt_receipt",type:"string"},receipt:{$ref:"#/$defs/WorkAttemptReceiptV1"}},required:["kind","receipt"],type:"object"},{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},evidence:{$ref:"#/$defs/WorkTaskSessionEvidenceV1"},kind:{const:"task_session",type:"string"}},required:["kind","attempt","evidence"],type:"object"},{additionalProperties:!1,properties:{hydration:{$ref:"#/$defs/WorkAnchorHydrationV1"},kind:{const:"anchor",type:"string"},link:{$ref:"#/$defs/TaskEvidenceLinkV1"}},required:["kind","link","hydration"],type:"object"}]},WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkItemInputV1:$M,WorkItemV1:$N,WorkProductRelationV1:$5,WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderAvailabilityV1:So,WorkProviderBackendV1:Sn,WorkProviderFallbackRecordV1:Sa,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTaskSessionContinuationV1:ST,WorkTaskSessionCoverageV1:{additionalProperties:!1,properties:{hidden:{format:"uint64",minimum:0,type:"integer"},redacted:{format:"uint64",minimum:0,type:"integer"},unknown:{format:"uint64",minimum:0,type:"integer"},visible:{format:"uint64",minimum:0,type:"integer"}},required:["visible","hidden","unknown","redacted"],type:"object"},WorkTaskSessionEvidenceV1:{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},continuation:{anyOf:[{$ref:"#/$defs/WorkTaskSessionContinuationV1"},{type:"null"}]},coverage:{$ref:"#/$defs/WorkEvidenceCoverageStateV1"},coverage_counts:{$ref:"#/$defs/WorkTaskSessionCoverageV1"},freshness:{$ref:"#/$defs/WorkEvidenceFreshnessV1"},hydrated:{items:{$ref:"#/$defs/WorkTaskSessionHydrationV1"},type:"array"},participant_epoch:{$ref:"#/$defs/ManifestDigest"},ranked_anchors:{items:{$ref:"#/$defs/WorkTaskSessionRankedAnchorV1"},type:"array"},redacted:{type:"boolean"},source:{$ref:"#/$defs/ObservationSourceIdentityV1"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["task_id","verified_version","attempt","source","participant_epoch","ranked_anchors","hydrated","coverage","coverage_counts","freshness","redacted"],type:"object"},WorkTaskSessionHydrationStateV1:{enum:["available","retained_but_unavailable","redacted","deleted","retention_expired","unauthorized","locked","unverifiable"],type:"string"},WorkTaskSessionHydrationV1:{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},content:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:["array","null"]},rank:{format:"uint32",minimum:0,type:"integer"},state:{$ref:"#/$defs/WorkTaskSessionHydrationStateV1"}},required:["rank","anchor_id","state"],type:"object"},WorkTaskSessionRankContributionV1:{additionalProperties:!1,properties:{calibrated_feature_micros:{format:"uint32",minimum:0,type:"integer"},calibration_profile:{type:"string"},ordinal_rank:{format:"uint32",minimum:0,type:"integer"},raw_score_micros:{format:"int64",type:"integer"},retriever:{type:"string"},retriever_revision:{type:"string"},score_domain:{type:"string"},source_occurrence:{type:"string"},weight_micros:{format:"uint32",minimum:0,type:"integer"},weighted_contribution_micros:{format:"uint64",minimum:0,type:"integer"}},required:["retriever","retriever_revision","source_occurrence","ordinal_rank","raw_score_micros","score_domain","calibration_profile","calibrated_feature_micros","weight_micros","weighted_contribution_micros"],type:"object"},WorkTaskSessionRankedAnchorV1:{additionalProperties:!1,properties:{anchor_id:{$ref:"#/$defs/RetrievalAnchorId"},contributions:{items:{$ref:"#/$defs/WorkTaskSessionRankContributionV1"},type:"array"},final_ordinal:{format:"uint32",minimum:0,type:"integer"},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","final_ordinal","utility_micros","contributions"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{continuations:{items:{$ref:"#/$defs/WorkEvidenceContinuationV1"},type:"array"},coverage:{$ref:"#/$defs/WorkEvidenceCoverageV1"},freshness:{$ref:"#/$defs/WorkEvidenceFreshnessV1"},item:{$ref:"#/$defs/WorkItemV1"},omissions:{items:{$ref:"#/$defs/WorkEvidenceOmissionV1"},type:"array"},proposal_decisions:{items:{$ref:"#/$defs/WorkProposalDecisionV1"},type:"array"},redacted:{type:"boolean"},relation_replan_decisions:{items:{$ref:"#/$defs/WorkRelationReplanDecisionV1"},type:"array"},relations:{items:{$ref:"#/$defs/WorkProductRelationV1"},type:"array"},sources:{items:{$ref:"#/$defs/WorkEvidenceSourceV1"},type:"array"},task_id:{$ref:"#/$defs/TaskId"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["task_id","verified_version","item","relations","proposal_decisions","relation_replan_decisions","sources","coverage","omissions","freshness","redacted","continuations"],title:"WorkEvidenceRetrievalV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkRetryCauseV1:Sf,WorkRetryFailureSelectorV1:Sh,WorkRetrySourceV1:Sy},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},failure:{$ref:"#/$defs/WorkRetryFailureSelectorV1"},new_attempt_id:{$ref:"#/$defs/AttemptId"},original_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["original_attempt","new_attempt_id","failure","command_id"],title:"RetryWorkAttemptCommandV1",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,RetryWorkAttemptCommandV1:{additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},failure:{$ref:"#/$defs/WorkRetryFailureSelectorV1"},new_attempt_id:{$ref:"#/$defs/AttemptId"},original_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["original_attempt","new_attempt_id","failure","command_id"],title:"RetryWorkAttemptCommandV1",type:"object"},ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,VerifiedWorkRetryFailureV1:{additionalProperties:!1,description:"Failure fact returned by a canonical evidence authority.",properties:{evidence_digest:{$ref:"#/$defs/ManifestDigest"},observed_at:{$ref:"#/$defs/UtcMicros"},selector:{$ref:"#/$defs/WorkRetryFailureSelectorV1"}},required:["selector","evidence_digest","observed_at"],type:"object"},WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkRetryCauseV1:Sf,WorkRetryFailureSelectorV1:Sh,WorkRetryReceiptV1:{additionalProperties:!1,properties:{canonical_input_digest:{$ref:"#/$defs/ManifestDigest"},command:{$ref:"#/$defs/RetryWorkAttemptCommandV1"},failure:{$ref:"#/$defs/VerifiedWorkRetryFailureV1"},new_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},owner_receipt_digest:{$ref:"#/$defs/ManifestDigest"},restarted_at:{$ref:"#/$defs/UtcMicros",description:"Daemon-owned admission time at which the new attempt was created."},retry_required_at:{$ref:"#/$defs/UtcMicros",description:"Exact source-owned time at which the failure made a retry necessary."}},required:["command","failure","new_attempt","retry_required_at","restarted_at","canonical_input_digest","owner_receipt_digest"],type:"object"},WorkRetrySourceV1:Sy,WorkSandboxPolicy:Sw,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptV1"},outcome:{const:"created",type:"string"},receipt:{$ref:"#/$defs/WorkRetryReceiptV1"}},required:["outcome","receipt","attempt"],type:"object"},{additionalProperties:!1,properties:{attempt:{$ref:"#/$defs/WorkAttemptV1"},outcome:{const:"replayed",type:"string"},receipt:{$ref:"#/$defs/WorkRetryReceiptV1"}},required:["outcome","receipt","attempt"],type:"object"}],title:"WorkRetryAttemptOutcomeV1"},{$defs:{CatalogGenerationId:hp,ConfigurationRevisionId:hM,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,ReviewWorkProposalDispositionV1:{description:"The only non-accepting dispositions the proposal-review operation can\ncommit. The broader decision request remains available to the graph\nmutation operation, which owns all decision forms.",enum:["rejected","superseded"],type:"string"},SourceStoreId:bS,TaskId:bT,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkCommandId:$p,WorkProductAuthorizedRelationScopeV1:$X,WorkProductEventEvidenceV1:$Y,WorkProductExpectedAuthorityV1:$2,WorkProductMutationIdentityV1:$6,WorkProductRevisionPinsV1:$8,WorkProductSelectionScopeV1:$7,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/ReviewWorkProposalDispositionV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","proposal","disposition","mutation"],title:"ReviewWorkProposalRequestV1",type:"object"},{$defs:{RunId:vF,TaskId:bT},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id"],title:"WorkRunControlRequestV1",type:"object"},{$defs:{AttemptId:fW,RunId:vF,TaskId:bT,UtcMicros:bZ,WorkRunControlAuthorityV1:Sb,WorkRunControlReasonV1:S$,WorkRunControlStateV1:SS,WorkRunControlV1:{additionalProperties:!1,description:"One run's durable control aggregate.",properties:{authority:{$ref:"#/$defs/WorkRunControlAuthorityV1"},deadline:{$ref:"#/$defs/WorkRunDeadlineCheckpointV1"},fenced_attempts:{description:'The exact attempts that were live when the current state published.\nEmpty means "none were live", never "we did not look".',items:{$ref:"#/$defs/AttemptId"},type:"array"},reason:{anyOf:[{$ref:"#/$defs/WorkRunControlReasonV1"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},state:{$ref:"#/$defs/WorkRunControlStateV1"},task_id:{$ref:"#/$defs/TaskId"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","run_id","state","authority","deadline","transitioned_at","fenced_attempts"],title:"WorkRunControlV1",type:"object"},WorkRunDeadlineCheckpointV1:Sk},$schema:"https://json-schema.org/draft/2020-12/schema",description:"One run's control reading.\n\n`Uncontrolled` is a distinct answer from `Controlled`: it says the run is\nadmitted and running under its admitted deadline with no control transition\never published, which is not the same as a control row that happens to say\n`Running`.",oneOf:[{additionalProperties:!1,description:"The run holds durable attempts but no control transition has ever been\npublished for it.",properties:{deadline:{$ref:"#/$defs/UtcMicros",description:"The admitted deadline the run is running against."},live_attempts:{description:"Attempts that have not reached a terminal state.",items:{$ref:"#/$defs/AttemptId"},type:"array"},state:{const:"uncontrolled",type:"string"},total_attempts:{format:"uint32",minimum:0,type:"integer"}},required:["state","deadline","live_attempts","total_attempts"],type:"object"},{additionalProperties:!1,description:"The published control aggregate, plus the live frontier as of this\nread (which may differ from the frontier the transition fenced).",properties:{control:{$ref:"#/$defs/WorkRunControlV1"},live_attempts:{items:{$ref:"#/$defs/AttemptId"},type:"array"},state:{const:"controlled",type:"string"},total_attempts:{format:"uint32",minimum:0,type:"integer"}},required:["state","control","live_attempts","total_attempts"],type:"object"}],title:"WorkRunControlReadingV1"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Starts one admitted provider attempt. Every field is a typed fact; there\nis no argv, environment entry, executable path, or shell string here. The\nprojection binding and admission facts are re-read from the canonical Work\nauthority, never trusted from the caller.",properties:{attempt_id:{$ref:"#/$defs/AttemptId"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},instructions:{type:"string"},occurred_at:{$ref:"#/$defs/UtcMicros"},operation:{$ref:"#/$defs/WorkflowOperationRef"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"},worktree_root:{type:"string"}},required:["task_id","run_id","attempt_id","operation","execution_snapshot","worktree_root","commit","instructions","effect_state","occurred_at"],title:"StartWorkAttemptCommand",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,StartWorkAttemptCommand:{additionalProperties:!1,description:"Starts one admitted provider attempt. Every field is a typed fact; there\nis no argv, environment entry, executable path, or shell string here. The\nprojection binding and admission facts are re-read from the canonical Work\nauthority, never trusted from the caller.",properties:{attempt_id:{$ref:"#/$defs/AttemptId"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},instructions:{type:"string"},occurred_at:{$ref:"#/$defs/UtcMicros"},operation:{$ref:"#/$defs/WorkflowOperationRef"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"},worktree_root:{type:"string"}},required:["task_id","run_id","attempt_id","operation","execution_snapshot","worktree_root","commit","instructions","effect_state","occurred_at"],type:"object"},TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkAttemptIdentityV1:b6,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkSandboxPolicy:Sw,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Admits one synthesis attempt over an ordered set of sibling sources.",properties:{output_name:{$ref:"#/$defs/WorkflowOutputName",description:"The fan-out output the synthesis belongs to, carried into the draft\nthe workflow completion path verifies."},sources:{description:"The ordered sibling sources the synthesis consumes.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},start:{$ref:"#/$defs/StartWorkAttemptCommand",description:"The synthesis attempt's own admission facts; it is started through\nthe same admission machinery as any other attempt."}},required:["start","output_name","sources"],title:"AdmitWorkSynthesisCommand",type:"object"},{$defs:{AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAttemptProgressV1:b5,WorkAttemptProjectionBindingV1:b8,WorkAttemptStateV1:$t,WorkAttemptV1:$n,WorkCancellationAcknowledgementV1:$a,WorkCancellationEscalationV1:$s,WorkCancellationRequestId:$d,WorkCancellationRequestV1:$c,WorkCancellationStateV1:$l,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionEnvelopeV1:$k,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRecoveryStateV1:Sl,WorkRestartReasonV1:Sm,WorkSandboxPolicy:Sw,WorkSynthesisEvidenceGroupV1:Sq,WorkSynthesisRefusalV1:SI,WorkSynthesisSourceEnvelopeV1:Sx,WorkSynthesisSourceOutcomeV1:Sj,WorkSynthesisSourceSetV1:SC,WorkTerminalEvidenceV1:SO,WorkTopologyPolicyV1:SA,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowSynthesisDraft:SH,WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",description:"The typed outcome of a synthesis request: an admitted attempt, or the\nsealed unsynthesized set when synthesis could not truthfully begin.",oneOf:[{additionalProperties:!1,description:"The admitted synthesis attempt and everything it is accountable to.",properties:{attempt:{$ref:"#/$defs/WorkAttemptV1",description:"The leased (or idempotently replayed) synthesis attempt."},draft:{$ref:"#/$defs/WorkflowSynthesisDraft",description:"The citation obligation, complete by construction: the draft cites\nevery citable source digest and is verified downstream by\n[`crate::workflow_synthesis::verify_workflow_synthesis_draft`]."},groups:{description:"Disagreement structure over the succeeded sources.",items:{$ref:"#/$defs/WorkSynthesisEvidenceGroupV1"},type:"array"},source_set:{$ref:"#/$defs/WorkSynthesisSourceSetV1",description:"The sealed source envelopes the attempt was admitted against."},synthesis:{const:"admitted",type:"string"},uncited:{description:"Sources preserved without citations: failures, unknowns, and\nartifact-less successes, in the caller's requested order.",items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"}},required:["synthesis","attempt","source_set","groups","draft","uncited"],type:"object"},{properties:{refusal:{$ref:"#/$defs/WorkSynthesisRefusalV1"},sources:{$ref:"#/$defs/WorkSynthesisSourceSetV1"},synthesis:{const:"unsynthesized",type:"string"}},required:["synthesis","sources","refusal"],type:"object"}],title:"WorkSynthesisAttemptV1"},{$defs:{WorkAttemptListCursorV1:b9},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One page-bounded topology view read. The cursor vocabulary is the attempt\nlist's: a cursor minted under a superseded topology generation is a typed\nstaleness refusal, never a silently different page.",properties:{cursor:{anyOf:[{$ref:"#/$defs/WorkAttemptListCursorV1"},{type:"null"}],default:null},page_size:{format:"uint32",minimum:0,type:"integer"}},required:["page_size"],title:"WorkTopologyViewRequestV1",type:"object"},{$defs:{BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,TaskId:bT,TopologyGatePolicyV1:bH,UtcMicros:bZ,WorkAttemptListCoverageV1:b3,WorkAttemptListCursorV1:b9,WorkAttemptTopologyBindingV1:$o,WorkPlacementBlockerV1:$H,WorkPlacementIdentityV1:$G,WorkPlacementKindV1:$B,WorkPlacementReadingV1:{description:"One placement reading. Absence is a state, not an empty placement.",oneOf:[{additionalProperties:!1,description:"No placement was ever admitted for this run.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The durable placement relation.",properties:{placement:{$ref:"#/$defs/WorkPlacementV1"},state:{const:"placed",type:"string"}},required:["state","placement"],type:"object"}],title:"WorkPlacementReadingV1"},WorkPlacementStateV1:$K,WorkPlacementTargetV1:$J,WorkPlacementV1:$Z,WorkTopologyExecutionPlacementV1:{additionalProperties:!1,description:"The execution-placement dimension: the policy's placement mode plus one\nlane per distinct `(task, run)` pair in page order.",properties:{lanes:{items:{$ref:"#/$defs/WorkTopologyPlacementLaneV1"},type:"array"},mode:{$ref:"#/$defs/WorktreePlacementModeV1"}},required:["mode","lanes"],title:"WorkTopologyExecutionPlacementV1",type:"object"},WorkTopologyIntegrationStrategyV1:{additionalProperties:!1,description:"The integration-strategy dimension, read verbatim from the resolved work\ntopology policy the runs in scope are admitted against.",properties:{cross_merge:{$ref:"#/$defs/CrossMergePolicyV1"},gates:{$ref:"#/$defs/TopologyGatePolicyV1"},protected_refs:{items:{$ref:"#/$defs/ProtectedRefRuleV1"},type:"array"}},required:["cross_merge","gates","protected_refs"],title:"WorkTopologyIntegrationStrategyV1",type:"object"},WorkTopologyPlacementLaneV1:{additionalProperties:!1,description:"One execution-placement lane: a distinct `(task, run)` pair from the\nattempt page joined to its durable placement reading. Placement absence is\na state on the lane, not a dropped lane.",properties:{attempt_count:{description:"Attempts this lane carried within the requested page.",format:"uint32",minimum:0,type:"integer"},placement:{$ref:"#/$defs/WorkPlacementReadingV1"},run_id:{$ref:"#/$defs/RunId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","run_id","attempt_count","placement"],title:"WorkTopologyPlacementLaneV1",type:"object"},WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ},$schema:"https://json-schema.org/draft/2020-12/schema",description:"The application-owned execution-topology view. Absence of any Work in\nscope is a typed state, distinct from an authorized-but-empty page.",oneOf:[{additionalProperties:!1,description:"No Work exists in this authority scope, so there is no topology to\ndraw. Concealed scopes are refused before any read.",properties:{state:{const:"absent",type:"string"}},required:["state"],type:"object"},{additionalProperties:!1,description:"The four dimensions, pinned to one verified topology generation.",properties:{branch_topology:{$ref:"#/$defs/BranchTopologyPolicyV1"},coverage:{$ref:"#/$defs/WorkAttemptListCoverageV1"},execution_placement:{$ref:"#/$defs/WorkTopologyExecutionPlacementV1"},integration_strategy:{$ref:"#/$defs/WorkTopologyIntegrationStrategyV1"},review_topology:{$ref:"#/$defs/ReviewTopologyPolicyV1"},state:{const:"view",type:"string"},topology:{$ref:"#/$defs/WorkAttemptTopologyBindingV1"}},required:["state","topology","coverage","execution_placement","branch_topology","review_topology","integration_strategy"],type:"object"}],title:"ExecutionTopologyViewV1"},{$defs:{ObservabilityHorizonV1:_W},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"One horizon-bounded execution-topology metrics read. The authorized scope\nis taken from the request context, not from the request, so a caller can\nnever widen the population it reads.",properties:{horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},max_events:{description:"Event budget for this read, at most\n[`MAX_EXECUTION_TOPOLOGY_EVENTS_V1`].",format:"uint32",minimum:0,type:"integer"}},required:["horizon","max_events"],title:"ExecutionTopologyMetricsRequestV1",type:"object"},{$defs:{CoverageStateV1:yf,ExecutionBlockedCauseV1:{description:"Cause a work item was blocked for.",enum:["dependency","needs_input","capability","policy","scope","conflict","lease","backpressure","test","ci","review","effect_unknown","other","unknown"],type:"string"},ExecutionConcurrencyPhaseV1:{description:"Concurrency-width phase. `Useful` counts only distinct admitted\nattempts that advanced a committed progress frontier; heartbeats,\nqueued work, child processes, and transport fanout never reach it.",enum:["requested","accepted","admitted","active","useful"],type:"string"},ExecutionConflictKindV1:{description:"Conflict prediction kind. Mechanical and semantic keep separate\ndenominators because their adjudicators are not interchangeable.",enum:["mechanical","semantic","combined"],type:"string"},ExecutionConflictOutcomeV1:{description:"Independently observed conflict outcome. `Censored` and `Unknown`\nnever enter a confusion-matrix denominator.",enum:["conflict","no_conflict","censored","unknown"],type:"string"},ExecutionDeliveryOutcomeV1:{description:"Per-surface delivery outcome. A multi-surface delivery is never a\nduplicate of product work; only `Deduplicated` is.",enum:["delivered","deduplicated","dropped","unknown"],type:"string"},ExecutionDuplicateKindV1:{description:"Adjudicated duplicate-work relation. Similarity, proximity, shared\npaths, and concurrency never produce one of these.",enum:["exact_duplicate","superseded_overlap","repeated_investigation","duplicate_effect","not_duplicate","censored","unknown"],type:"string"},ExecutionDuplicateOutcomeV1:{description:"Whether a duplicate effect was prevented or actually committed. The\ntwo never collapse into one count.",enum:["prevented","committed","unknown","not_applicable"],type:"string"},ExecutionDurationBucketV1:{description:"Fixed duration buckets shared by stale stack age, blocked time, and\nrerun latency. Raw timestamps and exact durations stay authorized\nlocal detail.",enum:["under1m","from1m_to5m","from5m_to15m","from15m_to1h","from1h_to4h","from4h_to24h","from1d_to7d","over7d"],type:"string"},ExecutionFanoutPhaseV1:{description:"Fan-out width phase. `PeakActive` is the sampled active width; the\nfan-out distribution is unweighted so serialized and blocked samples,\nwhich carry no interval, are preserved rather than dropped.",enum:["requested","accepted","admitted","peak_active","useful"],type:"string"},ExecutionGitHubStackCapabilityReadingV1:{additionalProperties:!1,description:"Latest trustworthy GitHub stacked-PR capability observation in the\nhorizon. It is a typed operational state, not a metric or success claim.",properties:{capability:{anyOf:[{$ref:"#/$defs/ExecutionGitHubStackCapabilityV1"},{type:"null"}]},coverage:{$ref:"#/$defs/MetricCoverageV1"},other_forge_fallback_available:{type:["boolean","null"]},standard_git_fallback_available:{type:["boolean","null"]},unavailable:{anyOf:[{$ref:"#/$defs/ExecutionMetricUnavailableV1"},{type:"null"}]}},required:["coverage"],title:"ExecutionGitHubStackCapabilityReadingV1",type:"object"},ExecutionGitHubStackCapabilityV1:{description:"Last bounded GitHub stacked-PR capability state observed in the\nhorizon. This remains orthogonal to GitHub ingress and item lifecycle.",enum:["unavailable","private_preview_disabled","enabled","degraded"],type:"string"},ExecutionIntegrationKindV1:{description:"Integration operation kind. Rebase remains external observation only.",enum:["fast_forward","merge_commit","rebase","cherry_pick","stack_retarget","graph_only","external_observed","unknown"],type:"string"},ExecutionIntegrationOutcomeV1:{description:"Terminal result of an observed native integration.",enum:["succeeded","conflicted","rejected","denied","stale","locked","cancelled","timed_out","failed","partial","effect_unknown","unsupported","unknown"],type:"string"},ExecutionIntervalStateV1:{description:"Whether the owning drift interval is still open or exactly closed.",enum:["open","closed"],type:"string"},ExecutionLeakKindV1:{description:"Independently proved execution-leak class.",enum:["lease_after_terminal","attempt_without_live_owner","effect_unknown_past_deadline","missing_worktree_binding","unbounded_delivery","none","unknown"],type:"string"},ExecutionLeakOutcomeV1:{description:"Recovery state a proved leak reached.",enum:["not_required","pending","recovered","failed","unknown"],type:"string"},ExecutionMetricUnavailableV1:{description:"Why a measurement carries no value. Absence is always one of these typed\nreasons; it is never an empty string, a zero, or a silently dropped row.",oneOf:[{const:"store_unavailable",description:"The observation store could not be read at all for this horizon.",type:"string"},{const:"event_budget_exceeded",description:"The horizon holds more events than one read may draw, so every\ndenominator here would be a partial count presented as a total.",type:"string"},{const:"cell_budget_exceeded",description:"The bounded projection would exceed the Plan 26 result-cell ceiling.\nThe whole read refuses rather than returning a misleading subset.",type:"string"},{const:"no_eligible_evidence",description:"No recorded event in the family supplies this metric's numerator or\ndenominator.",type:"string"},{const:"support_floor_unmet",description:"Eligible cases exist but fall below the metric's support floor.",type:"string"},{const:"coverage_floor_unmet",description:"Observed cases cover less of the eligible population than the metric's\ncoverage floor allows.",type:"string"},{const:"censoring_ceiling_exceeded",description:"More of the eligible population is censored than the metric admits.",type:"string"},{const:"unbounded_interval",description:"The interval this metric integrates over has no proved upper bound, so\nits duration cannot be measured without inventing a terminal.",type:"string"}]},ExecutionQuantityUnitV1:{description:"Quantity unit for duplicate-effort accounting. Each unit is reported\nseparately: wall time, tokens, cost, tests, and effects are never\nsummed into one number.",enum:["wall_micros","tokens","cost_micros","tests","effects"],type:"string"},ExecutionRerunCauseV1:{description:"Typed rerun cause. Repeated logs and transport redelivery are not\nreruns and never carry one of these.",enum:["runtime_retry","runtime_fallback","test_rerun","ci_rerun","recovery","human_requested","unknown"],type:"string"},ExecutionRerunSourceV1:{description:"Which independent system observed the rerun.",enum:["runtime","test","ci"],type:"string"},ExecutionStackDriftKindV1:{description:"Exact reason a stack became stale. The enum is bounded and never\ncarries a branch, ref, worktree, repository, or provider identity.",enum:["head_advanced","base_advanced","merge_base_changed","retargeted","superseded"],type:"string"},ExecutionSurfaceFamilyV1:{description:"Delivery surface family. Addresses, payloads, principals, and\nrecipients are never observed, so the family is the whole label.",enum:["hook","mcp","lsp","dashboard","cli","other"],type:"string"},ExecutionTopologyDimensionV1:{description:"One allowed local grouping dimension. The set is closed by construction:\nevery value is produced by an exhaustive match over a bounded domain class,\nso no person, agent, task, project, repository, worktree, branch, ref,\ncommit, model version, or route can ever appear as a label.",oneOf:[{properties:{dimension:{const:"concurrency_phase",type:"string"},value:{$ref:"#/$defs/ExecutionConcurrencyPhaseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"fanout_phase",type:"string"},value:{$ref:"#/$defs/ExecutionFanoutPhaseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"width_bucket",type:"string"},value:{$ref:"#/$defs/ExecutionWidthBucketV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"duration_bucket",type:"string"},value:{$ref:"#/$defs/ExecutionDurationBucketV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"duplicate_kind",type:"string"},value:{$ref:"#/$defs/ExecutionDuplicateKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"unit",type:"string"},value:{$ref:"#/$defs/ExecutionQuantityUnitV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"duplicate_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionDuplicateOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"conflict_kind",type:"string"},value:{$ref:"#/$defs/ExecutionConflictKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"conflict_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionConflictOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"integration_kind",type:"string"},value:{$ref:"#/$defs/ExecutionIntegrationKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"integration_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionIntegrationOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"stack_drift_kind",type:"string"},value:{$ref:"#/$defs/ExecutionStackDriftKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"interval_state",type:"string"},value:{$ref:"#/$defs/ExecutionIntervalStateV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"blocked_cause",type:"string"},value:{$ref:"#/$defs/ExecutionBlockedCauseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"rerun_source",type:"string"},value:{$ref:"#/$defs/ExecutionRerunSourceV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"rerun_cause",type:"string"},value:{$ref:"#/$defs/ExecutionRerunCauseV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"leak_kind",type:"string"},value:{$ref:"#/$defs/ExecutionLeakKindV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"leak_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionLeakOutcomeV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"surface",type:"string"},value:{$ref:"#/$defs/ExecutionSurfaceFamilyV1"}},required:["dimension","value"],type:"object"},{properties:{dimension:{const:"delivery_outcome",type:"string"},value:{$ref:"#/$defs/ExecutionDeliveryOutcomeV1"}},required:["dimension","value"],type:"object"}]},ExecutionTopologyDrillAnchorV1:{additionalProperties:!1,description:"An opaque cursor minted by the registered observation authority. It can be\nresolved only through that same authorized local query boundary and is not\na metric dimension or exportable identity.",properties:{cursor:{type:"string"}},required:["cursor"],title:"ExecutionTopologyDrillAnchorV1",type:"object"},ExecutionTopologyEmissionCoverageV1:{additionalProperties:!1,description:"Envelope-level delivery evidence for this read. `None` means the store did\nnot answer, so no zero may be inferred. `dropped` is the proved lower bound\nfrom the bound producer scope, deduplicated across explicit loss receipts\nand their next-envelope carriers; it is not attributed to a topology\nfamily. Sampling stays a count of sampled topology envelopes and is never\nexpanded into a fabricated population estimate.",properties:{delayed:{format:"uint64",minimum:0,type:["integer","null"]},dropped:{format:"uint64",minimum:0,type:["integer","null"]},emitted:{format:"uint64",minimum:0,type:["integer","null"]},sampled_events:{format:"uint64",minimum:0,type:["integer","null"]}},title:"ExecutionTopologyEmissionCoverageV1",type:"object"},ExecutionTopologyMeasurementV1:{additionalProperties:!1,description:"One descriptor cell: the Plan 26 descriptor name, its grouping dimensions,\nand the landed metric envelope carrying value, denominator, coverage, and\nprovenance.",properties:{dimensions:{description:"Allowed local grouping dimensions, at most\n[`MAX_METRIC_DIMENSIONS_V1`], in a fixed order per descriptor.",items:{$ref:"#/$defs/ExecutionTopologyDimensionV1"},type:"array"},unavailable:{anyOf:[{$ref:"#/$defs/ExecutionMetricUnavailableV1"},{type:"null"}],description:"Typed absence reason. It is `Some` exactly when `value.value` is\n`None`, so a reader can never mistake a refused metric for a zero."},value:{$ref:"#/$defs/MetricValueV1"}},required:["dimensions","value"],title:"ExecutionTopologyMeasurementV1",type:"object"},ExecutionWidthBucketV1:{description:"Fixed width buckets. Raw widths stay authorized local detail; only\nbucket counts leave the projection.",enum:["zero","one","two","from3_to4","from5_to8","from9_to16","from17_to32","from33_to64","over64"],type:"string"},MetricCalibrationV1:_h,MetricCohortV1:_y,MetricCoverageV1:_g,MetricEvidenceClassV1:__,MetricProvenanceV1:_v,MetricSourceV1:_b,MetricTemporalV1:_$,MetricUncertaintyV1:_S,MetricValueV1:_k,ObservabilityHorizonV1:_W},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"The canonical execution-topology read model. Observatory and Costs render\nthis without local formulas; CLI, MCP, and HTTP return the same bytes.",properties:{authorized_scope_ref:{description:"Local authorization anchor the read was admitted under. It is derived\nfrom the resolved scope, never from a caller-supplied string.",type:"string"},coverage:{$ref:"#/$defs/MetricCoverageV1",description:"Family-level coverage over the event population, independent of any\nsingle descriptor's denominator."},current:{description:"True only when the whole family was read with `Known` coverage. A\nfalse value means at least one descriptor below is a typed absence.",type:"boolean"},drill_anchors:{description:"Bounded registered source cursors for authorized local drill-down.\nPayload anchors, traces, and scope identifiers never enter this list.",items:{$ref:"#/$defs/ExecutionTopologyDrillAnchorV1"},type:"array"},emission_coverage:{$ref:"#/$defs/ExecutionTopologyEmissionCoverageV1"},github_stack_capability:{$ref:"#/$defs/ExecutionGitHubStackCapabilityReadingV1"},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"},measurements:{items:{$ref:"#/$defs/ExecutionTopologyMeasurementV1"},type:"array"},observed_at_micros:{format:"int64",type:"integer"},watermark:{description:"Watermark of the last event this projection consumed. A rebuild at the\nsame watermark yields the same values.",type:"string"}},required:["authorized_scope_ref","horizon","watermark","observed_at_micros","current","coverage","emission_coverage","github_stack_capability","drill_anchors","measurements"],title:"ExecutionTopologyMetricsV1",type:"object"},{$defs:{ProjectId:_4,RepositoryId:vb,UtcMicros:bZ,WorkGraphReadModeV1:{oneOf:[{properties:{mode:{const:"current",type:"string"}},required:["mode"],type:"object"},{properties:{mode:{const:"as_of",type:"string"},valid_at:{$ref:"#/$defs/UtcMicros"}},required:["mode","valid_at"],type:"object"},{properties:{from_valid_at:{$ref:"#/$defs/UtcMicros"},mode:{const:"evolution",type:"string"},through_valid_at:{$ref:"#/$defs/UtcMicros"}},required:["mode","from_valid_at","through_valid_at"],type:"object"},{properties:{from_observed_at:{$ref:"#/$defs/UtcMicros"},mode:{const:"forensic",type:"string"},through_observed_at:{$ref:"#/$defs/UtcMicros"}},required:["mode","from_observed_at","through_observed_at"],type:"object"}]},WorkProductAuthorizedRelationScopeV1:$X,WorkProductSelectionScopeV1:$7},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{continuation:{type:["string","null"]},mode:{$ref:"#/$defs/WorkGraphReadModeV1"},observed_at:{$ref:"#/$defs/UtcMicros"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","mode","observed_at"],title:"WorkGraphReadRequestV1",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AuthorizedWorkProductScopeV1:{additionalProperties:!1,description:"Owner identity resolved by the registered profile authority. It is never\naccepted from a Work request.",properties:{owner_brain_id:{$ref:"#/$defs/BrainId"},owner_profile_id:{$ref:"#/$defs/UserProfileId"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["owner_brain_id","owner_profile_id","selection"],type:"object"},BrainId:f1,ManifestDigest:_l,ProjectId:_4,ProjectionGenerationId:_5,ProposalId:_8,ProviderId:vo,RepositoryId:vb,RetrievalAnchorId:vI,RunId:vF,TaskEvidenceLinkV1:bj,TaskId:bT,UserProfileId:bJ,UtcMicros:bZ,VerifiedWorkGraphVersionV1:bX,WorkAcceptanceCriterionV1:bY,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkCausalProjectionV1:{additionalProperties:!1,properties:{candidate_edges:{items:{$ref:"#/$defs/WorkDagEdgeV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"}},required:["graph_version","candidate_edges"],type:"object"},WorkCriticalPathProjectionV1:{additionalProperties:!1,properties:{graph_version:{format:"uint64",minimum:0,type:"integer"},task_ids:{items:{$ref:"#/$defs/TaskId"},type:"array"},total_effort:{format:"uint32",minimum:0,type:"integer"}},required:["graph_version","task_ids","total_effort"],type:"object"},WorkDagEdgeV1:{additionalProperties:!1,properties:{dependency:{$ref:"#/$defs/TaskId"},dependent:{$ref:"#/$defs/TaskId"}},required:["dependency","dependent"],type:"object"},WorkDagProjectionV1:{additionalProperties:!1,properties:{gating_edges:{items:{$ref:"#/$defs/WorkDagEdgeV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"},task_ids:{items:{$ref:"#/$defs/TaskId"},type:"array"}},required:["graph_version","task_ids","gating_edges"],type:"object"},WorkGraphSelectionCoverageV1:{description:"How much of the owner's journal the read's selection actually covers.\n\nA selection names a slice of the owner's work, not the whole journal: an\nevent records the relation scopes it was admitted under, and a selection\nthat does not name them puts that event *outside* the slice. The events\noutside a selection do not poison the ones inside it, but they must never be\nconcealed either, a caller who is shown the covered slice with no way to\nlearn that more exists is reading a silently incomplete graph.\n\nSo the read answers over the covered slice and says so, in the same\n`Complete`/`Partial` vocabulary [`WorkGraphTimelineCoverageV1`] and\n[`WorkHistoryCoverageV1`](crate::WorkHistoryCoverageV1) already use.\n\nThe covered slice is always a *prefix* of the journal, and that is a\nproperty of folding rather than a simplification. A graph version is folded\nfrom every event up to its own sequence, so the first event a selection does\nnot cover ends the readable slice: every later version, whatever scopes its\nown event named, would have to be folded across that event to exist at all.\n`excluded_events` therefore counts every event from the first uncovered one\nonward.",oneOf:[{description:"The selection covers the owner's whole journal. Nothing was withheld.",properties:{coverage:{const:"complete",type:"string"},covered_events:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","covered_events"],type:"object"},{description:"The selection covers `covered_events` events and `excluded_events`\nevents lie outside it, starting at `first_excluded_sequence`. Every\nentry this read returned was folded from covered events alone.",properties:{coverage:{const:"partial",type:"string"},covered_events:{format:"uint32",minimum:0,type:"integer"},excluded_events:{format:"uint32",minimum:0,type:"integer"},first_excluded_sequence:{format:"uint64",minimum:0,type:"integer"}},required:["coverage","covered_events","excluded_events","first_excluded_sequence"],type:"object"}]},WorkGraphTimelineCoverageV1:{oneOf:[{properties:{coverage:{const:"complete",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned"],type:"object"},{properties:{continuation:{type:"string"},coverage:{const:"partial",type:"string"},returned:{format:"uint32",minimum:0,type:"integer"}},required:["coverage","returned","continuation"],type:"object"}]},WorkGraphTimelineV1:{additionalProperties:!1,properties:{coverage:{$ref:"#/$defs/WorkGraphTimelineCoverageV1"},entries:{items:{$ref:"#/$defs/WorkGraphVersionEntryV1"},type:"array"}},required:["entries","coverage"],type:"object"},WorkGraphVersionEntryV1:{additionalProperties:!1,description:"One immutable graph version and every Work projection derived from that\nsame version at the caller's explicit observation time.",properties:{graph:{$ref:"#/$defs/WorkProductGraphV1"},observed_at:{$ref:"#/$defs/UtcMicros"},projected_at:{$ref:"#/$defs/UtcMicros"},projections:{$ref:"#/$defs/WorkProductProjectionBundleV1"},runtime:{$ref:"#/$defs/WorkRuntimeProjectionV1"},valid_at:{$ref:"#/$defs/UtcMicros"},verified_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["valid_at","observed_at","projected_at","verified_version","graph","runtime","projections"],type:"object"},WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkKanbanCardV1:{additionalProperties:!1,properties:{effort:{format:"uint32",minimum:0,type:"integer"},lane:{$ref:"#/$defs/WorkTimelineLaneV1"},legal_actions:{items:{$ref:"#/$defs/WorkLegalActionV1"},type:"array",uniqueItems:!0},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","lane","effort","legal_actions"],type:"object"},WorkKanbanProjectionV1:{additionalProperties:!1,properties:{cards:{items:{$ref:"#/$defs/WorkKanbanCardV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"}},required:["graph_version","cards"],type:"object"},WorkLegalActionV1:{enum:["view_evidence","generate_proposal","accept_proposal","link_accepted_attempt","accept_task","handoff","archive"],type:"string"},WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProductAuthorizedRelationScopeV1:$X,WorkProductGraphV1:$4,WorkProductProjectionBundleV1:{additionalProperties:!1,properties:{causal:{$ref:"#/$defs/WorkCausalProjectionV1"},critical_path:{$ref:"#/$defs/WorkCriticalPathProjectionV1"},dag:{$ref:"#/$defs/WorkDagProjectionV1"},graph_version:{format:"uint64",minimum:0,type:"integer"},kanban:{$ref:"#/$defs/WorkKanbanProjectionV1"},runtime:{$ref:"#/$defs/WorkRuntimeProjectionV1"},timeline:{$ref:"#/$defs/WorkTimelineProjectionV1"},workload:{$ref:"#/$defs/WorkWorkloadProjectionV1"}},required:["graph_version","runtime","kanban","dag","timeline","causal","critical_path","workload"],type:"object"},WorkProductSelectionScopeV1:$7,WorkProjectionSequenceV1:{format:"uint64",minimum:0,title:"WorkProjectionSequenceV1",type:"integer"},WorkProposalDecisionV1:Se,WorkProposalDispositionV1:St,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRelationReplanDecisionV1:Sp,WorkRelationReplanProposalV1:Su,WorkRouteDecisionV1:S_,WorkRuntimeAttemptProjectionV1:{additionalProperties:!1,properties:{identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},state:{$ref:"#/$defs/WorkAttemptStateV1"}},required:["identity","state"],type:"object"},WorkRuntimeProjectionCoverageV1:{oneOf:[{additionalProperties:!1,properties:{coverage:{const:"complete",type:"string"}},required:["coverage"],type:"object"},{additionalProperties:!1,properties:{coverage:{const:"partial",type:"string"},unavailable_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array",uniqueItems:!0}},required:["coverage","unavailable_attempts"],type:"object"},{additionalProperties:!1,properties:{coverage:{const:"unavailable",type:"string"}},required:["coverage"],type:"object"}]},WorkRuntimeProjectionV1:{additionalProperties:!1,properties:{attempts:{items:{$ref:"#/$defs/WorkRuntimeAttemptProjectionV1"},type:"array"},coverage:{$ref:"#/$defs/WorkRuntimeProjectionCoverageV1"},generation_id:{$ref:"#/$defs/ProjectionGenerationId"},graph_version:{format:"uint64",minimum:0,type:"integer"},observed_at:{$ref:"#/$defs/UtcMicros"},sequence:{$ref:"#/$defs/WorkProjectionSequenceV1"}},required:["graph_version","generation_id","sequence","observed_at","attempts","coverage"],type:"object"},WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTimelineEntryV1:{additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},deadline:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},scheduled_at:{anyOf:[{$ref:"#/$defs/UtcMicros"},{type:"null"}]},task_id:{$ref:"#/$defs/TaskId"},updated_at:{$ref:"#/$defs/UtcMicros"}},required:["task_id","created_at","updated_at"],type:"object"},WorkTimelineLaneV1:{enum:["triage","todo","scheduled","ready","running","blocked","review","done","archived","cancelled","unavailable"],type:"string"},WorkTimelineProjectionV1:{additionalProperties:!1,properties:{entries:{items:{$ref:"#/$defs/WorkTimelineEntryV1"},type:"array"},graph_version:{format:"uint64",minimum:0,type:"integer"}},required:["graph_version","entries"],type:"object"},WorkWorkloadProjectionV1:{additionalProperties:!1,properties:{actual_concurrency:{format:"uint32",minimum:0,type:["integer","null"]},blocked_effort:{format:"uint32",minimum:0,type:["integer","null"]},graph_version:{format:"uint64",minimum:0,type:"integer"},ready_effort:{format:"uint32",minimum:0,type:["integer","null"]},requested_concurrency:{format:"uint32",minimum:0,type:["integer","null"]},running_effort:{format:"uint32",minimum:0,type:["integer","null"]},total_effort:{format:"uint32",minimum:0,type:"integer"}},required:["graph_version","total_effort"],type:"object"}},$schema:"https://json-schema.org/draft/2020-12/schema",oneOf:[{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"current",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},snapshot:{$ref:"#/$defs/WorkGraphVersionEntryV1"}},required:["mode","authorized_scope","selection_coverage","snapshot"],type:"object"},{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"as_of",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},snapshot:{$ref:"#/$defs/WorkGraphVersionEntryV1"}},required:["mode","authorized_scope","selection_coverage","snapshot"],type:"object"},{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"evolution",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},timeline:{$ref:"#/$defs/WorkGraphTimelineV1"}},required:["mode","authorized_scope","selection_coverage","timeline"],type:"object"},{properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"forensic",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"},timeline:{$ref:"#/$defs/WorkGraphTimelineV1"}},required:["mode","authorized_scope","selection_coverage","timeline"],type:"object"},{description:"A `Current` or `AsOf` point read under an authorized selection that has\nno published graph version at that point: no task has been created yet.\nThe caller was authorized; the legal next action is creating a task.",properties:{authorized_scope:{$ref:"#/$defs/AuthorizedWorkProductScopeV1"},mode:{const:"absent",type:"string"},selection_coverage:{$ref:"#/$defs/WorkGraphSelectionCoverageV1"}},required:["mode","authorized_scope","selection_coverage"],type:"object"}],title:"WorkGraphReadV1"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::activate`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},expected_revision:{description:"Current candidate disposition revision. A newly registered candidate\nstarts at revision 1; activation reports expected and observed values\nwhen this compare-and-swap precondition is stale.",format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version","expected_revision"],title:"WorkflowDefinitionActivateRequest",type:"object"},{$defs:{UtcMicros:bZ,WorkflowDefinitionId:SM,WorkflowDefinitionLifecycleState:{description:'Durable lifecycle disposition of one immutable workflow definition version.\n\nPlan 32 ("Typed workflow definitions"): "Lifecycle retains candidate,\nvalidate, activate, retire, reject, list, get, diff, and history operations\nthrough the same application surfaces." The definition payload itself stays\nimmutable, "Editing creates a new version; admitted runs remain pinned",\nso the disposition is a separate revisioned aggregate keyed by the same\ndefinition identity.',enum:["candidate","validated","active","retired","rejected"],type:"string"}},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Revisioned lifecycle disposition of one definition version.",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},revision:{format:"uint64",minimum:1,type:"integer"},state:{$ref:"#/$defs/WorkflowDefinitionLifecycleState"},transitioned_at:{$ref:"#/$defs/UtcMicros"}},required:["definition_id","definition_version","state","revision","transitioned_at"],title:"WorkflowDefinitionDisposition",type:"object"},{$defs:{RunId:vF,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Requests cooperative cancellation as a durable typed transition; the run\nsettles to `Cancelled` when the runtime reconciles in-flight steps.",properties:{command_id:{$ref:"#/$defs/WorkCommandId"},expected_sequence:{format:"uint64",minimum:0,type:"integer"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","expected_sequence","command_id"],title:"WorkflowRunCancelRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProjectId:_4,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkArtifactId:b0,WorkArtifactRefV1:b2,WorkAttemptIdentityV1:b6,WorkAuthority:{additionalProperties:!1,properties:{actor_id:{$ref:"#/$defs/ActorId"},policy_digest:{$ref:"#/$defs/ManifestDigest"},project_id:{$ref:"#/$defs/ProjectId"},repository_id:{$ref:"#/$defs/RepositoryId"},worktree_id:{$ref:"#/$defs/WorktreeId"}},required:["project_id","repository_id","worktree_id","actor_id","policy_digest"],type:"object"},WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFilesystemPolicy:$x,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTopologyPolicyV1:SA,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowFanOutChildPlanV1:{additionalProperties:!1,properties:{admit_command_id:{$ref:"#/$defs/WorkCommandId"},attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"},create_command_id:{$ref:"#/$defs/WorkCommandId"},initiative:{$ref:"#/$defs/WorkInitiativeV1"},instructions:{type:"string"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"},proposal:{$ref:"#/$defs/WorkProposalV1"},proposal_command_id:{$ref:"#/$defs/WorkCommandId"},task_id:{$ref:"#/$defs/TaskId"}},required:["task_id","attempt_identity","create_command_id","proposal_command_id","admit_command_id","initiative","plan","milestone","item","proposal","instructions"],type:"object"},WorkflowFanOutFailurePolicyV1:{oneOf:[{properties:{policy:{const:"fail_fast",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"collect",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"require_at_least",type:"string"},successes:{format:"uint16",maximum:65535,minimum:1,type:"integer"}},required:["policy","successes"],type:"object"}]},WorkflowFanOutPlanV1:{additionalProperties:!1,properties:{admitted_at:{$ref:"#/$defs/UtcMicros"},authority:{$ref:"#/$defs/WorkAuthority",description:"Exact Work authority that admitted this plan. Recovery may execute the\nplan only from a runtime with this byte-identical authority."},children:{items:{$ref:"#/$defs/WorkflowFanOutChildPlanV1"},type:"array"},commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},failure_policy:{$ref:"#/$defs/WorkflowFanOutFailurePolicyV1"},maximum_parallel:{format:"uint16",maximum:65535,minimum:1,type:"integer"},operation:{$ref:"#/$defs/WorkflowOperationRef"},plan_digest:{$ref:"#/$defs/ManifestDigest"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]},step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["authority","step_id","operation","plan_digest","admitted_at","maximum_parallel","failure_policy","execution_snapshot","commit","effect_state","children"],type:"object"},WorkflowOperationRef:Sz,WorkflowOutputArtifact:{additionalProperties:!1,properties:{artifact:{$ref:"#/$defs/WorkArtifactRefV1"},attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["attempt_identity","artifact"],type:"object"},WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowPlacementReceipt:{additionalProperties:!1,properties:{backend:{$ref:"#/$defs/WorkProviderBackendV1"},configuration_digest:{$ref:"#/$defs/ManifestDigest"},model:{type:"string"},placement_digest:{$ref:"#/$defs/ManifestDigest"},provider_registry_digest:{$ref:"#/$defs/ManifestDigest"},route:{$ref:"#/$defs/WorkProviderRouteV1"},run_id:{$ref:"#/$defs/RunId"},step_id:{$ref:"#/$defs/WorkflowStepId"},topology_digest:{$ref:"#/$defs/ManifestDigest"},worktree_placement:{$ref:"#/$defs/WorktreePlacementModeV1"}},required:["run_id","step_id","route","backend","model","configuration_digest","topology_digest","provider_registry_digest","worktree_placement","placement_digest"],type:"object"},WorkflowRunEvent:{additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},event:{$ref:"#/$defs/WorkflowRunEventKind"},input_digest:{$ref:"#/$defs/ManifestDigest"},occurred_at:{$ref:"#/$defs/UtcMicros"},run_id:{$ref:"#/$defs/RunId"},sequence:{format:"uint64",minimum:0,type:"integer"}},required:["run_id","sequence","command_id","input_digest","occurred_at","event"],type:"object"},WorkflowRunEventKind:{oneOf:[{properties:{definition:{$ref:"#/$defs/WorkflowDefinition"},fan_out_plans:{default:[],items:{$ref:"#/$defs/WorkflowFanOutPlanV1"},type:"array"},pinned_provider_registry_digest:{$ref:"#/$defs/ManifestDigest"},pinned_topology_digest:{$ref:"#/$defs/ManifestDigest"},type:{const:"admitted",type:"string"}},required:["type","definition","pinned_topology_digest","pinned_provider_registry_digest"],type:"object"},{properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"fan_out_children_released",type:"string"}},required:["type","step_id","attempts"],type:"object"},{properties:{attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"fan_out_children_settled",type:"string"}},required:["type","step_id","attempts"],type:"object"},{properties:{planned_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},prior_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},replacement_attempt:{$ref:"#/$defs/WorkAttemptIdentityV1"},retry_receipt_digest:{$ref:"#/$defs/ManifestDigest"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"fan_out_child_retry_rebound",type:"string"}},required:["type","step_id","planned_attempt","prior_attempt","replacement_attempt","retry_receipt_digest"],type:"object"},{properties:{placement:{$ref:"#/$defs/WorkflowPlacementReceipt"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"step_started",type:"string"}},required:["type","step_id","placement"],type:"object"},{properties:{effect_receipt:{$ref:"#/$defs/WorkflowStepEffectReceipt"},outputs:{items:{$ref:"#/$defs/WorkflowStepOutput"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"step_completed",type:"string"}},required:["type","step_id","outputs","effect_receipt"],type:"object"},{properties:{effect_receipt:{$ref:"#/$defs/WorkflowStepEffectReceipt"},outputs:{items:{$ref:"#/$defs/WorkflowStepOutput"},type:"array"},step_id:{$ref:"#/$defs/WorkflowStepId"},type:{const:"step_failed",type:"string"}},required:["type","step_id","outputs","effect_receipt"],type:"object"},{properties:{type:{const:"paused",type:"string"}},required:["type"],type:"object"},{properties:{type:{const:"resumed",type:"string"}},required:["type"],type:"object"},{properties:{type:{const:"cancellation_requested",type:"string"}},required:["type"],type:"object"},{properties:{type:{const:"cancelled",type:"string"}},required:["type"],type:"object"}]},WorkflowRunStatus:{enum:["running","paused","cancelling","completed","failed","cancelled"],type:"string"},WorkflowStep:SL,WorkflowStepEffectOutcome:{enum:["completed","failed","cancelled","timed_out","unknown"],type:"string"},WorkflowStepEffectReceipt:{additionalProperties:!1,properties:{effect_digest:{$ref:"#/$defs/ManifestDigest"},outcome:{$ref:"#/$defs/WorkflowStepEffectOutcome"},output_set_digest:{$ref:"#/$defs/ManifestDigest"},placement_digest:{$ref:"#/$defs/ManifestDigest"},receipt_digest:{$ref:"#/$defs/ManifestDigest"},run_id:{$ref:"#/$defs/RunId"},step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["run_id","step_id","placement_digest","outcome","effect_digest","output_set_digest","receipt_digest"],type:"object"},WorkflowStepId:SU,WorkflowStepOutput:{additionalProperties:!1,properties:{artifacts:{items:{$ref:"#/$defs/WorkflowOutputArtifact"},type:"array"},output_name:{$ref:"#/$defs/WorkflowOutputName"}},required:["output_name","artifacts"],type:"object"},WorkflowStepRunProjection:{additionalProperties:!1,properties:{effect_receipt:{anyOf:[{$ref:"#/$defs/WorkflowStepEffectReceipt"},{type:"null"}]},outputs:{additionalProperties:{$ref:"#/$defs/WorkflowStepOutput"},type:"object"},placement_receipt:{anyOf:[{$ref:"#/$defs/WorkflowPlacementReceipt"},{type:"null"}]},status:{$ref:"#/$defs/WorkflowStepStatus"}},required:["status","outputs"],type:"object"},WorkflowStepStatus:{enum:["blocked","ready","running","succeeded","failed","cancelled"],type:"string"},WorktreeCleanlinessRequirementV1:SG,WorktreeId:SB,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{definition:{$ref:"#/$defs/WorkflowDefinition"},fan_out_plans:{additionalProperties:{$ref:"#/$defs/WorkflowFanOutPlanV1"},type:"object"},history:{items:{$ref:"#/$defs/WorkflowRunEvent"},type:"array"},pinned_provider_registry_digest:{$ref:"#/$defs/ManifestDigest"},pinned_topology_digest:{$ref:"#/$defs/ManifestDigest"},released_fan_out_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array",uniqueItems:!0},run_id:{$ref:"#/$defs/RunId"},sequence:{format:"uint64",minimum:0,type:"integer"},settled_fan_out_attempts:{items:{$ref:"#/$defs/WorkAttemptIdentityV1"},type:"array",uniqueItems:!0},status:{$ref:"#/$defs/WorkflowRunStatus"},steps:{additionalProperties:{$ref:"#/$defs/WorkflowStepRunProjection"},type:"object"}},required:["run_id","definition","pinned_topology_digest","pinned_provider_registry_digest","status","sequence","steps","fan_out_plans","released_fan_out_attempts","settled_fan_out_attempts","history"],title:"WorkflowRunProjection",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::history`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"}},required:["definition_id"],title:"WorkflowDefinitionHistoryRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/WorkflowDefinition"},title:"Array_of_WorkflowDefinition",type:"array"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::diff`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},from_version:{format:"uint64",minimum:1,type:"integer"},to_version:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","from_version","to_version"],title:"WorkflowDefinitionDiffRequest",type:"object"},{$defs:{WorkflowDefinitionId:SM,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{catalog_changed:{type:"boolean"},changed_steps:{items:{$ref:"#/$defs/WorkflowStepId"},type:"array",uniqueItems:!0},configuration_changed:{type:"boolean"},definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},from_version:{format:"uint64",minimum:0,type:"integer"},policy_changed:{type:"boolean"},to_version:{format:"uint64",minimum:0,type:"integer"}},required:["definition_id","from_version","to_version","changed_steps","policy_changed","configuration_changed","catalog_changed"],title:"WorkflowDefinitionDiff",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::get`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version"],title:"WorkflowDefinitionGetRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:0,type:"integer"},pinned_catalog_digest:{$ref:"#/$defs/ManifestDigest",description:"Must equal the live Work executable catalog digest. Validation and\nactivation report the current digest when this pin is stale."},pinned_configuration_digest:{$ref:"#/$defs/ManifestDigest"},pinned_policy_digest:{$ref:"#/$defs/ManifestDigest"},project_id:{$ref:"#/$defs/ProjectId"},steps:{items:{$ref:"#/$defs/WorkflowStep"},type:"array"}},required:["definition_id","definition_version","project_id","steps","pinned_policy_digest","pinned_configuration_digest","pinned_catalog_digest"],title:"WorkflowDefinition",type:"object"},{$defs:{RunId:vF},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{run_id:{$ref:"#/$defs/RunId"}},required:["run_id"],title:"WorkflowRunGetRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkHandoffAttemptFrontierV1:$C,WorkHandoffFrontierV1:$T,WorkHandoffLineageV1:$O,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`TaskHandoffService::issue`].\n\n`secret` is the caller-supplied bearer token; the authority persists only\nits digest, never the secret itself. The scope must name a step the\nActive definition version declares and a run admitted from that version;\nany other scope is refused as not found and journals no grant.",properties:{frontier:{$ref:"#/$defs/WorkHandoffFrontierV1",description:"The exact work/evidence frontier this handoff records (Plan 24)."},scope:{$ref:"#/$defs/TaskHandoffScope"},secret:{type:"string"}},required:["scope","secret","frontier"],title:"TaskHandoffIssueRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkHandoffAttemptFrontierV1:$C,WorkHandoffFrontierV1:$T,WorkHandoffLineageV1:$O,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{expires_at:{$ref:"#/$defs/UtcMicros"},frontier:{$ref:"#/$defs/WorkHandoffFrontierV1",description:"The exact work/evidence frontier this handoff records (Plan 24)."},frontier_digest:{$ref:"#/$defs/ManifestDigest",description:"The canonical digest of `frontier`; lineage chains hold this value."},issued_at:{$ref:"#/$defs/UtcMicros"},scope:{$ref:"#/$defs/TaskHandoffScope"},token_digest:{$ref:"#/$defs/ManifestDigest"}},required:["scope","token_digest","issued_at","expires_at","frontier","frontier_digest"],title:"TaskHandoffGrant",type:"object"},{$defs:{ActorId:fb,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`TaskHandoffService::redeem`].",properties:{expected_scope:{$ref:"#/$defs/TaskHandoffScope"},secret:{type:"string"}},required:["secret","expected_scope"],title:"TaskHandoffRedeemRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,ManifestDigest:_l,ProjectId:_4,RepositoryId:vb,RunId:vF,TaskHandoffScope:bC,TaskId:bT,ThreadId:bz,UtcMicros:bZ,WorkAttemptIdentityV1:b6,WorkAttemptStateV1:$t,WorkHandoffAttemptFrontierV1:$C,WorkHandoffFrontierV1:$T,WorkHandoffLineageV1:$O,WorkflowDefinitionId:SM,WorkflowStepId:SU,WorktreeId:SB},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire response for [`TaskHandoffService::redeem`]: the redemption receipt,\nonce and only once, for the caller that actually consumed the grant.\n\nThe receipt is checkpoint evidence only. It deliberately carries no\nlease, fence, or acceptance authority: redeeming a handoff cannot renew\na lease, establish task acceptance, or mutate graph or runtime state\n(Plan 24). The redeemer must earn runtime authority through the normal\nadmission and lease paths.",properties:{frontier:{$ref:"#/$defs/WorkHandoffFrontierV1",description:"The frontier exactly as the issuer recorded it."},frontier_digest:{$ref:"#/$defs/ManifestDigest",description:"The canonical digest of `frontier`, for lineage chaining."},redeemed_at:{$ref:"#/$defs/UtcMicros"},scope:{$ref:"#/$defs/TaskHandoffScope"}},required:["scope","frontier","frontier_digest","redeemed_at"],title:"TaskHandoffRedeemed",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::list`].",title:"WorkflowDefinitionListRequest",type:"object"},{$defs:{RunId:vF,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},expected_sequence:{format:"uint64",minimum:0,type:"integer"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","expected_sequence","command_id"],title:"WorkflowRunPauseRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::register`].",properties:{definition:{$ref:"#/$defs/WorkflowDefinition"}},required:["definition"],title:"WorkflowDefinitionRegisterRequest",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::reject`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},expected_revision:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version","expected_revision"],title:"WorkflowDefinitionRejectRequest",type:"object"},{$defs:{RunId:vF,WorkCommandId:$p},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{command_id:{$ref:"#/$defs/WorkCommandId"},expected_sequence:{format:"uint64",minimum:0,type:"integer"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","expected_sequence","command_id"],title:"WorkflowRunResumeRequest",type:"object"},{$defs:{WorkflowDefinitionId:SM},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::retire`].",properties:{definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},expected_revision:{format:"uint64",minimum:1,type:"integer"}},required:["definition_id","definition_version","expected_revision"],title:"WorkflowDefinitionRetireRequest",type:"object"},{$defs:{ActorId:fb,AttemptId:fW,AutomaticWorktreeGcV1:fF,BranchCollisionPolicyV1:f0,BranchNameComponentV1:f2,BranchNameSeparatorV1:f4,BranchNamingPolicyV1:f6,BranchTopologyKindV1:ht,BranchTopologyPolicyV1:hr,CanonicalGitRefNameV1:hd,CanonicalGitRefPrefix:hc,CapabilityId:hl,CommitId:hq,ConfigurationRevisionId:hM,ConfigurationSnapshotId:hN,CredentialReferenceId:yh,CrossMergeModeV1:yy,CrossMergePolicyV1:yg,GitHubStackedPullRequestPolicyV1:gw,HistoryRewritePolicyV1:gF,LocatorDigest:_r,ManifestDigest:_l,ProposalId:_8,ProtectedRefDispositionV1:_7,ProtectedRefRuleV1:ve,ProtectedRefSelectorV1:vt,ProviderId:vo,RefId:vm,RepositoryId:vb,RepositoryPlacementScopeV1:v$,RequiredCheckExpectationV1:vS,RequiredCheckV1:vk,ReviewRequirementV1:vE,ReviewTopologyKindV1:vA,ReviewTopologyPolicyV1:vW,RunId:vF,SensitiveFilesystemLocatorV1:v4,TaskId:bT,TopologyConcurrencyPolicyV1:bL,TopologyEscalationPolicyV1:bU,TopologyGatePolicyV1:bH,TopologyNotificationLevelV1:bG,UtcMicros:bZ,WorkAcceptanceCriterionV1:bY,WorkApprovalPolicy:b1,WorkAttemptIdentityV1:b6,WorkCommandId:$p,WorkEffectStateV1:$h,WorkEgressPolicy:$g,WorkExecutableReference:$S,WorkExecutionLimits:$w,WorkExecutionSnapshot:$P,WorkFallbackTopology:$q,WorkFenceEpochV1:$I,WorkFilesystemPolicy:$x,WorkHandoffV1:$E,WorkHierarchyV1:$A,WorkInitiativeV1:$W,WorkItemInputV1:$M,WorkItemV1:$N,WorkLeaseFenceV1:$D,WorkLeaseId:$F,WorkMilestoneV1:$L,WorkPlanV1:$Q,WorkProposalV1:Sr,WorkProposedChildV1:Si,WorkProviderBackendV1:Sn,WorkProviderProtocol:Ss,WorkProviderRouteId:Sd,WorkProviderRouteV1:Sc,WorkRouteDecisionV1:S_,WorkSandboxPolicy:Sw,WorkScoreKindV1:SP,WorkShapeAssessmentV1:SV,WorkSizingV1:SR,WorkTopologyPolicyV1:SA,WorkflowDefinitionId:SM,WorkflowExecutionFence:{additionalProperties:!1,properties:{attempt_id:{$ref:"#/$defs/AttemptId"},lease:{$ref:"#/$defs/WorkLeaseFenceV1"}},required:["attempt_id","lease"],type:"object"},WorkflowFailurePolicy:{oneOf:[{properties:{policy:{const:"fail_fast",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"collect",type:"string"}},required:["policy"],type:"object"},{properties:{policy:{const:"require_at_least",type:"string"},successes:{format:"uint32",minimum:1,type:"integer"}},required:["policy","successes"],type:"object"}]},WorkflowFanOutInput:{additionalProperties:!1,properties:{initiative:{$ref:"#/$defs/WorkInitiativeV1"},input_digest:{$ref:"#/$defs/ManifestDigest"},instructions:{type:"string"},item:{$ref:"#/$defs/WorkItemV1"},milestone:{$ref:"#/$defs/WorkMilestoneV1"},plan:{$ref:"#/$defs/WorkPlanV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["instructions","input_digest","initiative","plan","milestone","item","proposal"],type:"object"},WorkflowFanOutStartV1:{additionalProperties:!1,description:"Caller input required to durably plan the entry fan-out of a workflow run.\nDaemon-owned registration and topology digests are resolved at admission.",properties:{commit:{$ref:"#/$defs/CommitId"},effect_state:{$ref:"#/$defs/WorkEffectStateV1"},execution_snapshot:{$ref:"#/$defs/WorkExecutionSnapshot"},failure_policy:{$ref:"#/$defs/WorkflowFailurePolicy"},fence:{$ref:"#/$defs/WorkflowExecutionFence"},inputs:{items:{$ref:"#/$defs/WorkflowFanOutInput"},type:"array"},max_parallel:{format:"uint32",minimum:1,type:"integer"},reference:{anyOf:[{$ref:"#/$defs/RefId"},{type:"null"}]}},required:["fence","max_parallel","failure_policy","execution_snapshot","commit","effect_state","inputs"],type:"object"},WorkflowProviderRegistration:{additionalProperties:!1,properties:{backend:{$ref:"#/$defs/WorkProviderBackendV1"},model:{type:"string"},priority:{format:"uint32",minimum:0,type:"integer"},route:{$ref:"#/$defs/WorkProviderRouteV1"}},required:["route","backend","model","priority"],type:"object"},WorktreeCleanlinessRequirementV1:SG,WorktreePlacementModeV1:SZ,WorktreeRetentionPolicyV1:SQ,WorktreeRootPolicyV1:SX},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Starts (admits) a journaled workflow run from an active definition.\n\nThe daemon derives every admission digest itself: the definition's own\npinned policy/configuration/catalog digests are checked against the live\nenvironment, the topology digest comes from the evaluated topology policy,\nand the provider registry digest is computed from this registration. The\ncaller never supplies a digest the runtime must trust.",properties:{command_id:{$ref:"#/$defs/WorkCommandId"},definition_id:{$ref:"#/$defs/WorkflowDefinitionId"},definition_version:{format:"uint64",minimum:1,type:"integer"},fan_out:{anyOf:[{$ref:"#/$defs/WorkflowFanOutStartV1"},{type:"null"}]},provider:{$ref:"#/$defs/WorkflowProviderRegistration"},run_id:{$ref:"#/$defs/RunId"}},required:["run_id","definition_id","definition_version","provider","command_id"],title:"WorkflowRunStartRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Wire request for [`WorkflowDefinitionService::validate`].",properties:{definition:{$ref:"#/$defs/WorkflowDefinition"}},required:["definition"],title:"WorkflowDefinitionValidateRequest",type:"object"},{$defs:{ManifestDigest:_l,ProjectId:_4,WorkflowDefinition:SW,WorkflowDefinitionId:SM,WorkflowFanOut:SN,WorkflowOperationRef:Sz,WorkflowOutputName:SD,WorkflowOutputReference:SF,WorkflowStep:SL,WorkflowStepId:SU},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{definition:{$ref:"#/$defs/WorkflowDefinition"}},required:["definition"],title:"WorkflowDefinitionValidation",type:"object"}].map(e=>t=>(!function e(t,r,i,o,n){var a;if("boolean"==typeof r){if(!r)throw TypeError(`${o} is rejected by the canonical schema`);return}let s=ft(r,o);if("string"==typeof s.$ref){if(n.has(s.$ref))throw TypeError(`cyclic canonical schema reference: ${s.$ref}`);n.add(s.$ref),e(t,function(e,t){if(!t.startsWith("#/"))throw TypeError(`unsupported canonical schema reference: ${t}`);let r=e;for(let e of t.slice(2).split("/")){let i=e.replaceAll("~1","/").replaceAll("~0","~");r=ft(r,t)[i]}return ft(r,t)}(i,s.$ref),i,o,n),n.delete(s.$ref);return}if("const"in s&&(a=s.const,fe(t)!==fe(a)))throw TypeError(`${o} does not match the canonical constant`);if(Array.isArray(s.enum)&&!s.enum.some(e=>fe(t)===fe(e)))throw TypeError(`${o} is not a canonical enum value`);if(Array.isArray(s.allOf))for(let r of s.allOf)e(t,r,i,o,new Set(n));if(Array.isArray(s.anyOf)&&!s.anyOf.some(r=>{try{return e(t,r,i,o,new Set(n)),!0}catch{return!1}}))throw TypeError(`${o} does not match any canonical variant`);if(Array.isArray(s.oneOf)&&1!==s.oneOf.filter(r=>{try{return e(t,r,i,o,new Set(n)),!0}catch{return!1}}).length)throw TypeError(`${o} must match exactly one canonical variant`);let d=s.type;if("string"==typeof d&&!fr(t,d))throw TypeError(`${o} must be ${d}`);if(Array.isArray(d)&&!d.some(e=>"string"==typeof e&&fr(t,e)))throw TypeError(`${o} has no canonical type`);if("string"==typeof t){if("number"==typeof s.minLength&&t.lengths.maxLength)throw TypeError(`${o} exceeds maxLength`);if("string"==typeof s.pattern&&!RegExp(s.pattern,"u").test(t))throw TypeError(`${o} does not match the canonical pattern`)}if("number"==typeof t){if("integer"===s.type){if("uint32"===s.format&&(t<0||t>0xffffffff))throw TypeError(`${o} is outside uint32`);if("uint64"===s.format&&(t<0||t>Number.MAX_SAFE_INTEGER))throw TypeError(`${o} is outside safely representable uint64`);if("int64"===s.format&&(tNumber.MAX_SAFE_INTEGER))throw TypeError(`${o} is outside safely representable int64`)}if("number"==typeof s.minimum&&ts.maximum)throw TypeError(`${o} exceeds maximum`)}if(Array.isArray(t)){if("number"==typeof s.minItems&&t.lengths.maxItems)throw TypeError(`${o} has too many items`);if(!0===s.uniqueItems){let e=new Set;for(let r of t){let t=fe(r);if(e.has(t))throw TypeError(`${o} contains duplicate items`);e.add(t)}}Array.isArray(s.prefixItems)&&s.prefixItems.forEach((r,n)=>{ne(t,s.items,i,`${o}[${r}]`,new Set))}if("object"==typeof t&&null!==t&&!Array.isArray(t)){let r=void 0===s.properties?{}:ft(s.properties,`${o}.properties`);if(Array.isArray(s.required)){for(let e of s.required)if("string"==typeof e&&!(e in t))throw TypeError(`${o}.${e} is required`)}for(let[n,a]of Object.entries(t))if(n in r)e(a,r[n],i,`${o}.${n}`,new Set);else if(!1===s.additionalProperties)throw TypeError(`${o}.${n} is not allowed`);else"object"==typeof s.additionalProperties&&e(a,s.additionalProperties,i,`${o}.${n}`,new Set)}}(t,e,e,"value",new Set),t));function S1(e){let t=SY[e];if(void 0===t)throw TypeError(`generated canonical schema ${e} is missing`);return t}let S0=[{operation:"active_project",operationId:"operation.application.active_project",transport:{kind:"mcp_tool",toolName:"tracedecay_active_project"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.active_project.v1",requestSchema:{schemaId:"schema.application.primitive.active-project.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.active-project.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(0),decodeResult:S1(1)},{operation:"admin_cli",operationId:"operation.application.admin_cli",transport:{kind:"mcp_tool",toolName:"tracedecay_admin_cli"},effect:"maintains_profile_state",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.admin_cli.v1",requestSchema:{schemaId:"schema.application.primitive.admin-cli.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.admin-cli.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","effect_in_flight"]},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(2),decodeResult:S1(3)},{operation:"admin_project",operationId:"operation.application.admin_project",transport:{kind:"mcp_tool",toolName:"tracedecay_admin_project"},effect:"maintains_owner_state",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.admin_project.v1",requestSchema:{schemaId:"schema.application.primitive.admin-project.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.admin-project.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(4),decodeResult:S1(5)},{operation:"admin_sync",operationId:"operation.application.admin_sync",transport:{kind:"mcp_tool",toolName:"tracedecay_admin_sync"},effect:"schedules_work",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.admin_sync.v1",requestSchema:{schemaId:"schema.application.primitive.admin-sync.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.admin-sync.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(6),decodeResult:S1(7)},{operation:"affected",operationId:"operation.application.affected",transport:{kind:"mcp_tool",toolName:"tracedecay_affected"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.affected.v1",requestSchema:{schemaId:"schema.application.primitive.affected.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.affected.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(8),decodeResult:S1(9)},{operation:"application_affected_tests",operationId:"operation.application.affected_tests",transport:{kind:"http",route:"/application/tests/affected",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.affected_tests.v1",requestSchema:{schemaId:"schema.application.feedback.affected-tests.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.affected-tests.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(11),decodeSuccess:e=>fp(e,"binding.http.affected_tests.v1","schema.application.feedback.affected-tests.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(11))},{operation:"analytics",operationId:"operation.application.analytics",transport:{kind:"mcp_tool",toolName:"tracedecay_analytics"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.analytics.v1",requestSchema:{schemaId:"schema.application.primitive.analytics.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.analytics.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(12),decodeResult:S1(13)},{operation:"apply_native_integration",operationId:"operation.application.apply_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_apply_native_integration"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.apply_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.apply.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.apply.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(14),decodeResult:S1(15)},{operation:"approve_native_integration",operationId:"operation.application.approve_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_approve_native_integration"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.approve_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.approve.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.approve.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(16),decodeResult:S1(15)},{operation:"ast_grep_rewrite",operationId:"operation.application.ast_grep_rewrite",transport:{kind:"mcp_tool",toolName:"tracedecay_ast_grep_rewrite"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.ast_grep_rewrite.v1",requestSchema:{schemaId:"schema.application.source-edit.ast-grep-rewrite.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.ast-grep-rewrite.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(17),decodeResult:S1(18)},{operation:"ast_grep_search",operationId:"operation.application.ast_grep_search",transport:{kind:"mcp_tool",toolName:"tracedecay_ast_grep_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.ast_grep_search.v1",requestSchema:{schemaId:"schema.application.primitive.ast-grep-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.ast-grep-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(19),decodeResult:S1(20)},{operation:"automation_run_artifact_view",operationId:"operation.application.automation_run_artifact_view",transport:{kind:"mcp_tool",toolName:"tracedecay_automation_run_artifact_view"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.automation_run_artifact_view.v1",requestSchema:{schemaId:"schema.application.primitive.automation-run-artifact-view.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.automation-run-artifact-view.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(21),decodeResult:S1(22)},{operation:"automation_run_list",operationId:"operation.application.automation_run_list",transport:{kind:"mcp_tool",toolName:"tracedecay_automation_run_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.automation_run_list.v1",requestSchema:{schemaId:"schema.application.primitive.automation-run-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.automation-run-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(23),decodeResult:S1(24)},{operation:"automation_run_view",operationId:"operation.application.automation_run_view",transport:{kind:"mcp_tool",toolName:"tracedecay_automation_run_view"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.automation_run_view.v1",requestSchema:{schemaId:"schema.application.primitive.automation-run-view.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.automation-run-view.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(25),decodeResult:S1(26)},{operation:"branch_diff",operationId:"operation.application.branch_diff",transport:{kind:"mcp_tool",toolName:"tracedecay_branch_diff"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.branch_diff.v1",requestSchema:{schemaId:"schema.application.primitive.branch-diff.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.branch-diff.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(27),decodeResult:S1(28)},{operation:"branch_list",operationId:"operation.application.branch_list",transport:{kind:"mcp_tool",toolName:"tracedecay_branch_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.branch_list.v1",requestSchema:{schemaId:"schema.application.primitive.branch-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.branch-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(29),decodeResult:S1(30)},{operation:"branch_search",operationId:"operation.application.branch_search",transport:{kind:"mcp_tool",toolName:"tracedecay_branch_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.branch_search.v1",requestSchema:{schemaId:"schema.application.primitive.branch-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.branch-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(31),decodeResult:S1(32)},{operation:"by_qualified_name",operationId:"operation.application.by_qualified_name",transport:{kind:"mcp_tool",toolName:"tracedecay_by_qualified_name"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.by_qualified_name.v1",requestSchema:{schemaId:"schema.application.primitive.by-qualified-name.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.by-qualified-name.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(33),decodeResult:S1(34)},{operation:"application_call_chain",operationId:"operation.application.call_chain",transport:{kind:"http",route:"/application/primitives/call_chain",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.call_chain.v1",requestSchema:{schemaId:"schema.application.primitive.call-chain.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.call-chain.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(35),decodeResult:S1(36),decodeSuccess:e=>fp(e,"binding.http.call_chain.v1","schema.application.primitive.call-chain.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(36))},{operation:"cancel_native_integration",operationId:"operation.application.cancel_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_cancel_native_integration"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.cancel_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.cancel.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.cancel.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(37),decodeResult:S1(15)},{operation:"changelog",operationId:"operation.application.changelog",transport:{kind:"mcp_tool",toolName:"tracedecay_changelog"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.changelog.v1",requestSchema:{schemaId:"schema.application.primitive.changelog.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.changelog.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(38),decodeResult:S1(39)},{operation:"circular",operationId:"operation.application.circular",transport:{kind:"mcp_tool",toolName:"tracedecay_circular"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.circular.v1",requestSchema:{schemaId:"schema.application.primitive.circular.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.circular.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(40),decodeResult:S1(41)},{operation:"code_callees",operationId:"operation.application.code_callees",transport:{kind:"http",route:"/application/code/code_callees",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_callees.v1",requestSchema:{schemaId:"schema.application.code-query.callees.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.callees.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(42),decodeResult:S1(43),decodeSuccess:e=>fp(e,"binding.http.code_callees.v1","schema.application.code-query.callees.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(43))},{operation:"code_callers",operationId:"operation.application.code_callers",transport:{kind:"http",route:"/application/code/code_callers",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_callers.v1",requestSchema:{schemaId:"schema.application.primitive.code-callers.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-callers.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(44),decodeResult:S1(45),decodeSuccess:e=>fp(e,"binding.http.code_callers.v1","schema.application.primitive.code-callers.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(45))},{operation:"code_declaration",operationId:"operation.application.code_declaration",transport:{kind:"http",route:"/application/code/code_declaration",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_declaration.v1",requestSchema:{schemaId:"schema.application.code-query.declaration.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.declaration.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(46),decodeResult:S1(47),decodeSuccess:e=>fp(e,"binding.http.code_declaration.v1","schema.application.code-query.declaration.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(47))},{operation:"code_exact_occurrence",operationId:"operation.application.code_exact_occurrence",transport:{kind:"http",route:"/application/code/code_exact_occurrence",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_exact_occurrence.v1",requestSchema:{schemaId:"schema.application.code-query.exact-occurrence.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.exact-occurrence.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(48),decodeResult:S1(49),decodeSuccess:e=>fp(e,"binding.http.code_exact_occurrence.v1","schema.application.code-query.exact-occurrence.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(49))},{operation:"code_facets",operationId:"operation.application.code_facets",transport:{kind:"http",route:"/application/code/code_facets",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_facets.v1",requestSchema:{schemaId:"schema.application.code-query.facets.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.facets.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(50),decodeResult:S1(51),decodeSuccess:e=>fp(e,"binding.http.code_facets.v1","schema.application.code-query.facets.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(51))},{operation:"code_implementations",operationId:"operation.application.code_implementations",transport:{kind:"http",route:"/application/code/code_implementations",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_implementations.v1",requestSchema:{schemaId:"schema.application.primitive.code-implementations.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-implementations.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(52),decodeResult:S1(53),decodeSuccess:e=>fp(e,"binding.http.code_implementations.v1","schema.application.primitive.code-implementations.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(53))},{operation:"code_phrase_search",operationId:"operation.application.code_phrase_search",transport:{kind:"http",route:"/application/code/code_phrase_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_phrase_search.v1",requestSchema:{schemaId:"schema.application.code-query.phrase-search.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.phrase-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(54),decodeResult:S1(55),decodeSuccess:e=>fp(e,"binding.http.code_phrase_search.v1","schema.application.code-query.phrase-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(55))},{operation:"code_references",operationId:"operation.application.code_references",transport:{kind:"http",route:"/application/code/code_references",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_references.v1",requestSchema:{schemaId:"schema.application.code-query.references.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.references.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(46),decodeResult:S1(43),decodeSuccess:e=>fp(e,"binding.http.code_references.v1","schema.application.code-query.references.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(43))},{operation:"code_signature_search",operationId:"operation.application.code_signature_search",transport:{kind:"http",route:"/application/code/code_signature_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_signature_search.v1",requestSchema:{schemaId:"schema.application.primitive.code-signature-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-signature-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(56),decodeResult:S1(57),decodeSuccess:e=>fp(e,"binding.http.code_signature_search.v1","schema.application.primitive.code-signature-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(57))},{operation:"code_symbol_search",operationId:"operation.application.code_symbol_search",transport:{kind:"http",route:"/application/code/code_symbol_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_symbol_search.v1",requestSchema:{schemaId:"schema.application.symbol-search.request",revision:1},resultSchema:{schemaId:"schema.application.symbol-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(58),decodeResult:S1(57),decodeSuccess:e=>fp(e,"binding.http.code_symbol_search.v1","schema.application.symbol-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(57))},{operation:"code_timeline",operationId:"operation.application.code_timeline",transport:{kind:"http",route:"/application/code/code_timeline",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_timeline.v1",requestSchema:{schemaId:"schema.application.code-query.timeline.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.timeline.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(59),decodeResult:S1(60),decodeSuccess:e=>fp(e,"binding.http.code_timeline.v1","schema.application.code-query.timeline.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(60))},{operation:"code_type_definition",operationId:"operation.application.code_type_definition",transport:{kind:"http",route:"/application/code/code_type_definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_type_definition.v1",requestSchema:{schemaId:"schema.application.code-query.type-definition.request",revision:1},resultSchema:{schemaId:"schema.application.code-query.type-definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(46),decodeResult:S1(47),decodeSuccess:e=>fp(e,"binding.http.code_type_definition.v1","schema.application.code-query.type-definition.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(47))},{operation:"code_type_hierarchy",operationId:"operation.application.code_type_hierarchy",transport:{kind:"http",route:"/application/code/code_type_hierarchy",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.code_type_hierarchy.v1",requestSchema:{schemaId:"schema.application.primitive.code-type-hierarchy.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.code-type-hierarchy.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(61),decodeResult:S1(62),decodeSuccess:e=>fp(e,"binding.http.code_type_hierarchy.v1","schema.application.primitive.code-type-hierarchy.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(62))},{operation:"commit_context",operationId:"operation.application.commit_context",transport:{kind:"mcp_tool",toolName:"tracedecay_commit_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.commit_context.v1",requestSchema:{schemaId:"schema.application.primitive.commit-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.commit-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(63),decodeResult:S1(64)},{operation:"complexity",operationId:"operation.application.complexity",transport:{kind:"mcp_tool",toolName:"tracedecay_complexity"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.complexity.v1",requestSchema:{schemaId:"schema.application.primitive.complexity.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.complexity.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(65),decodeResult:S1(66)},{operation:"config",operationId:"operation.application.config",transport:{kind:"mcp_tool",toolName:"tracedecay_config"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.config.v1",requestSchema:{schemaId:"schema.application.primitive.config.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.config.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(67),decodeResult:S1(68)},{operation:"application_configuration_audit",operationId:"operation.application.configuration_audit",transport:{kind:"http",route:"/application/configuration/configuration_audit",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_audit.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_audit.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_audit.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(69),decodeResult:S1(70),decodeSuccess:e=>fp(e,"binding.http.configuration_audit.v1","schema.application.configuration.configuration_audit.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(70))},{operation:"application_configuration_batch",operationId:"operation.application.configuration_batch",transport:{kind:"http",route:"/application/configuration/configuration_batch",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_batch.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_batch.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_batch.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(71),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_batch.v1","schema.application.configuration.configuration_batch.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_get",operationId:"operation.application.configuration_get",transport:{kind:"http",route:"/application/configuration/configuration_get",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_get.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_get.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_get.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(73),decodeResult:S1(74),decodeSuccess:e=>fp(e,"binding.http.configuration_get.v1","schema.application.configuration.configuration_get.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(74))},{operation:"application_configuration_list",operationId:"operation.application.configuration_list",transport:{kind:"http",route:"/application/configuration/configuration_list",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_list.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_list.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(75),decodeResult:S1(76),decodeSuccess:e=>fp(e,"binding.http.configuration_list.v1","schema.application.configuration.configuration_list.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(76))},{operation:"application_configuration_observed_state",operationId:"operation.application.configuration_observed_state",transport:{kind:"http",route:"/application/configuration/configuration_observed_state",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_observed_state.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_observed_state.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_observed_state.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(77),decodeResult:S1(78),decodeSuccess:e=>fp(e,"binding.http.configuration_observed_state.v1","schema.application.configuration.configuration_observed_state.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(78))},{operation:"application_configuration_protected_apply",operationId:"operation.application.configuration_protected_apply",transport:{kind:"http",route:"/application/configuration/configuration_protected_apply",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_protected_apply.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_protected_apply.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_protected_apply.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(79),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_protected_apply.v1","schema.application.configuration.configuration_protected_apply.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_protected_preview",operationId:"operation.application.configuration_protected_preview",transport:{kind:"http",route:"/application/configuration/configuration_protected_preview",method:"POST"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_protected_preview.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_protected_preview.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_protected_preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(80),decodeResult:S1(81),decodeSuccess:e=>fp(e,"binding.http.configuration_protected_preview.v1","schema.application.configuration.configuration_protected_preview.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(81))},{operation:"application_configuration_rollback_apply",operationId:"operation.application.configuration_rollback_apply",transport:{kind:"http",route:"/application/configuration/configuration_rollback_apply",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_rollback_apply.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_rollback_apply.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_rollback_apply.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(79),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_rollback_apply.v1","schema.application.configuration.configuration_rollback_apply.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_rollback_preview",operationId:"operation.application.configuration_rollback_preview",transport:{kind:"http",route:"/application/configuration/configuration_rollback_preview",method:"POST"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_rollback_preview.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_rollback_preview.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_rollback_preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(82),decodeResult:S1(81),decodeSuccess:e=>fp(e,"binding.http.configuration_rollback_preview.v1","schema.application.configuration.configuration_rollback_preview.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(81))},{operation:"application_configuration_set",operationId:"operation.application.configuration_set",transport:{kind:"http",route:"/application/configuration/configuration_set",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_set.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_set.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_set.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(83),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_set.v1","schema.application.configuration.configuration_set.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_configuration_unset",operationId:"operation.application.configuration_unset",transport:{kind:"http",route:"/application/configuration/configuration_unset",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.configuration_unset.v1",requestSchema:{schemaId:"schema.application.configuration.configuration_unset.request",revision:1},resultSchema:{schemaId:"schema.application.configuration.configuration_unset.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(84),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.configuration_unset.v1","schema.application.configuration.configuration_unset.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"constructors",operationId:"operation.application.constructors",transport:{kind:"mcp_tool",toolName:"tracedecay_constructors"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.constructors.v1",requestSchema:{schemaId:"schema.application.primitive.constructors.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.constructors.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(85),decodeResult:S1(86)},{operation:"context",operationId:"operation.application.context",transport:{kind:"mcp_tool",toolName:"tracedecay_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.context.v1",requestSchema:{schemaId:"schema.application.primitive.context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(87),decodeResult:S1(88)},{operation:"application_context_scout_budget",operationId:"operation.application.context_scout_budget",transport:{kind:"http",route:"/application/context-scout/context_scout_budget",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_budget.v1",requestSchema:{schemaId:"schema.application.context-scout-budget.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-budget.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(89),decodeResult:S1(90),decodeSuccess:e=>fp(e,"binding.http.context_scout_budget.v1","schema.application.context-scout-budget.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(90))},{operation:"application_context_scout_cancel",operationId:"operation.application.context_scout_cancel",transport:{kind:"http",route:"/application/context-scout/context_scout_cancel",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_cancel.v1",requestSchema:{schemaId:"schema.application.context-scout-cancel.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-cancel.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(91),decodeResult:S1(92),decodeSuccess:e=>fp(e,"binding.http.context_scout_cancel.v1","schema.application.context-scout-cancel.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(92))},{operation:"application_context_scout_capability",operationId:"operation.application.context_scout_capability",transport:{kind:"http",route:"/application/context-scout/context_scout_capability",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_capability.v1",requestSchema:{schemaId:"schema.application.context-scout-capability.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-capability.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(89),decodeResult:S1(93),decodeSuccess:e=>fp(e,"binding.http.context_scout_capability.v1","schema.application.context-scout-capability.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(93))},{operation:"application_context_scout_claim",operationId:"operation.application.context_scout_claim",transport:{kind:"http",route:"/application/context-scout/context_scout_claim",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_claim.v1",requestSchema:{schemaId:"schema.application.context-scout-claim.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-claim.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(94),decodeResult:S1(95),decodeSuccess:e=>fp(e,"binding.http.context_scout_claim.v1","schema.application.context-scout-claim.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(95))},{operation:"application_context_scout_delivery",operationId:"operation.application.context_scout_delivery",transport:{kind:"http",route:"/application/context-scout/context_scout_delivery",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_delivery.v1",requestSchema:{schemaId:"schema.application.context-scout-delivery.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-delivery.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(96),decodeResult:S1(97),decodeSuccess:e=>fp(e,"binding.http.context_scout_delivery.v1","schema.application.context-scout-delivery.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(97))},{operation:"application_context_scout_explain",operationId:"operation.application.context_scout_explain",transport:{kind:"http",route:"/application/context-scout/context_scout_explain",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_explain.v1",requestSchema:{schemaId:"schema.application.context-scout-explain.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-explain.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(98),decodeResult:S1(99),decodeSuccess:e=>fp(e,"binding.http.context_scout_explain.v1","schema.application.context-scout-explain.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(99))},{operation:"application_context_scout_feedback",operationId:"operation.application.context_scout_feedback",transport:{kind:"http",route:"/application/context-scout/context_scout_feedback",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_feedback.v1",requestSchema:{schemaId:"schema.application.context-scout-feedback.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-feedback.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(100),decodeResult:S1(92),decodeSuccess:e=>fp(e,"binding.http.context_scout_feedback.v1","schema.application.context-scout-feedback.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(92))},{operation:"application_context_scout_pause",operationId:"operation.application.context_scout_pause",transport:{kind:"http",route:"/application/context-scout/context_scout_pause",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_pause.v1",requestSchema:{schemaId:"schema.application.context-scout-pause.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-pause.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(101),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.context_scout_pause.v1","schema.application.context-scout-pause.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_context_scout_recent",operationId:"operation.application.context_scout_recent",transport:{kind:"http",route:"/application/context-scout/context_scout_recent",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_recent.v1",requestSchema:{schemaId:"schema.application.context-scout-recent.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-recent.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(98),decodeResult:S1(102),decodeSuccess:e=>fp(e,"binding.http.context_scout_recent.v1","schema.application.context-scout-recent.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(102))},{operation:"application_context_scout_resume",operationId:"operation.application.context_scout_resume",transport:{kind:"http",route:"/application/context-scout/context_scout_resume",method:"POST"},effect:"configuration_write",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_resume.v1",requestSchema:{schemaId:"schema.application.context-scout-resume.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-resume.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:15e3},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(101),decodeResult:S1(72),decodeSuccess:e=>fp(e,"binding.http.context_scout_resume.v1","schema.application.context-scout-resume.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(72))},{operation:"application_context_scout_status",operationId:"operation.application.context_scout_status",transport:{kind:"http",route:"/application/context-scout/context_scout_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.context_scout_status.v1",requestSchema:{schemaId:"schema.application.context-scout-status.request",revision:1},resultSchema:{schemaId:"schema.application.context-scout-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(89),decodeResult:S1(103),decodeSuccess:e=>fp(e,"binding.http.context_scout_status.v1","schema.application.context-scout-status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(103))},{operation:"coupling",operationId:"operation.application.coupling",transport:{kind:"mcp_tool",toolName:"tracedecay_coupling"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.coupling.v1",requestSchema:{schemaId:"schema.application.primitive.coupling.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.coupling.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(104),decodeResult:S1(105)},{operation:"dashboard",operationId:"operation.application.dashboard",transport:{kind:"mcp_tool",toolName:"tracedecay_dashboard"},effect:"binds_server",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dashboard.v1",requestSchema:{schemaId:"schema.application.primitive.dashboard.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dashboard.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(106),decodeResult:S1(107)},{operation:"dead_code",operationId:"operation.application.dead_code",transport:{kind:"mcp_tool",toolName:"tracedecay_dead_code"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dead_code.v1",requestSchema:{schemaId:"schema.application.primitive.dead-code.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dead-code.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(108),decodeResult:S1(109)},{operation:"dependency_depth",operationId:"operation.application.dependency_depth",transport:{kind:"mcp_tool",toolName:"tracedecay_dependency_depth"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dependency_depth.v1",requestSchema:{schemaId:"schema.application.primitive.dependency-depth.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dependency-depth.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(110),decodeResult:S1(111)},{operation:"derives",operationId:"operation.application.derives",transport:{kind:"mcp_tool",toolName:"tracedecay_derives"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.derives.v1",requestSchema:{schemaId:"schema.application.primitive.derives.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.derives.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(112),decodeResult:S1(113)},{operation:"diagnose",operationId:"operation.application.diagnose",transport:{kind:"mcp_tool",toolName:"tracedecay_diagnose"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.diagnose.v1",requestSchema:{schemaId:"schema.application.primitive.diagnose.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.diagnose.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(114),decodeResult:S1(115)},{operation:"application_diagnostics_read",operationId:"operation.application.diagnostics_read",transport:{kind:"http",route:"/application/primitives/diagnostics_read",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.diagnostics_read.v1",requestSchema:{schemaId:"schema.application.primitive.diagnostics-read.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.diagnostics-read.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(116),decodeResult:S1(117),decodeSuccess:e=>fp(e,"binding.http.diagnostics_read.v1","schema.application.primitive.diagnostics-read.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(117))},{operation:"diff_context",operationId:"operation.application.diff_context",transport:{kind:"mcp_tool",toolName:"tracedecay_diff_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.diff_context.v1",requestSchema:{schemaId:"schema.application.primitive.diff-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.diff-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(118),decodeResult:S1(119)},{operation:"distribution",operationId:"operation.application.distribution",transport:{kind:"mcp_tool",toolName:"tracedecay_distribution"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.distribution.v1",requestSchema:{schemaId:"schema.application.primitive.distribution.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.distribution.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(120),decodeResult:S1(121)},{operation:"doc_coverage",operationId:"operation.application.doc_coverage",transport:{kind:"mcp_tool",toolName:"tracedecay_doc_coverage"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.doc_coverage.v1",requestSchema:{schemaId:"schema.application.primitive.doc-coverage.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.doc-coverage.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(122),decodeResult:S1(123)},{operation:"dsm",operationId:"operation.application.dsm",transport:{kind:"mcp_tool",toolName:"tracedecay_dsm"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.dsm.v1",requestSchema:{schemaId:"schema.application.primitive.dsm.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.dsm.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(124),decodeResult:S1(125)},{operation:"application_fact_feedback",operationId:"operation.application.fact_feedback",transport:{kind:"http",route:"/application/retained/fact_feedback",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_feedback.v1",requestSchema:{schemaId:"schema.application.retained.fact-feedback.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-feedback.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(126),decodeResult:S1(127),decodeSuccess:e=>fp(e,"binding.http.fact_feedback.v1","schema.application.retained.fact-feedback.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(127))},{operation:"application_fact_store_add",operationId:"operation.application.fact_store_add",transport:{kind:"http",route:"/application/retained/fact_store_add",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_add.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-add.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-add.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(128),decodeResult:S1(129),decodeSuccess:e=>fp(e,"binding.http.fact_store_add.v1","schema.application.retained.fact-store-add.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(129))},{operation:"application_fact_store_contradict",operationId:"operation.application.fact_store_contradict",transport:{kind:"http",route:"/application/retained/fact_store_contradict",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_contradict.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-contradict.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-contradict.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(130),decodeResult:S1(131),decodeSuccess:e=>fp(e,"binding.http.fact_store_contradict.v1","schema.application.retained.fact-store-contradict.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(131))},{operation:"application_fact_store_curate",operationId:"operation.application.fact_store_curate",transport:{kind:"http",route:"/application/retained/fact_store_curate",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"required",resultSemantics:"fact_store_curate_receipt",bindingId:"binding.http.fact_store_curate.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-curate.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-curate.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:9e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(132),decodeResult:S1(133),decodeSuccess:e=>fp(e,"binding.http.fact_store_curate.v1","schema.application.retained.fact-store-curate.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(133))},{operation:"application_fact_store_get",operationId:"operation.application.fact_store_get",transport:{kind:"http",route:"/application/retained/fact_store_get",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_get.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-get.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-get.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(134),decodeResult:S1(135),decodeSuccess:e=>fp(e,"binding.http.fact_store_get.v1","schema.application.retained.fact-store-get.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(135))},{operation:"application_fact_store_list",operationId:"operation.application.fact_store_list",transport:{kind:"http",route:"/application/retained/fact_store_list",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_list.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-list.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(136),decodeResult:S1(137),decodeSuccess:e=>fp(e,"binding.http.fact_store_list.v1","schema.application.retained.fact-store-list.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(137))},{operation:"application_fact_store_probe",operationId:"operation.application.fact_store_probe",transport:{kind:"http",route:"/application/retained/fact_store_probe",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_probe.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-probe.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-probe.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(138),decodeResult:S1(139),decodeSuccess:e=>fp(e,"binding.http.fact_store_probe.v1","schema.application.retained.fact-store-probe.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(139))},{operation:"application_fact_store_reason",operationId:"operation.application.fact_store_reason",transport:{kind:"http",route:"/application/retained/fact_store_reason",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_reason.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-reason.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-reason.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(140),decodeResult:S1(141),decodeSuccess:e=>fp(e,"binding.http.fact_store_reason.v1","schema.application.retained.fact-store-reason.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(141))},{operation:"application_fact_store_related",operationId:"operation.application.fact_store_related",transport:{kind:"http",route:"/application/retained/fact_store_related",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_related.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-related.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-related.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(142),decodeResult:S1(143),decodeSuccess:e=>fp(e,"binding.http.fact_store_related.v1","schema.application.retained.fact-store-related.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(143))},{operation:"application_fact_store_remove",operationId:"operation.application.fact_store_remove",transport:{kind:"http",route:"/application/retained/fact_store_remove",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_remove.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-remove.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-remove.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(144),decodeResult:S1(145),decodeSuccess:e=>fp(e,"binding.http.fact_store_remove.v1","schema.application.retained.fact-store-remove.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(145))},{operation:"application_fact_store_search",operationId:"operation.application.fact_store_search",transport:{kind:"http",route:"/application/retained/fact_store_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_search.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-search.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(146),decodeResult:S1(147),decodeSuccess:e=>fp(e,"binding.http.fact_store_search.v1","schema.application.retained.fact-store-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(147))},{operation:"application_fact_store_supersede",operationId:"operation.application.fact_store_supersede",transport:{kind:"http",route:"/application/retained/fact_store_supersede",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_supersede.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-supersede.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-supersede.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(148),decodeResult:S1(149),decodeSuccess:e=>fp(e,"binding.http.fact_store_supersede.v1","schema.application.retained.fact-store-supersede.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(149))},{operation:"application_fact_store_update",operationId:"operation.application.fact_store_update",transport:{kind:"http",route:"/application/retained/fact_store_update",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.fact_store_update.v1",requestSchema:{schemaId:"schema.application.retained.fact-store-update.request",revision:1},resultSchema:{schemaId:"schema.application.retained.fact-store-update.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(150),decodeResult:S1(151),decodeSuccess:e=>fp(e,"binding.http.fact_store_update.v1","schema.application.retained.fact-store-update.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(151))},{operation:"application_feedback_advisory_cycle",operationId:"operation.application.feedback_advisory_cycle",transport:{kind:"http",route:"/application/feedback/advisory_cycle",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_advisory_cycle.v1",requestSchema:{schemaId:"schema.application.feedback.advisory-cycle.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.advisory-cycle.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(152),decodeResult:S1(153),decodeSuccess:e=>fp(e,"binding.http.feedback_advisory_cycle.v1","schema.application.feedback.advisory-cycle.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(153))},{operation:"application_feedback_diagnostics",operationId:"operation.application.feedback_diagnostics",transport:{kind:"http",route:"/application/feedback/diagnostics",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_diagnostics.v1",requestSchema:{schemaId:"schema.application.feedback.diagnostics.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.diagnostics.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(154),decodeSuccess:e=>fp(e,"binding.http.feedback_diagnostics.v1","schema.application.feedback.diagnostics.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(154))},{operation:"application_feedback_expand",operationId:"operation.application.feedback_expand",transport:{kind:"http",route:"/application/feedback/expand",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_expand.v1",requestSchema:{schemaId:"schema.application.feedback.expand.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.expand.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(155),decodeSuccess:e=>fp(e,"binding.http.feedback_expand.v1","schema.application.feedback.expand.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(155))},{operation:"application_feedback_get",operationId:"operation.application.feedback_get",transport:{kind:"http",route:"/application/feedback/get",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_get.v1",requestSchema:{schemaId:"schema.application.feedback.get.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.get.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(156),decodeSuccess:e=>fp(e,"binding.http.feedback_get.v1","schema.application.feedback.get.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(156))},{operation:"application_feedback_impact",operationId:"operation.application.feedback_impact",transport:{kind:"http",route:"/application/feedback/impact",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_impact.v1",requestSchema:{schemaId:"schema.application.feedback.impact.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.impact.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(157),decodeSuccess:e=>fp(e,"binding.http.feedback_impact.v1","schema.application.feedback.impact.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(157))},{operation:"application_feedback_list",operationId:"operation.application.feedback_list",transport:{kind:"http",route:"/application/feedback/list",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_list.v1",requestSchema:{schemaId:"schema.application.feedback.list.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(10),decodeResult:S1(158),decodeSuccess:e=>fp(e,"binding.http.feedback_list.v1","schema.application.feedback.list.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(158))},{operation:"application_feedback_proximity",operationId:"operation.application.feedback_proximity",transport:{kind:"http",route:"/application/feedback/proximity",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.feedback_proximity.v1",requestSchema:{schemaId:"schema.application.feedback.proximity.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.proximity.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(159),decodeResult:S1(160),decodeSuccess:e=>fp(e,"binding.http.feedback_proximity.v1","schema.application.feedback.proximity.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(160))},{operation:"field_sites",operationId:"operation.application.field_sites",transport:{kind:"mcp_tool",toolName:"tracedecay_field_sites"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.field_sites.v1",requestSchema:{schemaId:"schema.application.primitive.field-sites.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.field-sites.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(161),decodeResult:S1(162)},{operation:"application_file_dependents",operationId:"operation.application.file_dependents",transport:{kind:"http",route:"/application/primitives/file_dependents",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.file_dependents.v1",requestSchema:{schemaId:"schema.application.primitive.file-dependents.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.file-dependents.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(163),decodeResult:S1(164),decodeSuccess:e=>fp(e,"binding.http.file_dependents.v1","schema.application.primitive.file-dependents.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(164))},{operation:"files",operationId:"operation.application.files",transport:{kind:"mcp_tool",toolName:"tracedecay_files"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.files.v1",requestSchema:{schemaId:"schema.application.primitive.files.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.files.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(165),decodeResult:S1(166)},{operation:"find_exact_symbol",operationId:"operation.application.find_exact_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_find_exact_symbol"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.find_exact_symbol.v1",requestSchema:{schemaId:"schema.application.primitive.find-exact-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.find-exact-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(167),decodeResult:S1(168)},{operation:"gini",operationId:"operation.application.gini",transport:{kind:"mcp_tool",toolName:"tracedecay_gini"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.gini.v1",requestSchema:{schemaId:"schema.application.primitive.gini.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.gini.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(169),decodeResult:S1(170)},{operation:"git_apply",operationId:"operation.application.git_apply",transport:{kind:"mcp_tool",toolName:"tracedecay_git_apply"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.git_apply.v1",requestSchema:{schemaId:"schema.application.git.apply.request",revision:1},resultSchema:{schemaId:"schema.application.git.apply.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(171),decodeResult:S1(172)},{operation:"application_git_blame",operationId:"operation.application.git_blame",transport:{kind:"http",route:"/application/git/blame",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_blame.v1",requestSchema:{schemaId:"schema.application.git.blame.request",revision:1},resultSchema:{schemaId:"schema.application.git.blame.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(173),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_blame.v1","schema.application.git.blame.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_git_diff",operationId:"operation.application.git_diff",transport:{kind:"http",route:"/application/git/diff",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_diff.v1",requestSchema:{schemaId:"schema.application.git.diff.request",revision:1},resultSchema:{schemaId:"schema.application.git.diff.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(175),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_diff.v1","schema.application.git.diff.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_git_history",operationId:"operation.application.git_history",transport:{kind:"http",route:"/application/git/history",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_history.v1",requestSchema:{schemaId:"schema.application.git.history.request",revision:1},resultSchema:{schemaId:"schema.application.git.history.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(176),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_history.v1","schema.application.git.history.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_git_hunks",operationId:"operation.application.git_hunks",transport:{kind:"http",route:"/application/git/hunks",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_hunks.v1",requestSchema:{schemaId:"schema.application.git.hunks.request",revision:1},resultSchema:{schemaId:"schema.application.git.hunks.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(177),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_hunks.v1","schema.application.git.hunks.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"git_preview",operationId:"operation.application.git_preview",transport:{kind:"mcp_tool",toolName:"tracedecay_git_preview"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.git_preview.v1",requestSchema:{schemaId:"schema.application.git.preview.request",revision:1},resultSchema:{schemaId:"schema.application.git.preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(178),decodeResult:S1(179)},{operation:"application_git_status",operationId:"operation.application.git_status",transport:{kind:"http",route:"/application/git/status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.git_status.v1",requestSchema:{schemaId:"schema.application.git.status.request",revision:1},resultSchema:{schemaId:"schema.application.git.status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(180),decodeResult:S1(174),decodeSuccess:e=>fp(e,"binding.http.git_status.v1","schema.application.git.status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(174))},{operation:"application_github_stack_signal_expand",operationId:"operation.application.github_stack_signal_expand",transport:{kind:"http",route:"/application/github-stack/signal-expand",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.github_stack_signal_expand.v1",requestSchema:{schemaId:"schema.application.github-stack.signal-expand.request",revision:1},resultSchema:{schemaId:"schema.application.github-stack.signal-expand.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(181),decodeResult:S1(182),decodeSuccess:e=>fp(e,"binding.http.github_stack_signal_expand.v1","schema.application.github-stack.signal-expand.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(182))},{operation:"god_class",operationId:"operation.application.god_class",transport:{kind:"mcp_tool",toolName:"tracedecay_god_class"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.god_class.v1",requestSchema:{schemaId:"schema.application.primitive.god-class.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.god-class.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(183),decodeResult:S1(184)},{operation:"grep",operationId:"operation.application.grep",transport:{kind:"mcp_tool",toolName:"tracedecay_grep"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.grep.v1",requestSchema:{schemaId:"schema.application.primitive.grep.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.grep.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(185),decodeResult:S1(186)},{operation:"health",operationId:"operation.application.health",transport:{kind:"mcp_tool",toolName:"tracedecay_health"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.health.v1",requestSchema:{schemaId:"schema.application.primitive.health.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.health.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(187),decodeResult:S1(188)},{operation:"application_health_delta",operationId:"operation.application.health_delta",transport:{kind:"http",route:"/application/primitives/health_delta",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.health_delta.v1",requestSchema:{schemaId:"schema.application.primitive.health-delta.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.health-delta.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(189),decodeResult:S1(190),decodeSuccess:e=>fp(e,"binding.http.health_delta.v1","schema.application.primitive.health-delta.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(190))},{operation:"application_health_read",operationId:"operation.application.health_read",transport:{kind:"http",route:"/application/primitives/health_read",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.health_read.v1",requestSchema:{schemaId:"schema.application.primitive.health-read.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.health-read.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(191),decodeResult:S1(192),decodeSuccess:e=>fp(e,"binding.http.health_read.v1","schema.application.primitive.health-read.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(192))},{operation:"hermes_skill_bridge",operationId:"operation.application.hermes_skill_bridge",transport:{kind:"mcp_tool",toolName:"tracedecay_hermes_skill_bridge"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.hermes_skill_bridge.v1",requestSchema:{schemaId:"schema.application.primitive.hermes-skill-bridge.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.hermes-skill-bridge.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(193),decodeResult:S1(194)},{operation:"hook_runtime",operationId:"operation.application.hook_runtime",transport:{kind:"mcp_tool",toolName:"tracedecay_hook_runtime"},effect:"records_host_evidence",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.hook_runtime.v1",requestSchema:{schemaId:"schema.application.primitive.hook-runtime.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.hook-runtime.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","unavailable","partial"],decodeRequest:S1(195),decodeResult:S1(196)},{operation:"hotspots",operationId:"operation.application.hotspots",transport:{kind:"mcp_tool",toolName:"tracedecay_hotspots"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.hotspots.v1",requestSchema:{schemaId:"schema.application.primitive.hotspots.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.hotspots.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(197),decodeResult:S1(198)},{operation:"impact",operationId:"operation.application.impact",transport:{kind:"mcp_tool",toolName:"tracedecay_impact"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.impact.v1",requestSchema:{schemaId:"schema.application.primitive.impact.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.impact.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(199),decodeResult:S1(200)},{operation:"inheritance_depth",operationId:"operation.application.inheritance_depth",transport:{kind:"mcp_tool",toolName:"tracedecay_inheritance_depth"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.inheritance_depth.v1",requestSchema:{schemaId:"schema.application.primitive.inheritance-depth.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.inheritance-depth.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(201),decodeResult:S1(202)},{operation:"insert_at",operationId:"operation.application.insert_at",transport:{kind:"mcp_tool",toolName:"tracedecay_insert_at"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.insert_at.v1",requestSchema:{schemaId:"schema.application.source-edit.insert-at.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.insert-at.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(203),decodeResult:S1(18)},{operation:"insert_at_symbol",operationId:"operation.application.insert_at_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_insert_at_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.insert_at_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.insert-at-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.insert-at-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(204),decodeResult:S1(18)},{operation:"largest",operationId:"operation.application.largest",transport:{kind:"mcp_tool",toolName:"tracedecay_largest"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.largest.v1",requestSchema:{schemaId:"schema.application.primitive.largest.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.largest.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(205),decodeResult:S1(206)},{operation:"application_lcm_describe",operationId:"operation.application.lcm_describe",transport:{kind:"http",route:"/application/retained/lcm_describe",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_describe.v1",requestSchema:{schemaId:"schema.application.retained.lcm-describe.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-describe.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(207),decodeResult:S1(208),decodeSuccess:e=>fp(e,"binding.http.lcm_describe.v1","schema.application.retained.lcm-describe.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(208))},{operation:"application_lcm_doctor",operationId:"operation.application.lcm_doctor",transport:{kind:"http",route:"/application/retained/lcm_doctor",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_doctor.v1",requestSchema:{schemaId:"schema.application.retained.lcm-doctor.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-doctor.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(209),decodeResult:S1(210),decodeSuccess:e=>fp(e,"binding.http.lcm_doctor.v1","schema.application.retained.lcm-doctor.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(210))},{operation:"application_lcm_expand",operationId:"operation.application.lcm_expand",transport:{kind:"http",route:"/application/retained/lcm_expand",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_expand.v1",requestSchema:{schemaId:"schema.application.retained.lcm-expand.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-expand.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(211),decodeResult:S1(212),decodeSuccess:e=>fp(e,"binding.http.lcm_expand.v1","schema.application.retained.lcm-expand.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(212))},{operation:"application_lcm_expand_query",operationId:"operation.application.lcm_expand_query",transport:{kind:"http",route:"/application/retained/lcm_expand_query",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_expand_query.v1",requestSchema:{schemaId:"schema.application.retained.lcm-expand-query.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-expand-query.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(213),decodeResult:S1(214),decodeSuccess:e=>fp(e,"binding.http.lcm_expand_query.v1","schema.application.retained.lcm-expand-query.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(214))},{operation:"application_lcm_grep",operationId:"operation.application.lcm_grep",transport:{kind:"http",route:"/application/retained/lcm_grep",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_grep.v1",requestSchema:{schemaId:"schema.application.retained.lcm-grep.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-grep.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(215),decodeResult:S1(216),decodeSuccess:e=>fp(e,"binding.http.lcm_grep.v1","schema.application.retained.lcm-grep.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(216))},{operation:"application_lcm_load_session",operationId:"operation.application.lcm_load_session",transport:{kind:"http",route:"/application/retained/lcm_load_session",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_load_session.v1",requestSchema:{schemaId:"schema.application.retained.lcm-load-session.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-load-session.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(217),decodeResult:S1(218),decodeSuccess:e=>fp(e,"binding.http.lcm_load_session.v1","schema.application.retained.lcm-load-session.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(218))},{operation:"application_lcm_status",operationId:"operation.application.lcm_status",transport:{kind:"http",route:"/application/retained/lcm_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.lcm_status.v1",requestSchema:{schemaId:"schema.application.retained.lcm-status.request",revision:1},resultSchema:{schemaId:"schema.application.retained.lcm-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(219),decodeResult:S1(220),decodeSuccess:e=>fp(e,"binding.http.lcm_status.v1","schema.application.retained.lcm-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(220))},{operation:"application_memory_status",operationId:"operation.application.memory_status",transport:{kind:"http",route:"/application/retained/memory_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.memory_status.v1",requestSchema:{schemaId:"schema.application.retained.memory-status.request",revision:1},resultSchema:{schemaId:"schema.application.retained.memory-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(221),decodeResult:S1(222),decodeSuccess:e=>fp(e,"binding.http.memory_status.v1","schema.application.retained.memory-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(222))},{operation:"application_message_search",operationId:"operation.application.message_search",transport:{kind:"http",route:"/application/retained/message_search",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.message_search.v1",requestSchema:{schemaId:"schema.application.retained.message-search.request",revision:1},resultSchema:{schemaId:"schema.application.retained.message-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(223),decodeResult:S1(224),decodeSuccess:e=>fp(e,"binding.http.message_search.v1","schema.application.retained.message-search.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(224))},{operation:"application_module_api",operationId:"operation.application.module_api",transport:{kind:"http",route:"/application/primitives/module_api",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.module_api.v1",requestSchema:{schemaId:"schema.application.primitive.module-api.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.module-api.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(225),decodeResult:S1(226),decodeSuccess:e=>fp(e,"binding.http.module_api.v1","schema.application.primitive.module-api.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(226))},{operation:"move_symbol",operationId:"operation.application.move_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_move_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.move_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.move-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.move-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(227),decodeResult:S1(18)},{operation:"multi_str_replace",operationId:"operation.application.multi_str_replace",transport:{kind:"mcp_tool",toolName:"tracedecay_multi_str_replace"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.multi_str_replace.v1",requestSchema:{schemaId:"schema.application.source-edit.multi-str-replace.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.multi-str-replace.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(228),decodeResult:S1(18)},{operation:"native_integration_status",operationId:"operation.application.native_integration_status",transport:{kind:"mcp_tool",toolName:"tracedecay_native_integration_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.native_integration_status.v1",requestSchema:{schemaId:"schema.application.native-integration.status.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(229),decodeResult:S1(15)},{operation:"node",operationId:"operation.application.node",transport:{kind:"mcp_tool",toolName:"tracedecay_node"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.node.v1",requestSchema:{schemaId:"schema.application.primitive.node.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.node.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(230),decodeResult:S1(231)},{operation:"observatory_read",operationId:"operation.application.observatory_read",transport:{kind:"mcp_tool",toolName:"tracedecay_observatory_read"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.observatory_read.v1",requestSchema:{schemaId:"schema.application.observatory-read.request",revision:1},resultSchema:{schemaId:"schema.application.observatory-read.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(232),decodeResult:S1(233)},{operation:"port_order",operationId:"operation.application.port_order",transport:{kind:"mcp_tool",toolName:"tracedecay_port_order"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.port_order.v1",requestSchema:{schemaId:"schema.application.primitive.port-order.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.port-order.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(234),decodeResult:S1(235)},{operation:"port_status",operationId:"operation.application.port_status",transport:{kind:"mcp_tool",toolName:"tracedecay_port_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.port_status.v1",requestSchema:{schemaId:"schema.application.primitive.port-status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.port-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(236),decodeResult:S1(237)},{operation:"pr_context",operationId:"operation.application.pr_context",transport:{kind:"mcp_tool",toolName:"tracedecay_pr_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.pr_context.v1",requestSchema:{schemaId:"schema.application.primitive.pr-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.pr-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(238),decodeResult:S1(239)},{operation:"preflight_native_integration",operationId:"operation.application.preflight_native_integration",transport:{kind:"mcp_tool",toolName:"tracedecay_preflight_native_integration"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.preflight_native_integration.v1",requestSchema:{schemaId:"schema.application.native-integration.preflight.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.preflight.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(240),decodeResult:S1(15)},{operation:"project_context",operationId:"operation.application.project_context",transport:{kind:"mcp_tool",toolName:"tracedecay_project_context"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.project_context.v1",requestSchema:{schemaId:"schema.application.primitive.project-context.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.project-context.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(241),decodeResult:S1(242)},{operation:"project_list",operationId:"operation.application.project_list",transport:{kind:"mcp_tool",toolName:"tracedecay_project_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.project_list.v1",requestSchema:{schemaId:"schema.application.primitive.project-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.project-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(243),decodeResult:S1(244)},{operation:"project_search",operationId:"operation.application.project_search",transport:{kind:"mcp_tool",toolName:"tracedecay_project_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.project_search.v1",requestSchema:{schemaId:"schema.application.primitive.project-search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.project-search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(245),decodeResult:S1(244)},{operation:"application_qualified_name",operationId:"operation.application.qualified_name",transport:{kind:"http",route:"/application/primitives/qualified_name",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.qualified_name.v1",requestSchema:{schemaId:"schema.application.primitive.qualified-name.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.qualified-name.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(246),decodeResult:S1(247),decodeSuccess:e=>fp(e,"binding.http.qualified_name.v1","schema.application.primitive.qualified-name.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(247))},{operation:"rank",operationId:"operation.application.rank",transport:{kind:"mcp_tool",toolName:"tracedecay_rank"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.rank.v1",requestSchema:{schemaId:"schema.application.primitive.rank.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.rank.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(248),decodeResult:S1(249)},{operation:"recursion",operationId:"operation.application.recursion",transport:{kind:"mcp_tool",toolName:"tracedecay_recursion"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.recursion.v1",requestSchema:{schemaId:"schema.application.primitive.recursion.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.recursion.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(250),decodeResult:S1(251)},{operation:"redundancy",operationId:"operation.application.redundancy",transport:{kind:"mcp_tool",toolName:"tracedecay_redundancy"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.redundancy.v1",requestSchema:{schemaId:"schema.application.primitive.redundancy.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.redundancy.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(252),decodeResult:S1(253)},{operation:"remote_status",operationId:"operation.application.remote_status",transport:{kind:"mcp_tool",toolName:"tracedecay_remote_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.remote_status.v1",requestSchema:{schemaId:"schema.application.primitive.remote-status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.remote-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(254),decodeResult:S1(255)},{operation:"rename_preview",operationId:"operation.application.rename_preview",transport:{kind:"mcp_tool",toolName:"tracedecay_rename_preview"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.rename_preview.v1",requestSchema:{schemaId:"schema.application.primitive.rename-preview.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.rename-preview.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(256),decodeResult:S1(257)},{operation:"rename_symbol",operationId:"operation.application.rename_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_rename_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.rename_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.rename-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.rename-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(258),decodeResult:S1(18)},{operation:"replace_symbol",operationId:"operation.application.replace_symbol",transport:{kind:"mcp_tool",toolName:"tracedecay_replace_symbol"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.replace_symbol.v1",requestSchema:{schemaId:"schema.application.source-edit.replace-symbol.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.replace-symbol.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(259),decodeResult:S1(18)},{operation:"retrieve",operationId:"operation.application.retrieve",transport:{kind:"mcp_tool",toolName:"tracedecay_retrieve"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.retrieve.v1",requestSchema:{schemaId:"schema.application.primitive.retrieve.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.retrieve.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(260),decodeResult:S1(261)},{operation:"run_affected_tests",operationId:"operation.application.run_affected_tests",transport:{kind:"mcp_tool",toolName:"tracedecay_run_affected_tests"},effect:"spawns_process",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.run_affected_tests.v1",requestSchema:{schemaId:"schema.application.primitive.run-affected-tests.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.run-affected-tests.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","effect_in_flight"]},deadline:{behavior:"return_operation_receipt",maximum_millis:6e5},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(262),decodeResult:S1(263)},{operation:"runtime",operationId:"operation.application.runtime",transport:{kind:"mcp_tool",toolName:"tracedecay_runtime"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.runtime.v1",requestSchema:{schemaId:"schema.application.primitive.runtime.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.runtime.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(264),decodeResult:S1(265)},{operation:"search",operationId:"operation.application.search",transport:{kind:"mcp_tool",toolName:"tracedecay_search"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.search.v1",requestSchema:{schemaId:"schema.application.primitive.search.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.search.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(266),decodeResult:S1(267)},{operation:"session_lookup",operationId:"operation.application.session_lookup",transport:{kind:"mcp_tool",toolName:"tracedecay_session_lookup"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.session_lookup.v1",requestSchema:{schemaId:"schema.application.primitive.session-lookup.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.session-lookup.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(268),decodeResult:S1(269)},{operation:"application_session_refresh_begin",operationId:"operation.application.session_refresh_begin",transport:{kind:"http",route:"/application/retained/session_refresh_begin",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.session_refresh_begin.v1",requestSchema:{schemaId:"schema.application.retained.session-refresh-begin.request",revision:1},resultSchema:{schemaId:"schema.application.retained.session-refresh-begin.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(270),decodeResult:S1(271),decodeSuccess:e=>fp(e,"binding.http.session_refresh_begin.v1","schema.application.retained.session-refresh-begin.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(271))},{operation:"application_session_refresh_cancel",operationId:"operation.application.session_refresh_cancel",transport:{kind:"http",route:"/application/retained/session_refresh_cancel",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.session_refresh_cancel.v1",requestSchema:{schemaId:"schema.application.retained.session-refresh-cancel.request",revision:1},resultSchema:{schemaId:"schema.application.retained.session-refresh-cancel.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],decodeRequest:S1(270),decodeResult:S1(272),decodeSuccess:e=>fp(e,"binding.http.session_refresh_cancel.v1","schema.application.retained.session-refresh-cancel.result",1,["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","reconciling","after_commit"]},"durable_effect","required",S1(272))},{operation:"application_session_refresh_status",operationId:"operation.application.session_refresh_status",transport:{kind:"http",route:"/application/retained/session_refresh_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.session_refresh_status.v1",requestSchema:{schemaId:"schema.application.retained.session-refresh-status.request",revision:1},resultSchema:{schemaId:"schema.application.retained.session-refresh-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(270),decodeResult:S1(273),decodeSuccess:e=>fp(e,"binding.http.session_refresh_status.v1","schema.application.retained.session-refresh-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(273))},{operation:"application_sessions_for",operationId:"operation.application.sessions_for",transport:{kind:"http",route:"/application/retained/sessions_for",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.sessions_for.v1",requestSchema:{schemaId:"schema.application.retained.sessions-for.request",revision:1},resultSchema:{schemaId:"schema.application.retained.sessions-for.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(274),decodeResult:S1(275),decodeSuccess:e=>fp(e,"binding.http.sessions_for.v1","schema.application.retained.sessions-for.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(275))},{operation:"signature",operationId:"operation.application.signature",transport:{kind:"mcp_tool",toolName:"tracedecay_signature"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.signature.v1",requestSchema:{schemaId:"schema.application.primitive.signature.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.signature.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(112),decodeResult:S1(276)},{operation:"similar",operationId:"operation.application.similar",transport:{kind:"mcp_tool",toolName:"tracedecay_similar"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.similar.v1",requestSchema:{schemaId:"schema.application.primitive.similar.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.similar.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(277),decodeResult:S1(278)},{operation:"skill_list",operationId:"operation.application.skill_list",transport:{kind:"mcp_tool",toolName:"tracedecay_skill_list"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.skill_list.v1",requestSchema:{schemaId:"schema.application.primitive.skill-list.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.skill-list.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(279),decodeResult:S1(280)},{operation:"skill_view",operationId:"operation.application.skill_view",transport:{kind:"mcp_tool",toolName:"tracedecay_skill_view"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.skill_view.v1",requestSchema:{schemaId:"schema.application.primitive.skill-view.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.skill-view.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(281),decodeResult:S1(282)},{operation:"application_source_body",operationId:"operation.application.source_body",transport:{kind:"http",route:"/application/primitives/source_body",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.source_body.v1",requestSchema:{schemaId:"schema.application.primitive.source-body.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.source-body.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(283),decodeResult:S1(284),decodeSuccess:e=>fp(e,"binding.http.source_body.v1","schema.application.primitive.source-body.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(284))},{operation:"source_edit_reconcile",operationId:"operation.application.source_edit_reconcile",transport:{kind:"mcp_tool",toolName:"tracedecay_source_edit_reconcile"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.source_edit_reconcile.v1",requestSchema:{schemaId:"schema.application.source-edit.reconcile.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.reconcile.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(285),decodeResult:S1(18)},{operation:"application_source_lines",operationId:"operation.application.source_lines",transport:{kind:"http",route:"/application/primitives/source_lines",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.source_lines.v1",requestSchema:{schemaId:"schema.application.primitive.source-lines.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.source-lines.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(286),decodeResult:S1(287),decodeSuccess:e=>fp(e,"binding.http.source_lines.v1","schema.application.primitive.source-lines.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(287))},{operation:"application_source_outline",operationId:"operation.application.source_outline",transport:{kind:"http",route:"/application/primitives/source_outline",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.source_outline.v1",requestSchema:{schemaId:"schema.application.primitive.source-outline.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.source-outline.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(288),decodeResult:S1(289),decodeSuccess:e=>fp(e,"binding.http.source_outline.v1","schema.application.primitive.source-outline.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(289))},{operation:"stack_snapshot",operationId:"operation.application.stack_snapshot",transport:{kind:"mcp_tool",toolName:"tracedecay_stack_snapshot"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.stack_snapshot.v1",requestSchema:{schemaId:"schema.application.native-integration.stack-snapshot.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.stack-snapshot.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(290),decodeResult:S1(15)},{operation:"status",operationId:"operation.application.status",transport:{kind:"mcp_tool",toolName:"tracedecay_status"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.status.v1",requestSchema:{schemaId:"schema.application.primitive.status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(291),decodeResult:S1(292)},{operation:"application_storage_status",operationId:"operation.application.storage_status",transport:{kind:"http",route:"/application/primitives/storage_status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.storage_status.v1",requestSchema:{schemaId:"schema.application.primitive.storage-status.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.storage-status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(293),decodeResult:S1(294),decodeSuccess:e=>fp(e,"binding.http.storage_status.v1","schema.application.primitive.storage-status.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(294))},{operation:"str_replace",operationId:"operation.application.str_replace",transport:{kind:"mcp_tool",toolName:"tracedecay_str_replace"},effect:"source_edit",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.str_replace.v1",requestSchema:{schemaId:"schema.application.source-edit.str-replace.request",revision:1},resultSchema:{schemaId:"schema.application.source-edit.str-replace.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(295),decodeResult:S1(18)},{operation:"test_map",operationId:"operation.application.test_map",transport:{kind:"mcp_tool",toolName:"tracedecay_test_map"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.test_map.v1",requestSchema:{schemaId:"schema.application.primitive.test-map.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.test-map.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(296),decodeResult:S1(297)},{operation:"application_test_results",operationId:"operation.application.test_results",transport:{kind:"http",route:"/application/tests/results",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.test_results.v1",requestSchema:{schemaId:"schema.application.feedback.test-results.request",revision:1},resultSchema:{schemaId:"schema.application.feedback.test-results.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:15e3},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(298),decodeResult:S1(299),decodeSuccess:e=>fp(e,"binding.http.test_results.v1","schema.application.feedback.test-results.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(299))},{operation:"test_risk",operationId:"operation.application.test_risk",transport:{kind:"mcp_tool",toolName:"tracedecay_test_risk"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.test_risk.v1",requestSchema:{schemaId:"schema.application.primitive.test-risk.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.test-risk.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(300),decodeResult:S1(301)},{operation:"todos",operationId:"operation.application.todos",transport:{kind:"mcp_tool",toolName:"tracedecay_todos"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.todos.v1",requestSchema:{schemaId:"schema.application.primitive.todos.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.todos.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:1e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(302),decodeResult:S1(303)},{operation:"unmounted_files",operationId:"operation.application.unmounted_files",transport:{kind:"mcp_tool",toolName:"tracedecay_unmounted_files"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.unmounted_files.v1",requestSchema:{schemaId:"schema.application.primitive.unmounted-files.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.unmounted-files.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(304),decodeResult:S1(305)},{operation:"unsafe_patterns",operationId:"operation.application.unsafe_patterns",transport:{kind:"mcp_tool",toolName:"tracedecay_unsafe_patterns"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.mcp.unsafe_patterns.v1",requestSchema:{schemaId:"schema.application.primitive.unsafe-patterns.request",revision:1},resultSchema:{schemaId:"schema.application.primitive.unsafe-patterns.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:12e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(306),decodeResult:S1(307)},{operation:"application_workflows",operationId:"operation.application.workflows",transport:{kind:"http",route:"/application/retained/workflows",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflows.v1",requestSchema:{schemaId:"schema.application.retained.workflows.request",revision:1},resultSchema:{schemaId:"schema.application.retained.workflows.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","unavailable","partial"],decodeRequest:S1(308),decodeResult:S1(309),decodeSuccess:e=>fp(e,"binding.http.workflows.v1","schema.application.retained.workflows.result",1,["completed","cancelled","timed_out","failed","unavailable","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(309))},{operation:"application_worktree_cleanup_confirm",operationId:"operation.application.worktree_cleanup_confirm",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_confirm",method:"POST"},effect:"preview",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_confirm.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-confirm.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-confirm.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(310),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_confirm.v1","schema.application.native-integration.worktree-cleanup-confirm.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"application_worktree_cleanup_inspect",operationId:"operation.application.worktree_cleanup_inspect",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_inspect",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_inspect.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-inspect.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-inspect.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(311),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_inspect.v1","schema.application.native-integration.worktree-cleanup-inspect.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"application_worktree_cleanup_reconcile",operationId:"operation.application.worktree_cleanup_reconcile",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_reconcile",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_reconcile.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-reconcile.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-reconcile.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(312),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_reconcile.v1","schema.application.native-integration.worktree-cleanup-reconcile.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"application_worktree_cleanup_remove",operationId:"operation.application.worktree_cleanup_remove",transport:{kind:"http",route:"/application/native-integration/worktree_cleanup_remove",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_cleanup_remove.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-remove.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-cleanup-remove.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(313),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_cleanup_remove.v1","schema.application.native-integration.worktree-cleanup-remove.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(15))},{operation:"application_worktree_inventory",operationId:"operation.application.worktree_inventory",transport:{kind:"http",route:"/application/native-integration/worktree_inventory",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.worktree_inventory.v1",requestSchema:{schemaId:"schema.application.native-integration.worktree-inventory.request",revision:1},resultSchema:{schemaId:"schema.application.native-integration.worktree-inventory.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(314),decodeResult:S1(15),decodeSuccess:e=>fp(e,"binding.http.worktree_inventory.v1","schema.application.native-integration.worktree-inventory.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(15))},{operation:"handoff_issue_task_handoff",operationId:"operation.handoff.issue_task_handoff",transport:{kind:"http",route:"/application/handoff/issue-task",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.issue_task_handoff",requestSchema:{schemaId:"schema.handoff.issue_task_handoff.request",revision:1},resultSchema:{schemaId:"schema.handoff.issue_task_handoff.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(315),decodeResult:S1(316),decodeSuccess:e=>fp(e,"binding.http.handoff.issue_task_handoff","schema.handoff.issue_task_handoff.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(316))},{operation:"handoff_list_task_handoffs",operationId:"operation.handoff.list_task_handoffs",transport:{kind:"http",route:"/application/handoff/list-task",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.list_task_handoffs",requestSchema:{schemaId:"schema.handoff.list_task_handoffs.request",revision:1},resultSchema:{schemaId:"schema.handoff.list_task_handoffs.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","timed_out","failed","partial"],decodeRequest:S1(317),decodeResult:S1(318),decodeSuccess:e=>fp(e,"binding.http.handoff.list_task_handoffs","schema.handoff.list_task_handoffs.result",1,["completed","timed_out","failed","partial"],{mode:"not_cancellable"},"operation","not_required",S1(318))},{operation:"handoff_open_investigation_handoff",operationId:"operation.handoff.open_investigation_handoff",transport:{kind:"http",route:"/application/handoff/open-investigation",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.open_investigation_handoff",requestSchema:{schemaId:"schema.handoff.open_investigation_handoff.request",revision:1},resultSchema:{schemaId:"schema.handoff.open_investigation_handoff.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(319),decodeResult:S1(320),decodeSuccess:e=>fp(e,"binding.http.handoff.open_investigation_handoff","schema.handoff.open_investigation_handoff.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(320))},{operation:"handoff_open_task_handoff",operationId:"operation.handoff.open_task_handoff",transport:{kind:"http",route:"/application/handoff/open-task",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.handoff.open_task_handoff",requestSchema:{schemaId:"schema.handoff.open_task_handoff.request",revision:1},resultSchema:{schemaId:"schema.handoff.open_task_handoff.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(321),decodeResult:S1(322),decodeSuccess:e=>fp(e,"binding.http.handoff.open_task_handoff","schema.handoff.open_task_handoff.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(322))},{operation:"multi_root_execute",operationId:"operation.multi_root.execute",transport:{kind:"http",route:"/application/multi-root/execute",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.multi_root.execute.v1",requestSchema:{schemaId:"schema.tracedecay.multi-root.execute-request.v1",revision:1},resultSchema:{schemaId:"schema.tracedecay.multi-root.execute-result.v1",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(323),decodeResult:S1(324),decodeSuccess:e=>fp(e,"binding.http.multi_root.execute.v1","schema.tracedecay.multi-root.execute-result.v1",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(324))},{operation:"multi_root_scope_set_compare_and_swap",operationId:"operation.multi_root.scope_set_compare_and_swap",transport:{kind:"http",route:"/application/multi-root/scope-set/compare-and-swap",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.multi_root.scope_set_compare_and_swap.v1",requestSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-compare-and-swap-request.v1",revision:1},resultSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-compare-and-swap-result.v1",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(325),decodeResult:S1(326),decodeSuccess:e=>fp(e,"binding.http.multi_root.scope_set_compare_and_swap.v1","schema.tracedecay.multi-root.scope-set-compare-and-swap-result.v1",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(326))},{operation:"multi_root_scope_set_read",operationId:"operation.multi_root.scope_set_read",transport:{kind:"http",route:"/application/multi-root/scope-set/read",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.multi_root.scope_set_read.v1",requestSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-read-request.v1",revision:1},resultSchema:{schemaId:"schema.tracedecay.multi-root.scope-set-read-result.v1",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(327),decodeResult:S1(328),decodeSuccess:e=>fp(e,"binding.http.multi_root.scope_set_read.v1","schema.tracedecay.multi-root.scope-set-read-result.v1",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(328))},{operation:"work_accept_proposal",operationId:"operation.work.accept_proposal",transport:{kind:"http",route:"/application/work/accept-proposal",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.accept_proposal",requestSchema:{schemaId:"schema.work.accept_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.accept_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(329),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.accept_proposal","schema.work.accept_proposal.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_adjudicate_duplicate",operationId:"operation.work.adjudicate_duplicate",transport:{kind:"http",route:"/application/work/adjudicate-duplicate",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.adjudicate_duplicate",requestSchema:{schemaId:"schema.work.adjudicate_duplicate.request",revision:1},resultSchema:{schemaId:"schema.work.adjudicate_duplicate.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(331),decodeResult:S1(332),decodeSuccess:e=>fp(e,"binding.http.work.adjudicate_duplicate","schema.work.adjudicate_duplicate.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(332))},{operation:"work_adjudicate_leak",operationId:"operation.work.adjudicate_leak",transport:{kind:"http",route:"/application/work/adjudicate-leak",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.adjudicate_leak",requestSchema:{schemaId:"schema.work.adjudicate_leak.request",revision:1},resultSchema:{schemaId:"schema.work.adjudicate_leak.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(333),decodeResult:S1(334),decodeSuccess:e=>fp(e,"binding.http.work.adjudicate_leak","schema.work.adjudicate_leak.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(334))},{operation:"work_admit_execution",operationId:"operation.work.admit_execution",transport:{kind:"http",route:"/application/work/admit-execution",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.admit_execution",requestSchema:{schemaId:"schema.work.admit_execution.request",revision:1},resultSchema:{schemaId:"schema.work.admit_execution.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(335),decodeResult:S1(336),decodeSuccess:e=>fp(e,"binding.http.work.admit_execution","schema.work.admit_execution.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(336))},{operation:"work_admit_placement",operationId:"operation.work.admit_placement",transport:{kind:"http",route:"/application/work/admit-placement",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.admit_placement",requestSchema:{schemaId:"schema.work.admit_placement.request",revision:1},resultSchema:{schemaId:"schema.work.admit_placement.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(337),decodeResult:S1(338),decodeSuccess:e=>fp(e,"binding.http.work.admit_placement","schema.work.admit_placement.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(338))},{operation:"work_advance_job",operationId:"operation.work.advance_job",transport:{kind:"http",route:"/application/work/advance-job",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.advance_job",requestSchema:{schemaId:"schema.work.advance_job.request",revision:1},resultSchema:{schemaId:"schema.work.advance_job.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(339),decodeResult:S1(340),decodeSuccess:e=>fp(e,"binding.http.work.advance_job","schema.work.advance_job.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(340))},{operation:"work_attempt_status",operationId:"operation.work.attempt_status",transport:{kind:"http",route:"/application/work/attempt-status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.attempt_status",requestSchema:{schemaId:"schema.work.attempt_status.request",revision:1},resultSchema:{schemaId:"schema.work.attempt_status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(341),decodeResult:S1(342),decodeSuccess:e=>fp(e,"binding.http.work.attempt_status","schema.work.attempt_status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(342))},{operation:"work_cancel_attempt",operationId:"operation.work.cancel_attempt",transport:{kind:"http",route:"/application/work/cancel-attempt",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.cancel_attempt",requestSchema:{schemaId:"schema.work.cancel_attempt.request",revision:1},resultSchema:{schemaId:"schema.work.cancel_attempt.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(343),decodeResult:S1(342),decodeSuccess:e=>fp(e,"binding.http.work.cancel_attempt","schema.work.cancel_attempt.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(342))},{operation:"work_compare_proposal",operationId:"operation.work.compare_proposal",transport:{kind:"http",route:"/application/work/compare-proposal",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.compare_proposal",requestSchema:{schemaId:"schema.work.compare_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.compare_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(344),decodeResult:S1(345),decodeSuccess:e=>fp(e,"binding.http.work.compare_proposal","schema.work.compare_proposal.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(345))},{operation:"work_create",operationId:"operation.work.create",transport:{kind:"http",route:"/application/work/create",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.create",requestSchema:{schemaId:"schema.work.create.request",revision:1},resultSchema:{schemaId:"schema.work.create.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(346),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.create","schema.work.create.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_execution_history",operationId:"operation.work.execution_history",transport:{kind:"http",route:"/application/work/execution-history",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.execution_history",requestSchema:{schemaId:"schema.work.execution_history.request",revision:1},resultSchema:{schemaId:"schema.work.execution_history.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(347),decodeResult:S1(348),decodeSuccess:e=>fp(e,"binding.http.work.execution_history","schema.work.execution_history.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(348))},{operation:"work_experience",operationId:"operation.work.experience",transport:{kind:"http",route:"/application/work/experience",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.experience",requestSchema:{schemaId:"schema.work.experience.request",revision:1},resultSchema:{schemaId:"schema.work.experience.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(349),decodeResult:S1(350),decodeSuccess:e=>fp(e,"binding.http.work.experience","schema.work.experience.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(350))},{operation:"work_generate_proposal",operationId:"operation.work.generate_proposal",transport:{kind:"http",route:"/application/work/generate-proposal",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.generate_proposal",requestSchema:{schemaId:"schema.work.generate_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.generate_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(351),decodeResult:S1(352),decodeSuccess:e=>fp(e,"binding.http.work.generate_proposal","schema.work.generate_proposal.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(352))},{operation:"work_hydrate_artifacts",operationId:"operation.work.hydrate_artifacts",transport:{kind:"http",route:"/application/work/hydrate-artifacts",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.hydrate_artifacts",requestSchema:{schemaId:"schema.work.hydrate_artifacts.request",revision:1},resultSchema:{schemaId:"schema.work.hydrate_artifacts.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(353),decodeResult:S1(354),decodeSuccess:e=>fp(e,"binding.http.work.hydrate_artifacts","schema.work.hydrate_artifacts.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(354))},{operation:"work_list_attempts",operationId:"operation.work.list_attempts",transport:{kind:"http",route:"/application/work/list-attempts",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.list_attempts",requestSchema:{schemaId:"schema.work.list_attempts.request",revision:1},resultSchema:{schemaId:"schema.work.list_attempts.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(347),decodeResult:S1(355),decodeSuccess:e=>fp(e,"binding.http.work.list_attempts","schema.work.list_attempts.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(355))},{operation:"work_mutate_graph",operationId:"operation.work.mutate_graph",transport:{kind:"http",route:"/application/work/mutate-graph",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.mutate_graph",requestSchema:{schemaId:"schema.work.mutate_graph.request",revision:1},resultSchema:{schemaId:"schema.work.mutate_graph.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(356),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.mutate_graph","schema.work.mutate_graph.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_pause_run",operationId:"operation.work.pause_run",transport:{kind:"http",route:"/application/work/pause-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.pause_run",requestSchema:{schemaId:"schema.work.pause_run.request",revision:1},resultSchema:{schemaId:"schema.work.pause_run.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(357),decodeResult:S1(358),decodeSuccess:e=>fp(e,"binding.http.work.pause_run","schema.work.pause_run.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(358))},{operation:"work_placement_preflight",operationId:"operation.work.placement_preflight",transport:{kind:"http",route:"/application/work/placement-preflight",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.placement_preflight",requestSchema:{schemaId:"schema.work.placement_preflight.request",revision:1},resultSchema:{schemaId:"schema.work.placement_preflight.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(359),decodeResult:S1(360),decodeSuccess:e=>fp(e,"binding.http.work.placement_preflight","schema.work.placement_preflight.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(360))},{operation:"work_placement_status",operationId:"operation.work.placement_status",transport:{kind:"http",route:"/application/work/placement-status",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.placement_status",requestSchema:{schemaId:"schema.work.placement_status.request",revision:1},resultSchema:{schemaId:"schema.work.placement_status.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(361),decodeResult:S1(362),decodeSuccess:e=>fp(e,"binding.http.work.placement_status","schema.work.placement_status.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(362))},{operation:"work_prepare_duplicate_adjudication",operationId:"operation.work.prepare_duplicate_adjudication",transport:{kind:"http",route:"/application/work/prepare-duplicate-adjudication",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.prepare_duplicate_adjudication",requestSchema:{schemaId:"schema.work.prepare_duplicate_adjudication.request",revision:1},resultSchema:{schemaId:"schema.work.prepare_duplicate_adjudication.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(363),decodeResult:S1(331),decodeSuccess:e=>fp(e,"binding.http.work.prepare_duplicate_adjudication","schema.work.prepare_duplicate_adjudication.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(331))},{operation:"work_prepare_graph_mutation",operationId:"operation.work.prepare_graph_mutation",transport:{kind:"http",route:"/application/work/prepare-graph-mutation",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.prepare_graph_mutation",requestSchema:{schemaId:"schema.work.prepare_graph_mutation.request",revision:1},resultSchema:{schemaId:"schema.work.prepare_graph_mutation.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(364),decodeResult:S1(356),decodeSuccess:e=>fp(e,"binding.http.work.prepare_graph_mutation","schema.work.prepare_graph_mutation.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(356))},{operation:"work_release_placement",operationId:"operation.work.release_placement",transport:{kind:"http",route:"/application/work/release-placement",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.release_placement",requestSchema:{schemaId:"schema.work.release_placement.request",revision:1},resultSchema:{schemaId:"schema.work.release_placement.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(365),decodeResult:S1(338),decodeSuccess:e=>fp(e,"binding.http.work.release_placement","schema.work.release_placement.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(338))},{operation:"work_resume_attempts",operationId:"operation.work.resume_attempts",transport:{kind:"http",route:"/application/work/resume-attempts",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.resume_attempts",requestSchema:{schemaId:"schema.work.resume_attempts.request",revision:1},resultSchema:{schemaId:"schema.work.resume_attempts.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(366),decodeResult:S1(367),decodeSuccess:e=>fp(e,"binding.http.work.resume_attempts","schema.work.resume_attempts.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(367))},{operation:"work_resume_run",operationId:"operation.work.resume_run",transport:{kind:"http",route:"/application/work/resume-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.resume_run",requestSchema:{schemaId:"schema.work.resume_run.request",revision:1},resultSchema:{schemaId:"schema.work.resume_run.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(368),decodeResult:S1(358),decodeSuccess:e=>fp(e,"binding.http.work.resume_run","schema.work.resume_run.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(358))},{operation:"work_retrieve_evidence",operationId:"operation.work.retrieve_evidence",transport:{kind:"http",route:"/application/work/retrieve-evidence",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.retrieve_evidence",requestSchema:{schemaId:"schema.work.retrieve_evidence.request",revision:1},resultSchema:{schemaId:"schema.work.retrieve_evidence.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(369),decodeResult:S1(370),decodeSuccess:e=>fp(e,"binding.http.work.retrieve_evidence","schema.work.retrieve_evidence.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(370))},{operation:"work_retry_attempt",operationId:"operation.work.retry_attempt",transport:{kind:"http",route:"/application/work/retry-attempt",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.retry_attempt",requestSchema:{schemaId:"schema.work.retry_attempt.request",revision:1},resultSchema:{schemaId:"schema.work.retry_attempt.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(371),decodeResult:S1(372),decodeSuccess:e=>fp(e,"binding.http.work.retry_attempt","schema.work.retry_attempt.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(372))},{operation:"work_review_proposal",operationId:"operation.work.review_proposal",transport:{kind:"http",route:"/application/work/review-proposal",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.review_proposal",requestSchema:{schemaId:"schema.work.review_proposal.request",revision:1},resultSchema:{schemaId:"schema.work.review_proposal.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(373),decodeResult:S1(330),decodeSuccess:e=>fp(e,"binding.http.work.review_proposal","schema.work.review_proposal.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(330))},{operation:"work_run_control",operationId:"operation.work.run_control",transport:{kind:"http",route:"/application/work/run-control",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.run_control",requestSchema:{schemaId:"schema.work.run_control.request",revision:1},resultSchema:{schemaId:"schema.work.run_control.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(374),decodeResult:S1(375),decodeSuccess:e=>fp(e,"binding.http.work.run_control","schema.work.run_control.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(375))},{operation:"work_start_attempt",operationId:"operation.work.start_attempt",transport:{kind:"http",route:"/application/work/start-attempt",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.start_attempt",requestSchema:{schemaId:"schema.work.start_attempt.request",revision:1},resultSchema:{schemaId:"schema.work.start_attempt.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(376),decodeResult:S1(342),decodeSuccess:e=>fp(e,"binding.http.work.start_attempt","schema.work.start_attempt.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(342))},{operation:"work_synthesize",operationId:"operation.work.synthesize",transport:{kind:"http",route:"/application/work/synthesize",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.synthesize",requestSchema:{schemaId:"schema.work.synthesize.request",revision:1},resultSchema:{schemaId:"schema.work.synthesize.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","cancelled","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(377),decodeResult:S1(378),decodeSuccess:e=>fp(e,"binding.http.work.synthesize","schema.work.synthesize.result",1,["completed","cancelled","timed_out","failed","effect_unknown","partial"],{mode:"cooperative",points:["before_admission","before_effect","effect_in_flight","after_commit"]},"durable_effect","required",S1(378))},{operation:"work_topology",operationId:"operation.work.topology",transport:{kind:"http",route:"/application/work/topology",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.topology",requestSchema:{schemaId:"schema.work.topology.request",revision:1},resultSchema:{schemaId:"schema.work.topology.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(379),decodeResult:S1(380),decodeSuccess:e=>fp(e,"binding.http.work.topology","schema.work.topology.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(380))},{operation:"work_topology_metrics",operationId:"operation.work.topology_metrics",transport:{kind:"http",route:"/application/work/topology-metrics",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.topology_metrics",requestSchema:{schemaId:"schema.work.topology_metrics.request",revision:1},resultSchema:{schemaId:"schema.work.topology_metrics.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(381),decodeResult:S1(382),decodeSuccess:e=>fp(e,"binding.http.work.topology_metrics","schema.work.topology_metrics.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(382))},{operation:"work_views",operationId:"operation.work.views",transport:{kind:"http",route:"/application/work/views",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.work.views",requestSchema:{schemaId:"schema.work.views.request",revision:1},resultSchema:{schemaId:"schema.work.views.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(383),decodeResult:S1(384),decodeSuccess:e=>fp(e,"binding.http.work.views","schema.work.views.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(384))},{operation:"workflow_activate_definition",operationId:"operation.workflow.activate_definition",transport:{kind:"http",route:"/application/workflow/activate-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.activate_definition",requestSchema:{schemaId:"schema.workflow.activate_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.activate_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(385),decodeResult:S1(386),decodeSuccess:e=>fp(e,"binding.http.workflow.activate_definition","schema.workflow.activate_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(386))},{operation:"workflow_cancel_run",operationId:"operation.workflow.cancel_run",transport:{kind:"http",route:"/application/workflow/cancel-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.cancel_run",requestSchema:{schemaId:"schema.workflow.cancel_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.cancel_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(387),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.cancel_run","schema.workflow.cancel_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_definition_history",operationId:"operation.workflow.definition_history",transport:{kind:"http",route:"/application/workflow/definition-history",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.definition_history",requestSchema:{schemaId:"schema.workflow.definition_history.request",revision:1},resultSchema:{schemaId:"schema.workflow.definition_history.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(389),decodeResult:S1(390),decodeSuccess:e=>fp(e,"binding.http.workflow.definition_history","schema.workflow.definition_history.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(390))},{operation:"workflow_diff_definition",operationId:"operation.workflow.diff_definition",transport:{kind:"http",route:"/application/workflow/diff-definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.diff_definition",requestSchema:{schemaId:"schema.workflow.diff_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.diff_definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(391),decodeResult:S1(392),decodeSuccess:e=>fp(e,"binding.http.workflow.diff_definition","schema.workflow.diff_definition.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(392))},{operation:"workflow_get_definition",operationId:"operation.workflow.get_definition",transport:{kind:"http",route:"/application/workflow/get-definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.get_definition",requestSchema:{schemaId:"schema.workflow.get_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.get_definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(393),decodeResult:S1(394),decodeSuccess:e=>fp(e,"binding.http.workflow.get_definition","schema.workflow.get_definition.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(394))},{operation:"workflow_get_run",operationId:"operation.workflow.get_run",transport:{kind:"http",route:"/application/workflow/get-run",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.get_run",requestSchema:{schemaId:"schema.workflow.get_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.get_run.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(395),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.get_run","schema.workflow.get_run.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(388))},{operation:"workflow_handoff_issue",operationId:"operation.workflow.handoff_issue",transport:{kind:"http",route:"/application/workflow/handoff-issue",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.handoff_issue",requestSchema:{schemaId:"schema.workflow.handoff_issue.request",revision:1},resultSchema:{schemaId:"schema.workflow.handoff_issue.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(396),decodeResult:S1(397),decodeSuccess:e=>fp(e,"binding.http.workflow.handoff_issue","schema.workflow.handoff_issue.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(397))},{operation:"workflow_handoff_redeem",operationId:"operation.workflow.handoff_redeem",transport:{kind:"http",route:"/application/workflow/handoff-redeem",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.handoff_redeem",requestSchema:{schemaId:"schema.workflow.handoff_redeem.request",revision:1},resultSchema:{schemaId:"schema.workflow.handoff_redeem.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(398),decodeResult:S1(399),decodeSuccess:e=>fp(e,"binding.http.workflow.handoff_redeem","schema.workflow.handoff_redeem.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(399))},{operation:"workflow_list_definitions",operationId:"operation.workflow.list_definitions",transport:{kind:"http",route:"/application/workflow/list-definitions",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.list_definitions",requestSchema:{schemaId:"schema.workflow.list_definitions.request",revision:1},resultSchema:{schemaId:"schema.workflow.list_definitions.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(400),decodeResult:S1(390),decodeSuccess:e=>fp(e,"binding.http.workflow.list_definitions","schema.workflow.list_definitions.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(390))},{operation:"workflow_pause_run",operationId:"operation.workflow.pause_run",transport:{kind:"http",route:"/application/workflow/pause-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.pause_run",requestSchema:{schemaId:"schema.workflow.pause_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.pause_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(401),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.pause_run","schema.workflow.pause_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_register_definition",operationId:"operation.workflow.register_definition",transport:{kind:"http",route:"/application/workflow/register-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.register_definition",requestSchema:{schemaId:"schema.workflow.register_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.register_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(402),decodeResult:S1(394),decodeSuccess:e=>fp(e,"binding.http.workflow.register_definition","schema.workflow.register_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(394))},{operation:"workflow_reject_definition",operationId:"operation.workflow.reject_definition",transport:{kind:"http",route:"/application/workflow/reject-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.reject_definition",requestSchema:{schemaId:"schema.workflow.reject_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.reject_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(403),decodeResult:S1(386),decodeSuccess:e=>fp(e,"binding.http.workflow.reject_definition","schema.workflow.reject_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(386))},{operation:"workflow_resume_run",operationId:"operation.workflow.resume_run",transport:{kind:"http",route:"/application/workflow/resume-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.resume_run",requestSchema:{schemaId:"schema.workflow.resume_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.resume_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(404),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.resume_run","schema.workflow.resume_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_retire_definition",operationId:"operation.workflow.retire_definition",transport:{kind:"http",route:"/application/workflow/retire-definition",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.retire_definition",requestSchema:{schemaId:"schema.workflow.retire_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.retire_definition.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(405),decodeResult:S1(386),decodeSuccess:e=>fp(e,"binding.http.workflow.retire_definition","schema.workflow.retire_definition.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(386))},{operation:"workflow_start_run",operationId:"operation.workflow.start_run",transport:{kind:"http",route:"/application/workflow/start-run",method:"POST"},effect:"administrative",idempotency:"required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.start_run",requestSchema:{schemaId:"schema.workflow.start_run.request",revision:1},resultSchema:{schemaId:"schema.workflow.start_run.result",revision:1},cancellation:{mode:"not_cancellable"},deadline:{behavior:"return_effect_receipt",maximum_millis:3e4},reconciliation:"required",receipt:"durable_effect",terminalStates:["completed","timed_out","failed","effect_unknown","partial"],decodeRequest:S1(406),decodeResult:S1(388),decodeSuccess:e=>fp(e,"binding.http.workflow.start_run","schema.workflow.start_run.result",1,["completed","timed_out","failed","effect_unknown","partial"],{mode:"not_cancellable"},"durable_effect","required",S1(388))},{operation:"workflow_validate_definition",operationId:"operation.workflow.validate_definition",transport:{kind:"http",route:"/application/workflow/validate-definition",method:"POST"},effect:"read",idempotency:"not_required",requestIdControl:"server_minted",resultSemantics:"schema_only",bindingId:"binding.http.workflow.validate_definition",requestSchema:{schemaId:"schema.workflow.validate_definition.request",revision:1},resultSchema:{schemaId:"schema.workflow.validate_definition.result",revision:1},cancellation:{mode:"cooperative",points:["before_admission","before_read","during_read"]},deadline:{behavior:"return_operation_receipt",maximum_millis:3e4},reconciliation:"not_required",receipt:"operation",terminalStates:["completed","cancelled","timed_out","failed","partial"],decodeRequest:S1(407),decodeResult:S1(408),decodeSuccess:e=>fp(e,"binding.http.workflow.validate_definition","schema.workflow.validate_definition.result",1,["completed","cancelled","timed_out","failed","partial"],{mode:"cooperative",points:["before_admission","before_read","during_read"]},"operation","not_required",S1(408))}],S2=new TextEncoder;class S4 extends Error{cause;constructor(e,t){super(e),this.name=new.target.name,this.cause=t}}class S6 extends S4{constructor(e){super("the caller aborted the request",e)}}class S3 extends S4{}class S9 extends S4{status;constructor(e){super(401===e?"the daemon rejected HTTP authentication":"the daemon rejected the HTTP origin"),this.status=e}}class S5 extends Error{status;payload;constructor(e,t={}){super(e),this.name=new.target.name,this.status=t.status,this.payload=t.payload}}class S8 extends S5{}class S7 extends Error{status;envelope;problem;constructor(e,t){super(`${t.problem.kind}/${t.problem.code}: ${t.problem.message}`),this.name=new.target.name,this.status=e,this.envelope=t,this.problem=t.problem}}class ke extends S7{}class kt extends S7{}class kr extends S7{}class ki extends S7{}class ko extends S7{}class kn extends S7{}class ka extends S7{}class ks extends S7{}class kd extends S7{}class kc extends S7{}class kl extends S7{}let kp=new Set(["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"]),ku=new TextEncoder;function km(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function kf(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function kh(e){return"number"==typeof e&&Number.isSafeInteger(e)}function ky(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&ku.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}function kg(e,t){let r=e.headers.get("content-type");return null!==r&&r.split(";",1)[0]?.trim().toLowerCase()===t}function k_(e){return!!km(e)&&!!kh(e.started_at)&&!!kh(e.ended_at)&&!(e.ended_at{let o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e),n=()=>{clearTimeout(o),i(new S6(t?.reason))};t?.addEventListener("abort",n,{once:!0})})}async function*k$(e,t){let r,i=e.getReader(),o=new TextDecoder("utf-8",{fatal:!0}),n=new Uint8Array(65536),a=0,s=0,d=!1,c="",l=0,p=t??"",u=ku.encode(p).byteLength,m=[],f=0,h=!1,y=()=>new S8("the daemon returned an SSE line or frame exceeding 65536 bytes",{payload:{limitBytes:65536}}),g=(e,t)=>{try{return o.decode(e,{stream:t})}catch(e){throw new S8("the daemon returned malformed UTF-8 event-stream data",{payload:e})}},_=e=>{if(""===e){if(h=!1,l=0,0===m.length)return c="",null;let e={event:""===c?"message":c,id:""===p?null:p,data:m.join("\n"),...void 0===r?{}:{retryDelayMs:r}};return c="",m=[],f=0,e}if(e.startsWith(":"))return null;h=!0;let t=e.indexOf(":"),i=t<0?e:e.slice(0,t),o=t<0?"":e.slice(t+1);o.startsWith(" ")&&(o=o.slice(1));let n=ku.encode(o).byteLength;if(("event"===i||"id"===i||"data"===i)&&l+u+f+n+1>65536)throw y();switch(i){case"event":c=o,l=n;break;case"id":o.includes("\0")||(p=o,u=n);break;case"data":f+=n+ +(0!==m.length),m.push(o);break;case"retry":if(/^[0-9]+$/.test(o)){let e=BigInt(o);r=e>2147483647n?0x7fffffff:Number(e)}}return null};try{for(;;){let e=await i.read();if(e.done){g(n.subarray(0,a),!1);break}for(let t=0;t0||h||m.length>0)throw new S3("operation stream ended with an incomplete SSE event")}catch(e){if(e instanceof S5||e instanceof S4)throw e;throw new S3("operation stream transport was interrupted",e)}finally{i.releaseLock()}}class kS{operations;projectRoot;applicationRoot;token;origin;doFetch;mcp;constructor(e){let t=new URL(e.baseUrl);if("http:"!==t.protocol&&"https:"!==t.protocol||""!==t.username||""!==t.password||""!==t.search||""!==t.hash)throw new S5("baseUrl must be an absolute HTTP URL without credentials, query, or fragment");let r=t.toString().replace(/\/+$/u,"");this.projectRoot=`${r}/projects/${encodeURIComponent(e.projectId)}`,this.applicationRoot=`${this.projectRoot}/application`,this.token=e.token,this.origin=e.origin??t.origin,this.doFetch=e.fetch??globalThis.fetch.bind(globalThis),this.mcp=e.mcp;let i={};for(let e of S0)i[e.operation]=(t,r)=>this.#p(e,t,r);this.operations=Object.freeze(i)}headers(e){return new Headers({accept:e,authorization:`Bearer ${this.token}`,origin:this.origin})}operationUrl(e,t){if(t?.size!==void 0&&(!Number.isSafeInteger(t.size)||t.size<1||t.size>1e3))throw new S5("page size must be an integer between 1 and 1000");if(t?.cursor!==void 0&&!ky(t.cursor,4096))throw new S5("page cursor is not a canonical opaque cursor");let r=new URL(`${this.projectRoot}${e}`);return t?.size!==void 0&&r.searchParams.set("page_size",String(t.size)),t?.cursor!==void 0&&r.searchParams.set("cursor",t.cursor),r}lifecycleUrl(e,t){if(!ky(e,512))throw new S5("operationId is not a canonical request handle");return new URL(`${this.applicationRoot}/operations/${encodeURIComponent(e)}/${t}`)}async fetchResponse(e,t,r){try{return await this.doFetch(e,t)}catch(t){if(r?.aborted)throw new S6(r.reason);throw new S3(`transport failure requesting ${e.pathname}`,t)}}async readJson(e,t,r,i){let o,n,a=!1,s=()=>n??=o?.cancel(i?.reason)??e.body?.cancel(i?.reason)??Promise.resolve(),d=()=>{s().catch(()=>void 0)};try{if(i?.aborted)throw new S6(i.reason);if(401===e.status||403===e.status)throw new S9(e.status);if(!kg(e,"application/json"))throw new S8("the daemon returned JSON with an invalid media type",{status:e.status});let n="";try{if(o=e.body?.getReader(),i?.addEventListener("abort",d,{once:!0}),i?.aborted)throw new S6(i.reason);if(void 0!==o){let e=new TextDecoder;for(;;){let{done:t,value:r}=await o.read();if(i?.aborted)throw new S6(i.reason);if(t)break;n+=e.decode(r,{stream:!0})}n+=e.decode()}a=!0}catch(e){if(i?.aborted)throw new S6(i.reason);throw new S3("transport failure reading the daemon response body",e)}let s=kv(n,e.status);if(km(s)&&"problem"===s.kind){var c;let i=s.value;if(!function(e){var t,r,i;if(!fu(e)||void 0!==e.binding_id&&"string"!=typeof e.binding_id||!(fu(t=e.contract)&&fh(t.schema_id,512)&&fm(t.schema_revision)&&t.schema_revision>0)||!fh(e.request_id,512)||!fu(e.problem))return!1;let o=e.problem,n=Array.isArray(o.legal_actions)?o.legal_actions:null,a="never"===o.retry?null:"same_request"===o.retry||"after_delay"===o.retry?"same_request":"after_revalidate"===o.retry?"fresh_request":"after_reconcile"===o.retry?"same_operation":void 0;if(!(1===o.revision&&"string"==typeof o.kind&&["invalid_request","not_found_or_not_authorized","conflict","partial_effect","stale","unsupported","unavailable","execution_failed","reset_required","saturated","cancelled","timed_out"].includes(o.kind)&&"string"==typeof o.code&&"string"==typeof o.message&&(null===o.diagnostic||fg(o.diagnostic))&&"detail"in o&&(null===o.detail||function(e){if(!fu(e))return!1;switch(e.kind){case"parked":return"string"==typeof e.cause&&"string"==typeof e.remedy&&"boolean"==typeof e.retries_on_wake;case"stale_refresh_frontier":return fm(e.requested)&&fm(e.committed)&&fm(e.active);case"stale_precondition":return"string"==typeof e.field&&fm(e.requested)&&fm(e.current);case"lock_deadline":return"string"==typeof e.resource&&fm(e.deadline_ms);case"diagnostics_unsupported":return(null===e.file||"string"==typeof e.file)&&Array.isArray(e.searched)&&e.searched.every(e=>fu(e)&&"string"==typeof e.path&&"boolean"==typeof e.present);case"diagnostics_pending":return"string"==typeof e.producer&&(null===e.generation||"string"==typeof e.generation);case"code_graph_rewarming":return fm(e.retry_after_millis);case"reset_required":return"string"==typeof e.authority&&(null===e.found_version||ff(e.found_version))&&(null===e.required_version||ff(e.required_version))&&"string"==typeof e.reason&&"string"==typeof e.remedy;default:return!1}}(o.detail))&&"committed_receipt"in o&&"string"==typeof o.owning_layer&&"string"==typeof o.terminality&&"boolean"==typeof o.retryable&&"string"==typeof o.retry&&(null===o.retry_scope||"string"==typeof o.retry_scope)&&(null===o.retry_after_millis||fm(o.retry_after_millis))&&"cancellation_stage"in o&&(null===o.cancellation_stage||"string"==typeof o.cancellation_stage&&["before_admission","before_read","during_read","before_effect","effect_in_flight"].includes(o.cancellation_stage))&&"unavailable_classification"in o&&(null===o.unavailable_classification||"string"==typeof o.unavailable_classification&&["authority","backend_unavailable","backend_disconnected","backend_retryable"].includes(o.unavailable_classification))&&"execution_failure_classification"in o&&(null===o.execution_failure_classification||"string"==typeof o.execution_failure_classification&&["denied","malformed_output","permanent"].includes(o.execution_failure_classification))&&o.request_id===e.request_id&&fh(o.trace_id,512)&&Array.isArray(o.details)&&o.details.every(fg)&&null!==n&&n.every(e=>"string"==typeof e)&&"coverage"in o)||null===n)return!1;let s=null!==o.cancellation_stage&&"before_admission"!==o.cancellation_stage,d=null!==o.unavailable_classification&&"authority"!==o.unavailable_classification,c="partial_effect"===o.kind||"reset_required"===o.kind||"execution_failed"===o.kind||s||d;return o.terminality===(c?"admitted_terminal":"pre_admission")&&"unavailable"===o.kind==(null!==o.unavailable_classification)&&"execution_failed"===o.kind==(null!==o.execution_failure_classification)&&("cancelled"===o.kind||"timed_out"===o.kind)==(null!==o.cancellation_stage)&&null!==o.diagnostic===("string"==typeof o.kind&&["invalid_request","conflict","partial_effect","stale","unsupported","unavailable","execution_failed","reset_required","saturated"].includes(o.kind))&&(null===o.detail||!!("string"==typeof o.kind&&["stale","unsupported","unavailable","reset_required","saturated"].includes(o.kind)))&&o.retryable===("never"!==o.retry)&&void 0!==a&&o.retry_scope===a&&"after_delay"===o.retry==(null!==o.retry_after_millis)&&("partial_effect"===o.kind?"admitted_terminal"===o.terminality&&!1===o.retryable&&"never"===o.retry&&(r=o.committed_receipt,i=e.request_id,fu(r)&&r.request_id===i&&"partial"===r.outcome&&"string"==typeof r.operation&&"string"==typeof r.effect_class&&"string"==typeof r.idempotency_key&&"string"==typeof r.input_digest&&("string"==typeof r.committed_state||"string"==typeof r.external_proof))&&1===n.length&&"reconcile"===n[0]:"reset_required"===o.kind?"admitted_terminal"===o.terminality&&!1===o.retryable&&"never"===o.retry&&null===o.committed_receipt&&1===n.length&&"reset"===n[0]:"unavailable"===o.kind&&"authority"!==o.unavailable_classification?"admitted_terminal"===o.terminality&&!0===o.retryable&&"after_revalidate"===o.retry&&null===o.committed_receipt&&1===n.length&&"retry"===n[0]:"execution_failed"===o.kind?"admitted_terminal"===o.terminality&&!1===o.retryable&&"never"===o.retry&&null===o.committed_receipt&&1===n.length&&"contact_administrator"===n[0]:null===o.committed_receipt)}(i))throw new S8("the daemon returned a malformed problem envelope",{status:e.status,payload:i});let o=void 0===t||(c=[t],"not_found_or_not_authorized"===i.problem.kind?void 0===i.binding_id:c.some(e=>e===i.binding_id));if(e.ok||!o||void 0!==r&&i.request_id!==r||!function(e,t){switch(t){case"invalid_request":return 400===e;case"not_found_or_not_authorized":return 404===e;case"conflict":case"partial_effect":case"stale":return 409===e;case"unsupported":return 422===e;case"unavailable":case"reset_required":return 503===e;case"execution_failed":return 500===e;case"saturated":return 429===e;case"cancelled":return 408===e;case"timed_out":return 504===e;default:return!1}}(e.status,i.problem.kind))throw new S8("the daemon returned a malformed problem envelope",{status:e.status,payload:i});throw function(e,t){switch(t.problem.kind){case"not_found_or_not_authorized":return new ke(e,t);case"unavailable":return new kt(e,t);case"unsupported":return new kr(e,t);case"stale":return new ki(e,t);case"conflict":return new ko(e,t);case"partial_effect":return new kn(e,t);case"reset_required":return new ka(e,t);case"saturated":return new ks(e,t);case"cancelled":return new kd(e,t);case"timed_out":return new kc(e,t);case"invalid_request":return new kl(e,t);default:return new S7(e,t)}}(e.status,i)}return s}finally{i?.removeEventListener("abort",d);try{a||await s()}catch{}finally{o?.releaseLock()}}}async #p(e,t,r={}){var i,o,n,a;let s=e.decodeRequest(t);if("http"!==e.transport.kind){let t;if(void 0!==r.page||void 0!==r.deadlineMicros||void 0!==r.requestId)throw new S5(`${e.operation} does not accept HTTP transport options`);if(void 0===this.mcp)throw new S4(`${e.operation} requires an MCP tool adapter`);try{t=await this.mcp.callTool(e.transport.toolName,s,{signal:r.signal})}catch(t){if(r.signal?.aborted)throw new S6(r.signal.reason??t);throw new S4(`MCP tool ${e.transport.toolName} failed`,t)}try{return e.decodeResult(t)}catch(r){throw new S8(`MCP tool ${e.transport.toolName} returned an invalid ${e.operation} result`,{payload:{response:t,cause:r}})}}let d=this.operationUrl(e.transport.route,r.page),c=JSON.stringify(s);if(void 0===c)throw new S5(`${e.operation} request decoder returned a non-JSON value`);let l=this.headers("application/json");l.set("content-type","application/json");let p=(i=l,o=e,void 0!==(n=r).deadlineMicros&&(!Number.isSafeInteger(n.deadlineMicros)||n.deadlineMicros<=0)?"deadlineMicros must be a positive safe integer":"required"===o.requestIdControl&&void 0===n.requestId?`${o.operation} requires a stable requestId replay handle`:"server_minted"===o.requestIdControl&&void 0!==n.requestId?`${o.operation} uses a server-minted request ID`:void 0===n.requestId||(a=n.requestId).length>0&&a.trim()===a&&S2.encode(a).byteLength<=512&&!/\p{Cc}/u.test(a)?void(void 0!==n.deadlineMicros&&i.set("x-tracedecay-deadline-micros",String(n.deadlineMicros)),void 0!==n.requestId&&i.set("x-tracedecay-request-id",n.requestId)):"requestId is not a canonical request identity");if(void 0!==p)throw new S5(p);let u=await this.fetchResponse(d,{method:e.transport.method,headers:l,body:c,signal:r.signal},r.signal),m=await this.readJson(u,e.bindingId,r.requestId,r.signal);if(!km(m)||"success"!==m.kind)throw new S8("the daemon returned an unknown HTTP envelope",{status:u.status,payload:m});if(!u.ok)throw new S8("the daemon returned success with a failing HTTP status",{status:u.status,payload:m});try{let t=e.decodeSuccess(m.value);if(!(km(t)&&km(t.outcome)&&km(t.outcome.value)&&"payload"in t.outcome.value&&k_(t.outcome.value.execution))||("evidence"===t.outcome.outcome?"completed"===t.outcome.value.execution.termination&&null===t.outcome.value.payload:"preview"!==t.outcome.outcome&&"effect"!==t.outcome.outcome))throw TypeError("decoded application success invariants are invalid");if(void 0!==r.requestId&&t.request_id!==r.requestId)throw TypeError("daemon returned a different application request ID");if("fact_store_curate_receipt"===e.resultSemantics&&!await async function(e,t){if(!fu(e)||!fu(t)||!fu(t.outcome))return!1;let r=t.outcome,i=fu(r.value)?r.value.payload:void 0;if("effect"!==r.outcome||!fu(i)||!fh(t.request_id,512)||"request_digest,run_id,state,task"!==Object.keys(i).sort().join(",")||i.run_id!==t.request_id||"memory_curator"!==i.task||"started"!==i.state)return!1;let o=e.fact_review_limit??24,n=e.min_confidence_millionths??72e4;return!!fm(o)&&!(o<1)&&!(o>1e3)&&!!fm(n)&&!(n>1e6)&&!!await async function(e){return!!fu(e)&&"project_id,reference,repository_id,scope_digest,worktree_id"===Object.keys(e).sort().join(",")&&!!fh(e.project_id,512)&&!!fh(e.repository_id,512)&&!!fh(e.worktree_id,512)&&(null===e.reference||!!fh(e.reference,512))&&e.scope_digest===await fy(["tracedecay.application.scope.v1",e.project_id,e.repository_id,e.worktree_id,e.reference])}(t.scope)&&i.request_digest===await fy(["tracedecay.automation-run.request-identity.v1",{kind:"memory_curator",options:{fact_review_limit:o,min_confidence_millionths:n}}])}(s,t))throw TypeError("automatic curation receipt invariants are invalid");return t}catch(t){throw new S8(`the daemon returned an invalid ${e.operation} success envelope`,{status:u.status,payload:{envelope:m.value,cause:t}})}}async *streamOperation(e,t={}){let r=t.resume?.resumeToken,i=t.resume?.nextSequence===void 0?void 0:function(e,t){let r;if("number"==typeof e){if(!kf(e))throw new S5(`${t} must be an unsigned safe integer`);r=BigInt(e)}else if("bigint"==typeof e)r=e;else if(/^[0-9]+$/.test(e))r=BigInt(e);else throw new S5(`${t} must be unsigned decimal`);if(r<0n||r>0xffffffffffffffffn)throw new S5(`${t} exceeds the canonical u64 range`);return r.toString()}(t.resume.nextSequence,"resume nextSequence");if(void 0!==r&&!ky(r,4096))throw new S5("resumeToken is not a canonical stream resume token");let o=t.maxReconnects??0;if(!Number.isSafeInteger(o)||o<0)throw new S5("maxReconnects must be a non-negative integer");let n=0,a=0;for(;;){let d;if(t.signal?.aborted)throw new S6(t.signal.reason);let c=this.lifecycleUrl(e,"events");void 0!==i&&c.searchParams.set("next_sequence",i),void 0!==r&&c.searchParams.set("resume_token",r);try{d=await this.fetchResponse(c,{method:"GET",headers:this.headers("text/event-stream"),signal:t.signal},t.signal)}catch(e){if(0===n||n>=o||!(e instanceof S3))throw e;n+=1,await kb(a,t.signal);continue}let l=!1;try{if(!d.ok||null===d.body)throw await this.readJson(d,void 0,void 0,t.signal),new S8("the daemon did not open an SSE stream",{status:d.status});if(!kg(d,"text/event-stream"))throw new S8("the daemon opened an operation stream with an invalid media type",{status:d.status});try{for await(let t of k$(d.body)){void 0!==t.retryDelayMs&&(a=t.retryDelayMs);let o=function(e,t,r){let i=kv(e.data,t);if(!km(i)||"string"!=typeof i.event||i.event!==e.event||!km(i.data))throw new S8("the daemon returned a malformed SSE event",{status:t,payload:i});let o=i.event,n=i.data;if("open"===o){let e=n.frontier;if(n.correlation_id!==r||!km(e)||!kf(e.next_sequence)||!kf(e.retained_from_sequence)||e.retained_from_sequence>e.next_sequence||null!==e.resume_token&&"string"!=typeof e.resume_token)throw new S8("the daemon returned a malformed SSE open frontier",{status:t,payload:i});return{event:{...i,event:o,data:n},frontier:{..."string"==typeof e.resume_token?{resumeToken:e.resume_token}:{}}}}if(!kf(n.sequence)||null===e.id)throw new S8("the daemon returned an SSE event without a valid sequence",{status:t,payload:i});let a=String(n.sequence);if(e.id!==a)throw new S8("the SSE event ID does not match its canonical sequence",{status:t,payload:i});if("item"===o&&!("item"in n))throw new S8("the SSE item payload is missing",{status:t,payload:i});if("progress"===o&&(!kf(n.completed)||null!==n.total&&!kf(n.total)))throw new S8("the SSE progress payload is malformed",{status:t,payload:i});if("resume_gap"===o){let e=n.gap;if(!km(e)||!kf(e.first_missing_sequence)||!kf(e.last_missing_sequence)||e.first_missing_sequence!==n.sequence||e.first_missing_sequence>e.last_missing_sequence||!km(e.frontier)||!kf(e.frontier.next_sequence)||!kf(e.frontier.retained_from_sequence)||e.frontier.retained_from_sequence>e.frontier.next_sequence||e.last_missing_sequence>=e.frontier.next_sequence||null!==e.frontier.resume_token&&"string"!=typeof e.frontier.resume_token)throw new S8("the SSE resume gap is malformed",{status:t,payload:i})}if(kp.has(o)){let e=n.terminal;if(!km(e)||!k_(e.receipt))throw new S8("the SSE terminal event is malformed",{status:t,payload:i});if(e.termination!==o||e.receipt.termination!==o)throw new S8("the SSE terminal event is inconsistent",{status:t,payload:i})}let s={...i,event:o,data:n};if("resume_gap"===o){let e=n.gap,t=e.frontier;return{event:s,sequence:a,lastSequence:String(e.last_missing_sequence),frontier:{..."string"==typeof t.resume_token?{resumeToken:t.resume_token}:{}}}}return{event:s,sequence:a}}(t,d.status,e);if(void 0!==o.sequence){var s;let e=i??"0",r=(s=o.lastSequence??o.sequence,(BigInt(s)+1n).toString()),n=kp.has(t.event);if(!n&&BigInt(o.sequence)=o){if(e instanceof S3)throw e;throw new S3(`operation stream disconnected after ${n} reconnects`,e)}}}catch(e){throw l=!0,e}finally{try{await d.body?.cancel()}catch(e){if(!l)throw new S3("failed to close operation stream transport",e)}}if(n>=o)throw new S3(`operation stream ended before a terminal event after ${n} reconnects`);if(void 0===i||void 0===r)throw new S3("operation stream ended before exposing a resumable frontier");n+=1,await kb(a,t.signal)}}async cancelOperation(e,t={}){let r=await this.fetchResponse(this.lifecycleUrl(e,"cancel"),{method:"POST",headers:this.headers("application/json"),signal:t.signal},t.signal),i=await this.readJson(r,void 0,void 0,t.signal);if(!km(i))throw new S8("the daemon returned a malformed cancellation response",{status:r.status,payload:i});let o=i.status,n="requested"===o&&202===r.status||("already_requested"===o||"already_terminal"===o)&&200===r.status;if(!r.ok||"requested"!==o&&"already_requested"!==o&&"already_terminal"!==o||!n)throw new S8("the daemon returned a malformed cancellation response",{status:r.status,payload:i});return{...i,status:o}}}function kk(e){let t=S0.find(t=>t.operation===e);if(void 0===t||"mcp_tool"!==t.transport.kind)throw TypeError(`${e} is not an MCP-backed operation in the canonical catalog`);return t}let kw=kk("project_list"),kP=kk("project_search"),kV=kk("project_context");class kR{#u;constructor(e){this.#u=e}projectList(e,t){return this.#m(kw,e,t)}projectContext(e,t){return this.#m(kV,e,t)}projectSearch(e,t){return this.#m(kP,e,t)}async #m(e,t,r){let i,o=e.transport.toolName,n=e.decodeRequest(t);try{if(r?.aborted||(i=await this.#u(o,n,r),r?.aborted))throw new S6(r.reason)}catch(e){if(r?.aborted)throw new S6(r.reason);throw new S4(`MCP tool ${o} failed`,e)}try{return e.decodeResult(i)}catch(t){throw new S8(`MCP tool ${o} returned an invalid ${e.operation} result`,{payload:{response:i,cause:t}})}}}var kq=Object.create,kI=Object.defineProperty,kx=Object.getOwnPropertyDescriptor,kj=Object.getOwnPropertyNames,kC=Object.getPrototypeOf,kT=Object.prototype.hasOwnProperty,kO=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let kE=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),kA=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),kW=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),kM=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),kN=Symbol.for("mcp.sdk.errorBrands");function kz(e,t){let r=new Set,i=t;for(;"function"==typeof i;){let e=i.mcpBrand;Object.prototype.hasOwnProperty.call(i,"mcpBrand")&&"string"==typeof e&&r.add(e),i=Object.getPrototypeOf(i)}0!==r.size&&Object.defineProperty(e,kN,{value:r,enumerable:!1,configurable:!0})}function kD(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,kN)){let r=t[kN];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return kD(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kD(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",kz(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});let kF=((X={}).NotConnected="NOT_CONNECTED",X.AlreadyConnected="ALREADY_CONNECTED",X.NotInitialized="NOT_INITIALIZED",X.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",X.RequestTimeout="REQUEST_TIMEOUT",X.ConnectionClosed="CONNECTION_CLOSED",X.SendFailed="SEND_FAILED",X.InvalidResult="INVALID_RESULT",X.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",X.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",X.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",X.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",X.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",X.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",X.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",X.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",X.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",X.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",X.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",X);var kL=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return kD(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kD(this,e)}constructor(e,t,r,i){super(t,i),this.code=e,this.data=r,this.name="SdkError",kz(this,new.target)}},kU=class extends kL{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,i){super(e,t,r,i),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};let kH="2026-07-28",kG=[kH];function kB(e){return e.filter(e=>!(e>=kH))}function kK(e){return e.filter(e=>e>=kH)}function kJ(e){let t=e.structuredContent;return void 0===t||!("object"!=typeof t||null===t||Array.isArray(t))||e.content?.some(e=>"text"===e.type)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}let kZ=["task","inputRequests","requestState"];function kQ(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||kZ.some(t=>t in e)?e:{...e,content:[]}}function kX(){let e,t,r,i,o,n,a,s,c,l,p,u,m,f,h,y,g,_,v,b,$,S,k,w,P,V,R,q,I,x,j,C,T,O,E,A,W,M,N,z,D,F,L,U,H,G,B,K,J,Z,Q,X,Y,ee,et,er,ei,eo,en,ea,es,ed,ec,el,ep,eu,em,ef,eh,ey,eg,e_,ev,eb,e$,eS,ek,ew,eP,eV,eR,eq,eI,ex,ej,eC,eT,eO,eE,eA,eW,eM,eN,ez,eD,eF,eL,eU,eH,eG,eB,eK,eJ,eZ,eQ,eX,eY,e1,e0,e2,e4,e6,e3,e9,e5,e8,e7,te,tt,tr,ti,to,tn,ta,ts,td,tc,tl,tp,tu,tm,tf,th,ty,tg,t_,tv,tb,t$,tS;return d??=(e=ao(()=>nD([o5(),nk(),nR(),nI(),nB(o5(),e),nA(e)])),t=nB(o5(),e),r=nD([o5(),nk().int()]),i=o5(),o=nM({ttl:nk().optional()}),n=nM({taskId:o5()}),c=(s=nM({_meta:(a=nN({progressToken:r.optional(),"io.modelcontextprotocol/related-task":n.optional()})).optional()})).extend({task:o.optional()}),l=nM({method:o5(),params:s.loose().optional()}),p=nM({_meta:a.optional()}),u=nM({method:o5(),params:p.loose().optional()}),m=nN({_meta:a.optional()}),f=nD([o5(),nk().int()]),h=m.strict(),y=p.extend({requestId:f.optional(),reason:o5().optional()}),g=u.extend({method:nQ("notifications/cancelled"),params:y}),_=nM({src:o5(),mimeType:o5().optional(),sizes:nA(o5()).optional(),theme:nJ(["light","dark"]).optional()}),v=nM({icons:nA(_).optional()}),$=(b=nM({name:o5(),title:o5().optional()})).extend({...b.shape,...v.shape,version:o5(),websiteUrl:o5().optional(),description:o5().optional()}),S=nH(nM({applyDefaults:nR().optional()}),t),k=aa(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nH(nM({form:S.optional(),url:t.optional()}),t.optional())),w=nN({list:t.optional(),cancel:t.optional(),requests:nN({sampling:nN({createMessage:t.optional()}).optional(),elicitation:nN({create:t.optional()}).optional()}).optional()}),P=nN({list:t.optional(),cancel:t.optional(),requests:nN({tools:nN({call:t.optional()}).optional()}).optional()}),V=nM({experimental:nB(o5(),t).optional(),sampling:nM({context:t.optional(),tools:t.optional()}).optional(),elicitation:k.optional(),roots:nM({listChanged:nR().optional()}).optional(),tasks:w.optional(),extensions:nB(o5(),t).optional()}),R=s.extend({protocolVersion:o5(),capabilities:V,clientInfo:$}),q=l.extend({method:nQ("initialize"),params:R}),I=nM({experimental:nB(o5(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nM({listChanged:nR().optional()}).optional(),resources:nM({subscribe:nR().optional(),listChanged:nR().optional()}).optional(),tools:nM({listChanged:nR().optional()}).optional(),tasks:P.optional(),extensions:nB(o5(),t).optional()}),x=m.extend({protocolVersion:o5(),capabilities:I,serverInfo:$,instructions:o5().optional()}),j=u.extend({method:nQ("notifications/initialized"),params:p.optional()}),C=l.extend({method:nQ("ping"),params:s.optional()}),T=nM({progress:nk(),total:n0(nk()),message:n0(o5())}),O=nM({...p.shape,...T.shape,progressToken:r}),E=u.extend({method:nQ("notifications/progress"),params:O}),A=s.extend({cursor:i.optional()}),W=l.extend({params:A.optional()}),M=m.extend({nextCursor:i.optional()}),z=(N=nM({uri:o5(),mimeType:n0(o5()),_meta:nB(o5(),nT()).optional()})).extend({text:o5()}),D=o5().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),F=N.extend({blob:D}),U=nM({audience:nA(L=nJ(["user","assistant"])).optional(),priority:nk().min(0).max(1).optional(),lastModified:as({offset:!0}).optional()}),H=nM({...b.shape,...v.shape,uri:o5(),description:n0(o5()),mimeType:n0(o5()),size:n0(nk()),annotations:U.optional(),_meta:n0(nN({}))}),G=nM({...b.shape,...v.shape,uriTemplate:o5(),description:n0(o5()),mimeType:n0(o5()),annotations:U.optional(),_meta:n0(nN({}))}),B=W.extend({method:nQ("resources/list")}),K=M.extend({resources:nA(H)}),J=W.extend({method:nQ("resources/templates/list")}),Z=M.extend({resourceTemplates:nA(G)}),Q=s.extend({uri:o5()}),X=l.extend({method:nQ("resources/read"),params:Q}),Y=m.extend({contents:nA(nD([z,F]))}),ee=u.extend({method:nQ("notifications/resources/list_changed"),params:p.optional()}),et=l.extend({method:nQ("resources/subscribe"),params:Q}),er=l.extend({method:nQ("resources/unsubscribe"),params:Q}),ei=p.extend({uri:o5()}),eo=u.extend({method:nQ("notifications/resources/updated"),params:ei}),en=nM({name:o5(),description:n0(o5()),required:n0(nR())}),ea=nM({...b.shape,...v.shape,description:n0(o5()),arguments:n0(nA(en)),_meta:n0(nN({}))}),es=W.extend({method:nQ("prompts/list")}),ed=M.extend({prompts:nA(ea)}),ec=s.extend({name:o5(),arguments:nB(o5(),o5()).optional()}),el=l.extend({method:nQ("prompts/get"),params:ec}),ep=nM({type:nQ("text"),text:o5(),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),eu=nM({type:nQ("image"),data:D,mimeType:o5(),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),em=nM({type:nQ("audio"),data:D,mimeType:o5(),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),ef=nM({type:nQ("tool_use"),name:o5(),id:o5(),input:nB(o5(),nT()),_meta:nB(o5(),nT()).optional()}),eh=nM({type:nQ("resource"),resource:nD([z,F]),annotations:U.optional(),_meta:nB(o5(),nT()).optional()}),e_=nM({role:L,content:eg=nD([ep,eu,em,ey=H.extend({type:nQ("resource_link")}),eh])}),ev=m.extend({description:o5().optional(),messages:nA(e_)}),eb=u.extend({method:nQ("notifications/prompts/list_changed"),params:p.optional()}),e$=nM({title:o5().optional(),readOnlyHint:nR().optional(),destructiveHint:nR().optional(),idempotentHint:nR().optional(),openWorldHint:nR().optional()}),eS=nM({taskSupport:nJ(["required","optional","forbidden"]).optional()}),ek=nM({...b.shape,...v.shape,description:o5().optional(),inputSchema:nM({type:nQ("object"),properties:nB(o5(),e).optional(),required:nA(o5()).optional()}).catchall(nT()),outputSchema:nM({type:nQ("object"),properties:nB(o5(),e).optional(),required:nA(o5()).optional()}).catchall(nT()).optional(),annotations:e$.optional(),execution:eS.optional(),_meta:nB(o5(),nT()).optional()}),ew=W.extend({method:nQ("tools/list")}),eP=M.extend({tools:nA(ek)}),eV=m.extend({content:nA(eg),structuredContent:nB(o5(),nT()).optional(),isError:nR().optional()}),eR=c.extend({name:o5(),arguments:nB(o5(),nT()).optional()}),eq=l.extend({method:nQ("tools/call"),params:eR}),eI=u.extend({method:nQ("notifications/tools/list_changed"),params:p.optional()}),ex=nJ(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=s.extend({level:ex}),eC=l.extend({method:nQ("logging/setLevel"),params:ej}),eT=p.extend({level:ex,logger:o5().optional(),data:nT()}),eO=u.extend({method:nQ("notifications/message"),params:eT}),eE=nM({name:o5().optional()}),eA=nM({hints:nA(eE).optional(),costPriority:nk().min(0).max(1).optional(),speedPriority:nk().min(0).max(1).optional(),intelligencePriority:nk().min(0).max(1).optional()}),eW=nM({mode:nJ(["auto","required","none"]).optional()}),eM=nM({type:nQ("tool_result"),toolUseId:o5().describe("The unique identifier for the corresponding tool call."),content:nA(eg),structuredContent:nM({}).loose().optional(),isError:nR().optional(),_meta:nB(o5(),nT()).optional()}),eN=nL("type",[ep,eu,em]),eD=nM({role:L,content:nD([ez=nL("type",[ep,eu,em,ef,eM]),nA(ez)]),_meta:nB(o5(),nT()).optional()}),eF=c.extend({messages:nA(eD),modelPreferences:eA.optional(),systemPrompt:o5().optional(),includeContext:nJ(["none","thisServer","allServers"]).optional(),temperature:nk().optional(),maxTokens:nk().int(),stopSequences:nA(o5()).optional(),metadata:t.optional(),tools:nA(ek).optional(),toolChoice:eW.optional()}),eL=l.extend({method:nQ("sampling/createMessage"),params:eF}),eU=m.extend({model:o5(),stopReason:n0(nJ(["endTurn","stopSequence","maxTokens"]).or(o5())),role:L,content:eN}),eH=m.extend({model:o5(),stopReason:n0(nJ(["endTurn","stopSequence","maxTokens","toolUse"]).or(o5())),role:L,content:nD([ez,nA(ez)])}),eG=nM({type:nQ("boolean"),title:o5().optional(),description:o5().optional(),default:nR().optional()}),eB=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),minLength:nk().optional(),maxLength:nk().optional(),format:nJ(["email","uri","date","date-time"]).optional(),default:o5().optional()}),eK=nM({type:nJ(["number","integer"]),title:o5().optional(),description:o5().optional(),minimum:nk().optional(),maximum:nk().optional(),default:nk().optional()}),eJ=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),default:o5().optional()}),eZ=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),oneOf:nA(nM({const:o5(),title:o5()})),default:o5().optional()}),eQ=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),enumNames:nA(o5()).optional(),default:o5().optional()}),eX=nD([eJ,eZ]),eY=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({type:nQ("string"),enum:nA(o5())}),default:nA(o5()).optional()}),e0=nD([eY,e1=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({anyOf:nA(nM({const:o5(),title:o5()}))}),default:nA(o5()).optional()})]),e2=nD([eQ,eX,e0]),e4=nD([e2,eG,eB,eK]),e6=c.extend({mode:nQ("form").optional(),message:o5(),requestedSchema:nM({type:nQ("object"),properties:nB(o5(),e4),required:nA(o5()).optional()}).catchall(nT())}),e9=nD([e6,e3=c.extend({mode:nQ("url"),message:o5(),elicitationId:o5(),url:o5().url()})]),e5=l.extend({method:nQ("elicitation/create"),params:e9}),e8=p.extend({elicitationId:o5()}),e7=u.extend({method:nQ("notifications/elicitation/complete"),params:e8}),te=m.extend({action:nJ(["accept","decline","cancel"]),content:aa(e=>null===e?void 0:e,nB(o5(),nD([o5(),nk(),nR(),nA(o5())])).optional())}),tt=nM({type:nQ("ref/resource"),uri:o5()}),tr=nM({type:nQ("ref/prompt"),name:o5()}),ti=s.extend({ref:nD([tr,tt]),argument:nM({name:o5(),value:o5()}),context:nM({arguments:nB(o5(),o5()).optional()}).optional()}),to=l.extend({method:nQ("completion/complete"),params:ti}),tn=m.extend({completion:nN({values:nA(o5()).max(100),total:n0(nk().int()),hasMore:n0(nR())})}),ta=nM({uri:o5().startsWith("file://"),name:o5().optional(),_meta:nB(o5(),nT()).optional()}),ts=l.extend({method:nQ("roots/list"),params:s.optional()}),td=m.extend({roots:nA(ta)}),tc=u.extend({method:nQ("notifications/roots/list_changed"),params:p.optional()}),tl=nN({ttl:nk().optional(),pollInterval:nk().optional()}),tp=nJ(["working","input_required","completed","failed","cancelled"]),tu=nM({taskId:o5(),status:tp,ttl:nD([nk(),nI()]),createdAt:o5(),lastUpdatedAt:o5(),pollInterval:n0(nk()),statusMessage:n0(o5())}),tm=m.extend({task:tu}),tf=p.merge(tu),th=u.extend({method:nQ("notifications/tasks/status"),params:tf}),ty=l.extend({method:nQ("tasks/get"),params:s.extend({taskId:o5()})}),tg=m.merge(tu),t_=l.extend({method:nQ("tasks/result"),params:s.extend({taskId:o5()})}),tv=m.loose(),tb=W.extend({method:nQ("tasks/list")}),t$=M.extend({tasks:nA(tu)}),tS=l.extend({method:nQ("tasks/cancel"),params:s.extend({taskId:o5()})}),{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:i,TaskMetadataSchema:o,RelatedTaskMetadataSchema:n,RequestMetaSchema:a,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:p,NotificationSchema:u,ResultSchema:m,RequestIdSchema:f,EmptyResultSchema:h,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:b,ImplementationSchema:$,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:P,ClientCapabilitiesSchema:V,InitializeRequestParamsSchema:R,InitializeRequestSchema:q,ServerCapabilitiesSchema:I,InitializeResultSchema:x,InitializedNotificationSchema:j,PingRequestSchema:C,ProgressSchema:T,ProgressNotificationParamsSchema:O,ProgressNotificationSchema:E,PaginatedRequestParamsSchema:A,PaginatedRequestSchema:W,PaginatedResultSchema:M,ResourceContentsSchema:N,TextResourceContentsSchema:z,BlobResourceContentsSchema:F,RoleSchema:L,AnnotationsSchema:U,ResourceSchema:H,ResourceTemplateSchema:G,ListResourcesRequestSchema:B,ListResourcesResultSchema:K,ListResourceTemplatesRequestSchema:J,ListResourceTemplatesResultSchema:Z,ResourceRequestParamsSchema:Q,ReadResourceRequestParamsSchema:Q,ReadResourceRequestSchema:X,ReadResourceResultSchema:Y,ResourceListChangedNotificationSchema:ee,SubscribeRequestParamsSchema:Q,SubscribeRequestSchema:et,UnsubscribeRequestParamsSchema:Q,UnsubscribeRequestSchema:er,ResourceUpdatedNotificationParamsSchema:ei,ResourceUpdatedNotificationSchema:eo,PromptArgumentSchema:en,PromptSchema:ea,ListPromptsRequestSchema:es,ListPromptsResultSchema:ed,GetPromptRequestParamsSchema:ec,GetPromptRequestSchema:el,TextContentSchema:ep,ImageContentSchema:eu,AudioContentSchema:em,ToolUseContentSchema:ef,EmbeddedResourceSchema:eh,ResourceLinkSchema:ey,ContentBlockSchema:eg,PromptMessageSchema:e_,GetPromptResultSchema:ev,PromptListChangedNotificationSchema:eb,ToolAnnotationsSchema:e$,ToolExecutionSchema:eS,ToolSchema:ek,ListToolsRequestSchema:ew,ListToolsResultSchema:eP,CallToolResultSchema:eV,CallToolRequestParamsSchema:eR,CallToolRequestSchema:eq,ToolListChangedNotificationSchema:eI,LoggingLevelSchema:ex,SetLevelRequestParamsSchema:ej,SetLevelRequestSchema:eC,LoggingMessageNotificationParamsSchema:eT,LoggingMessageNotificationSchema:eO,ModelHintSchema:eE,ModelPreferencesSchema:eA,ToolChoiceSchema:eW,ToolResultContentSchema:eM,SamplingContentSchema:eN,SamplingMessageContentBlockSchema:ez,SamplingMessageSchema:eD,CreateMessageRequestParamsSchema:eF,CreateMessageRequestSchema:eL,CreateMessageResultSchema:eU,CreateMessageResultWithToolsSchema:eH,BooleanSchemaSchema:eG,StringSchemaSchema:eB,NumberSchemaSchema:eK,UntitledSingleSelectEnumSchemaSchema:eJ,TitledSingleSelectEnumSchemaSchema:eZ,LegacyTitledEnumSchemaSchema:eQ,SingleSelectEnumSchemaSchema:eX,UntitledMultiSelectEnumSchemaSchema:eY,TitledMultiSelectEnumSchemaSchema:e1,MultiSelectEnumSchemaSchema:e0,EnumSchemaSchema:e2,PrimitiveSchemaDefinitionSchema:e4,ElicitRequestFormParamsSchema:e6,ElicitRequestURLParamsSchema:e3,ElicitRequestParamsSchema:e9,ElicitRequestSchema:e5,ElicitationCompleteNotificationParamsSchema:e8,ElicitationCompleteNotificationSchema:e7,ElicitResultSchema:te,ResourceTemplateReferenceSchema:tt,PromptReferenceSchema:tr,CompleteRequestParamsSchema:ti,CompleteRequestSchema:to,CompleteResultSchema:tn,RootSchema:ta,ListRootsRequestSchema:ts,ListRootsResultSchema:td,RootsListChangedNotificationSchema:tc,TaskCreationParamsSchema:tl,TaskStatusSchema:tp,TaskSchema:tu,CreateTaskResultSchema:tm,TaskStatusNotificationParamsSchema:tf,TaskStatusNotificationSchema:th,GetTaskRequestSchema:ty,GetTaskResultSchema:tg,GetTaskPayloadRequestSchema:t_,GetTaskPayloadResultSchema:tv,ListTasksRequestSchema:tb,ListTasksResultSchema:t$,CancelTaskRequestSchema:tS,CancelTaskResultSchema:m.merge(tu),ClientRequestSchema:nD([C,q,to,eC,el,es,B,J,X,et,er,eq,ew,ty,t_,tb,tS]),ClientNotificationSchema:nD([g,E,j,tc,th]),ClientResultSchema:nD([h,eU,eH,te,td,tg,t$,tm]),ServerRequestSchema:nD([C,eL,e5,ts,ty,t_,tb,tS]),ServerNotificationSchema:nD([g,E,eO,eo,ee,eI,eb,th,e7]),ServerResultSchema:nD([h,x,tn,ev,ed,K,Z,Y,eV,eP,tg,t$,tm]),CallToolResultWireSchema:nT().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of kZ)if(r in e)return void t.addIssue({code:"custom",message:`content is required when the body carries '${r}' — another result family cannot default into an empty tools/call success`})}}).transform(kQ).pipe(eV)})}function kY(e){return"object"!==e.type}let k1=new Set(["const","enum","default","examples"]),k0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function k2(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let k4={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},k6={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},k3={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function k9(){if(c)return c;let e=kX();return c={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}}}function k5(e){return Object.prototype.hasOwnProperty.call(k4,e)}function k8(e){return Object.prototype.hasOwnProperty.call(k6,e)}function k7(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function we(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(k4),Object.keys(k6);let wt={ok:!1,reason:"not-in-era"};function wr(e){return k7(e)&&k7(e.outputSchema)&&kY(e.outputSchema)}let wi={era:"2025-11-25",hasRequestMethod:k5,hasNotificationMethod:k8,validateRequest:(e,t)=>we(k5(e)?k9().requestSchemas[e]:void 0,t),validateResult:(e,t)=>we(Object.prototype.hasOwnProperty.call(k3,e)?k9().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>we(k8(e)?k9().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>wt,validateInputResponse:()=>wt,samplingResultVariant:(e,t)=>{let r=kX();return we(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=kJ(e),i=r.structuredContent;if(void 0===i)return r;let o="object"!=typeof i||null===i||Array.isArray(i),n=void 0!==t&&kY(t);return o||n?{...r,structuredContent:{result:i}}:r},decodeResult(e,t){if(k7(t)&&"resultType"in t){let e={...t};return delete e.resultType,{kind:"complete",result:e}}return{kind:"complete",result:t}},encodeResult(e,t){if("tools/list"!==e)return t;let r=t.tools;return Array.isArray(r)&&r.some(e=>wr(e))?{...t,tools:r.map(e=>wr(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(k2(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let i="string"==typeof(t=e.$schema)&&kA.has(t.replace(/#$/,""))&&!0!==e.$recursiveAnchor,o=(e,t)=>{if(Array.isArray(e))return e.map(e=>o(e,!1));if(null===e||"object"!=typeof e||!t&&k2(e.$id))return e;let r={},n=!1;for(let[a,s]of Object.entries(e))t?r[a]=o(s,!1):("$ref"===a||"$dynamicRef"===a)&&"string"==typeof s?r[a]="#"===s?"#/properties/result":s.startsWith("#/")?`#/properties/result${s.slice(1)}`:s:"$recursiveRef"===a&&"#"===s&&i?n=!0:k1.has(a)?r[a]=s:k0.has(a)?r[a]=o(s,!0):r[a]=o(s,!1);return n&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...void 0!==r&&{$schema:r},type:"object",properties:{result:o(e,!1)},required:["result"]}}(e.outputSchema)}:e)}:t},encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope:e=>void 0};function wo(){return l??=function(){let e=ao(()=>nD([o5(),nk(),nR(),nI(),nB(o5(),e),nA(e)])),t=nB(o5(),e),r=nD([o5(),nk().int()]),i=o5(),o=nD([o5(),nk().int()]),n=nJ(["user","assistant"]),a=nJ(["debug","info","notice","warning","error","critical","alert","emergency"]),s=o5().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),d=nM({ttl:nk().optional()}),c=nM({taskId:o5()}),l=nN({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),p=nM({_meta:l.optional()}),u=p.extend({task:d.optional()}),m=nM({_meta:l.optional()}),f=nM({method:o5(),params:m.loose().optional()}),h=nM({src:o5(),mimeType:o5().optional(),sizes:nA(o5()).optional(),theme:nJ(["light","dark"]).optional()}),y=nM({icons:nA(h).optional()}),g=nM({name:o5(),title:o5().optional()}),_=g.extend({...g.shape,...y.shape,version:o5(),websiteUrl:o5().optional(),description:o5().optional()}),v=nH(nM({applyDefaults:nR().optional()}),t),b=aa(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nH(nM({form:v.optional(),url:t.optional()}),t.optional())),$=nN({list:t.optional(),cancel:t.optional(),requests:nN({sampling:nN({createMessage:t.optional()}).optional(),elicitation:nN({create:t.optional()}).optional()}).optional()}),S=nN({list:t.optional(),cancel:t.optional(),requests:nN({tools:nN({call:t.optional()}).optional()}).optional()}),k=nM({experimental:nB(o5(),t).optional(),sampling:nM({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:nM({listChanged:nR().optional()}).optional(),tasks:$.optional(),extensions:nB(o5(),t).optional()}),w=nM({experimental:nB(o5(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nM({listChanged:nR().optional()}).optional(),resources:nM({subscribe:nR().optional(),listChanged:nR().optional()}).optional(),tools:nM({listChanged:nR().optional()}).optional(),tasks:S.optional(),extensions:nB(o5(),t).optional()}),P=nM({progress:nk(),total:n0(nk()),message:n0(o5())}),V=nM({...m.shape,...P.shape,progressToken:r}),R=f.extend({method:nQ("notifications/progress"),params:V}),q=m.extend({level:a,logger:o5().optional(),data:nT()}),I=f.extend({method:nQ("notifications/message"),params:q}),x=nM({uri:o5(),mimeType:n0(o5()),_meta:nB(o5(),nT()).optional()}),j=x.extend({text:o5()}),C=x.extend({blob:s}),T=nM({audience:nA(n).optional(),priority:nk().min(0).max(1).optional(),lastModified:as({offset:!0}).optional()}),O=nM({...g.shape,...y.shape,uri:o5(),description:n0(o5()),mimeType:n0(o5()),size:n0(nk()),annotations:T.optional(),_meta:n0(nN({}))}),E=nM({...g.shape,...y.shape,uriTemplate:o5(),description:n0(o5()),mimeType:n0(o5()),annotations:T.optional(),_meta:n0(nN({}))}),A=f.extend({method:nQ("notifications/resources/list_changed"),params:m.optional()}),W=m.extend({uri:o5()}),M=f.extend({method:nQ("notifications/resources/updated"),params:W}),N=nM({name:o5(),description:n0(o5()),required:n0(nR())}),z=nM({...g.shape,...y.shape,description:n0(o5()),arguments:n0(nA(N)),_meta:n0(nN({}))}),D=f.extend({method:nQ("notifications/prompts/list_changed"),params:m.optional()}),F=nM({type:nQ("text"),text:o5(),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),L=nM({type:nQ("image"),data:s,mimeType:o5(),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),U=nM({type:nQ("audio"),data:s,mimeType:o5(),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),H=nM({type:nQ("tool_use"),name:o5(),id:o5(),input:nB(o5(),nT()),_meta:nB(o5(),nT()).optional()}),G=nM({type:nQ("resource"),resource:nD([j,C]),annotations:T.optional(),_meta:nB(o5(),nT()).optional()}),B=O.extend({type:nQ("resource_link")}),K=nD([F,L,U,B,G]),J=nM({role:n,content:K}),Z=nM({title:o5().optional(),readOnlyHint:nR().optional(),destructiveHint:nR().optional(),idempotentHint:nR().optional(),openWorldHint:nR().optional()}),Q=f.extend({method:nQ("notifications/tools/list_changed"),params:m.optional()}),X=nM({name:o5().optional()}),Y=nM({hints:nA(X).optional(),costPriority:nk().min(0).max(1).optional(),speedPriority:nk().min(0).max(1).optional(),intelligencePriority:nk().min(0).max(1).optional()}),ee=nM({mode:nJ(["auto","required","none"]).optional()}),et=nM({type:nQ("boolean"),title:o5().optional(),description:o5().optional(),default:nR().optional()}),er=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),minLength:nk().optional(),maxLength:nk().optional(),format:nJ(["email","uri","date","date-time"]).optional(),default:o5().optional()}),ei=nM({type:nJ(["number","integer"]),title:o5().optional(),description:o5().optional(),minimum:nk().optional(),maximum:nk().optional(),default:nk().optional()}),eo=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),default:o5().optional()}),en=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),oneOf:nA(nM({const:o5(),title:o5()})),default:o5().optional()}),ea=nM({type:nQ("string"),title:o5().optional(),description:o5().optional(),enum:nA(o5()),enumNames:nA(o5()).optional(),default:o5().optional()}),es=nD([eo,en]),ed=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({type:nQ("string"),enum:nA(o5())}),default:nA(o5()).optional()}),ec=nM({type:nQ("array"),title:o5().optional(),description:o5().optional(),minItems:nk().optional(),maxItems:nk().optional(),items:nM({anyOf:nA(nM({const:o5(),title:o5()}))}),default:nA(o5()).optional()}),el=nD([ed,ec]),ep=nD([ea,es,el]),eu=nD([ep,et,er,ei]),em=u.extend({mode:nQ("form").optional(),message:o5(),requestedSchema:nM({type:nQ("object"),properties:nB(o5(),eu),required:nA(o5()).optional()}).catchall(nT())}),ef=nM({type:nQ("ref/resource"),uri:o5()}),eh=nM({type:nQ("ref/prompt"),name:o5()}),ey=nM({uri:o5().startsWith("file://"),name:o5().optional(),_meta:nB(o5(),nT()).optional()}),eg=k.shape,e_=nM({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),ev=w.shape,eb=nM({experimental:ev.experimental,logging:ev.logging,completions:ev.completions,prompts:ev.prompts,resources:ev.resources,tools:ev.tools,extensions:ev.extensions}),e$=nN({progressToken:r.optional(),[al]:o5(),[ap]:_.optional(),[am]:e_,[ah]:a.optional()}),eS=nM({...g.shape,...y.shape,description:o5().optional(),inputSchema:nN({$schema:o5().optional(),type:nQ("object")}),outputSchema:nN({$schema:o5().optional()}).optional(),annotations:Z.optional(),_meta:nB(o5(),nT()).optional()}),ek=nM({type:nQ("tool_result"),toolUseId:o5(),content:nA(K),structuredContent:nT().optional(),isError:nR().optional(),_meta:nB(o5(),nT()).optional()}),ew=nD([F,L,U,H,ek]),eP=nM({role:n,content:nD([ew,nA(ew)]),_meta:nB(o5(),nT()).optional()}),eV=o5(),eR=nN({[au]:_.optional().catch(void 0)}),eq=eR.optional();function eI(e){return nN({_meta:eq,resultType:eV.default("complete"),...e})}let ex=eI({}),ej=eI({nextCursor:i.optional()}),eC=eI({content:nA(K),structuredContent:nT().optional(),isError:nR().optional()}),eT=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),tools:nA(eS),nextCursor:i.optional()}),eO=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),prompts:nA(z),nextCursor:i.optional()}),eE=eI({description:o5().optional(),messages:nA(J)}),eA=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resources:nA(O),nextCursor:i.optional()}),eW=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resourceTemplates:nA(E),nextCursor:i.optional()}),eM=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),contents:nA(nD([j,C]))}),eN=eI({completion:nM({values:nA(o5()).max(100),total:nk().int().optional(),hasMore:nR().optional()}).loose()}),ez=eI({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"])}),eD=eI({ttlMs:nk().int().min(0).catch(0),cacheScope:nJ(["public","private"]).catch("private"),supportedVersions:nA(o5()),capabilities:eb,instructions:o5().optional()}),eF=nM({messages:nA(eP),modelPreferences:Y.optional(),systemPrompt:o5().optional(),includeContext:nJ(["none","thisServer","allServers"]).optional(),temperature:nk().optional(),maxTokens:nk().int(),stopSequences:nA(o5()).optional(),metadata:t.optional(),tools:nA(eS).optional(),toolChoice:ee.optional()}),eL=nM({method:nQ("sampling/createMessage"),params:eF}),eU=nM({method:nQ("roots/list"),params:nM({_meta:nB(o5(),nT()).optional()}).optional()}),eH=nM({...eP.shape,model:o5(),stopReason:o5().optional()}),eG=nM({roots:nA(ey)}),eB=nM({action:nJ(["accept","decline","cancel"]),content:nB(o5(),nD([o5(),nk(),nR(),nA(o5())])).optional()}),eK=nM({mode:nQ("url"),message:o5(),url:o5().url()}),eJ=nD([em,eK]),eZ=nM({method:nQ("elicitation/create"),params:eJ}),eQ=nD([eL,eU,eZ]),eX=nD([eH,eG,eB]),eY=nB(o5(),eQ),e1=nB(o5(),eX),e0=eI({inputRequests:eY.optional(),requestState:o5().optional()}),e2={inputResponses:e1.optional(),requestState:o5().optional()},e4=nM({_meta:e$,...e2}),e6=nN({progressToken:r.optional()});function e3(e,t){return nM({method:nQ(e),params:nM({_meta:e$,...t})})}function e9(e,t){return nM({method:nQ(e),params:nM({_meta:e6.optional(),...t}).optional()})}let e5={name:o5(),arguments:nB(o5(),nT()).optional(),...e2},e8={cursor:i.optional()},e7=e3("tools/call",e5),te=e3("tools/list",e8),tt=e3("prompts/list",e8),tr=e3("prompts/get",{name:o5(),arguments:nB(o5(),o5()).optional(),...e2}),ti=e3("resources/list",e8),to=e3("resources/templates/list",e8),tn=e3("resources/read",{uri:o5(),...e2}),ta={ref:nD([eh,ef]),argument:nM({name:o5(),value:o5()}),context:nM({arguments:nB(o5(),o5()).optional()}).optional()},ts=e3("completion/complete",ta),td=e3("server/discover",{}),tc=nM({toolsListChanged:nR().optional(),promptsListChanged:nR().optional(),resourcesListChanged:nR().optional(),resourceSubscriptions:nA(o5()).optional()}),tl={notifications:tc},tp=e3("subscriptions/listen",tl),tu=eR.extend({"io.modelcontextprotocol/subscriptionId":o}),tm=nN({_meta:tu,resultType:eV.default("complete")}),tf={"tools/call":e9("tools/call",e5),"tools/list":e9("tools/list",e8),"prompts/get":e9("prompts/get",{name:o5(),arguments:nB(o5(),o5()).optional()}),"prompts/list":e9("prompts/list",e8),"resources/list":e9("resources/list",e8),"resources/templates/list":e9("resources/templates/list",e8),"resources/read":e9("resources/read",{uri:o5()}),"completion/complete":e9("completion/complete",ta),"server/discover":e9("server/discover",{}),"subscriptions/listen":e9("subscriptions/listen",tl)};function th(e){return nN({_meta:eq,...e})}let ty={"tools/call":th({content:nA(K),structuredContent:nT().optional(),isError:nR().optional()}),"tools/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),tools:nA(eS),nextCursor:i.optional()}),"prompts/get":th({description:o5().optional(),messages:nA(J)}),"prompts/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),prompts:nA(z),nextCursor:i.optional()}),"resources/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resources:nA(O),nextCursor:i.optional()}),"resources/templates/list":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),resourceTemplates:nA(E),nextCursor:i.optional()}),"resources/read":th({ttlMs:nk().int().min(0),cacheScope:nJ(["public","private"]),contents:nA(nD([j,C]))}),"completion/complete":th({completion:nM({values:nA(o5()).max(100),total:nk().int().optional(),hasMore:nR().optional()}).loose()}),"server/discover":th({ttlMs:nk().int().min(0).catch(0),cacheScope:nJ(["public","private"]).catch("private"),supportedVersions:nA(o5()),capabilities:eb,instructions:o5().optional()}),"subscriptions/listen":th({})},tg=nN({"io.modelcontextprotocol/subscriptionId":o.optional()}),t_=nM({method:nQ("notifications/subscriptions/acknowledged"),params:nM({_meta:tg.optional(),notifications:tc})}),tv=nM({_meta:tg.optional(),requestId:o,reason:o5().optional()}),tb=nM({method:nQ("notifications/cancelled"),params:tv}),t$=e=>nM({jsonrpc:nQ("2.0"),id:nD([o5(),nk().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:i,RequestIdSchema:o,RoleSchema:n,LoggingLevelSchema:a,TaskMetadataSchema:d,RelatedTaskMetadataSchema:c,RequestMetaSchema:l,BaseRequestParamsSchema:p,TaskAugmentedRequestParamsSchema:u,NotificationsParamsSchema:m,NotificationSchema:f,IconSchema:h,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:_,ClientTasksCapabilitySchema:$,ServerTasksCapabilitySchema:S,ClientCapabilitiesSchema:k,ServerCapabilitiesSchema:w,ProgressSchema:P,ProgressNotificationParamsSchema:V,ProgressNotificationSchema:R,LoggingMessageNotificationParamsSchema:q,LoggingMessageNotificationSchema:I,ResourceContentsSchema:x,TextResourceContentsSchema:j,BlobResourceContentsSchema:C,AnnotationsSchema:T,ResourceSchema:O,ResourceTemplateSchema:E,ResourceListChangedNotificationSchema:A,ResourceUpdatedNotificationParamsSchema:W,ResourceUpdatedNotificationSchema:M,PromptArgumentSchema:N,PromptSchema:z,PromptListChangedNotificationSchema:D,TextContentSchema:F,ImageContentSchema:L,AudioContentSchema:U,ToolUseContentSchema:H,EmbeddedResourceSchema:G,ResourceLinkSchema:B,ContentBlockSchema:K,PromptMessageSchema:J,ToolAnnotationsSchema:Z,ToolListChangedNotificationSchema:Q,ModelHintSchema:X,ModelPreferencesSchema:Y,ToolChoiceSchema:ee,BooleanSchemaSchema:et,StringSchemaSchema:er,NumberSchemaSchema:ei,UntitledSingleSelectEnumSchemaSchema:eo,TitledSingleSelectEnumSchemaSchema:en,LegacyTitledEnumSchemaSchema:ea,SingleSelectEnumSchemaSchema:es,UntitledMultiSelectEnumSchemaSchema:ed,TitledMultiSelectEnumSchemaSchema:ec,MultiSelectEnumSchemaSchema:el,EnumSchemaSchema:ep,PrimitiveSchemaDefinitionSchema:eu,ElicitRequestFormParamsSchema:em,ResourceTemplateReferenceSchema:ef,PromptReferenceSchema:eh,RootSchema:ey,ClientCapabilities2026Schema:e_,ServerCapabilities2026Schema:eb,RequestMetaEnvelopeSchema:e$,ToolSchema:eS,ToolResultContentSchema:ek,SamplingMessageContentBlockSchema:ew,SamplingMessageSchema:eP,ResultTypeSchema:eV,ResultMetaSchema:eR,ResultSchema:ex,PaginatedResultSchema:ej,CallToolResultSchema:eC,ListToolsResultSchema:eT,ListPromptsResultSchema:eO,GetPromptResultSchema:eE,ListResourcesResultSchema:eA,ListResourceTemplatesResultSchema:eW,ReadResourceResultSchema:eM,CompleteResultSchema:eN,CacheableResultSchema:ez,DiscoverResultSchema:eD,CreateMessageRequestParamsSchema:eF,CreateMessageRequestSchema:eL,ListRootsRequestSchema:eU,CreateMessageResultSchema:eH,ListRootsResultSchema:eG,ElicitResultSchema:eB,ElicitRequestURLParamsSchema:eK,ElicitRequestParamsSchema:eJ,ElicitRequestSchema:eZ,InputRequestSchema:eQ,InputResponseSchema:eX,InputRequestsSchema:eY,InputResponsesSchema:e1,InputRequiredResultSchema:e0,InputResponseRequestParamsSchema:e4,CallToolRequestSchema:e7,ListToolsRequestSchema:te,ListPromptsRequestSchema:tt,GetPromptRequestSchema:tr,ListResourcesRequestSchema:ti,ListResourceTemplatesRequestSchema:to,ReadResourceRequestSchema:tn,CompleteRequestSchema:ts,DiscoverRequestSchema:td,SubscriptionFilterSchema:tc,SubscriptionsListenRequestSchema:tp,SubscriptionsListenResultMetaSchema:tu,SubscriptionsListenResultSchema:tm,dispatchRequestSchemas:tf,dispatchResultSchemas:ty,NotificationMetaSchema:tg,SubscriptionsAcknowledgedNotificationSchema:t_,CancelledNotificationParamsSchema:tv,CancelledNotificationSchema:tb,notificationSchemas2026:{"notifications/cancelled":tb,"notifications/progress":R,"notifications/message":I,"notifications/resources/updated":M,"notifications/resources/list_changed":A,"notifications/tools/list_changed":Q,"notifications/prompts/list_changed":D,"notifications/subscriptions/acknowledged":t_},JSONRPCResultResponseSchema:t$(ex),CallToolResultResponseSchema:t$(nD([eC,e0])),ListToolsResultResponseSchema:t$(eT),ListPromptsResultResponseSchema:t$(eO),GetPromptResultResponseSchema:t$(nD([eE,e0])),ListResourcesResultResponseSchema:t$(eA),ListResourceTemplatesResultResponseSchema:t$(eW),ReadResourceResultResponseSchema:t$(nD([eM,e0])),CompleteResultResponseSchema:t$(eN),DiscoverResultResponseSchema:t$(eD),SubscriptionsListenResultResponseSchema:t$(tm)}}()}let wn=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],wa=Symbol("modelcontextprotocol.resultCacheHintFallback");function ws(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function wd(e){return"public"===e||"private"===e}let wc=((Y={})[Y.ParseError=-32700]="ParseError",Y[Y.InvalidRequest=-32600]="InvalidRequest",Y[Y.MethodNotFound=-32601]="MethodNotFound",Y[Y.InvalidParams=-32602]="InvalidParams",Y[Y.InternalError=-32603]="InternalError",Y[Y.ResourceNotFound=-32002]="ResourceNotFound",Y[Y.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",Y[Y.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",Y[Y.UrlElicitationRequired=-32042]="UrlElicitationRequired",Y);var wl=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return kD(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kD(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",kz(this,new.target)}static fromError(t,r,i){return t===wc.UrlElicitationRequired&&i&&i.elicitations?new wu(i.elicitations,r):t===wc.UnsupportedProtocolVersion&&i&&Array.isArray(i.supported)&&"string"==typeof i.requested?new wm({supported:i.supported,requested:i.requested},r):(t===wc.InvalidParams||t===wc.ResourceNotFound)&&"string"==typeof i?.uri&&(t===wc.ResourceNotFound||1===Object.keys(i).length)?new wp(i.uri,r):t===wc.MissingRequiredClientCapability&&i&&null!==i.requiredCapabilities&&"object"==typeof i.requiredCapabilities&&!Array.isArray(i.requiredCapabilities)?new wf({requiredCapabilities:i.requiredCapabilities},r):new e(t,r,i)}},wp=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(wc.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},wu=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(wc.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},wm=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(wc.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},wf=class extends wl{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(wc.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let wh=["tools/call","prompts/get","resources/read"],wy=["elicitation/create","sampling/createMessage","roots/list"];function wg(){if(p)return p;let e=wo();return p={request:{"elicitation/create":nM({method:nQ("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":nM({method:nQ("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":nM({method:nQ("roots/list"),params:nN({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function w_(e){return wy.includes(e)}function wv(e){return w_(e)?wg().request[e]:void 0}let wb={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},w$={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function wS(e){return Object.prototype.hasOwnProperty.call(wb,e)}function wk(e){return Object.prototype.hasOwnProperty.call(w$,e)}function ww(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function wP(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(wb),Object.keys(w$);let wV={ok:!1,reason:"not-in-era"},wR=[al,am],wq={era:"2026-07-28",hasRequestMethod:wS,hasNotificationMethod:wk,hasInputRequestMethod:e=>void 0!==wv(e),validateRequest:(e,t)=>wP(wS(e)?wo().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>wP(Object.prototype.hasOwnProperty.call(wb,e)?wo().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>wP(wk(e)?wo().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>wP(wv(e),t),validateInputResponse:(e,t)=>wP(w_(e)?wg().response[e]:void 0,t),samplingResultVariant:()=>wV,outboundEnvelope:e=>({[al]:e.protocolVersion,[ap]:e.clientInfo,[am]:e.clientCapabilities,...void 0!==e.logLevel&&{[ah]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of wR)r in e||t.push({key:r,problem:"missing"});let r=wo().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let e of r.error.issues){let r=e.path.map(String),i=r.length>0?r.join("."):"_meta";1===r.length&&t.some(e=>e.key===i&&"missing"===e.problem)||t.push({key:i,problem:e.message})}return t},projectCallToolResult:e=>kJ(e),inputRequestSchema:wv,decodeResult(e,t){if(!ww(t))return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if("string"!=typeof r)return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,i=ww(r)?r:{},o=t.requestState,n=void 0===t._meta?void 0:wo().ResultMetaSchema.safeParse(t._meta),a=n?.success?n.data:void 0;return 0===Object.keys(i).length&&"string"!=typeof o?{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:i,..."string"==typeof o&&{requestState:o},...void 0!==a&&{_meta:a}}}if("complete"!==r)return{kind:"invalid",error:new kL(kF.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let i=function(){if(u)return u;let e=wo();return u={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema}}(),o=Object.hasOwn(i,e)?i[e]:void 0;if(void 0!==o){let r=o.safeParse(t);if(!r.success)return{kind:"invalid",error:new kL(kF.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}let n={...t};return delete n.resultType,{kind:"complete",result:n}},encodeResult:(e,t,r)=>(function(e,t){if(void 0===t)return e;let r=e._meta;return void 0===r?{...e,_meta:{[au]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[au]?e:{...e,_meta:{...r,[au]:t}}})(function(e,t){var r,i;let o=t[wa];if("complete"!==t.resultType||!wn.includes(e)){let e;return void 0===o?t:(e={...t},delete e[wa],e)}let n=ws(t.ttlMs)?t.ttlMs:void 0!==(r=o)&&ws(r.ttlMs)?r.ttlMs:0,a=wd(t.cacheScope)?t.cacheScope:void 0!==(i=o)&&wd(i.cacheScope)?i.cacheScope:"private",s={...t,ttlMs:n,cacheScope:a};return delete s[wa],s}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||wh.includes(e))return t;throw new wl(wc.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}(e,function(e,t){let r=t,i=!1,o=()=>(i||(r={...r},i=!0),r),n=t.tools;"tools/list"===e&&Array.isArray(n)&&n.some(e=>ww(e)&&"execution"in e)&&(o().tools=n.map(e=>{if(!ww(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let a=t.capabilities;if(ww(a)&&"tasks"in a){let e={...a};delete e.tasks,o().capabilities=e}return r}(e,t))),r),encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope(e){if(void 0===e.envelope)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=wo().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join("; ")}`}},wI="2026-07-28";function wx(e){return void 0!==e&&e>=kH?wq:wi}function wj(e){return void 0!==e.revision?wx(e.revision).era:"modern"===e.era?wq.era:wi.era}function wC(e){return wE.some(t=>t.hasRequestMethod(e))}function wT(e){return wE.some(t=>t.hasNotificationMethod(e))}function wO(e){return"tasks/get"===e||"tasks/cancel"===e}let wE=[wi,wq];var wA=(e=>{let t={};for(var r in e)kI(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>sn,AudioContentSchema:()=>sE,BaseMetadataSchema:()=>aL,BaseRequestParamsSchema:()=>aw,BlobResourceContentsSchema:()=>si,BooleanSchemaSchema:()=>ds,CallToolRequestParamsSchema:()=>sZ,CallToolRequestSchema:()=>sQ,CallToolResultSchema:()=>sK,CancelTaskRequestSchema:()=>dB,CancelTaskResultSchema:()=>dK,CancelledNotificationParamsSchema:()=>aN,CancelledNotificationSchema:()=>az,ClientCapabilitiesSchema:()=>aJ,ClientNotificationSchema:()=>dZ,ClientRequestSchema:()=>dJ,ClientResultSchema:()=>dQ,ClientTasksCapabilitySchema:()=>aB,CompatibilityCallToolResultSchema:()=>sJ,CompleteRequestParamsSchema:()=>dq,CompleteRequestSchema:()=>dI,CompleteResultSchema:()=>dx,ContentBlockSchema:()=>sN,CreateMessageRequestParamsSchema:()=>dr,CreateMessageRequestSchema:()=>di,CreateMessageResultSchema:()=>dn,CreateMessageResultWithToolsSchema:()=>da,CreateTaskResultSchema:()=>dM,CursorSchema:()=>ab,DiscoverRequestSchema:()=>a0,DiscoverResultSchema:()=>a2,ElicitRequestFormParamsSchema:()=>dv,ElicitRequestParamsSchema:()=>d$,ElicitRequestSchema:()=>dS,ElicitRequestURLParamsSchema:()=>db,ElicitResultSchema:()=>dP,ElicitationCompleteNotificationParamsSchema:()=>dk,ElicitationCompleteNotificationSchema:()=>dw,EmbeddedResourceSchema:()=>sW,EmptyResultSchema:()=>aM,EnumSchemaSchema:()=>dg,GetPromptRequestParamsSchema:()=>sj,GetPromptRequestSchema:()=>sC,GetPromptResultSchema:()=>sD,GetTaskPayloadRequestSchema:()=>dL,GetTaskPayloadResultSchema:()=>dU,GetTaskRequestSchema:()=>dD,GetTaskResultSchema:()=>dF,IconSchema:()=>aD,IconsSchema:()=>aF,ImageContentSchema:()=>sO,ImplementationSchema:()=>aU,InitializeRequestParamsSchema:()=>aZ,InitializeRequestSchema:()=>aQ,InitializeResultSchema:()=>aY,InitializedNotificationSchema:()=>a1,JSONArraySchema:()=>a_,JSONObjectSchema:()=>ag,JSONRPCErrorResponseSchema:()=>aE,JSONRPCMessageSchema:()=>aA,JSONRPCNotificationSchema:()=>aT,JSONRPCRequestSchema:()=>aC,JSONRPCResponseSchema:()=>aW,JSONRPCResultResponseSchema:()=>aO,JSONValueSchema:()=>ay,LegacyTitledEnumSchemaSchema:()=>du,ListChangedOptionsBaseSchema:()=>sY,ListPromptsRequestSchema:()=>sI,ListPromptsResultSchema:()=>sx,ListResourceTemplatesRequestSchema:()=>sl,ListResourceTemplatesResultSchema:()=>sp,ListResourcesRequestSchema:()=>sd,ListResourcesResultSchema:()=>sc,ListRootsRequestSchema:()=>dC,ListRootsResultSchema:()=>dT,ListTasksRequestSchema:()=>dH,ListTasksResultSchema:()=>dG,ListToolsRequestSchema:()=>sG,ListToolsResultSchema:()=>sB,LoggingLevelSchema:()=>s1,LoggingMessageNotificationParamsSchema:()=>s4,LoggingMessageNotificationSchema:()=>s6,ModelHintSchema:()=>s3,ModelPreferencesSchema:()=>s9,MultiSelectEnumSchemaSchema:()=>dy,NotificationSchema:()=>aq,NotificationsParamsSchema:()=>aR,NumberSchemaSchema:()=>dc,PaginatedRequestParamsSchema:()=>a5,PaginatedRequestSchema:()=>a8,PaginatedResultSchema:()=>a7,PingRequestSchema:()=>a4,PrimitiveSchemaDefinitionSchema:()=>d_,ProgressNotificationParamsSchema:()=>a3,ProgressNotificationSchema:()=>a9,ProgressSchema:()=>a6,ProgressTokenSchema:()=>av,PromptArgumentSchema:()=>sR,PromptListChangedNotificationSchema:()=>sF,PromptMessageSchema:()=>sz,PromptReferenceSchema:()=>dR,PromptSchema:()=>sq,ReadResourceRequestParamsSchema:()=>su,ReadResourceRequestSchema:()=>sm,ReadResourceResultSchema:()=>sf,RelatedTaskMetadataSchema:()=>aS,RequestIdSchema:()=>aj,RequestMetaSchema:()=>ak,RequestSchema:()=>aV,ResourceContentsSchema:()=>se,ResourceLinkSchema:()=>sM,ResourceListChangedNotificationSchema:()=>sh,ResourceRequestParamsSchema:()=>su,ResourceSchema:()=>sa,ResourceTemplateReferenceSchema:()=>dV,ResourceTemplateSchema:()=>ss,ResourceUpdatedNotificationParamsSchema:()=>sP,ResourceUpdatedNotificationSchema:()=>sV,ResultMetaObjectSchema:()=>aI,ResultSchema:()=>ax,RoleSchema:()=>so,RootSchema:()=>dj,RootsListChangedNotificationSchema:()=>dO,SamplingContentSchema:()=>s7,SamplingMessageContentBlockSchema:()=>de,SamplingMessageSchema:()=>dt,ServerCapabilitiesSchema:()=>aX,ServerNotificationSchema:()=>dY,ServerRequestSchema:()=>dX,ServerResultSchema:()=>d1,ServerTasksCapabilitySchema:()=>aK,SetLevelRequestParamsSchema:()=>s0,SetLevelRequestSchema:()=>s2,SingleSelectEnumSchemaSchema:()=>dm,StringSchemaSchema:()=>dd,SubscribeRequestParamsSchema:()=>su,SubscribeRequestSchema:()=>sy,SubscriptionFilterSchema:()=>s_,SubscriptionsAcknowledgedNotificationParamsSchema:()=>s$,SubscriptionsAcknowledgedNotificationSchema:()=>sS,SubscriptionsListenRequestParamsSchema:()=>sv,SubscriptionsListenRequestSchema:()=>sb,SubscriptionsListenResultMetaSchema:()=>sk,SubscriptionsListenResultSchema:()=>sw,TaskAugmentedRequestParamsSchema:()=>aP,TaskCreationParamsSchema:()=>dE,TaskMetadataSchema:()=>a$,TaskSchema:()=>dW,TaskStatusNotificationParamsSchema:()=>dN,TaskStatusNotificationSchema:()=>dz,TaskStatusSchema:()=>dA,TextContentSchema:()=>sT,TextResourceContentsSchema:()=>st,TitledMultiSelectEnumSchemaSchema:()=>dh,TitledSingleSelectEnumSchemaSchema:()=>dp,ToolAnnotationsSchema:()=>sL,ToolChoiceSchema:()=>s5,ToolExecutionSchema:()=>sU,ToolListChangedNotificationSchema:()=>sX,ToolResultContentSchema:()=>s8,ToolSchema:()=>sH,ToolUseContentSchema:()=>sA,UnsubscribeRequestParamsSchema:()=>su,UnsubscribeRequestSchema:()=>sg,UntitledMultiSelectEnumSchemaSchema:()=>df,UntitledSingleSelectEnumSchemaSchema:()=>dl});let wW=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,wM="x-mcp-header",wN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,wz=new Set(["string","integer","boolean"]);function wD(e){let t,r=[],i=new Map,o=(e,n,a)=>{if(null===e||"object"!=typeof e)return;if(wM in e){if(!a||0===n.length)return`${wU(n)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let o=e[wM];if("string"!=typeof o||0===o.length)return`${wU(n)}: x-mcp-header MUST be a non-empty string`;if(!wN.test(o))return`${wU(n)}: x-mcp-header '${o}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let s="string"==typeof e.type?e.type:void 0;if(void 0===s||!wz.has(s)){let e=`${wU(n)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${s??""}`;if("number"!==s)return e;t??=e}let d=o.toLowerCase(),c=i.get(d);if(void 0!==c)return`x-mcp-header '${o}' is not case-insensitively unique (also declared as '${c}')`;i.set(d,o),r.push({path:n,headerName:o,type:s})}let s=e.properties;if(null!==s&&"object"==typeof s)for(let[e,t]of Object.entries(s)){let r=o(t,[...n,e],a);if(void 0!==r)return r}for(let t of wF){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&wL.has(t)?Object.values(r):[r]){let r=o(e,[...n,`<${t}>`],!1);if(void 0!==r)return r}}},n=o(e,[],!0);return void 0!==n?{valid:!1,reason:t??n}:void 0===t?{valid:!0,declarations:r}:{valid:!1,reason:t,declarations:r}}let wF=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],wL=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function wU(e){return 0===e.length?"":e.join(".")}let wH="=?base64?";function wG(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function wB(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}wc.InvalidRequest,wc.UnsupportedProtocolVersion,wc.InvalidParams,wc.MethodNotFound,wc.InvalidParams,wc.MissingRequiredClientCapability,wc.ParseError,wc.InvalidRequest,wc.MethodNotFound,wc.UnsupportedProtocolVersion,wc.MissingRequiredClientCapability;let wK=!1,wJ="draft-2020-12",wZ=/^#\/(\$defs|definitions)\/([^/~%]+)$/;async function wQ(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(e=>e.path?.length?`${e.path.map(e=>String("object"==typeof e?e.key:e)).join(".")}: ${e.message}`:e.message).join(", ")}:{success:!0,data:r.value}}let wX=/\\\.\\d\{(\d+)\}/;function wY(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let w1=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function w0(e){return w1.has(e)||e.startsWith("x-")}let w2=new Set(["$schema",...Object.keys(dv.shape.requestedSchema.shape)]),w4={string:wG([dd,dl,dp,du]),number:wG([dc]),integer:wG([dc]),boolean:wG([ds]),array:wG([df,dh])},w6=new Set(dd.shape.format.unwrap().options);Object.assign(function(e){let t=void 0!==e.inputRequests&&Object.keys(e.inputRequests).length>0,r="string"==typeof e.requestState;if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==e.inputRequests&&{inputRequests:e.inputRequests},...void 0!==e.requestState&&{requestState:e.requestState}}},{elicit(e){try{return{method:"elicitation/create",params:function(e){var t;if(!wB(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let r=e.requestedSchema["~standard"].vendor,i=function(e,t){let r={},i=[];for(let[o,n]of Object.entries(e))"properties"===o&&wY(n)?r[o]=Object.fromEntries(Object.entries(n).map(([e,r])=>[e,function(e,t,r,i){if(!wY(e))return e;let o="string"==typeof e.type&&Object.hasOwn(w4,e.type)?w4[e.type]:void 0;if(void 0===o)return e;let n={};for(let[s,d]of Object.entries(e))if(o.has(s)||w0(s))n[s]=d;else if("pattern"===s&&"string"===e.type&&"string"==typeof e.format)if(w6.has(e.format)){var a;"string"==typeof d&&(a=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[iS(ni,void 0)];break;case"uri":r=[ik(na,void 0)];break;case"date":r=[iP(ne,void 0)];break;case"date-time":let i,o;i=wX.exec(t),o=[void 0,-1,0],i&&o.push(Number(i[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>o.map(r=>as({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=oq(e,{target:wJ,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(a,d).has(d))||i.push(`${t}.${s}`)}else n[s]=d;else i.push(`${t}.${s}`);return n}(r,`properties.${e}`,t,i)])):w2.has(o)?r[o]=n:w0(o)||i.push(o);if(i.length>0)throw new wl(wc.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);return r}(function(e){try{return function(e,t="input"){let r,i=e["~standard"];if(i.jsonSchema)r=i.jsonSchema[t]({target:wJ});else if("zod"===i.vendor){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");wK||(wK=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=oq(e,{target:wJ,io:t})}else throw Error(`Schema library "${i.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===t)return void 0!==r.type||!function e(t,r=t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;let i="string"==typeof t.$ref&&wZ.exec(t.$ref);if(i&&r[i[1]]?.[i[2]]?.type==="object")return!0;for(let i of["oneOf","anyOf","allOf"]){let o=t[i];if(Array.isArray(o)&&o.length>0)return o.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t,"$id"in t?{}:r)))}return!1}(r)?r:{type:"object",...r};if(void 0!==r.type&&"object"!==r.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}(e,"input")}catch(t){let e=t instanceof Error?t.message:String(t);throw new wl(wc.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),o=(t=dv.shape.requestedSchema,oB(t,i));if(!o.success)throw new wl(wc.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!wY(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!oB(d_,e).success).map(([e])=>`properties.${e}`);return r.length>0?r.join(", "):t}(i,o.error.message)}`);let n=function e(t,r,i=""){return Array.isArray(t)&&Array.isArray(r)?t.flatMap((t,o)=>e(t,r[o],`${i}[${o}]`)):wY(t)&&wY(r)?Object.entries(t).flatMap(([t,o])=>{let n=i?`${i}.${t}`:t;return Object.prototype.hasOwnProperty.call(r,t)?e(o,r[t],n):w0(t)?[]:[n]}):[]}(i,o.data);if(n.length>0)throw new wl(wc.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let a=(o.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(o.data.properties,e));if(a.length>0)throw new wl(wc.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}(e)}}catch(e){throw e instanceof wl?TypeError(e.message,{cause:e}):e}},elicitUrl:e=>({method:"elicitation/create",params:{...e,mode:"url"}}),createMessage:e=>({method:"sampling/createMessage",params:e}),listRoots:()=>({method:"roots/list"})});let w3={},w9={};function w5(e,t){let r=e.slice(0,-6);w3[r]=t,w9[r]=e=>t.safeParse(e).success}for(let e of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])w5(e,wA[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:d7,OAuthClientInformationFullSchema:co,OAuthClientInformationSchema:ci,OAuthClientMetadataSchema:cr,OAuthClientRegistrationErrorSchema:cn,OAuthErrorResponseSchema:ce,OAuthMetadataSchema:d3,OAuthProtectedResourceMetadataSchema:d6,OAuthTokenRevocationRequestSchema:ca,OAuthTokensSchema:d8,OpenIdProviderDiscoveryMetadataSchema:d5,OpenIdProviderMetadataSchema:d9}))w5(e,t);Object.freeze(w3);let w8=Object.freeze(w9),w7=[al,ap,am,ah],Pe=["inputResponses","requestState"];function Pt(e,t){let r=e.params;if(!Pn(r))return{message:e,lifted:{}};let i=r._meta,o=Pn(i)?w7.filter(e=>e in i):[],n="request"===t?Pe.filter(e=>e in r):[];if(0===o.length&&0===n.length)return{message:e,lifted:{}};let a={},s={...r};if(o.length>0&&Pn(i)){let e={},t={...i};for(let r of o)e[r]=i[r],delete t[r];a.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of n)"inputResponses"===e&&(a.inputResponses=s[e]),"requestState"===e&&(a.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:a}}function Pr(e,t){let r=e.validateResult(t,void 0);if(r.ok||"not-in-era"!==r.reason)return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let i=e.validateResult(t,r);return i.ok?{value:i.value}:{issues:[{message:"invalid"===i.reason?i.message:`not-in-era: ${t}`}]}}}}}let Pi=(ee=void 0,()=>ee);var Po=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??ac,this.setNotificationHandler("notifications/cancelled",e=>{this._oncancel(e)}),this.setNotificationHandler("notifications/progress",e=>{this._onprogress(e)}),this.setRequestHandler("ping",e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(void 0===t)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new kL(kF.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){void 0!==e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new kL(kF.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let i=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{if(i?.(e,t),aO.safeParse(e).success||aE.safeParse(e).success)this._onresponse(e);else if(aC.safeParse(e).success)this._onrequest(e,t);else aT.safeParse(e).success?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new kL(kF.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(r);for(let e of t.values())e.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=Pt(e,"notification"),i=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=wj(t.classification);if(e!==i.era)return void this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${e} but this instance serves ${i.era}`))}if(wT(r.method)&&!i.hasNotificationMethod(r.method))return;let o=this._notificationHandlers.get(r.method),n=this.fallbackNotificationHandler;(void 0!==o||void 0!==n)&&Promise.resolve().then(()=>void 0===o?n(r):o(r,i)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r;let{message:i,lifted:o}=Pt(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return void this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));let a=this._transport,s=(e,t,r)=>{let o={jsonrpc:"2.0",id:i.id,error:{code:e,message:t,...void 0!==r&&{data:r}}};a?.send(o).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=wj(t.classification);if(e!==n.era){this._onerror(Error(`Era mismatch on inbound request '${i.method}': classified as ${e} but this instance serves ${n.era}`));let r=t.classification.revision??e;s(wc.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(wC(i.method)&&!n.hasRequestMethod(i.method)&&!(wO(i.method)&&this._customSchemaRequestMethods.has(i.method)))return void s(wc.MethodNotFound,"Method not found");let d=this._requestHandlers.get(i.method)??this.fallbackRequestHandler;if(void 0===d)return void s(wc.MethodNotFound,"Method not found");let c=n.checkInboundEnvelope(o);if(void 0!==c)return void s(wc.InvalidParams,c);let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:i.id}),p=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:i.id}),u=new AbortController;this._requestHandlerAbortControllers.set(i.id,u);let m=void 0===o.inputResponses?void 0:function(e){let t={},r=[];if(!Pa(e))return{accepted:t,droppedKeys:r};for(let[i,o]of Object.entries(e)){if(!Pa(o)||"method"in o||"result"in o){r.push(i);continue}t[i]=o}return{accepted:t,droppedKeys:r}}(o.inputResponses),f={sessionId:a?.sessionId,mcpReq:{id:i.id,method:i.method,_meta:i.params?._meta,...void 0!==o.envelope&&{envelope:o.envelope},...void 0!==m&&{inputResponses:m.accepted},...void 0!==m&&m.droppedKeys.length>0&&{droppedInputResponseKeys:m.droppedKeys},requestState:void 0===o.requestState?Pi:(r=o.requestState,()=>r),signal:u.signal,send:(e,t,r)=>{let i=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(i,e.method),wB(t))return p(e,t,r);let o=Pr(i,e.method);if(void 0===o)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return p(e,o,t)},notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},h=this.buildContext(f,t);Promise.resolve().then(()=>d(i,h)).then(async e=>{let t;if(u.signal.aborted)return;try{t=n.encodeResult(i.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${i.method}: ${e}`)),s(wc.InternalError,"Internal error");return}let r={result:t,jsonrpc:"2.0",id:i.id};await a?.send(r)},async e=>{if(u.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:wc.InternalError,r={jsonrpc:"2.0",id:i.id,error:{code:n.encodeErrorCode(t),message:e.message??"Internal error",...void 0!==e.data&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(i.id)===u&&this._requestHandlerAbortControllers.delete(i.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,i=Number(t),o=this._progressHandlers.get(i);if(!o)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let n=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&n&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(e){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),n(e);return}o(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);void 0===r?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),r(aO.safeParse(e).success?e:wl.fromError(e.error.code,e.error.message,e.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let i=this._resolveOutboundCodec(e.method);if(wB(t))return wO(e.method)||this._assertOutboundRequestInEra(i,e.method),this._requestWithSchemaViaCodec(i,e,t,r);this._assertOutboundRequestInEra(i,e.method);let o=Pr(i,e.method);if(void 0===o)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(i,e,o,t)}_negotiatedWireCodec(){return wx(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(void 0===this._negotiatedProtocolVersion){let t=function(e){switch(e){case"initialize":case"notifications/initialized":return wx(void 0);case"server/discover":return wx(wI);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(wC(t)&&!e.hasRequestMethod(t))throw new kL(kF.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let i=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(i,e.method),this._requestWithSchemaViaCodec(i,e,t,r)}_requestWithSchemaViaCodec(e,t,r,i){let o,n,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:d,headers:c}=i??{},l=Date.now();return new Promise((p,u)=>{let m=e=>{u(e)};if(!this._transport)return void m(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){m(e);return}if(i?.signal?.aborted){let e=i.signal.reason;throw e instanceof kL?e:new kL(kF.RequestTimeout,String(e))}let f=e.era===wI&&!0===this._transport.hasPerRequestStream?new AbortController:void 0,h=this._requestMessageId++;n=h;let y={...t,jsonrpc:"2.0",id:h};i?.onprogress&&(this._progressHandlers.set(h,i.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let g=this._envelopeOutbound(y),_=!1,v=e=>{_||(this._progressHandlers.delete(h),void 0===f?"initialize"!==t.method&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(e)}}),{relatedRequestId:a,resumptionToken:s,onresumptiontoken:d}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):f.abort(),u(e instanceof kL?e:new kL(kF.RequestTimeout,String(e))))};this._responseHandlers.set(h,o=>{let n;if(!i?.signal?.aborted){if(_=!0,o instanceof Error)return u(o);try{n=e.decodeResult(t.method,o.result)}catch(e){return u(e instanceof Error?e:Error(String(e)))}if("invalid"===n.kind)return u(n.error);if("input_required"===n.kind){var a;return i?.allowInputRequired===!0?p({resultType:"input_required",inputRequests:(a=n).inputRequests,...void 0!==a.requestState&&{requestState:a.requestState},...void 0!==a._meta&&{_meta:a._meta}}):p(this._resolveNonCompleteResult(n,{codec:e,request:t,resultSchema:r,options:i,flowStartedAt:l,retry:(i,o)=>this._requestWithSchemaViaCodec(e,void 0===i?{method:t.method}:{method:t.method,params:i},r,o)}))}wQ(r,n.result).then(e=>{e.success?p(e.data):u(new kL(kF.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},u)}}),o=()=>v(i?.signal?.reason),i?.signal?.addEventListener("abort",o,{once:!0});let b=i?.timeout??6e4;this._setupTimeout(h,b,i?.maxTotalTimeout,()=>v(new kL(kF.RequestTimeout,"Request timed out",{timeout:b})),i?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:d,headers:c,requestSignal:f?.signal}).catch(e=>{this._progressHandlers.delete(h),u(e)})}).finally(()=>{o&&i?.signal?.removeEventListener("abort",o),void 0!==n&&(this._responseHandlers.delete(n),this._cleanupTimeout(n))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new kL(kF.NotConnected,"Not connected");if(wT(t.method)&&!e.hasNotificationMethod(t.method))throw new kL(kF.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let i=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(i,r).catch(e=>this._onerror(e))});return}await this._transport.send(i,r)}setRequestHandler(e,t,r){let i;if(this.assertRequestHandlerCapability(e),"function"==typeof t){if(!wC(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);i=(r,i)=>{let o=this._negotiatedWireCodec(),n=o.validateRequest(e,r);if(n.ok||"not-in-era"!==n.reason||(n=o.validateInputRequest(e,r)),!n.ok){if("not-in-era"===n.reason)throw new wl(wc.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(n.message)}return Promise.resolve(t(n.value,i))}}else if(r)i=async(i,o)=>{let n=await wQ(t.params,{...i.params});if(!n.success)throw new wl(wc.InvalidParams,`Invalid params for ${e}: ${n.error}`);return r(n.data,o)};else throw TypeError("setRequestHandler: handler is required");"function"==typeof t?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,i))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if("function"==typeof t){if(!wT(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,i)=>{let o=i.validateNotification(e,r);if(!o.ok){if("not-in-era"===o.reason)throw new wl(wc.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(o.message)}return Promise.resolve(t(o.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async i=>{let o=await wQ(t.params,{...i.params});if(!o.success)throw new wl(wc.InvalidParams,`Invalid params for notification ${e}: ${o.error}`);await r(o.data,i)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Pn(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Pa(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ps(e){throw new kL(kF.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}(kO(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function o(e){this.parameters=Object.create(null),this.type=e}e.parse=function(e){if(!e)throw TypeError("argument string is required");var n,a,s,d="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof d)throw TypeError("argument string is required to be a string");var c=d.indexOf(";"),l=-1!==c?d.slice(0,c).trim():d.trim();if(!i.test(l))throw TypeError("invalid media type");var p=new o(l.toLowerCase());if(-1!==c){for(t.lastIndex=c;a=t.exec(d);){if(a.index!==c)throw TypeError("invalid parameter format");c+=a[0].length,n=a[1].toLowerCase(),34===(s=a[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(r,"$1")),p.parameters[n]=s}if(c!==d.length)throw TypeError("invalid parameter format")}return p}}))();var Pd=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??0xa00000}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let t=this._buffer.indexOf("\n");if(-1===t)break;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");this._buffer=this._buffer.subarray(t+1);try{var e;return e=r,aA.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};let Pc=ed("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"),Pl="win32"===N.platform?["APPDATA","COMSPEC","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PATHEXT","PROCESSOR_ARCHITECTURE","PROGRAMDATA","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","WINDIR"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var Pp=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new Pd({maxBufferSize:e.maxBufferSize}),("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new F)}async start(){if(this._process)throw Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._process=Pc(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of Pl){let r=N.env[t];void 0!==r&&(r.startsWith("()")||(e[t]=r))}return e}(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:"win32"===N.platform,cwd:this._serverParams.cwd}),this._process.on("error",e=>{t(e),this.onerror?.(e)}),this._process.on("spawn",()=>{e()}),this._process.on("close",e=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",e=>{this.onerror?.(e)}),this._process.stdout?.on("data",e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}}),this._process.stdout?.on("error",e=>{this.onerror?.(e)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async _dispose(){let e=this._process;if(this._process=void 0,e&&null===e.exitCode&&null===e.signalCode){let t=new Promise(t=>e.once("exit",()=>t()));try{e.stdin?.end()}catch{}try{e.kill("SIGTERM")}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,1e3).unref())]),null===e.exitCode&&null===e.signalCode)try{e.kill("SIGKILL")}catch{}await t}try{e?.stdout?.destroy()}catch{}try{e?.stdin?.destroy()}catch{}try{e?.stderr?.destroy()}catch{}this._readBuffer.clear()}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(t=>{e.once("close",()=>{t()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())]),null===e.exitCode){try{e.kill("SIGTERM")}catch{}await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())])}if(null===e.exitCode)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw new kL(kF.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let Pu=new TextEncoder,Pm=new TextDecoder,Pf=new TextDecoder("utf-8",{fatal:!0});function Ph(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let i of e)t.set(i,r),r+=i.length;return t}function Py(e,t,r){if(t<0||t>=0x100000000)throw RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function Pg(e){let t=Math.floor(e/0x100000000),r=new Uint8Array(8);return Py(r,t,0),Py(r,e%0x100000000,4),r}function P_(e){let t=new Uint8Array(4);return Py(t,e),t}let Pv=/[^\x00-\x7f]/;function Pb(e){if("string"==typeof e&&e.length>=128){if(Pv.test(e))throw TypeError("non-ASCII string encountered in encode()");return Pu.encode(e)}let t=new Uint8Array(e.length);for(let r=0;r127)throw TypeError("non-ASCII string encountered in encode()");t[r]=i}return t}function P$(e,t=!1){if(Uint8Array.prototype.toBase64)return e.toBase64({alphabet:t?"base64url":"base64",omitPadding:t});let r=[];for(let t=0;t"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);return void 0===t?void 0:new Set(t)}function PX(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function PY(e,t,r,i,o){if(void 0!==o.crit&&i?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||void 0===i.crit)return[];if(!Array.isArray(i.crit)||0===i.crit.length||i.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let n=void 0===r?t:{__proto__:null,...r,...t};for(let t of i.crit){if(!(t in n))throw new Pq(`Extension Header Parameter "${t}" is not recognized`);if(!Object.hasOwn(o,t)||void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(n[t]&&(!Object.hasOwn(i,t)||void 0===i[t]))throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return i.crit}function P1(e,t){if(t.includes("b64")){let t=e.b64;if("boolean"!=typeof t)throw new Pj('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}function P0(e,t){let r,i;try{r=JSON.stringify(t),i=JSON.parse(r)}catch(t){throw new e("JOSE Header is not valid JSON",{cause:t})}if(!PF(i))throw new e("JOSE Header is not a JSON object");return[i,r]}async function P2(e,t,r){let i,o,{alg:n,secret:a}=e,s="decrypt"===r||"sign"===r;if(a&&t instanceof Uint8Array)return t;if(PF(t)){if("string"!=typeof(i=Va(t)).kty)throw Ve(n,t,a);if(!(a?"oct"===i.kty&&"string"==typeof i.k:"oct"!==i.kty&&(s?"AKP"===i.kty&&"string"==typeof i.priv||"string"==typeof i.d:void 0===i.d&&void 0===i.priv)))throw TypeError(a?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${s?"private":"public"} JWK`);if(((e,t,r)=>{let{alg:i}=e;if(void 0!==t.use){let e="sign"===r||"verify"===r?"sig":"enc";if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==i)throw TypeError(`Invalid key for this operation, its "alg" must be "${i}" when present`);if(Array.isArray(t.key_ops)){let i="encrypt"===r||"decrypt"===r?e.ops?.[+("encrypt"!==r)]:r;if(i&&!t.key_ops.includes(i))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${i}" when present`)}})(e,i,r),"oct"===i.kty)return PN(i.k);if(!Object.isFrozen(t)){let{key_ops:e}=t;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}}else{if(!P5(t))throw Ve(n,t,a);let e=a?"secret":s?"private":"public";if(t.type!==e&&(a||["secret","public","private"].includes(t.type)))throw TypeError(`${t[Symbol.toStringTag]} instances must be of type "${e}" for the ${n} algorithm`);if(P3(t))return t;if("secret"===(o=t).type)return o.export()}let d=(m||=new WeakMap).get(t);if(d?.[n])return d[n];if(d||m.set(t,d={}),o&&"function"==typeof o.toCryptoKey){let t="public"===o.type,r=P4[o.asymmetricKeyDetails?.namedCurve],i=e.resolve?.({crv:r,asymmetricKeyType:o.asymmetricKeyType})??e.subtle;return d[n]=o.toCryptoKey(i,t,e.usages[+!t])}return(i??=o.export({format:"jwk"})).alg=n,d[n]=await Vd(e,i)}let P4={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function P6(e){if(!P3(e))throw Error("CryptoKey instance expected")}let P3=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},P9=e=>e?.[Symbol.toStringTag]==="KeyObject",P5=e=>P3(e)||P9(e);function P8(e,t,...r){if(r.length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let P7=(e,...t)=>P8("Key must be ",e,...t);function Ve(e,t,r){let i=["CryptoKey","KeyObject","JSON Web Key"];return r&&i.push("Uint8Array"),TypeError(P8(`Key for the ${e} algorithm must be `,t,...i))}let Vt=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function Vr(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Vi(e,t){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function Vo(e,t,r){let i=e.algorithm;if(i.name!==t.name)throw Vt(t.name);if(t.hash&&i.hash?.name!==t.hash)throw Vt(t.hash,"algorithm.hash");if(t.namedCurve&&i.namedCurve!==t.namedCurve)throw Vt(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&i.length!==t.length)throw Vt(t.length,"algorithm.length");Vr(e,r)}function Vn(e){return{__proto__:null,...e}}function Va(e){let t=Vn(e);if(void 0!==t.ext&&"boolean"!=typeof t.ext)throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(void 0!==t.key_ops){let e=t.key_ops,r=Array.isArray(e)?[...e]:void 0;if(!r||r.some(e=>"string"!=typeof e)||new Set(r).size!==r.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=r}return t}function Vs(e){if(void 0!==e&&"boolean"!=typeof e)throw TypeError('"extractable" option must be a boolean');return e}async function Vd(e,t,r){if(!e.kty.includes(t.kty))throw new Pq('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let i=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,o=!!(t.d||t.priv),n={...t,ext:r??t.ext};return"AKP"!==n.kty&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,i,n.ext??!o,t.key_ops??e.usages[+!!o])}async function Vc(e,t,r,i=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,i,[r])),Vo(e,t,r),e}let Vl=e=>crypto.getRandomValues(new Uint8Array(e.cekBits>>3));function Vp(e,t){let r=e.byteLength<<3;if(r!==t)throw new Px(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}function Vu(e,t){if(t.length<<3!==e.ivBits)throw new Px("Invalid Initialization Vector length")}async function Vm(e,t,r){if(!(t instanceof Uint8Array))throw TypeError(P7(t,"Uint8Array"));let i=e.cekBits>>1;return[await crypto.subtle.importKey("raw",t.subarray(i>>3),"AES-CBC",!1,[r]),await crypto.subtle.importKey("raw",t.subarray(0,i>>3),{hash:`SHA-${i<<1}`,name:"HMAC"},!1,["sign"]),i]}async function Vf(e,t,r){return new Uint8Array((await crypto.subtle.sign("HMAC",e,t)).slice(0,r>>3))}async function Vh(e,t,r,i,o){if(!P3(r)&&!(r instanceof Uint8Array))throw TypeError(P7(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(i?Vu(e,i):i=crypto.getRandomValues(new Uint8Array(e.ivBits>>3)),r instanceof Uint8Array&&Vp(r,e.cekBits),e.cbc)return async function(e,t,r,i,o){let[n,a,s]=await Vm(e,r,"encrypt"),d=new Uint8Array(await crypto.subtle.encrypt({iv:i,name:"AES-CBC"},n,t)),c=Ph(o,i,d,Pg(8*o.length));return{ciphertext:d,tag:await Vf(a,c,s),iv:i}}(e,t,r,i,o);let n=await Vc(r,e.subtle,"encrypt"),a=new Uint8Array(await crypto.subtle.encrypt({additionalData:o,iv:i,name:"AES-GCM",tagLength:128},n,t));return{ciphertext:a.subarray(0,-16),tag:a.subarray(-16),iv:i}}async function Vy(e,t,r,i,o,n){if(!P3(t)&&!(t instanceof Uint8Array))throw TypeError(P7(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!i)throw new Px("JWE Initialization Vector missing");if(!o)throw new Px("JWE Authentication Tag missing");if(!e.cbc&&16!==o.length)throw new Px("Invalid Authentication Tag length");if(Vu(e,i),t instanceof Uint8Array&&Vp(t,e.cekBits),e.cbc)return async function(e,t,r,i,o,n){let[a,s,d]=await Vm(e,t,"decrypt"),c=Ph(n,i,r,Pg(8*n.length)),l=await Vf(s,c,d);try{if(await async function(e,t){let r={name:"HMAC",hash:"SHA-256"},i=await crypto.subtle.generateKey(r,!1,["sign","verify"]),o=await crypto.subtle.sign(r,i,e);return crypto.subtle.verify(r,i,o,t)}(o,l))return new Uint8Array(await crypto.subtle.decrypt({iv:i,name:"AES-CBC"},a,r))}catch{}throw new PI}(e,t,r,i,o,n);let a=await Vc(t,e.subtle,"decrypt");try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:n,iv:i,name:"AES-GCM",tagLength:128},a,Ph(r,o)))}catch{throw new PI}}function Vg(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}let V_=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Vv=[[],["deriveBits"]],Vb=[[],[]];function V$(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:V_,ops:["wrapKey","unwrapKey"]}}function VS(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:e,crv:t,asymmetricKeyType:r})=>{if("X25519"===t||"x25519"===r)return{name:"X25519"};if("OKP"===e)throw new Pq('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:t}},usages:Vv,ops:[void 0,"deriveBits"]}}function Vk(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:Vb,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function Vw(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:Vb,ops:["deriveBits","deriveBits"]}}let VP=Vg({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:Vb,ops:["encrypt","decrypt"]},"RSA-OAEP":V$(1),"RSA-OAEP-256":V$(256),"RSA-OAEP-384":V$(384),"RSA-OAEP-512":V$(512),"ECDH-ES":VS("direct-key-agreement"),"ECDH-ES+A128KW":VS("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":VS("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":VS("key-agreement-with-key-wrapping"),A128KW:Vk(128),A192KW:Vk(192),A256KW:Vk(256),A128GCMKW:Vk(128,!0),A192GCMKW:Vk(192,!0),A256GCMKW:Vk(256,!0),"PBES2-HS256+A128KW":Vw(),"PBES2-HS384+A192KW":Vw(),"PBES2-HS512+A256KW":Vw()}),VV=["encrypt","decrypt"];function VR(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:Vb,ops:VV,cekBits:e,ivBits:t?128:96,cbc:t}}let Vq=Vg({A128GCM:VR(128),A192GCM:VR(192),A256GCM:VR(256),"A128CBC-HS256":VR(256,!0),"A192CBC-HS384":VR(384,!0),"A256CBC-HS512":VR(512,!0)});function VI(e,t){throw new Pq(`Invalid or unsupported "${e}" (JWE ${t}) header value`)}function Vx(e){return("string"==typeof e?VP[e]:void 0)??VI("alg","Algorithm")}function Vj(e){return"key-wrapping"===e.mode||"key-encryption"===e.mode||"key-agreement-with-key-wrapping"===e.mode}function VC(e){return("string"==typeof e?Vq[e]:void 0)??VI("enc","Encryption Algorithm")}function VT(e,t){if("ECDH"!==e.algorithm.name&&"X25519"!==e.algorithm.name)throw TypeError("CryptoKey does not support this operation, its algorithm.name must be ECDH or X25519");Vr(e,t)}function VO(e,t,r){Vo(t,Vx(e).subtle,r),Vi(e,t)}async function VE(e,t,r,i){if(!(e instanceof Uint8Array)||e.length<8)throw new Px("PBES2 Salt Input must be 8 or more octets");if(!Number.isSafeInteger(r)||1!==Math.sign(r))throw new Px("PBES2 Count Input must be a positive integer");let o=Ph(Pb(t),Uint8Array.of(0),e),n=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:o},s=await Vc(i,Vx(t).subtle,"deriveBits");return new Uint8Array(await crypto.subtle.deriveBits(a,s,n))}function VA(e){return Ph(P_(e.length),e)}async function VW(e,t,r,i,o=new Uint8Array,n=new Uint8Array){VT(e),VT(t,"deriveBits");let a=Ph(VA(Pb(r)),VA(o),VA(n),P_(i));return async function(e,t,r){let i=t>>3,o=Math.ceil(i/32),n=new Uint8Array(32*o);for(let t=1;t<=o;t++){let i=await Pk("sha256",Ph(P_(t),e,r));n.set(i,(t-1)*32)}return n.slice(0,i)}(new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,"X25519"===e.algorithm.name?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3)),i,a)}function VM(e){P6(e);let t=e.algorithm.namedCurve;if("P-256"!==t&&"P-384"!==t&&"P-521"!==t&&"X25519"!==e.algorithm.name)throw new Pq("ECDH with the provided key is not allowed or not supported by your javascript runtime")}function VN(e,t){let r=e[t];if(void 0!==r){if("string"!=typeof r)throw new Px(`JOSE Header "${t}" (Agreement Party${"apu"===t?"U":"V"}Info) invalid`);return PG(r,t,Px)}}function Vz(e,t){if(void 0!==e&&void 0!==t&&e.byteLength===t.byteLength){for(let r=0;r"u")throw new Pq(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function VH(e,t,r=1/0){let i=e.writable.getWriter();i.write(t).catch(()=>{}),i.close().catch(()=>{});let o=[],n=0,a=e.readable.getReader();for(;;){let{value:e,done:t}=await a.read();if(t)break;if(o.push(e),n+=e.byteLength,1/0!==r&&n>r)throw new Px("Decompressed plaintext exceeded the configured limit")}return Ph(...o)}function VG(e){let{aad:t,ciphertext:r,iv:i,protected:o,tag:n,unprotected:a}=e;if(void 0!==i&&("string"!=typeof i||!i))throw new Px("JWE Initialization Vector incorrect type");if("string"!=typeof r)throw new Px("JWE Ciphertext missing or incorrect type");if(void 0!==n&&("string"!=typeof n||!n))throw new Px("JWE Authentication Tag incorrect type");if(void 0!==o&&"string"!=typeof o)throw new Px("JWE Protected Header incorrect type");if(void 0!==t&&("string"!=typeof t||!t))throw new Px("JWE AAD incorrect type");if(void 0!==a&&!PF(a))throw new Px("JWE Shared Unprotected Header incorrect type");return{aad:t,ciphertext:r,iv:i,protected:o,tag:n,unprotected:void 0===a?void 0:{...a}}}function VB(e){let t,r;try{let{header:i}=e;if(PF(i)){r=i.alg;let e=Object.keys(i);e.includes("alg")||(r=void 0),t=Object.fromEntries(e.map(e=>[e,"alg"===e?r:i[e]]))}else t=i;let{encrypted_key:o}=e;return[{encrypted_key:o,header:t},r]}catch(e){return[void 0,r,e]}}function VK(e){let{encrypted_key:t,header:r}=e;if(void 0!==t&&"string"!=typeof t)throw new Px("JWE Encrypted Key incorrect type");if(void 0!==r&&!PF(r))throw new Px("JWE Per-Recipient Unprotected Header incorrect type");if(void 0===e.protected&&void 0===r&&void 0===e.unprotected)throw new Px("JOSE Header missing")}function VJ(e){let t,{protected:r,ciphertext:i,iv:o,tag:n,aad:a}=e;return void 0!==r&&(t=PK(r,Px,"JWE Protected Header is invalid")),[t,PG(i,"ciphertext",Px),void 0!==o?PG(o,"iv",Px):void 0,void 0!==n?PG(n,"tag",Px):void 0,PB((r??"")+(void 0!==a?`.${a}`:""),"aad",Px)]}function VZ(e){return[e&&PQ("keyManagementAlgorithms",e.keyManagementAlgorithms),e&&PQ("contentEncryptionAlgorithms",e.contentEncryptionAlgorithms),e?.crit,e?.maxPBES2Count,e?.maxDecompressedLength]}async function VQ(e,t,r,i=VJ(e)){let o,n,a,s,[d,c,l,p,u]=i,{header:m,unprotected:f,aad:h}=e;if(void 0!==m||void 0!==f){if(!PU(d,m,f))throw new Px("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");o={...d,...m,...f}}else o=d??{};let[y,g,_,v,b]=t,{encrypted_key:$}=e;PY(Px,PZ,_,d,o),VL(o,d);let{alg:S,enc:k}=o;if("string"!=typeof S||!S)throw new Px("missing JWE Algorithm (alg) in JWE Header");let w=VP[S];if(""===$&&(!w||!Vj(w)))throw new Px("JWE Encrypted Key incorrect type");let P=w?.mode==="integrated-encryption";if(!P&&("string"!=typeof k||!k))throw new Px("missing JWE Encryption Algorithm (enc) in JWE Header");if(y&&!y.has(S)||!y&&S.startsWith("PBES2"))throw new PR('"alg" (Algorithm) Header Parameter value not allowed');if(P){if(void 0!==k)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter must not be present for integrated encryption');if(l?.byteLength)throw new Px("JWE Initialization Vector must be empty for integrated encryption");if(p?.byteLength)throw new Px("JWE Authentication Tag must be empty for integrated encryption")}else{if(g&&!g.has(k))throw new PR('"enc" (Encryption Algorithm) Header Parameter value not allowed');n=VC(k)}if(void 0!==$)try{a=PG($,"encrypted_key",Px)}catch(e){if(!w||!Vj(w))throw e;a=new Uint8Array}let V=!1;"function"==typeof r&&(r=await r(d,e),V=!0);let R=w??Vx(S);Vj(R)&&void 0===a&&(a=new Uint8Array);let q=await P2("direct-encryption"===R.mode?n:R,r,"decrypt");if("integrated-encryption"===R.mode)s=await R.decrypt(q,a,c,u,d,o);else{let e,t=n;try{e=await async function(e,t,r,i,o,n){let{alg:a}=e,s=e.mode;if("direct-encryption"===s)return VD(i),r;let d="direct-key-agreement"===s;switch(d?VD(i):function(e){if(void 0===e)throw new Px("JWE Encrypted Key missing")}(i),e.subtle.name){case"ECDH":{let{epk:i}=o;if(!PF(i)||["d","k","p","q","dp","dq","qi","oth","priv"].some(e=>Object.hasOwn(i,e)))throw new Px('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');VM(r);let n=await Vd(e,i),s=VN(o,"apu"),c=VN(o,"apv");Vz(s,c);let l=await VW(n,r,d?t.alg:a,d?t.cekBits:parseInt(a.slice(-5,-2),10),s,c);if(d)return l;r=l;break}case"RSA-OAEP":return P6(r),VO(a,r,"decrypt"),new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP",r,i));case"PBKDF2":{if("number"!=typeof o.p2c)throw new Px('JOSE Header "p2c" (PBES2 Count) missing or invalid');if(void 0!==n&&1/0!==n&&(!Number.isSafeInteger(n)||n<1))throw TypeError("maxPBES2Count must be a positive safe integer or Infinity");if(o.p2c>(n??1e4))throw new Px('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof o.p2s)throw new Px('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let e=PG(o.p2s,"p2s",Px);r=await VE(e,a,o.p2c,r);break}case"AES-GCM":{if("string"!=typeof o.iv)throw new Px('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof o.tag)throw new Px('JOSE Header "tag" (Authentication Tag) missing or invalid');let e=PG(o.iv,"iv",Px),t=PG(o.tag,"tag",Px);if(12!==e.byteLength)throw new Px("Invalid Initialization Vector length");if(16!==t.byteLength)throw new Px("Invalid Authentication Tag length");return Vy(VC(a.slice(0,-2)),r,i,e,t,new Uint8Array)}}return async function(e,t,r){let i=await Vc(t,Vx(e).subtle,"unwrapKey",!0),o=await crypto.subtle.unwrapKey("raw",r,i,"AES-KW",{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.exportKey("raw",o))}(a.slice(-6),r,i)}(R,t,q,a,o,v),Vj(R)&&e instanceof Uint8Array&&e.byteLength<<3!==t.cekBits&&(e=Vl(t))}catch(r){if(r instanceof TypeError||r instanceof Px||r instanceof Pq)throw r;e=Vl(t)}s=await Vy(t,e,c,l,p,u)}if("DEF"===o.zip){let e=b??25e4;if(0===e)throw new Pq('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');if(1/0!==e&&(!Number.isSafeInteger(e)||e<1))throw TypeError("maxDecompressedLength must be 0, a positive safe integer, or Infinity");s=await (async function(e,t){return VU("DecompressionStream"),VH(new DecompressionStream("deflate-raw"),e,t)})(s,e).catch(e=>{throw e instanceof Px?e:new Px("Failed to decompress plaintext",{cause:e})})}return{plaintext:s,...d&&{protectedHeader:d},...void 0!==h&&{additionalAuthenticatedData:PG(h,"aad",Px)},...f&&{sharedUnprotectedHeader:f},...m&&{unprotectedHeader:m},...V&&{key:q}}}async function VX(e,t,r){if(e instanceof Uint8Array&&(e=Pm.decode(e)),"string"!=typeof e)throw new Px("Compact JWE must be a string or Uint8Array");let{0:i,1:o,2:n,3:a,4:s,length:d}=e.split(".");if(5!==d)throw new Px("Invalid Compact JWE");return VQ({ciphertext:a,iv:n||void 0,protected:i,tag:s||void 0,encrypted_key:o||void 0},t,r)}async function VY(e,t,r){return VX(e,VZ(r),t)}async function V1(e,t,r){if(!PF(e))throw new Px("Flattened JWE must be an object");let i=VG(e),[o,,n]=VB(e);if(!o)throw n;let a={...i,...o};return VK(a),VQ(a,VZ(r),t)}async function V0(e,t,r){let i,o,n;if(!PF(e))throw new Px("General JWE must be an object");let a=e.recipients;if(!Array.isArray(a))throw new Px("JWE Recipients missing or incorrect type");let s=Array.from(a);if(!s.every(PF))throw new Px("JWE Recipients missing or incorrect type");if(!s.length)throw new Px("JWE Recipients has no members");try{i=VZ(r),o=VG(e),n=VJ(o)}catch{throw new PI}let d=s.map(e=>VB(e));if(s.length>1)for(let[,e]of d){let t=n[0]?.alg??e??o.unprotected?.alg,r="string"==typeof t?VP[t]:void 0;if(r&&!Vj(r))throw new Px(`"${t}" alg may only have a single recipient`)}for(let[e]of d)if(e)try{let r={...o,...e};return VK(r),await VQ(r,i,t,n)}catch{}throw new PI}function V2(e,t,r){if(!PU(e,t,r))throw new Px("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint")}function V4(e,t,r=!1){if(!e[1]&&!e[2]&&!e[3])throw new Px("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");void 0!==t&&(e[8]=t?.crit);let[,i,o,n,a,s,d,c,l]=e;if(void 0!==a&&PD(a,"JWE Additional Authenticated Data"),void 0!==s&&PD(s,"JWE Content Encryption Key"),void 0!==d&&PD(d,"JWE Initialization Vector"),r||void 0===i||(i=P0(Px,i)[0],e[1]=i),void 0!==o&&(o=P0(Px,o)[0],e[2]=o),r||void 0===n||(n=P0(Px,n)[0],e[3]=n),void 0!==c&&!PF(c))throw TypeError("JWE Key Management Parameters must be an object");V2(i,o,n);let p={...i,...o,...n};PX(Px,i),PY(Px,PZ,l,i,p),VL(p,i);let{alg:u,enc:m}=p;if("string"!=typeof u||!u)throw new Px('JWE "alg" (Algorithm) Header Parameter missing or invalid');let f=VP[u];if(f?.mode==="integrated-encryption"){if(void 0!==m)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter must not be present for integrated encryption');if(void 0!==s)throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${u}`);if(void 0!==d)throw TypeError(`setInitializationVector cannot be called with JWE "alg" (Algorithm) Header ${u}`);return[p,void 0,f]}if("string"!=typeof m||!m)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');return[p,VC(m),f]}async function V6(e,t,r){let i,o,n,a,s,d,[c,l,p]=t,[u,m,f,h,y,g,_,v,,b]=e,$=m,S=f,k=p??Vx(c.alg);"integrated-encryption"===k.mode?n=await P2(k,r,"encrypt"):[n,i,o]=await VF(k,l,r,c,g,v),o&&(b?S=S?{...S,...o}:o:$=$?{...$,...o}:o,V2($,S,h));let w=$?Pz(JSON.stringify($)):"",P=y?.byteLength?Pz(y):void 0,V=Pb(P?`${w}.${P}`:w),R=u;"DEF"===c.zip&&(R=await (async function(e){return VU("CompressionStream"),VH(new CompressionStream("deflate-raw"),e)})(R).catch(e=>{throw new Px("Failed to compress plaintext",{cause:e})})),"integrated-encryption"===k.mode?[i,a]=await k.encrypt(n,R,V,$,c,v):{ciphertext:a,tag:s,iv:d}=await Vh(l,R,n,_,V);let q={ciphertext:Pz(a)};return d&&(q.iv=Pz(d)),s&&(q.tag=Pz(s)),i?.byteLength&&(q.encrypted_key=Pz(i)),P&&(q.aad=P),$&&(q.protected=w),h&&(q.unprotected=h),S&&(q.header=S),q}async function V3(e,t,r){return V6(e,V4(e,r),t)}function V9(e){return[e.protected,e.encrypted_key,e.iv,e.ciphertext,e.tag].join(".")}class V5{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r]}setUnprotectedHeader(e){return PH(this.state[0],"setUnprotectedHeader"),this.state[0]=e,this}setKeyManagementParameters(e){return PH(this.state[1],"setKeyManagementParameters"),this.state[1]=e,this}addRecipient(...e){return this.#f.addRecipient(...e)}encrypt(...e){return this.#f.encrypt(...e)}done(){return this.#f}}class V8{#h;#y=[];#g;#_;#v;constructor(e){this.#h=e}addRecipient(e,t){let r=new V5(this,e,t?.crit);return this.#y.push(r),r}setProtectedHeader(e){return PH(this.#g,"setProtectedHeader"),this.#g=e,this}setSharedUnprotectedHeader(e){return PH(this.#_,"setSharedUnprotectedHeader"),this.#_=e,this}setAdditionalAuthenticatedData(e){return this.#v=e,this}async encrypt(){if(!this.#y.length)throw new Px("at least one recipient must be added");PD(this.#h,"plaintext");let e=this.#y.length>1,t,r=this.#g,i=this.#_,o=[];for(let n of this.#y){let[a,s,d,c]=n.state,l=[this.#h,r,a,i,this.#v,void 0,void 0,s,c,e],p=V4(l,void 0,o.length>0);o.length||(r=l[1],i=l[3]),o.push([l,p,d]);let[{alg:u,enc:m},,f]=p;if(e&&f&&!Vj(f))throw new Px(`"${u}" alg may only have a single recipient`);if(t){if(t!==m)throw new Px('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else t=m}for(let[,e]of o)e[2]??=Vx(e[0].alg);let[n,a,s]=o[0],d=e?Vl(a[1]):void 0;n[5]=d;let{encrypted_key:c,header:l,...p}=await V6(n,a,s),u={...p,recipients:[{}]};c&&(u.recipients[0].encrypted_key=c),l&&(u.recipients[0].header=l);for(let e=1;e(function(e,t){try{let r=Rs(e,[t]),i=Rc(r.protected),{b64:o,crit:n}=i;return[r,i,Array.isArray(n)&&n.includes("b64")?"boolean"==typeof o?o?1:2:0:1]}catch{return}})(e,s)).filter(e=>void 0!==e),c=0;for(let[,,e]of d)if(3==(c|=e))throw new Pj("inconsistent use of JWS Unencoded Payload (RFC7797)");for(let e of d)try{let[r]=await Ru(e[0],i,t,Rl,e[1]);return r}catch{}throw new PM}let Rg=e=>Math.floor(e.getTime()/1e3),R_={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},Rv=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Rb="check_failed";function R$(){throw TypeError("Invalid time period format")}function RS(e){"string"!=typeof e&&R$();let t=Rv.exec(e);(!t||t[4]&&t[1])&&R$();let r=Math.round(parseFloat(t[2])*R_[t[3][0].toLowerCase()]);return Number.isFinite(r)||R$(),"-"===t[1]||"ago"===t[4]?-r:r}function Rk(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}function Rw(e,t){if("string"!=typeof t)throw TypeError(`"${e}" claim must be a string`)}function RP(e,t){return"number"==typeof e?Rk(t,e):e instanceof Date?Rk(t,Rg(e)):Rg(new Date)+RS(e)}let RV=e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`};function RR(e,t,r=!1){let i=e[t];if(!(void 0===i&&!r)){if("number"!=typeof i)throw new PP(`"${t}" claim must be a number`,e,t,"invalid");return i}}function Rq(e,t){throw new PP(`unexpected "${t}" claim value`,e,t,Rb)}function RI(e,t,r={}){let i,o,n;try{i=JSON.parse(Pf.decode(t))}catch{}if(!PF(i))throw new PC("JWT Claims Set must be a top-level JSON object");let{typ:a}=r;if(void 0!==a&&("string"!=typeof e.typ||RV(e.typ)!==RV(a)))throw new PP('unexpected "typ" JWT header value',i,"typ",Rb);let{requiredClaims:s=[],issuer:d,subject:c,audience:l,maxTokenAge:p}=r,u=[...s];for(let e of(void 0!==p&&u.push("iat"),void 0!==l&&u.push("aud"),void 0!==c&&u.push("sub"),void 0!==d&&u.push("iss"),new Set(u.reverse())))if(!Object.hasOwn(i,e))throw new PP(`missing required "${e}" claim`,i,e,"missing");void 0===d||(Array.isArray(d)?d:[d]).includes(i.iss)||Rq(i,"iss"),void 0!==c&&i.sub!==c&&Rq(i,"sub"),void 0===l||(o=i.aud,n="string"==typeof l?[l]:l,"string"==typeof o?n.includes(o):!!Array.isArray(o)&&n.some(e=>o.includes(e)))||Rq(i,"aud");let{clockTolerance:m}=r,f=0;if("string"==typeof m)f=RS(m);else if(void 0!==m){if("number"!=typeof m)throw TypeError("Invalid clockTolerance option type");f=m}Rk("clockTolerance option",f);let{currentDate:h}=r,y=Rk("currentDate option",Rg(void 0===h?new Date:h)),g=RR(i,"iat",void 0!==p),_=RR(i,"nbf");if(void 0!==_&&_>y+f)throw new PP('"nbf" claim timestamp check failed',i,"nbf",Rb);let v=RR(i,"exp");if(void 0!==v&&v<=y-f)throw new PV('"exp" claim timestamp check failed',i,"exp",Rb);if(void 0!==p){let e=y-g;if(e-f>Rk("maxTokenAge option","number"==typeof p?p:RS(p)))throw new PV('"iat" claim timestamp check failed (too far in the past)',i,"iat",Rb);if(e<-f)throw new PP('"iat" claim timestamp check failed (it should be in the past)',i,"iat",Rb)}return i}function Rx(e){return f.get(e)}function Rj(e){let t=Rx(e);for(let e of["iat","nbf","exp"]){let r=t[e];if("number"==typeof r&&!Number.isFinite(r))throw TypeError(`"${e}" claim must be a finite number`)}return Pu.encode(JSON.stringify(t))}class RC{constructor(e={}){if(!PF(e))throw TypeError("JWT Claims Set MUST be an object");(f||=new WeakMap).set(this,structuredClone(e))}setIssuer(e){return Rw("iss",e),Rx(this).iss=e,this}setSubject(e){return Rw("sub",e),Rx(this).sub=e,this}setAudience(e){return function(e){if("string"!=typeof e&&(!Array.isArray(e)||Array.from(e).some(e=>"string"!=typeof e)))throw TypeError('"aud" claim must be a string or an array of strings')}(e),Rx(this).aud=e,this}setJti(e){return Rw("jti",e),Rx(this).jti=e,this}setNotBefore(e){return Rx(this).nbf=RP(e,"setNotBefore"),this}setExpirationTime(e){return Rx(this).exp=RP(e,"setExpirationTime"),this}setIssuedAt(e){let t=Rx(this);return void 0===e?t.iat=Rg(new Date):"string"==typeof e?t.iat=Rk("setIssuedAt",Rg(new Date)+RS(e)):t.iat=RP(e,"setIssuedAt"),this}}async function RT(e,t,r){let[i,o]=await Rm(e,Rd(r),t);if(!o)throw new PC("JWTs MUST NOT use unencoded payload");let n=RI(i.protectedHeader,i.payload,r);return{...i,payload:n}}async function RO(e,t,r){let{plaintext:i,...o}=await VX(e,VZ(r),t),{protectedHeader:n}=o,a=RI(n,i,r);for(let e of["iss","sub","aud"])if(void 0!==n[e]&&("aud"===e?JSON.stringify(n.aud)!==JSON.stringify(a.aud):n[e]!==a[e]))throw new PP(`replicated "${e}" claim header parameter mismatch`,a,e,"mismatch");return{payload:a,...o}}class RE{#b;constructor(e){PD(e,"plaintext"),this.#b=[e]}setContentEncryptionKey(e){return PH(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PH(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PH(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}async encrypt(e,t){return V9(await V3([...this.#b],e,t))}}class RA{#b;constructor(e){PD(e,"plaintext"),this.#b=[e]}setKeyManagementParameters(e){return PH(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setSharedUnprotectedHeader(e){return PH(this.#b[3],"setSharedUnprotectedHeader"),this.#b[3]=e,this}setUnprotectedHeader(e){return PH(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}setAdditionalAuthenticatedData(e){return this.#b[4]=e,this}setContentEncryptionKey(e){return PH(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PH(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}async encrypt(e,t){return V3([...this.#b],e,t)}}async function RW(e,t,r){let[i,o,n,a]=e,s="";if(void 0!==o){let e=P0(Pj,o);o=e[0],s=Pz(e[1])}if(void 0!==n&&(n=P0(Pj,n)[0]),!o&&!n)throw new Pj("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!PU(o,n))throw new Pj("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...o,...n};PX(Pj,o);let c=P1(o,PY(Pj,PJ,a,o,d));c||r?.();let{alg:l}=d;if("string"!=typeof l||!l)throw new Pj('JWS "alg" (Algorithm) Header Parameter missing or invalid');let p=Ra(l),u="",m=i,f;if(c){let t=e[4];t?(u=t[0]??=Pz(i),m=t[1]??=Pb(u)):(u=Pz(i),f=Pu.encode(`${s}.${u}`))}f??=Ph(Pb(s),Pb("."),m);let h=await Vc(await P2(p,t,"sign"),p.subtle,"sign");p.minRsaBits&&Vi(p.alg,h);let y={signature:Pz(new Uint8Array(await crypto.subtle.sign(p.signing,h,f))),payload:u};return o&&(y.protected=s),n&&(y.header=n),[y,c]}async function RM(e,t,r,i,o){let[n]=await RW([e,t,void 0,r],i,o);return`${n.protected}.${n.payload}.${n.signature}`}class RN{#$;#g;constructor(e){PD(e,"payload"),this.#$=e}setProtectedHeader(e){return PH(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RM(this.#$,this.#g,t?.crit,e,()=>{throw TypeError("use the flattened module for creating JWS with b64: false")})}}class Rz{#b;constructor(e){PD(e,"payload"),this.#b=[e]}setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setUnprotectedHeader(e){return PH(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}async sign(e,t){let r=[...this.#b];r[3]=t?.crit;let[i]=await RW(r,e);return i}}class RD{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r?.crit]}setProtectedHeader(e){return PH(this.state[0],"setProtectedHeader"),this.state[0]=e,this}setUnprotectedHeader(e){return PH(this.state[1],"setUnprotectedHeader"),this.state[1]=e,this}addSignature(...e){return this.#f.addSignature(...e)}sign(...e){return this.#f.sign(...e)}done(){return this.#f}}class RF{#$;#S=[];constructor(e){this.#$=e}addSignature(e,t){let r=new RD(this,e,t);return this.#S.push(r),r}async sign(){let e;if(!this.#S.length)throw new Pj("at least one signature must be added");PD(this.#$,"payload");let t={signatures:[],payload:""},r=[];for(let i of this.#S){let[o,n,a,s]=i.state,[{payload:d,...c},l]=await RW([this.#$,o,n,s,r],a);if(void 0===e)e=l,t.payload=d;else if(e!==l)throw new Pj("inconsistent use of JWS Unencoded Payload (RFC7797)");t.signatures.push(c)}return t}}let RL=RC;class RU extends RL{#g;setProtectedHeader(e){return PH(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RM(Rj(this),this.#g,t?.crit,e,()=>{throw new PC("JWTs MUST NOT use unencoded payload")})}}let RH=RC;class RG extends RH{#b=[void 0];#k;#w;#P;setProtectedHeader(e){return PH(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PH(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setContentEncryptionKey(e){return PH(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PH(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}replicateIssuerAsHeader(){return this.#k=!0,this}replicateSubjectAsHeader(){return this.#w=!0,this}replicateAudienceAsHeader(){return this.#P=!0,this}async encrypt(e,t){let r=Rj(this);this.#b[1]&&(this.#k||this.#w||this.#P)&&(this.#b[1]={...this.#b[1],iss:this.#k?Rx(this).iss:void 0,sub:this.#w?Rx(this).sub:void 0,aud:this.#P?Rx(this).aud:void 0});let i=[...this.#b];return i[0]=r,V9(await V3(i,e,t))}}let RB='"alg" (Algorithm)';function RK(e='JWK "alg" (Algorithm) Parameter'){throw new Pq(`Invalid or unsupported ${e} value`)}function RJ(e,t){return("string"==typeof e?Rn[e]??VP[e]:void 0)??RK(t)}let RZ=async(e,t,r)=>{var i,o;let n;if(P9(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!P3(r))throw TypeError(P7(r,"CryptoKey","KeyObject"));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return i=P$(new Uint8Array(await crypto.subtle.exportKey(t,r))),o=`${e.toUpperCase()} KEY`,n=(i.match(/.{1,64}/g)||[]).join(` `),`-----BEGIN ${o}----- ${n} -----END ${o}-----`},RQ=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r({data:e,pos:0}),RY=e=>{let t=e.data[e.pos++];if(void 0===t)throw Error("Unexpected end of ASN.1 input");return t},R1=e=>{let t=RY(e);if(128&t){let r=127&t,i=0;for(let t=0;t{for(;t-- >0;){e.pos++;let t=R1(e);e.pos+=t}},R2=(e,t,r)=>{if(RY(e)!==t)throw Error(r)},R4=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},R6=async(e,t,r,i)=>{let o,n=Vs(i?.extractable),a=RJ(r,RB);a.secret&&RK(RB);let s="spki"===e;if(a.resolve)try{let r=RX(t);(function(e,t){if(R2(e,48,`Invalid ${"spki"===t?"SPKI":"PKCS#8"} structure`),R1(e),"pkcs8"===t){R2(e,2,"Expected version field");let t=R1(e);e.pos+=t}R2(e,48,"Expected algorithm identifier"),R1(e)})(r,e),o=a.resolve({crv:(e=>{let t,r=(R2(e,6,"Expected algorithm OID"),t=R1(e),R4(e,t));if(RQ(r,[43,101,110]))return"X25519";if(!RQ(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");R2(e,6,"Expected curve OID");let i=R1(e),o=R4(e,i);if(RQ(o,[42,134,72,206,61,3,1,7]))return"P-256";if(RQ(o,[43,129,4,0,34]))return"P-384";if(RQ(o,[43,129,4,0,35]))return"P-521";throw Error("Unsupported named curve")})(r)})}catch{throw new Pq("Invalid or unsupported key format")}else o=a.subtle;return crypto.subtle.importKey(e,t,o,n??s,a.usages[+!s])},R3=(e,t)=>PS(e.replace(t,""));function R9(e){return RZ("public","spki",e)}function R5(e){return RZ("private","pkcs8",e)}async function R8(e){if(P9(e))if("secret"!==e.type)return e.export({format:"jwk"});else e=e.export();if(e instanceof Uint8Array)return{kty:"oct",k:Pz(e)};if(!P3(e))throw TypeError(P7(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let t=await crypto.subtle.exportKey("jwk",e);for(let e of(delete t.ext,delete t.key_ops,delete t.use,"AKP"!==t.kty&&delete t.alg,Object.keys(t)))void 0===t[e]&&delete t[e];return t}let R7=(e,t)=>{if("string"!=typeof e||!e)throw new PT(`${t} missing or invalid`)};async function qe(e,t){let r,i;if(PF(e)){if("string"!=typeof(r=Vn(e)).kty)throw TypeError(P7(e,"CryptoKey","KeyObject","JSON Web Key"))}else if(P5(e))r=Vn(await R8(e));else throw TypeError(P7(e,"CryptoKey","KeyObject","JSON Web Key"));if("sha256"!==(t??="sha256")&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(r.kty){case"AKP":R7(r.alg,'"alg" (Algorithm) Parameter'),R7(r.pub,'"pub" (Public key) Parameter'),i={alg:r.alg,kty:r.kty,pub:r.pub};break;case"EC":R7(r.crv,'"crv" (Curve) Parameter'),R7(r.x,'"x" (X Coordinate) Parameter'),R7(r.y,'"y" (Y Coordinate) Parameter'),i={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":R7(r.crv,'"crv" (Subtype of Key Pair) Parameter'),R7(r.x,'"x" (Public Key) Parameter'),i={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":R7(r.e,'"e" (Exponent) Parameter'),R7(r.n,'"n" (Modulus) Parameter'),i={e:r.e,kty:r.kty,n:r.n};break;case"oct":if("string"!=typeof r.k)throw new PT('"k" (Key Value) Parameter missing or invalid');i={k:r.k,kty:r.kty};break;default:throw new Pq('"kty" (Key Type) Parameter missing or unsupported')}let o=Pb(JSON.stringify(i));return Pz(await Pk(t,o))}async function qt(e,t){t??="sha256";let r=await qe(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}async function qr(e,t){let r,i={...e,...t?.header};if(!PF(i.jwk))throw new Pj('"jwk" (JSON Web Key) Header Parameter must be a JSON object');try{r=Va(i.jwk)}catch(e){throw new Pj("Invalid Embedded JWK",{cause:e})}let o=Ra(i.alg);if(void 0!==r.use&&"sig"!==r.use)throw new Pj('Invalid Embedded JWK, its "use" must be "sig" when present');if(void 0!==r.alg&&r.alg!==o.alg)throw new Pj(`Invalid Embedded JWK, its "alg" must be "${o.alg}" when present`);let n=await Vd(o,r,!0);if("public"!==n.type)throw new Pj('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}async function qi(e,t,r){let i=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(void 0===i[o]){let e=Vd(r,t,!0).then(e=>{if("public"!==e.type)throw new PO("JSON Web Key Set members must be public keys");return i[o]=e,e}).catch(t=>{throw i[o]===e&&delete i[o],t});i[o]=e}return i[o]}function qo(e){let t;try{t=structuredClone(e)}catch{}if(!PL(t))throw new PO("JSON Web Key Set malformed");let r=t.keys.map(e=>{let t=Vn(e);return Array.isArray(t.key_ops)&&(t.key_ops=[...t.key_ops]),t}),i=new WeakMap;return Object.defineProperty(async(e,o)=>{let{alg:n,kid:a}={...e,...o?.header},s="string"==typeof n?Rn[n]:void 0;if(!s||s.secret)throw new Pq('Unsupported "alg" value for a JSON Web Key Set');let d=t.keys.filter((e,t)=>(function(e,t,r,i){let{kty:o,key_ops:n,ext:a,kid:s,alg:d,use:c,crv:l}=e;return(void 0===a||"boolean"==typeof a)&&(void 0===n||Array.isArray(n)&&n.every((e,t)=>"string"==typeof e&&n.indexOf(e)===t)&&n.includes("verify"))&&t.kty.includes(o)&&(void 0===i||"string"==typeof i&&i===s)&&(void 0===d?"AKP"!==o:r===d)&&(void 0===c||"sig"===c)&&(!t.crv||l===t.crv)})(r[t],s,n,a)),{0:c,length:l}=d;if(!l)throw new PE;if(1!==l){let e=new PA;throw e[Symbol.asyncIterator]=async function*(){for(let e of d)try{yield await qi(i,e,s)}catch{}},e}return qi(i,c,s)},"jwks",{value:()=>structuredClone(t)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(h="jose/v6.2.12");let qn=Symbol(),qa=Symbol();function qs(e,t){return Number.isFinite(e)&&Date.now(){if(u&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(u=void 0),!u){let e=++m,t=u=(async function(e,t,r,i=fetch){let o=await i(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{throw"TimeoutError"===e.name?new PW:e});if(200!==o.status)throw new Pw("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch{throw new Pw("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(r,d,AbortSignal.timeout(n),c).then(t=>{let r=qo(t);if(e<=f)return;y=r;let i=Date.now();l&&(l.uat=i,l.jwks=t),p=i,f=e}).finally(()=>{u===t&&(u=void 0)})}await u};return Object.defineProperties(async(e,t)=>{y&&qs(p,s)||await g();try{return await y(e,t)}catch(r){if(r instanceof PE&&!qs(p,a))return await g(),y(e,t);throw r}},{coolingDown:{get:()=>qs(p,a),enumerable:!0},fresh:{get:()=>qs(p,s),enumerable:!0},reload:{value:g,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>y?.jwks(),enumerable:!0}})}let ql=RC;class qp extends ql{encode(){let e=Pz(JSON.stringify({alg:"none"})),t=Pz(Rj(this));return`${e}.${t}.`}static decode(e,t){let r,i;if("string"!=typeof e)throw new PC("Unsecured JWT must be a string");let{0:o,1:n,2:a,length:s}=e.split(".");if(3!==s||""!==a)throw new PC("Invalid Unsecured JWT");try{r=PK(o,Pj,"JWS Protected Header is invalid");let e=PY(Pj,PJ,void 0,r,r);i=P1(r,e)}catch(e){throw e instanceof Pj?new PC("Invalid Unsecured JWT",{cause:e}):e}if("none"!==r.alg)throw new PC("Invalid Unsecured JWT");if(!i)throw new PC("JWTs MUST NOT use unencoded payload");return{payload:RI(r,PG(n,"payload",PC),t),header:r}}}async function qu(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw TypeError('"spki" must be SPKI formatted string');return R6("spki",R3(e,/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g),t,r)}async function qm(e,t,r){let i;if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw TypeError('"x509" must be X.509 formatted string');try{let t=R3(e,/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g);i=function(e){let t=RX(e);R2(t,48,"Invalid certificate structure");let r=R1(t);if(r<0||t.pos+r>t.data.length)throw Error("Unexpected end of ASN.1 input");R2(t,48,"Invalid tbsCertificate structure"),R1(t),160===e[t.pos]?R0(t,6):R0(t,5);let i=t.pos;R2(t,48,"Invalid SPKI structure");let o=R1(t);return e.subarray(i,i+o+(t.pos-i))}(t)}catch(e){throw TypeError("Failed to parse the X.509 certificate",{cause:e})}return R6("spki",i,t,r)}async function qf(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return R6("pkcs8",R3(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),t,r)}async function qh(e,t,r){if(!PF(e))throw TypeError("JWK must be an object");let i=Va(e),o=Vs(r?.extractable),{alg:n}=i;if(t??=n,"oct"!==i.kty&&!t)throw TypeError('"alg" argument is required when "jwk.alg" is not present');switch(i.kty){case"oct":if("string"!=typeof i.k)throw TypeError('missing "k" (Key Value) Parameter value');return PN(i.k);case"AKP":if("string"!=typeof n||!n)throw TypeError('missing "alg" (Algorithm) Parameter value');if(t!==n)throw TypeError("JWK alg and alg option value mismatch");return Vd(RJ(t),i,o);case"RSA":case"EC":case"OKP":return Vd(RJ(t),i,o);default:throw new Pq('Unsupported "kty" (Key Type) Parameter value')}}function qy(e){let t;if("string"==typeof e){let r=e.split(".");(3===r.length||5===r.length)&&([t]=r)}else if("object"==typeof e&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");let r="Invalid Token or Protected Header formatting";if("string"!=typeof t||!t)throw TypeError(r);return PK(t,TypeError,r)}function qg(e){let t,r;if("string"!=typeof e)throw new PC("JWTs must use Compact JWS serialization, JWT must be a string");let{1:i,length:o}=e.split(".");if(5===o)throw new PC("Only JWTs using Compact JWS serialization can be decoded");if(3!==o)throw new PC("Invalid JWT");if(!i)throw new PC("JWTs must contain a payload");try{t=PN(i)}catch{throw new PC("Failed to base64url decode the payload")}try{r=JSON.parse(Pf.decode(t))}catch{throw new PC("Failed to parse the decoded payload as JSON")}if(!PF(r))throw new PC("Invalid JWT Claims Set");return r}async function q_(e,t){let r,i=Vs(t?.extractable),o=RJ(e,RB);if(o.secret&&RK(RB),o.resolve){let e=t?.crv??"P-256";if(!["P-256","P-384","P-521","X25519"].includes(e))throw new Pq("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, and X25519");r=o.resolve({crv:e})}else{if(void 0!==o.crv&&t?.crv!==void 0&&t.crv!==o.crv)throw new Pq(`Invalid or unsupported crv option provided, the only supported value for ${e} is ${o.crv}`);r="RSA"===o.kty[0]?{...o.subtle,publicExponent:Uint8Array.of(1,0,1),modulusLength:function(e){let t=e?.modulusLength??2048;if("number"!=typeof t||!Number.isInteger(t)||t<2048)throw new Pq("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return t}(t)}:o.subtle}return crypto.subtle.generateKey(r,i??!1,[...o.usages[1],...o.usages[0]])}async function qv(e,t){let r,i,o,n=Vs(t?.extractable);switch(e){case"HS256":case"HS384":case"HS512":r=+e.slice(-3),i={name:"HMAC",hash:`SHA-${r}`,length:r},o=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return crypto.getRandomValues(new Uint8Array(e.slice(-3)>>3));case"A128KW":case"A192KW":case"A256KW":i={name:"AES-KW",length:r=+e.slice(1,4)},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":i={name:"AES-GCM",length:r=+e.slice(1,4)},o=["encrypt","decrypt"];break;default:RK(RB)}return crypto.subtle.generateKey(i,n??!1,o)}let qb="WebCryptoAPI";var q$=kO(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var i=class extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}};function o(e,...t){let r=[e[0]],n=0;for(;n{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=q$();var r,i,o=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};(r=i||(e.UsedValueState=i={}))[r.Started=0]="Started",r[r.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=n;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(r)}[${i}]`}};e.ValueScopeName=a;let s=(0,t._)`\n`;var d=class extends n{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,n=null!=(r=t.key)?r:t.ref,a=this._values[o];if(a){let e=a.get(n);if(e)return e}else a=this._values[o]=new Map;a.set(n,i);let s=this._scope[o]||(this._scope[o]=[]),d=s.length;return s[d]=t.ref,i.setValue(t,{property:o,itemIndex:d}),i}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw Error(`CodeGen: name "${r}" has no value`);return(0,t._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(r,n,a={},s){let d=t.nil;for(let c in r){let l=r[c];if(!l)continue;let p=a[c]=a[c]||new Map;l.forEach(r=>{if(p.has(r))return;p.set(r,i.Started);let a=n(r);if(a){let i=this.opts.es5?e.varKinds.var:e.varKinds.const;d=(0,t._)`${d}${i} ${r} = ${a};${this.opts._n}`}else if(a=null==s?void 0:s(r))d=(0,t._)`${d}${a}${this.opts._n}`;else throw new o(r);p.set(r,i.Completed)})}return d}};e.ValueScope=d}),qk=kO(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=q$(),r=qS();var i=q$();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return i.Name}});var o=qS();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var n=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},a=class extends n{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let i=e?r.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${i} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends n{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=x(this.rhs,e,r),this}get names(){return I(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},d=class extends s{constructor(e,t,r,i){super(e,r,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},c=class extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},l=class extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},p=class extends n{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},u=class extends n{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=x(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},m=class extends n{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,i=r.length;for(;i--;){let o=r[i];o.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,o.names),r.splice(i,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>q(e,t.names),{})}},f=class extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},h=class extends m{},y=class extends f{};y.kind="else";var g=class e extends f{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(!0===t)return this.nodes;let r=this.else;if(r){let e=r.optimizeNodes();r=this.else=Array.isArray(e)?new y(e):e}return r?!1===t?r instanceof e?r:r.nodes:this.nodes.length?this:new e(j(t),r instanceof e?[r]:r.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=x(this.condition,e,t),this}get names(){let e=super.names;return I(e,this.condition),this.else&&q(e,this.else.names),e}};g.kind="if";var _=class extends f{};_.kind="for";var v=class extends _{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=x(this.iteration,e,t),this}get names(){return q(super.names,this.iteration.names)}},b=class extends _{constructor(e,t,r,i){super(),this.varKind=e,this.name=t,this.from=r,this.to=i}render(e){let t=e.es5?r.varKinds.var:this.varKind,{name:i,from:o,to:n}=this;return`for(${t} ${i}=${o}; ${i}<${n}; ${i}++)`+super.render(e)}get names(){return I(I(super.names,this.from),this.to)}},$=class extends _{constructor(e,t,r,i){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=x(this.iterable,e,t),this}get names(){return q(super.names,this.iterable.names)}},S=class extends f{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};S.kind="func";var k=class extends m{render(e){return"return "+super.render(e)}};k.kind="return";var w=class extends f{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,i;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(i=this.finally)||i.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&q(e,this.catch.names),this.finally&&q(e,this.finally.names),e}},P=class extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};P.kind="catch";var V=class extends f{render(e){return"finally"+super.render(e)}};V.kind="finally";var R=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,i){let o=this._scope.toName(t);return void 0!==r&&i&&(this._constants[o.str]=r),this._leafNode(new a(e,o,r)),o}const(e,t,i){return this._def(r.varKinds.const,e,t,i)}let(e,t,i){return this._def(r.varKinds.let,e,t,i)}var(e,t,i){return this._def(r.varKinds.var,e,t,i)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new d(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new u(e)),this}object(...e){let r=["{"];for(let[i,o]of e)r.length>1&&r.push(","),r.push(i),(i!==o||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,o));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,i,o,n=this.opts.es5?r.varKinds.var:r.varKinds.let){let a=this._scope.toName(e);return this._for(new b(n,a,t,i),()=>o(a))}forOf(e,i,o,n=r.varKinds.const){let a=this._scope.toName(e);if(this.opts.es5){let e=i instanceof t.Name?i:this.var("_arr",i);return this.forRange("_i",0,(0,t._)`${e}.length`,r=>{this.var(a,(0,t._)`${e}[${r}]`),o(a)})}return this._for(new $("of",n,a,i),()=>o(a))}forIn(e,i,o,n=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${i})`,o);let a=this._scope.toName(e);return this._for(new $("in",n,a,i),()=>o(a))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new l(e))}return(e){let t=new k;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let i=new w;if(this._blockNode(i),this.code(e),t){let e=this.name("e");this._currNode=i.catch=new P(e),t(e)}return r&&(this._currNode=i.finally=new V,this.code(r)),this._endBlockNode(P,V)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,i,o){return this._blockNode(new S(e,r,i)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function q(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function I(e,r){return r instanceof t._CodeOrName?q(e,r.names):e}function x(e,r,i){var o;if(e instanceof t.Name)return n(e);if(!((o=e)instanceof t._Code&&o._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==i[e.str])))return e;return new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=n(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[]));function n(e){let t=i[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${E(e)}`}e.CodeGen=R,e.not=j;let C=O(e.operators.AND);e.and=function(...e){return e.reduce(C)};let T=O(e.operators.OR);function O(e){return(r,i)=>r===t.nil?i:i===t.nil?r:(0,t._)`${E(r)} ${e} ${E(i)}`}function E(e){return e instanceof t.Name?e:(0,t._)`(${e})`}e.or=function(...e){return e.reduce(T)}}),qw=kO(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let i=qk(),o=q$();function n(e,t=e.schema){let{opts:r,self:i}=e;if(!r.strictSchema||"boolean"==typeof t)return;let o=i.RULES.keywords;for(let r in t)o[r]||m(e,`unknown keyword: "${r}"`)}function a(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function s(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function d(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(n,a,s,d)=>{let c=void 0===s?a:s instanceof i.Name?(a instanceof i.Name?e(n,a,s):t(n,a,s),s):a instanceof i.Name?(t(n,s,a),a):r(a,s);return d!==i.Name||c instanceof i.Name?c:o(n,c)}}function l(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&p(e,r,t),r}function p(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}e.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!a(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=a,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,n){if(!n){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(o)}`},e.unescapeFragment=function(e){return d(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(s(e))},e.escapeJsonPointer=s,e.unescapeJsonPointer=d,e.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},e.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),p(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:c({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=l,e.setEvaluated=p;let u={};function m(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new o._Code(t.code))})},(r=t||(e.Type=t={}))[r.Num=0]="Num",r[r.Str=1]="Str",e.getErrorPath=function(e,r,o){if(e instanceof i.Name){let n=r===t.Num;return o?n?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:n?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return o?(0,i.getProperty)(e).toString():"/"+s(e)},e.checkStrictMode=m}),qP=kO(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=qk();e.default={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")}}),qV=kO(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=qk(),r=qw(),i=qP();function o(e,r){let o=e.const("err",r);e.if((0,t._)`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,(0,t._)`[${o}]`),(0,t._)`${i.default.vErrors}.push(${o})`),e.code((0,t._)`${i.default.errors}++`)}function n(e,r){let{gen:i,validateName:o,schemaEnv:n}=e;n.$async?i.throw((0,t._)`new ${e.ValidationError}(${r})`):(i.assign((0,t._)`${o}.errors`,r),i.return(!1))}e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?(0,t.str)`"${e}" keyword must be ${r} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`},e.reportError=function(r,i=e.keywordError,a,d){let{it:c}=r,{gen:l,compositeRule:p,allErrors:u}=c,m=s(r,i,a);(null!=d?d:p||u)?o(l,m):n(c,(0,t._)`[${m}]`)},e.reportExtraError=function(t,r=e.keywordError,a){let{it:d}=t,{gen:c,compositeRule:l,allErrors:p}=d;o(c,s(t,r,a)),l||p||n(d,i.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(i.default.errors,r),e.if((0,t._)`${i.default.vErrors} !== null`,()=>e.if(r,()=>e.assign((0,t._)`${i.default.vErrors}.length`,r),()=>e.assign(i.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:o,data:n,errsCount:a,it:s}){if(void 0===a)throw Error("ajv implementation error");let d=e.name("err");e.forRange("i",a,i.default.errors,a=>{e.const(d,(0,t._)`${i.default.vErrors}[${a}]`),e.if((0,t._)`${d}.instancePath === undefined`,()=>e.assign((0,t._)`${d}.instancePath`,(0,t.strConcat)(i.default.instancePath,s.errorPath))),e.assign((0,t._)`${d}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign((0,t._)`${d}.schema`,o),e.assign((0,t._)`${d}.data`,n))})};let a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,o,n){let{createErrors:s}=e.it;return!1===s?(0,t._)`{}`:function(e,o,n={}){let{gen:s,it:d}=e,c=[function({errorPath:e},{instancePath:o}){let n=o?(0,t.str)`${e}${(0,r.getErrorPath)(o,r.Type.Str)}`:e;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,n)]}(d,n),function({keyword:e,it:{errSchemaPath:i}},{schemaPath:o,parentSchema:n}){let s=n?i:(0,t.str)`${i}/${e}`;return o&&(s=(0,t.str)`${s}${(0,r.getErrorPath)(o,r.Type.Str)}`),[a.schemaPath,s]}(e,n)];return function(e,{params:r,message:o},n){let{keyword:s,data:d,schemaValue:c,it:l}=e,{opts:p,propertyName:u,topSchemaRef:m,schemaPath:f}=l;n.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),p.messages&&n.push([a.message,"function"==typeof o?o(e):o]),p.verbose&&n.push([a.schema,c],[a.parentSchema,(0,t._)`${m}${f}`],[i.default.data,d]),u&&n.push([a.propertyName,u])}(e,o,c),s.object(...c)}(e,o,n)}}),qR=kO(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=qV(),r=qk(),i=qP(),o={message:"boolean schema is false"};function n(e,r){let{gen:i,data:n}=e;(0,t.reportError)({gen:i,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},o,void 0,r)}e.topBoolOrEmptySchema=function(e){let{gen:t,schema:o,validateName:a}=e;!1===o?n(e,!1):"object"==typeof o&&!0===o.$async?t.return(i.default.data):(t.assign((0,r._)`${a}.errors`,null),t.return(!0))},e.boolOrEmptySchema=function(e,t){let{gen:r,schema:i}=e;!1===i?(r.var(t,!1),n(e)):r.var(t,!0)}}),qq=kO(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(e){return"string"==typeof e&&t.has(e)},e.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}}),qI=kO(e=>{function t(e,t){return t.rules.some(t=>r(e,t))}function r(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:e,self:r},i){let o=r.RULES.types[i];return o&&!0!==o&&t(e,o)},e.shouldUseGroup=t,e.shouldUseRule=r}),qx=kO(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let i=qq(),o=qI(),n=qV(),a=qk(),s=qw();function d(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(r=t||(e.DataType=t={}))[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong",e.getSchemaTypes=function(e){let t=d(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=d,e.coerceAndCheckDataType=function(e,r){var i,n;let{gen:s,data:d,opts:l}=e,u=(i=r,(n=l.coerceTypes)?i.filter(e=>c.has(e)||"array"===n&&"array"===e):[]),f=r.length>0&&!(0===u.length&&1===r.length&&(0,o.schemaHasRulesForType)(e,r[0]));if(f){let i=p(r,d,l.strictNumbers,t.Wrong);s.if(i,()=>{u.length?function(e,t,r){let{gen:i,data:o,opts:n}=e,s=i.let("dataType",(0,a._)`typeof ${o}`),d=i.let("coerced",(0,a._)`undefined`);for(let e of("array"===n.coerceTypes&&i.if((0,a._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>i.assign(o,(0,a._)`${o}[0]`).assign(s,(0,a._)`typeof ${o}`).if(p(t,o,n.strictNumbers),()=>i.assign(d,o))),i.if((0,a._)`${d} !== undefined`),r))(c.has(e)||"array"===e&&"array"===n.coerceTypes)&&function(e){switch(e){case"string":i.elseIf((0,a._)`${s} == "number" || ${s} == "boolean"`).assign(d,(0,a._)`"" + ${o}`).elseIf((0,a._)`${o} === null`).assign(d,(0,a._)`""`);return;case"number":i.elseIf((0,a._)`${s} == "boolean" || ${o} === null diff --git a/sdks/typescript/src/operations.ts b/sdks/typescript/src/operations.ts index 5f677af18d..c2607556f0 100644 --- a/sdks/typescript/src/operations.ts +++ b/sdks/typescript/src/operations.ts @@ -903,7 +903,7 @@ export type SafeDiagnostic_2 = { readonly code: string; readonly message: string export type SanitizationReceiptId = string; export type SchemaConvergenceFindingV1 = { readonly degraded_row?: string | null; readonly stage: SchemaConvergenceStageV1; readonly started_at_micros: number; readonly state: SchemaConvergenceStateV1; readonly store: string }; export type SchemaConvergenceStageV1 = "registered_schema"; -export type SchemaConvergenceStateV1 = "pending" | "running" | "degraded" | "completed"; +export type SchemaConvergenceStateV1 = "pending" | "running" | "completed" | "retrying" | "degraded"; export type ScopeAccessRule = { readonly authority: AuthorityRef; readonly capabilities: readonly CapabilityId[]; readonly effect: RuleEffect; readonly expires_at?: UtcMicros | null; readonly rule_id: AccessRuleId; readonly subject: ScopeAccessSubjectV1 }; export type ScopeAccessSubjectV1 = { readonly actor?: ActorId | null; readonly operation?: ScopeControlOperationV1 | null; readonly source_kind?: SourceKindV1 | null }; export type ScopeControlOperationV1 = "read" | "source_bind" | "source_rebind" | "source_unbind" | "access_rule_upsert" | "access_rule_remove" | "replace_topology_policy" | "rollback"; @@ -1024,7 +1024,7 @@ export type StatusMemoryPressureV1 = "unobserved" | "nominal" | "over_budget"; export type StatusMemoryReservationV1 = { readonly bytes: number; readonly component: string }; export type StatusMemoryV1 = { readonly high_watermark_bytes: number; readonly idle_window_seconds: number; readonly limit_bytes: number; readonly low_watermark_bytes: number; readonly owners: readonly StatusMemoryOwnerV1[]; readonly psi_some_avg10?: number | null; readonly reservations: readonly StatusMemoryReservationV1[]; readonly reserved_bytes: number; readonly resident_bytes?: number | null; readonly retained_bytes: number; readonly shed_order: readonly string[]; readonly status: StatusMemoryPressureV1; readonly unattributed_bytes?: number | null; readonly unmeasured_owners: number }; export type StatusRetrievalServingV1 = { readonly condition?: StatusServingConditionV1 | null; readonly freshness: StatusServingFreshnessV1; readonly last_reconcile_age_seconds?: number | null; readonly seated_generation_age_seconds?: number | null; readonly status: "serving" } | { readonly reason: string; readonly status: "unavailable" }; -export type StatusSchemaConvergenceStateV1 = "completed" | "in_progress" | "degraded"; +export type StatusSchemaConvergenceStateV1 = "completed" | "in_progress" | "retrying" | "degraded"; export type StatusSchemaConvergenceV1 = { readonly findings: readonly SchemaConvergenceFindingV1[]; readonly status: StatusSchemaConvergenceStateV1 }; export type StatusServingConditionV1 = "artifact_restore" | "source_verification" | "rebuilding" | "stalled"; export type StatusServingFreshnessV1 = "current" | "restoring" | "last_complete_stale" | "unknown"; @@ -2706,7 +2706,7 @@ const DEFINITIONS = { SanitizationReceiptId: {"description":"Strongly typed canonical identity: `SanitizationReceiptId`.","type":"string"}, SchemaConvergenceFindingV1: {"additionalProperties":false,"properties":{"degraded_row":{"type":["string","null"]},"stage":{"$ref":"#/$defs/SchemaConvergenceStageV1"},"started_at_micros":{"format":"int64","type":"integer"},"state":{"$ref":"#/$defs/SchemaConvergenceStateV1"},"store":{"type":"string"}},"required":["store","stage","state","started_at_micros"],"type":"object"}, SchemaConvergenceStageV1: {"enum":["registered_schema"],"type":"string"}, - SchemaConvergenceStateV1: {"enum":["pending","running","degraded","completed"],"type":"string"}, + SchemaConvergenceStateV1: {"oneOf":[{"enum":["pending","running","completed"],"type":"string"},{"const":"retrying","description":"The last attempt failed and the store's convergence task tries again by\nitself. `degraded_row` carries that attempt's failure.","type":"string"},{"const":"degraded","description":"Convergence stopped on a failure and nothing retries it on this mount.","type":"string"}]}, ScopeAccessRule: {"additionalProperties":false,"description":"Restrictive policy input. An allow never grants capabilities absent from\nthe independently authorized capability set passed to the resolver.","properties":{"authority":{"$ref":"#/$defs/AuthorityRef"},"capabilities":{"items":{"$ref":"#/$defs/CapabilityId"},"type":"array","uniqueItems":true},"effect":{"$ref":"#/$defs/RuleEffect"},"expires_at":{"anyOf":[{"$ref":"#/$defs/UtcMicros"},{"type":"null"}]},"rule_id":{"$ref":"#/$defs/AccessRuleId"},"subject":{"$ref":"#/$defs/ScopeAccessSubjectV1"}},"required":["rule_id","subject","authority","capabilities","effect"],"type":"object"}, ScopeAccessSubjectV1: {"additionalProperties":false,"description":"Typed rule selectors. Unset dimensions match all values at that dimension,\nbut at least one dimension must be constrained. Free-form paths, labels,\ncollection names, and branch names are deliberately absent.","properties":{"actor":{"anyOf":[{"$ref":"#/$defs/ActorId"},{"type":"null"}]},"operation":{"anyOf":[{"$ref":"#/$defs/ScopeControlOperationV1"},{"type":"null"}]},"source_kind":{"anyOf":[{"$ref":"#/$defs/SourceKindV1"},{"type":"null"}]}},"type":"object"}, ScopeControlOperationV1: {"enum":["read","source_bind","source_rebind","source_unbind","access_rule_upsert","access_rule_remove","replace_topology_policy","rollback"],"type":"string"}, @@ -2827,7 +2827,7 @@ const DEFINITIONS = { StatusMemoryReservationV1: {"additionalProperties":false,"properties":{"bytes":{"format":"uint64","minimum":0,"type":"integer"},"component":{"type":"string"}},"required":["component","bytes"],"type":"object"}, StatusMemoryV1: {"additionalProperties":false,"description":"The daemon's memory admission and resident accounting as one project sees it.","properties":{"high_watermark_bytes":{"format":"uint64","minimum":0,"type":"integer"},"idle_window_seconds":{"format":"uint64","minimum":0,"type":"integer"},"limit_bytes":{"format":"uint64","minimum":0,"type":"integer"},"low_watermark_bytes":{"format":"uint64","minimum":0,"type":"integer"},"owners":{"description":"This project's retained owners; other projects' belong to the\ndaemon-wide Doctor inventory.","items":{"$ref":"#/$defs/StatusMemoryOwnerV1"},"type":"array"},"psi_some_avg10":{"format":"double","type":["number","null"]},"reservations":{"description":"`reserved_bytes` per component, largest first.","items":{"$ref":"#/$defs/StatusMemoryReservationV1"},"type":"array"},"reserved_bytes":{"description":"Bytes admitted work has reserved daemon-wide: the admission model of\nin-flight builds and decodes, not a measurement.","format":"uint64","minimum":0,"type":"integer"},"resident_bytes":{"description":"Observed admission occupancy: anonymous/shared process pages plus swap,\nconstrained by shared cgroup headroom. This is not raw process RSS.","format":"uint64","minimum":0,"type":["integer","null"]},"retained_bytes":{"format":"uint64","minimum":0,"type":"integer"},"shed_order":{"items":{"type":"string"},"type":"array"},"status":{"$ref":"#/$defs/StatusMemoryPressureV1"},"unattributed_bytes":{"description":"Raw process RSS from the last successful canonical sample minus the\ndaemon-wide measured `retained_bytes`, saturating at zero. Unlike\n`resident_bytes`, this excludes swap and shared cgroup pressure. Work in\nflight, runtime allocations, SQLite page caches, and allocator-held pages\ncan contribute. `None` until a resident sample has been published.","format":"uint64","minimum":0,"type":["integer","null"]},"unmeasured_owners":{"format":"uint","minimum":0,"type":"integer"}},"required":["status","limit_bytes","high_watermark_bytes","low_watermark_bytes","idle_window_seconds","shed_order","retained_bytes","unmeasured_owners","reserved_bytes","reservations","owners"],"type":"object"}, StatusRetrievalServingV1: {"oneOf":[{"additionalProperties":false,"description":"A sealed complete generation serves the exact worktree. The ages tell a\nroutine rebuild window from a wedged route.","properties":{"condition":{"anyOf":[{"$ref":"#/$defs/StatusServingConditionV1"},{"type":"null"}]},"freshness":{"$ref":"#/$defs/StatusServingFreshnessV1"},"last_reconcile_age_seconds":{"format":"int64","type":["integer","null"]},"seated_generation_age_seconds":{"format":"int64","type":["integer","null"]},"status":{"const":"serving","type":"string"}},"required":["status","freshness"],"type":"object"},{"additionalProperties":false,"description":"The census answered and nothing is servable yet.","properties":{"reason":{"type":"string"},"status":{"const":"unavailable","type":"string"}},"required":["status","reason"],"type":"object"}]}, - StatusSchemaConvergenceStateV1: {"enum":["completed","in_progress","degraded"],"type":"string"}, + StatusSchemaConvergenceStateV1: {"enum":["completed","in_progress","retrying","degraded"],"type":"string"}, StatusSchemaConvergenceV1: {"additionalProperties":false,"properties":{"findings":{"items":{"$ref":"#/$defs/SchemaConvergenceFindingV1"},"type":"array"},"status":{"$ref":"#/$defs/StatusSchemaConvergenceStateV1"}},"required":["status","findings"],"type":"object"}, StatusServingConditionV1: {"enum":["artifact_restore","source_verification","rebuilding","stalled"],"type":"string"}, StatusServingFreshnessV1: {"enum":["current","restoring","last_complete_stale","unknown"],"type":"string"}, From efcab24483e59f923a2f77bd0861907a498be80f Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 02:32:31 -0800 Subject: [PATCH 48/63] test(work): use explicit empty artifact assertions --- .../invocation/work_attempt_exec/tests/output_admission.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs index be33d509c2..14219599f7 100644 --- a/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs +++ b/crates/tracedecay-daemon-service/src/invocation/work_attempt_exec/tests/output_admission.rs @@ -208,7 +208,7 @@ fn canonical_binding_fences_recovering_work_without_terminal_failure() { let recovery = fixture.current_attempt(); assert_eq!(recovery.state(), WorkAttemptStateV1::RecoveryRequired); assert!(recovery.terminal().is_none()); - assert!(recovery.artifacts().is_empty()); + assert_eq!(recovery.artifacts(), Vec::::new()); assert_eq!( fixture .effects @@ -255,7 +255,10 @@ fn still_recovering_admission_executes_no_effect_and_leaves_retryable_work() { execute(&fixture, executable, None, protocol).await; assert!(!marker.exists()); assert_eq!(fixture.state(), WorkAttemptStateV1::RecoveryRequired); - assert!(fixture.current_attempt().artifacts().is_empty()); + assert_eq!( + fixture.current_attempt().artifacts(), + Vec::::new() + ); assert_eq!( fixture .effects From daa3f7a106ba8413cfa2d4a3e1b590f2f50eff0f Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 03:14:30 -0800 Subject: [PATCH 49/63] fix(evals): reject malformed scoring evidence Refs #4535. Refuse nonnumeric, out-of-range or nonfinite probability values before evaluating accuracy or calibration. Also reject invalid labels, duplicate cases, missing category coverage, invalid choices and elapsed times, including corrupted raw probability telemetry. Preserve legitimate Noul and Choice result shapes (including an explicit none option). A malformed result must not replace an existing summary. Add focused direct and CLI regressions. The standalone Python validation probe passed; Bazel scoring tests and integrated CI remain outstanding. --- evals/intent_engine/score.py | 46 +++++++++++++++++++++++++++++-- evals/intent_engine/test_score.py | 45 ++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index e51e66795f..a9f80bbbbd 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -4,7 +4,7 @@ categories with both label classes and reports its category coverage. Nonempty macro F1 retains the historical fixed-CATS, zero-for-undefined convention. """ -import json, glob, os, statistics, sys, tempfile +import json, glob, math, os, statistics, sys, tempfile sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from common import CATS @@ -26,6 +26,47 @@ def publish_summary(path, summary): os.unlink(staged) +def validate_rows(rows, config): + """Refuse invalid measured evidence before any threshold or AUC arithmetic.""" + if not isinstance(rows, list) or not rows: + raise ValueError("configuration %r has no rows to score" % config) + categories = set(CATS) + seen = set() + for row in rows: + if not isinstance(row, dict): + raise ValueError("configuration %r has a non-object result row" % config) + case_id = row.get("id") + if not isinstance(case_id, str) or not case_id or case_id in seen: + raise ValueError("configuration %r has a missing or duplicate case ID" % config) + seen.add(case_id) + labels = row.get("labels") + if (not isinstance(labels, list) or + any(not isinstance(label, str) or label not in categories for label in labels) or + len(set(labels)) != len(labels)): + raise ValueError(f"configuration {config!r} case {case_id} has invalid labels") + if not isinstance(row.get("context_needed"), bool): + raise ValueError(f"configuration {config!r} case {case_id} has invalid context_needed") + for field in ("probs", "probs_raw"): + if field == "probs_raw" and field not in row: + continue + probs = row.get(field) + if (not isinstance(probs, dict) or not categories.issubset(probs) or + set(probs) - categories - {"none"}): + raise ValueError(f"configuration {config!r} case {case_id} has invalid {field} coverage") + for label, value in probs.items(): + if (isinstance(value, bool) or not isinstance(value, (int, float)) or + not math.isfinite(value) or not 0 <= value <= 1): + raise ValueError(f"configuration {config!r} case {case_id} has invalid {field} value for {label}") + if "choice" in row: + choice = row["choice"] + if choice is not None and (not isinstance(choice, str) or choice not in categories | {"none"}): + raise ValueError(f"configuration {config!r} case {case_id} has invalid choice") + elapsed = row.get("ms") + if (isinstance(elapsed, bool) or not isinstance(elapsed, (int, float)) or + not math.isfinite(elapsed) or elapsed < 0): + raise ValueError(f"configuration {config!r} case {case_id} has invalid elapsed ms") + + def auc(pos, neg): if not pos or not neg: return None s = sum((p > n) + 0.5 * (p == n) for p in pos for n in neg) @@ -107,8 +148,7 @@ def score_config(res, fixed_t=None): if not isinstance(experiment, dict) or experiment.get("version") != 2: raise ValueError("HTTP result telemetry version is unsupported; rerun with a new tag") rows = res["rows"] - if not rows: - raise ValueError("configuration %r has no rows to score" % res.get("config")) + validate_rows(rows, res.get("config")) choices = ["choice" in row for row in rows] if any(choices) and not all(choices): raise ValueError("configuration %r has incomplete choice coverage" % res.get("config")) diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index d25e7f8d37..932ecc2c34 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -201,6 +201,51 @@ def test_absent_usage_remains_unknown_in_cli_summary(self): compared = self.run_script(root, "compare.py", "unknown") self.assertEqual(compared.returncode, 0, compared.stderr) + def test_result_rows_require_valid_predictions_and_verifiable_case_labels(self): + original = row("a", [score.CATS[0]]) + cases = [ + ({"probs": {**original["probs"], score.CATS[0]: True}}, "probs value"), + ({"probs": {**original["probs"], score.CATS[0]: float("nan")}}, "probs value"), + ({"probs": {**original["probs"], score.CATS[0]: float("inf")}}, "probs value"), + ({"probs": {**original["probs"], score.CATS[0]: -0.1}}, "probs value"), + ({"probs": {**original["probs"], score.CATS[0]: 1.1}}, "probs value"), + ({"probs": {k: v for k, v in original["probs"].items() if k != score.CATS[0]}}, "probs coverage"), + ({"probs": {**original["probs"], "unexpected": 0.2}}, "probs coverage"), + ({"probs_raw": {**original["probs"], score.CATS[0]: False}}, "probs_raw value"), + ({"labels": ["not_an_intent"]}, "invalid labels"), + ({"labels": [score.CATS[0], score.CATS[0]]}, "invalid labels"), + ({"context_needed": "true"}, "context_needed"), + ({"choice": "not_an_option"}, "invalid choice"), + ({"ms": True}, "elapsed ms"), + ({"ms": float("nan")}, "elapsed ms"), + ] + for changed, message in cases: + with self.subTest(changed=changed): + with self.assertRaisesRegex(ValueError, message): + score.score_config({"config": "invalid", "rows": [{**original, **changed}]}) + with self.assertRaisesRegex(ValueError, "duplicate case ID"): + score.score_config({"config": "duplicate", "rows": [original, dict(original)]}) + choice = {**original, "choice": "none", + "probs": {**original["probs"], "none": 0.2}} + self.assertEqual(score.score_config({"config": "choice", "rows": [choice]})["latency"]["total_cases"], 1) + + def test_invalid_probability_cannot_replace_previous_cli_summary(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + (root / "results").mkdir() + invalid = row("a", [score.CATS[0]]) + invalid["probs"][score.CATS[0]] = True + (root / "results" / "bad.json").write_text( + json.dumps({"config": "bad", "rows": [invalid]}), encoding="utf-8", + ) + summary = root / "summary.json" + summary.write_bytes(b"previous valid summary\n") + result = self.run_script(root, "score.py") + self.assertNotEqual(result.returncode, 0) + self.assertIn("invalid probs value", result.stderr) + self.assertEqual(summary.read_bytes(), b"previous valid summary\n") + def test_invalid_usage_is_not_silently_discarded_as_missing(self): for field in ("state_tokens", "input_tokens", "dropped"): for value in (True, -1, 1.5, "12", float("nan")): From 569184b8a228e9399a1bd3e76b5c99778145c911 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 03:22:24 -0800 Subject: [PATCH 50/63] fix(evals): reject inconsistent calibrated score evidence Refuse versioned HTTP scoring rows whose calibrated probabilities disagree with recorded raw Noul probabilities or calibration temperature. Move the existing runner calibration function verbatim into shared common.py so runtime validation and scoring use one authority. Cover valid calibration, corrupted output, missing raw evidence, temperature conflicts, and the CLI summary no-clobber path. Refs #4535. The standalone/Bazel tests have not run in this environment; full integration CI on the exact head is required before merge to master. --- evals/intent_engine/common.py | 11 +++++++ evals/intent_engine/run_http.py | 12 +------- evals/intent_engine/score.py | 33 ++++++++++++++++++++- evals/intent_engine/test_score.py | 48 +++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 12 deletions(-) diff --git a/evals/intent_engine/common.py b/evals/intent_engine/common.py index 3200f9fc8c..1678498ee6 100644 --- a/evals/intent_engine/common.py +++ b/evals/intent_engine/common.py @@ -1,5 +1,6 @@ """Shared questions and state renderers. Written after the dataset was frozen.""" import json +import math CATS = ["session_recall", "memory_store", "call_graph", "impact", "refactor_edit", "review_changes", "type_orientation", "project_context", "unexpected_changes"] @@ -16,6 +17,16 @@ "unexpected_changes": "Does the user's latest message ask about commits or file edits that neither the user nor the assistant made?", } +def calibrated(probability, temperature): + if probability in (0, 1): + return probability + log_odds = (math.log(probability) - math.log1p(-probability)) / temperature + if log_odds >= 0: + return 1 / (1 + math.exp(-log_odds)) + exp_odds = math.exp(log_odds) + return exp_odds / (1 + exp_odds) + + def noul_questions(cats=CATS): return {c: {"type": "noul", "instructions": NOUL_INS[c]} for c in cats} diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 629c24cde0..8126376ade 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -19,7 +19,7 @@ HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) -from common import noul_questions, prompt_only, text_window +from common import calibrated, noul_questions, prompt_only, text_window STATES = { "A_noul_prompt": prompt_only, @@ -187,16 +187,6 @@ def noul_probabilities(response, questions): return probabilities(values, questions) -def calibrated(probability, temperature): - if probability in (0, 1): - return probability - log_odds = (math.log(probability) - math.log1p(-probability)) / temperature - if log_odds >= 0: - return 1 / (1 + math.exp(-log_odds)) - exp_odds = math.exp(log_odds) - return exp_odds / (1 + exp_odds) - - def serialize_result(row, questions, temperature): """Admit fresh and resumed rows before any durable output is changed.""" probabilities(row.get("probs"), questions) diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index a9f80bbbbd..b30e84cd20 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -6,7 +6,7 @@ """ import json, glob, math, os, statistics, sys, tempfile sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -from common import CATS +from common import CATS, calibrated TH = [0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] @@ -67,6 +67,36 @@ def validate_rows(rows, config): raise ValueError(f"configuration {config!r} case {case_id} has invalid elapsed ms") +def validate_calibration(result, rows): + """Check HTTP calibration against its raw measurements before scoring.""" + if "experiment" not in result: + return # Historical local scoring files have no HTTP calibration. + temperature = result["experiment"].get("noul_temperature") + if temperature is not None and ( + isinstance(temperature, bool) + or not isinstance(temperature, (int, float)) + or not math.isfinite(temperature) + or temperature <= 0 + ): + raise ValueError("invalid HTTP calibration temperature") + if ("noul_temperature" in result + and result["noul_temperature"] != temperature): + raise ValueError("HTTP calibration temperature differs from recorded experiment") + if temperature is None: + if any("probs_raw" in row for row in rows): + raise ValueError("uncalibrated HTTP result contains raw probabilities") + return + for row in rows: + if "probs_raw" not in row: + raise ValueError("calibrated HTTP result is missing raw probabilities") + expected = { + category: calibrated(value, temperature) + for category, value in row["probs_raw"].items() + } + if row["probs"] != expected: + raise ValueError("calibrated probabilities disagree with raw telemetry") + + def auc(pos, neg): if not pos or not neg: return None s = sum((p > n) + 0.5 * (p == n) for p in pos for n in neg) @@ -149,6 +179,7 @@ def score_config(res, fixed_t=None): raise ValueError("HTTP result telemetry version is unsupported; rerun with a new tag") rows = res["rows"] validate_rows(rows, res.get("config")) + validate_calibration(res, rows) choices = ["choice" in row for row in rows] if any(choices) and not all(choices): raise ValueError("configuration %r has incomplete choice coverage" % res.get("config")) diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index 932ecc2c34..ab33a920c9 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -229,6 +229,54 @@ def test_result_rows_require_valid_predictions_and_verifiable_case_labels(self): "probs": {**original["probs"], "none": 0.2}} self.assertEqual(score.score_config({"config": "choice", "rows": [choice]})["latency"]["total_cases"], 1) + def test_http_calibration_must_match_raw_evidence(self): + original = row("a", [score.CATS[0]]) + raw = dict(original["probs"]) + temperature = 2.0 + measured = {cat: score.calibrated(p, temperature) for cat, p in raw.items()} + calibrated_row = {**original, "probs_raw": raw, "probs": measured} + result = { + "config": "http_calibrated", + "experiment": {"version": 2, "noul_temperature": temperature}, + "noul_temperature": temperature, + "rows": [calibrated_row], + } + self.assertEqual(score.score_config(result)["latency"]["total_cases"], 1) + + conflicting = {**calibrated_row, "probs": raw} + with self.assertRaisesRegex(ValueError, "calibrated probabilities disagree"): + score.score_config({**result, "rows": [conflicting]}) + missing_raw = {k: v for k, v in calibrated_row.items() if k != "probs_raw"} + with self.assertRaisesRegex(ValueError, "missing raw probabilities"): + score.score_config({**result, "rows": [missing_raw]}) + with self.assertRaisesRegex(ValueError, "temperature differs"): + score.score_config({**result, "noul_temperature": 3.0}) + with self.assertRaisesRegex(ValueError, "invalid HTTP calibration temperature"): + score.score_config({ + **result, "experiment": {"version": 2, "noul_temperature": 0.0}, + "noul_temperature": 0.0, + }) + with self.assertRaisesRegex(ValueError, "uncalibrated HTTP result"): + score.score_config({ + **result, "experiment": {"version": 2, "noul_temperature": None}, + "noul_temperature": None, + }) + + # A corrupt calibrated result must not replace a previous scored summary. + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + (root / "results").mkdir() + (root / "results" / "bad.json").write_text( + json.dumps({**result, "rows": [conflicting]}), encoding="utf-8", + ) + summary = root / "summary.json" + summary.write_bytes(b"last verified summary\n") + attempt = self.run_script(root, "score.py") + self.assertNotEqual(attempt.returncode, 0) + self.assertIn("calibrated probabilities disagree", attempt.stderr) + self.assertEqual(summary.read_bytes(), b"last verified summary\n") + def test_invalid_probability_cannot_replace_previous_cli_summary(self): with tempfile.TemporaryDirectory() as directory: root = Path(directory) From 7194f4d963134a322a3ce926afe7dfb9518c9937 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 04:14:19 -0800 Subject: [PATCH 51/63] fix(evals): verify HTTP score experiment fingerprints Reject score inputs whose recorded HTTP experiment identity, per-case request fingerprint aggregate, case order, dataset identity, or arm name does not match the completed result. Preserve local-only scoring and calibration checks. Add regression cases for each mismatch and the last-good summary preservation path. Refs #4535. Focused Python fingerprint validation passed; full Bazel tests and integrated CI are required before merging to master. --- evals/intent_engine/HTTP_RUNNER.md | 2 +- evals/intent_engine/score.py | 36 ++++++++++- evals/intent_engine/test_score.py | 100 ++++++++++++++++++++++++----- 3 files changed, 120 insertions(+), 18 deletions(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index 899a8542e0..a4d3652b43 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -70,7 +70,7 @@ cannot be recovered as measurements. Use a new tag; do not relabel old logs. Version-1 completed HTTP results are also refused by the scorer. Historical reports are not rewritten or retrospectively qualified. -The runner still uses the historical nine-category evaluation in `common.py`. +The scorer also rejects completed HTTP results whose experiment-identity digest,\nper-case request fingerprints, recorded order, dataset digest, or configuration\ndisagree with the output. This detects accidental edits and mismatched runs;\nthese operator-written hashes do not authenticate the remote model or verify\nindependent ground-truth labels.\n\nThe runner still uses the historical nine-category evaluation in `common.py`. Runtime-renderer parity, qualified labels, held-out quality, and independent verification of server-reported telemetry remain separate qualification work. diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index b30e84cd20..3e918d6d37 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -4,7 +4,7 @@ categories with both label classes and reports its category coverage. Nonempty macro F1 retains the historical fixed-CATS, zero-for-undefined convention. """ -import json, glob, math, os, statistics, sys, tempfile +import hashlib, json, glob, math, os, re, statistics, sys, tempfile sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from common import CATS, calibrated @@ -67,6 +67,39 @@ def validate_rows(rows, config): raise ValueError(f"configuration {config!r} case {case_id} has invalid elapsed ms") +def evidence_digest(value): + return hashlib.sha256( + json.dumps(value, sort_keys=True, allow_nan=False).encode("utf-8") + ).hexdigest() + + +def validate_http_provenance(result, rows): + """Bind scored HTTP rows to the recorded experiment and request order.""" + if "experiment" not in result: + return # Local-only scoring inputs do not claim HTTP provenance. + experiment = result["experiment"] + if result.get("experiment_sha256") != evidence_digest(experiment): + raise ValueError("HTTP experiment identity digest disagrees with recorded settings") + case_ids = [row["id"] for row in rows] + if experiment.get("case_ids") != case_ids: + raise ValueError("HTTP experiment case IDs or ordering disagree with result rows") + requests = [] + for row in rows: + request_sha = row.get("request_sha256") + if not isinstance(request_sha, str) or not re.fullmatch(r"[0-9a-f]{64}", request_sha): + raise ValueError(f"HTTP case {row['id']} has an invalid request fingerprint") + requests.append([row["id"], request_sha]) + if experiment.get("requests_sha256") != evidence_digest(requests): + raise ValueError("HTTP request fingerprints disagree with experiment identity") + if result.get("dataset_sha256") != experiment.get("dataset_sha256"): + raise ValueError("HTTP dataset digest disagrees with experiment identity") + config = result.get("config") + variant = experiment.get("config") + if (not isinstance(config, str) or not isinstance(variant, str) + or (config != variant and not config.endswith("_" + variant))): + raise ValueError("HTTP configuration disagrees with experiment identity") + + def validate_calibration(result, rows): """Check HTTP calibration against its raw measurements before scoring.""" if "experiment" not in result: @@ -180,6 +213,7 @@ def score_config(res, fixed_t=None): rows = res["rows"] validate_rows(rows, res.get("config")) validate_calibration(res, rows) + validate_http_provenance(res, rows) choices = ["choice" in row for row in rows] if any(choices) and not all(choices): raise ValueError("configuration %r has incomplete choice coverage" % res.get("config")) diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index ab33a920c9..194068f146 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -1,4 +1,5 @@ """Behavioral coverage for sparse evaluation slices and their CLI reports.""" +import hashlib import json from pathlib import Path import subprocess @@ -26,6 +27,37 @@ def row(case_id, labels=(), context=False, choice=None): return result +def signed_http_result(config, rows, temperature=None): + # Fixture independently reproduces the fingerprint scheme in run_http.py. + rows = [ + {**item, "request_sha256": hashlib.sha256(item["id"].encode()).hexdigest()} + for item in rows + ] + + def fingerprint(value): + return hashlib.sha256( + json.dumps(value, sort_keys=True, allow_nan=False).encode("utf-8") + ).hexdigest() + + experiment = { + "version": 2, "config": config, "dataset_sha256": "a" * 64, + "case_ids": [item["id"] for item in rows], + "requests_sha256": fingerprint( + [[item["id"], item["request_sha256"]] for item in rows] + ), + "endpoint_sha256": "b" * 64, "requested_model": None, + "noul_temperature": temperature, + "server_config": {"checkpoint": "weights@immutable", "server_revision": "server@one", + "backend": "cpu", "dtype": "float32", "temperature": 1.0}, + } + return { + "config": config, "experiment": experiment, + "experiment_sha256": fingerprint(experiment), + "dataset_sha256": experiment["dataset_sha256"], + "noul_temperature": temperature, "rows": rows, + } + + class ScoringTests(unittest.TestCase): def test_empty_slice_metrics_are_unknown(self): metrics = score.case_metrics([], {cat: 0.5 for cat in score.CATS}) @@ -235,18 +267,13 @@ def test_http_calibration_must_match_raw_evidence(self): temperature = 2.0 measured = {cat: score.calibrated(p, temperature) for cat, p in raw.items()} calibrated_row = {**original, "probs_raw": raw, "probs": measured} - result = { - "config": "http_calibrated", - "experiment": {"version": 2, "noul_temperature": temperature}, - "noul_temperature": temperature, - "rows": [calibrated_row], - } + result = signed_http_result("http_calibrated", [calibrated_row], temperature) self.assertEqual(score.score_config(result)["latency"]["total_cases"], 1) - conflicting = {**calibrated_row, "probs": raw} + conflicting = {**result["rows"][0], "probs": raw} with self.assertRaisesRegex(ValueError, "calibrated probabilities disagree"): score.score_config({**result, "rows": [conflicting]}) - missing_raw = {k: v for k, v in calibrated_row.items() if k != "probs_raw"} + missing_raw = {k: v for k, v in result["rows"][0].items() if k != "probs_raw"} with self.assertRaisesRegex(ValueError, "missing raw probabilities"): score.score_config({**result, "rows": [missing_raw]}) with self.assertRaisesRegex(ValueError, "temperature differs"): @@ -277,6 +304,51 @@ def test_http_calibration_must_match_raw_evidence(self): self.assertIn("calibrated probabilities disagree", attempt.stderr) self.assertEqual(summary.read_bytes(), b"last verified summary\n") + def test_http_result_fingerprints_bind_case_order_and_experiment(self): + original = signed_http_result("B_noul_text", [row("first"), row("second")]) + self.assertEqual(score.score_config(original)["latency"]["total_cases"], 2) + for mutation, diagnostic in [ + ("identity", "identity digest"), + ("missing_digest", "identity digest"), + ("request", "request fingerprints"), + ("case_order", "case IDs or ordering"), + ("dataset", "dataset digest"), + ("config", "configuration disagrees"), + ]: + changed = json.loads(json.dumps(original)) + if mutation == "identity": + changed["experiment"]["server_config"]["checkpoint"] = "different" + elif mutation == "missing_digest": + del changed["experiment_sha256"] + elif mutation == "request": + changed["rows"][0]["request_sha256"] = "c" * 64 + elif mutation == "case_order": + changed["rows"].reverse() + elif mutation == "dataset": + changed["dataset_sha256"] = "f" * 64 + elif mutation == "config": + changed["config"] = "different" + with self.subTest(mutation=mutation): + with self.assertRaisesRegex(ValueError, diagnostic): + score.score_config(changed) + + # An altered completed result cannot destroy the last scored summary. + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + (root / "results").mkdir() + changed = json.loads(json.dumps(original)) + changed["rows"][1]["request_sha256"] = "c" * 64 + (root / "results" / "bad.json").write_text( + json.dumps(changed), encoding="utf-8" + ) + summary = root / "summary.json" + summary.write_bytes(b"last verified summary\\n") + attempt = self.run_script(root, "score.py") + self.assertNotEqual(attempt.returncode, 0) + self.assertIn("request fingerprints", attempt.stderr) + self.assertEqual(summary.read_bytes(), b"last verified summary\\n") + def test_invalid_probability_cannot_replace_previous_cli_summary(self): with tempfile.TemporaryDirectory() as directory: root = Path(directory) @@ -331,14 +403,10 @@ def test_cli_preserves_a_recorded_hybrid_instead_of_replacing_its_measurements(s self.stage_scripts(root) results = root / "results" results.mkdir() - hybrid = { - "config": "H_hybrid_text", - "experiment": {"version": 2}, - "rows": [{ - **row("a", [score.CATS[0]], True), "ms": 17, - "input_tokens": 151, "state_tokens": 93, "dropped": 4, - }], - } + hybrid = signed_http_result("H_hybrid_text", [{ + **row("a", [score.CATS[0]], True), "ms": 17, + "input_tokens": 151, "state_tokens": 93, "dropped": 4, + }]) configurations = [ {"config": "B_noul_text", "rows": [row("a")]}, {"config": "C_choice_text", "rows": [row("a", choice="none")]}, From dc62266b69878925a2be92247e0b7afa985bfa85 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 04:15:16 -0800 Subject: [PATCH 52/63] docs(evals): correct provenance note and test newline bytes Restore real Markdown newlines and the intended newline-terminated last-good summary fixture in the HTTP provenance regression. Refs #4535. --- evals/intent_engine/HTTP_RUNNER.md | 8 +++++++- evals/intent_engine/test_score.py | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index a4d3652b43..4928038ff0 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -70,7 +70,13 @@ cannot be recovered as measurements. Use a new tag; do not relabel old logs. Version-1 completed HTTP results are also refused by the scorer. Historical reports are not rewritten or retrospectively qualified. -The scorer also rejects completed HTTP results whose experiment-identity digest,\nper-case request fingerprints, recorded order, dataset digest, or configuration\ndisagree with the output. This detects accidental edits and mismatched runs;\nthese operator-written hashes do not authenticate the remote model or verify\nindependent ground-truth labels.\n\nThe runner still uses the historical nine-category evaluation in `common.py`. +The scorer also rejects completed HTTP results whose experiment-identity digest, +per-case request fingerprints, recorded order, dataset digest, or configuration +disagree with the output. This detects accidental edits and mismatched runs; +these operator-written hashes do not authenticate the remote model or verify +independent ground-truth labels. + +The runner still uses the historical nine-category evaluation in `common.py`. Runtime-renderer parity, qualified labels, held-out quality, and independent verification of server-reported telemetry remain separate qualification work. diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index 194068f146..00bb894fe5 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -343,11 +343,11 @@ def test_http_result_fingerprints_bind_case_order_and_experiment(self): json.dumps(changed), encoding="utf-8" ) summary = root / "summary.json" - summary.write_bytes(b"last verified summary\\n") + summary.write_bytes(b"last verified summary\n") attempt = self.run_script(root, "score.py") self.assertNotEqual(attempt.returncode, 0) self.assertIn("request fingerprints", attempt.stderr) - self.assertEqual(summary.read_bytes(), b"last verified summary\\n") + self.assertEqual(summary.read_bytes(), b"last verified summary\n") def test_invalid_probability_cannot_replace_previous_cli_summary(self): with tempfile.TemporaryDirectory() as directory: From 62fa329c0aaa0760089d09aa84f8ad5c4bdcd728 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 05:10:34 -0800 Subject: [PATCH 53/63] fix(evals): serialize concurrent HTTP result resumes Refs #4535. Lock each partial output for its writer lifetime and reject redirected or replaced partial paths before writing. Preserve crash-resumable files and refuse concurrent same-tag inference without duplicating results. Add a barrier regression for two concurrent runs and an alias-isolation test. Full Kev qualification, labels and runtime parity remain open. --- evals/intent_engine/run_http.py | 31 +++++++++++++++++ evals/intent_engine/test_run_http.py | 50 +++++++++++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 8126376ade..90b3ce5bac 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -7,6 +7,7 @@ See HTTP_RUNNER.md for invocation and provenance limits. """ import argparse +import errno import hashlib import json import math @@ -214,6 +215,35 @@ def serialize_result(row, questions, temperature): return json.dumps(row, allow_nan=False) +def lock_partial_writer(partial, path): + """Lock the resumable log itself, without crash-stale lockfile state. + + Refuse an opened file whose pathname was replaced or redirected. Otherwise + two same-tag writers could rewrite a partial log and corrupt evaluation. + """ + try: + if os.name == "nt": + import msvcrt + partial.seek(0) + msvcrt.locking(partial.fileno(), msvcrt.LK_NBLCK, 1) + else: + import fcntl + fcntl.flock(partial.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB) + except OSError as error: + if error.errno in (errno.EACCES, errno.EAGAIN): + raise ValueError(f"another evaluator is writing this partial output: {path}") from error + raise + + try: + current = os.stat(path, follow_symlinks=False) + except FileNotFoundError as error: + raise ValueError(f"partial output disappeared during writer admission: {path}") from error + opened = os.fstat(partial.fileno()) + if (current.st_dev, current.st_ino) != (opened.st_dev, opened.st_ino): + raise ValueError(f"partial output was replaced or redirected: {path}") + partial.seek(0) + + def resume_rows(partial, header, cases, requests, questions, temperature): """Validate the whole existing log before appending or issuing HTTP work.""" first = partial.readline() @@ -311,6 +341,7 @@ def main(argv=None): partial = open(partial_path, "r+", encoding="utf-8") created = False with partial: + lock_partial_writer(partial, partial_path) if created: partial.write(json.dumps(header, allow_nan=False) + "\n") partial.flush() diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index f1abb1cfa2..d972f7dfb6 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -13,7 +13,7 @@ import unittest import urllib.error from http.server import BaseHTTPRequestHandler, HTTPServer -from threading import Thread +from threading import Event, Thread from unittest.mock import patch sys.path.insert(0, str(Path(__file__).resolve().parent)) @@ -92,6 +92,54 @@ def test_exact_resume_only_requests_the_missing_case(self): self.assertFalse(self.partial.exists()) + def test_concurrent_same_tag_writers_cannot_corrupt_resumable_evidence(self): + entered, release = Event(), Event() + errors = [] + + def inference(url, body): + if not entered.is_set(): + entered.set() + if not release.wait(10): + raise OSError("inference barrier was never released") + return self.response(url, body) + + def first_run(): + try: + self.run_main() + except Exception as error: + errors.append(error) + + with patch.object(run_http, "post", side_effect=inference) as post: + worker = Thread(target=first_run) + worker.start() + try: + self.assertTrue(entered.wait(10), "first inference did not start") + before = self.partial.read_bytes() + with self.assertRaisesRegex(ValueError, "another evaluator"): + self.run_main() + self.assertEqual(self.partial.read_bytes(), before) + finally: + release.set() + worker.join(10) + self.assertFalse(worker.is_alive()) + self.assertEqual(errors, []) + self.assertEqual(post.call_count, len(self.dataset)) + result = json.loads(self.output.read_text()) + self.assertEqual([row["id"] for row in result["rows"]], ["first", "second"]) + + @unittest.skipUnless(os.name == "posix", "symlink identity check requires POSIX") + def test_symlinked_partial_cannot_write_to_another_file(self): + self.partial.parent.mkdir(parents=True, exist_ok=True) + unrelated = self.root / "other.json" + unrelated.write_text("unchanged", encoding="utf-8") + self.partial.symlink_to(unrelated) + with patch.object(run_http, "post") as post: + with self.assertRaisesRegex(ValueError, "replaced or redirected"): + self.run_main() + post.assert_not_called() + self.assertEqual(unrelated.read_text(encoding="utf-8"), "unchanged") + self.assertFalse(self.output.exists()) + def test_input_tokens_do_not_fabricate_state_or_truncation_measurements(self): self.interrupt() with patch.object(run_http, "post", side_effect=self.response): From c2aba7c2c053dd92598acef1cabebfff8021897a Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 06:13:17 -0800 Subject: [PATCH 54/63] feat(evals): support secure bearer authentication for HTTP qualification Refs #4535. Allow operators to supply a bearer token through an environment variable without recording the credential or its variable name in experiment identity, partial rows or completed results. Require HTTPS for authenticated remote inference, allowing direct loopback HTTP for local serving. Keep proxies and redirects disabled. Cover early denial of missing, malformed and insecure configuration, credential-free evidence, and actual loopback transport behavior. This enables remote authentication only; independent labels, runtime parity and model qualification are still outstanding. --- evals/intent_engine/HTTP_RUNNER.md | 10 +++- evals/intent_engine/run_http.py | 35 ++++++++++++-- evals/intent_engine/test_run_http.py | 72 ++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 6 deletions(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index 4928038ff0..54a89fdfe2 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -11,6 +11,14 @@ python evals/intent_engine/run_http.py \ B_noul_text ``` +For an authenticated server, set a bearer-token environment variable and pass +`--bearer-token-env NAME` (for example, `SYSTEMONE_TOKEN`). The runner +reads it before creating partial output or issuing requests, sends it only in +the HTTP Authorization header, and never stores the credential or its variable +name in result evidence. An authenticated remote endpoint must use HTTPS; +plain HTTP is accepted only for direct loopback addresses. Ambient proxies +and HTTP redirects are disabled, including for authenticated requests. + The JSON declaration must contain nonempty `checkpoint`, `server_revision`, `backend`, and `dtype` strings, and the actual finite, nonnegative server `temperature`. Include other settings that affect inference as additional keys. @@ -33,7 +41,7 @@ duplicate/foreign cases, and malformed probability maps also refuse; no migratio or silent salvage is performed. Choose a new tag for another experiment or an old unidentifiable log. Completed output files are never overwritten. -Use only one writer per tag/configuration. Rows are flushed after each response; +An exclusive lock on the partial log rejects concurrent writers for the same tag/configuration. Rows are flushed after each response; this is not a crash-durable database or a concurrent-writer protocol. The runner writes and syncs the final result to a temporary file in the results directory, then publishes it with a hard link, which fails if the output path already diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 90b3ce5bac..fe47f78e1c 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -17,6 +17,7 @@ import sys import time import urllib.request +from urllib.parse import urlsplit HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) @@ -124,10 +125,27 @@ def redirect_request(self, req, fp, code, msg, headers, newurl): return None -def post(url, body, timeout=1800): - req = urllib.request.Request( - url, request_bytes(body), {"content-type": "application/json"} - ) +def load_bearer_token(name, url): + """Read an optional bearer credential without persisting it in evidence.""" + if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): + raise ValueError("--bearer-token-env requires an environment variable name") + token = os.environ.get(name) + if not token or not re.fullmatch(r"[A-Za-z0-9._~+/-]+=*", token): + raise ValueError(f"--bearer-token-env {name} must contain a valid bearer token") + endpoint = urlsplit(url) + if endpoint.scheme != "https" and not ( + endpoint.scheme == "http" + and endpoint.hostname in ("localhost", "127.0.0.1", "::1") + ): + raise ValueError("bearer authentication requires HTTPS or a loopback HTTP endpoint") + return token + + +def post(url, body, timeout=1800, bearer_token=None): + headers = {"content-type": "application/json"} + if bearer_token is not None: + headers["Authorization"] = f"Bearer {bearer_token}" + req = urllib.request.Request(url, request_bytes(body), headers) # Transcript state belongs to the operator-selected endpoint. Ambient # proxies and redirects can leak the request or misattribute model results. opener = urllib.request.build_opener( @@ -274,6 +292,8 @@ def main(argv=None): ap.add_argument("--server-config", required=True, help="JSON file with immutable serving identity; omit credentials") ap.add_argument("--subset") ap.add_argument("--send-model") + ap.add_argument("--bearer-token-env", metavar="NAME", + help="name of an environment variable holding a bearer token (never recorded)") ap.add_argument("--sample-out", help="write the first raw response here") ap.add_argument("--noul-temperature", type=float, help="client calibration temperature; raw probabilities are retained") ap.add_argument("configs", nargs="+", choices=tuple(STATES)) @@ -284,6 +304,8 @@ def main(argv=None): and (not math.isfinite(args.noul_temperature) or args.noul_temperature <= 0)): raise ValueError("--noul-temperature must be finite and greater than zero") server_config = load_server_config(args.server_config) + bearer_token = (load_bearer_token(args.bearer_token_env, args.url) + if args.bearer_token_env is not None else None) if args.sample_out and os.path.lexists(args.sample_out) and not os.path.isfile(args.sample_out): raise ValueError(f"sample path exists but is not a regular file: {args.sample_out}") with open(os.path.join(HERE, "dataset.json"), "rb") as source: @@ -352,7 +374,10 @@ def main(argv=None): if case["id"] in done: continue body, request_sha = requests[case["id"]] - response, ms = post(args.url, body) + if bearer_token is None: + response, ms = post(args.url, body) + else: + response, ms = post(args.url, body, bearer_token=bearer_token) probs = noul_probabilities(response, questions) server_ms = response.get("latency_ms") if server_ms is None: diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index d972f7dfb6..e9626878e3 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -749,6 +749,78 @@ def test_transmitted_bytes_match_the_recorded_request_fingerprint(self): self.assertEqual(sent, run_http.request_bytes(body)) self.assertEqual(hashlib.sha256(sent).hexdigest(), hashlib.sha256(run_http.request_bytes(body)).hexdigest()) + + def test_authentication_reads_env_without_persisting_credentials(self): + token = "opaque.Test~7+/-==" + response, elapsed = self.response("", {"questions": run_http.noul_questions()}) + with patch.dict(os.environ, {"TRACEDECAY_EVAL_TEST_TOKEN": token}): + with patch.object(run_http, "post", return_value=(response, elapsed)) as post: + self.run_main(["--bearer-token-env", "TRACEDECAY_EVAL_TEST_TOKEN"]) + self.assertEqual(post.call_count, len(self.dataset)) + self.assertTrue(all(call.kwargs == {"bearer_token": token} + for call in post.call_args_list)) + result = self.output.read_text(encoding="utf-8") + self.assertNotIn(token, result) + self.assertNotIn("TRACEDECAY_EVAL_TEST_TOKEN", result) + self.assertFalse(self.partial.exists()) + + def test_bad_auth_configuration_refuses_before_http_or_partial_writes(self): + variable = "TRACEDECAY_EVAL_TEST_TOKEN" + for token, url in ( + (None, "http://localhost:8009/v1/systemone"), + ("bad" + chr(13) + chr(10) + "X-Header: injected", "http://localhost:8009/v1/systemone"), + ("opaque-token", "http://model.example/v1/systemone"), + ("opaque-token", "http://localhost.attacker.example/v1/systemone"), + ): + with self.subTest(token=token, url=url): + environment = {variable: token} if token is not None else {} + with patch.dict(os.environ, environment, clear=True): + with patch.object(run_http, "post") as post: + with self.assertRaises(ValueError): + self.run_main(["--bearer-token-env", variable, "--url", url]) + post.assert_not_called() + self.assertFalse(self.partial.exists()) + self.assertFalse(self.output.exists()) + with patch.object(run_http, "post") as post: + with self.assertRaisesRegex(ValueError, "environment variable name"): + self.run_main(["--bearer-token-env", ""]) + post.assert_not_called() + self.assertFalse(self.partial.exists()) + + def test_bearer_transport_sends_only_to_selected_loopback_server(self): + received = [] + + class Answer(BaseHTTPRequestHandler): + def do_POST(self): + received.append(( + self.headers.get("Authorization"), + self.rfile.read(int(self.headers["Content-Length"])), + )) + reply = b'{"answers":{}}' + self.send_response(200) + self.send_header("Content-Length", str(len(reply))) + self.end_headers() + self.wfile.write(reply) + + def log_message(self, *_): + pass + + server = HTTPServer(("127.0.0.1", 0), Answer) + worker = Thread(target=server.serve_forever, daemon=True) + worker.start() + body = {"state": "private transcript", "questions": {}} + try: + url = f"http://127.0.0.1:{server.server_port}/v1/systemone" + with patch.dict(os.environ, {"TRACEDECAY_EVAL_TEST_TOKEN": "opaque-token"}): + token = run_http.load_bearer_token("TRACEDECAY_EVAL_TEST_TOKEN", url) + reply, _ = run_http.post(url, body, timeout=2, bearer_token=token) + self.assertEqual(reply, {"answers": {}}) + self.assertEqual(received, [("Bearer opaque-token", run_http.request_bytes(body))]) + finally: + server.shutdown() + worker.join(timeout=2) + server.server_close() + def test_decision_request_does_not_use_environment_proxy(self): received = [] From f02c6f5fee335b2226e2c0fb699b0fad6c45481b Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 06:25:35 -0800 Subject: [PATCH 55/63] fix(evals): require HTTP transport for decision evidence --- evals/intent_engine/HTTP_RUNNER.md | 5 +++++ evals/intent_engine/run_http.py | 19 ++++++++++++++++++- evals/intent_engine/test_run_http.py | 25 +++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index 54a89fdfe2..0aa3b2b665 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -11,6 +11,11 @@ python evals/intent_engine/run_http.py \ B_noul_text ``` +The endpoint must use HTTP or HTTPS with a hostname. File URLs, data URLs, +other non-HTTP schemes, malformed ports and URL-embedded credentials are +refused before any evaluation output is opened. Otherwise urllib can read +static local JSON instead of performing a network inference. + For an authenticated server, set a bearer-token environment variable and pass `--bearer-token-env NAME` (for example, `SYSTEMONE_TOKEN`). The runner reads it before creating partial output or issuing requests, sends it only in diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index fe47f78e1c..acf156c923 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -125,6 +125,21 @@ def redirect_request(self, req, fp, code, msg, headers, newurl): return None +def require_http_endpoint(url): + """Require a real HTTP transport before writing evaluation evidence.""" + try: + endpoint = urlsplit(url) + # Accessing port also refuses malformed explicit port declarations. + _ = endpoint.port + except ValueError as error: + raise ValueError("--url must be a valid HTTP(S) endpoint") from error + if endpoint.scheme not in ("http", "https") or not endpoint.hostname: + raise ValueError("--url must use HTTP or HTTPS with a hostname") + if endpoint.username is not None or endpoint.password is not None: + raise ValueError("--url must not include credentials; use --bearer-token-env") + return endpoint + + def load_bearer_token(name, url): """Read an optional bearer credential without persisting it in evidence.""" if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): @@ -132,7 +147,7 @@ def load_bearer_token(name, url): token = os.environ.get(name) if not token or not re.fullmatch(r"[A-Za-z0-9._~+/-]+=*", token): raise ValueError(f"--bearer-token-env {name} must contain a valid bearer token") - endpoint = urlsplit(url) + endpoint = require_http_endpoint(url) if endpoint.scheme != "https" and not ( endpoint.scheme == "http" and endpoint.hostname in ("localhost", "127.0.0.1", "::1") @@ -142,6 +157,7 @@ def load_bearer_token(name, url): def post(url, body, timeout=1800, bearer_token=None): + require_http_endpoint(url) headers = {"content-type": "application/json"} if bearer_token is not None: headers["Authorization"] = f"Bearer {bearer_token}" @@ -303,6 +319,7 @@ def main(argv=None): if (args.noul_temperature is not None and (not math.isfinite(args.noul_temperature) or args.noul_temperature <= 0)): raise ValueError("--noul-temperature must be finite and greater than zero") + require_http_endpoint(args.url) server_config = load_server_config(args.server_config) bearer_token = (load_bearer_token(args.bearer_token_env, args.url) if args.bearer_token_env is not None else None) diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index e9626878e3..183e84e851 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -750,6 +750,31 @@ def test_transmitted_bytes_match_the_recorded_request_fingerprint(self): self.assertEqual(hashlib.sha256(sent).hexdigest(), hashlib.sha256(run_http.request_bytes(body)).hexdigest()) + def test_non_http_and_url_embedded_credentials_refused_before_any_evidence(self): + # urllib.request normally accepts POST-style Request bodies for file: + # and data: handlers, which could fabricate evaluated model answers. + static = self.root / "fake-server-answer.json" + static.write_text('{"answers":{}}', encoding="utf-8") + for url in ( + static.as_uri(), + "data:application/json,%7B%22answers%22%3A%7B%7D%7D", + "ftp://localhost/answer.json", + "https:///missing-host", + "http://name:password@127.0.0.1:8009/v1/systemone", + "http://model.example:invalid/v1/systemone", + ): + with self.subTest(url=url): + with patch.object(run_http, "post") as post: + with self.assertRaisesRegex(ValueError, "HTTP|credentials"): + self.run_main(["--url", url]) + post.assert_not_called() + self.assertFalse(self.partial.exists()) + self.assertFalse(self.output.exists()) + with patch("urllib.request.build_opener") as opener: + with self.assertRaisesRegex(ValueError, "HTTP|credentials"): + run_http.post(url, {"state": "private transcript", "questions": {}}) + opener.assert_not_called() + def test_authentication_reads_env_without_persisting_credentials(self): token = "opaque.Test~7+/-==" response, elapsed = self.response("", {"questions": run_http.noul_questions()}) From d479d1bfa5e382da5680b769b972836de7926ae2 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 07:15:36 -0800 Subject: [PATCH 56/63] perf(evals): avoid quadratic AUC and leave-one-out rescans Use binary-search ranks for tied AUC and subtract a held-out row from precomputed threshold confusion counts. Keep threshold tie-breaking and undefined-class semantics unchanged. Add exhaustive-oracle comparison and a large-cohort scoring regression. Refs #4535 --- evals/intent_engine/score.py | 35 +++++++++++++++---- evals/intent_engine/test_score.py | 58 +++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index 3e918d6d37..be32156976 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -4,7 +4,7 @@ categories with both label classes and reports its category coverage. Nonempty macro F1 retains the historical fixed-CATS, zero-for-undefined convention. """ -import hashlib, json, glob, math, os, re, statistics, sys, tempfile +import bisect, hashlib, json, glob, math, os, re, statistics, sys, tempfile sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from common import CATS, calibrated @@ -132,8 +132,14 @@ def validate_calibration(result, rows): def auc(pos, neg): if not pos or not neg: return None - s = sum((p > n) + 0.5 * (p == n) for p in pos for n in neg) - return s / (len(pos) * len(neg)) + # Count strict wins and half-credit ties using negative-score ranks. + # This preserves pairwise AUC without the quadratic comparison matrix. + ordered_neg = sorted(neg) + twice_wins = sum( + bisect.bisect_left(ordered_neg, p) + bisect.bisect_right(ordered_neg, p) + for p in pos + ) + return twice_wins / (2 * len(pos) * len(neg)) def mean_defined(values): values = [value for value in values if value is not None] @@ -234,10 +240,25 @@ def score_config(res, fixed_t=None): per[c].update(loo_f1=None, loo_p=None, loo_r=None) continue tp = fp = fn = 0 - for i, r in enumerate(rows): - rest = rows[:i] + rows[i + 1:] - t = max(TH, key=lambda t: (prf(rest, c, t)["f1"] or 0, t)) - hit = r["probs"][c] >= t; y = c in r["labels"] + # Each held-out training sweep differs from the full sweep by one + # row. Subtract that row's contribution instead of rescanning all + # other rows for every threshold and every held-out case. + full_sweep = per[c]["sweep"] + for r in rows: + probability = r["probs"][c] + y = c in r["labels"] + + def training_f1(t): + counts = full_sweep[str(t)] + predicted = probability >= t + held_tp = counts["tp"] - int(predicted and y) + held_fp = counts["fp"] - int(predicted and not y) + held_fn = counts["fn"] - int(not predicted and y) + denominator = 2 * held_tp + held_fp + held_fn + return 2 * held_tp / denominator if denominator else 0 + + t = max(TH, key=lambda threshold: (training_f1(threshold), threshold)) + hit = probability >= t tp += hit and y; fp += hit and not y; fn += (not hit) and y per[c]["loo_f1"] = 2 * tp / (2 * tp + fp + fn) if tp + fp + fn else None per[c]["loo_p"] = tp / (tp + fp) if tp + fp else None diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index 00bb894fe5..f7e823d105 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -141,6 +141,64 @@ def test_full_class_coverage_preserves_existing_scores(self): self.assertEqual(result[name]["macro_f1"], 1.0) self.assertEqual(result[name]["all"]["exact_set_acc"], 1.0) + def test_ranked_auc_matches_exhaustive_pairwise_ties(self): + for pos, neg in ( + ([], []), ([0.5], []), ([], [0.5]), + ([0.5], [0.5]), ([0.0, 0.5, 1.0], [1.0, 0.5, 0.0]), + ([0.1, 0.1, 0.4, 0.8, 1.0], [0.0, 0.1, 0.3, 0.8, 0.8]), + ): + with self.subTest(pos=pos, neg=neg): + expected = (sum((p > n) + 0.5 * (p == n) + for p in pos for n in neg) / (len(pos) * len(neg)) + if pos and neg else None) + self.assertEqual(score.auc(pos, neg), expected) + + def test_leave_one_out_matches_independent_training_rescans(self): + levels = [0, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 1.0] + for count in (2, 3, 11, 24): + rows = [] + for index in range(count): + labels = [cat for j, cat in enumerate(score.CATS) + if (index + 3 * j) % 5 == 0] + item = row(str(index), labels, index % 2 == 0) + item["probs"] = { + cat: levels[(3 * index + 7 * j) % len(levels)] + for j, cat in enumerate(score.CATS) + } + rows.append(item) + actual = score.score_config({"config": "loo-check", "rows": rows}) + self.assertEqual(actual["loo_evaluated_cases"], count) + for category in score.CATS: + tp = fp = fn = 0 + for index, item in enumerate(rows): + train = rows[:index] + rows[index + 1:] + threshold = max( + score.TH, + key=lambda t: (score.prf(train, category, t)["f1"] or 0, t), + ) + hit = item["probs"][category] >= threshold + positive = category in item["labels"] + tp += hit and positive + fp += hit and not positive + fn += not hit and positive + expected = { + "loo_f1": 2 * tp / (2 * tp + fp + fn) if tp + fp + fn else None, + "loo_p": tp / (tp + fp) if tp + fp else None, + "loo_r": tp / (tp + fn) if tp + fn else None, + } + for metric, value in expected.items(): + self.assertEqual(actual["per_cat"][category][metric], value) + + def test_scoring_large_held_out_cohort_without_pairwise_rescans(self): + rows = [ + row(str(i), [score.CATS[0]] if i % 2 else [], bool(i % 3)) + for i in range(1200) + ] + result = score.score_config({"config": "large", "rows": rows}) + self.assertEqual(result["loo_evaluated_cases"], len(rows)) + self.assertEqual(result["latency"]["total_cases"], len(rows)) + self.assertEqual(result["per_cat"][score.CATS[0]]["auc"], 1.0) + def test_cli_reports_the_scored_subset_without_loading_the_full_dataset(self): with tempfile.TemporaryDirectory() as directory: root = Path(directory) From fd5217fb0d94d88dd2cebbd5d4b180bce5810127 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 08:12:01 -0800 Subject: [PATCH 57/63] fix(evals): hold writer lock through completed publication Refs #4535. A second same-tag evaluator could acquire the partial lock after the first released it but before the first published the result, racing to publish the same evidence. Keep the lock until the no-clobber final result is linked, recheck an output that appeared before lock admission, and cover both races with behavioral tests. --- evals/intent_engine/run_http.py | 21 +++++----- evals/intent_engine/test_run_http.py | 59 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 9 deletions(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index acf156c923..3682c61e64 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -381,6 +381,9 @@ def main(argv=None): created = False with partial: lock_partial_writer(partial, partial_path) + # Another writer may have completed this tag since the preflight. + if os.path.lexists(path): + raise ValueError(f"completed output already exists: {path}; use a new tag") if created: partial.write(json.dumps(header, allow_nan=False) + "\n") partial.flush() @@ -428,15 +431,15 @@ def main(argv=None): partial.flush() done[case["id"]] = row print(cfg, index, case["id"], "%.0f ms" % ms, flush=True) - # An interrupted or failed write leaves no truncated result at the - # output path. The complete partial log stays in place, so a retry with - # the same identity makes no new model calls. - publish_final_result(path, { - "config": name, "dataset_sha256": dataset_sha, - "noul_temperature": args.noul_temperature, - "subset": args.subset and os.path.basename(args.subset), - **header, "rows": [done[case_id] for case_id in cases], - }) + # Hold the partial writer lock through exclusive publication. + # A second evaluator must not publish the same complete log first. + # Failed publication retains the partial for an exact resume. + publish_final_result(path, { + "config": name, "dataset_sha256": dataset_sha, + "noul_temperature": args.noul_temperature, + "subset": args.subset and os.path.basename(args.subset), + **header, "rows": [done[case_id] for case_id in cases], + }) os.remove(partial_path) print(cfg, "done", flush=True) diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index 183e84e851..d64293c233 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -127,6 +127,65 @@ def first_run(): result = json.loads(self.output.read_text()) self.assertEqual([row["id"] for row in result["rows"]], ["first", "second"]) + def test_partial_lock_covers_final_result_publication(self): + entered, release = Event(), Event() + errors = [] + original_publish = run_http.publish_final_result + + def paused_publish(path, document): + if not entered.is_set(): + entered.set() + if not release.wait(10): + raise OSError("publication barrier was never released") + return original_publish(path, document) + + def first_run(): + try: + self.run_main() + except Exception as error: + errors.append(error) + + with patch.object(run_http, "post", side_effect=self.response) as post: + with patch.object(run_http, "publish_final_result", + side_effect=paused_publish) as publish: + worker = Thread(target=first_run) + worker.start() + try: + self.assertTrue(entered.wait(10), "first publication did not start") + before = self.partial.read_bytes() + with self.assertRaisesRegex(ValueError, "another evaluator"): + self.run_main() + self.assertEqual(self.partial.read_bytes(), before) + self.assertFalse(self.output.exists()) + finally: + release.set() + worker.join(10) + self.assertFalse(worker.is_alive()) + self.assertEqual(errors, []) + self.assertEqual(post.call_count, len(self.dataset)) + publish.assert_called_once() + self.assertTrue(self.output.exists()) + self.assertFalse(self.partial.exists()) + + def test_completion_between_preflight_and_lock_refuses_resume(self): + self.interrupt() + original_lock = run_http.lock_partial_writer + before = self.partial.read_bytes() + previous = '{"previous":true}' + + def publish_before_locked_check(partial, path): + original_lock(partial, path) + self.output.write_text(previous, encoding="utf-8") + + with patch.object(run_http, "lock_partial_writer", + side_effect=publish_before_locked_check): + with patch.object(run_http, "post") as post: + with self.assertRaisesRegex(ValueError, "completed output already exists"): + self.run_main() + post.assert_not_called() + self.assertEqual(self.output.read_text(encoding="utf-8"), previous) + self.assertEqual(self.partial.read_bytes(), before) + @unittest.skipUnless(os.name == "posix", "symlink identity check requires POSIX") def test_symlinked_partial_cannot_write_to_another_file(self): self.partial.parent.mkdir(parents=True, exist_ok=True) From af7fb3fc4584b7f8b2ea42eb381d8e73318b2c20 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 09:16:06 -0800 Subject: [PATCH 58/63] fix(evals): refuse nonregular HTTP resume files Avoid indefinite FIFO reads during resumable evaluation admission. Use nonblocking, no-follow opening and validate the descriptor type before taking the existing exclusive lock and parsing the log. Retain existing pathname-identity verification and regular resume behavior. Add a bounded behavioral regression that proves a named pipe is refused without waiting for a writer or issuing model requests. Refs #4535 --- evals/intent_engine/run_http.py | 27 +++++++++++++++++++++++++- evals/intent_engine/test_run_http.py | 29 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 3682c61e64..afc9bedc39 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -14,6 +14,7 @@ import os import re import secrets +import stat import sys import time import urllib.request @@ -278,6 +279,30 @@ def lock_partial_writer(partial, path): partial.seek(0) +def open_partial_for_resume(path): + """Open only regular resumable evidence, without blocking on a FIFO. + + A pre-existing .partial path is untrusted filesystem state. Opening it + as r+ before inspecting its type can hang forever on a named pipe, so + request nonblocking/no-follow admission and check the opened descriptor. + The later lock still checks inode identity against the pathname. + """ + flags = os.O_RDWR | getattr(os, "O_NONBLOCK", 0) | getattr(os, "O_NOFOLLOW", 0) + try: + descriptor = os.open(path, flags) + except OSError as error: + if error.errno == errno.ELOOP: + raise ValueError(f"partial output was replaced or redirected: {path}") from error + raise + try: + if not stat.S_ISREG(os.fstat(descriptor).st_mode): + raise ValueError(f"partial output must be a regular file: {path}") + return os.fdopen(descriptor, "r+", encoding="utf-8") + except BaseException: + os.close(descriptor) + raise + + def resume_rows(partial, header, cases, requests, questions, temperature): """Validate the whole existing log before appending or issuing HTTP work.""" first = partial.readline() @@ -377,7 +402,7 @@ def main(argv=None): partial = open(partial_path, "x+", encoding="utf-8") created = True except FileExistsError: - partial = open(partial_path, "r+", encoding="utf-8") + partial = open_partial_for_resume(partial_path) created = False with partial: lock_partial_writer(partial, partial_path) diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index d64293c233..f37c06feff 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -199,6 +199,35 @@ def test_symlinked_partial_cannot_write_to_another_file(self): self.assertEqual(unrelated.read_text(encoding="utf-8"), "unchanged") self.assertFalse(self.output.exists()) + @unittest.skipUnless(hasattr(os, "mkfifo"), "named pipes require POSIX") + def test_named_pipe_partial_is_refused_without_waiting_for_a_writer(self): + self.partial.parent.mkdir(parents=True, exist_ok=True) + os.mkfifo(self.partial) + outcome = {} + finished = Event() + + def resume(): + try: + self.run_main() + except Exception as error: + outcome["error"] = error + finally: + finished.set() + + with patch.object(run_http, "post") as post: + worker = Thread(target=resume, daemon=True) + worker.start() + self.assertTrue( + finished.wait(5), + "resume blocked on a FIFO before it could refuse non-file evidence", + ) + worker.join() + self.assertIsInstance(outcome.get("error"), ValueError) + self.assertIn("regular file", str(outcome["error"])) + post.assert_not_called() + self.assertTrue(stat.S_ISFIFO(self.partial.lstat().st_mode)) + self.assertFalse(self.output.exists()) + def test_input_tokens_do_not_fabricate_state_or_truncation_measurements(self): self.interrupt() with patch.object(run_http, "post", side_effect=self.response): From 5b97b7e4eae351d538d2cc8398cd23c363555ad1 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:09:53 -0800 Subject: [PATCH 59/63] fix(evals): refuse HTTP scoring without experiment identity HTTP measurement rows retain request fingerprints. If the experiment field disappears, the scorer previously treated these results as an unprovenanced local run, bypassing identity and calibration checks. Require the HTTP identity whenever HTTP fingerprint markers remain. Preserve historical local results with their dataset digest, and test both refusal and preservation of the last scored summary. Refs #4535 --- evals/intent_engine/score.py | 9 ++++++- evals/intent_engine/test_score.py | 39 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index be32156976..126754f81e 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -76,7 +76,14 @@ def evidence_digest(value): def validate_http_provenance(result, rows): """Bind scored HTTP rows to the recorded experiment and request order.""" if "experiment" not in result: - return # Local-only scoring inputs do not claim HTTP provenance. + # Historical local runs can carry a dataset digest, but HTTP request + # fingerprints and experiment digests require a matching identity. + # Losing the identity cannot silently downgrade HTTP evidence to local. + if "experiment_sha256" in result or any( + "request_sha256" in row for row in rows + ): + raise ValueError("HTTP result is missing its experiment identity") + return experiment = result["experiment"] if result.get("experiment_sha256") != evidence_digest(experiment): raise ValueError("HTTP experiment identity digest disagrees with recorded settings") diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index f7e823d105..1618236280 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -362,6 +362,45 @@ def test_http_calibration_must_match_raw_evidence(self): self.assertIn("calibrated probabilities disagree", attempt.stderr) self.assertEqual(summary.read_bytes(), b"last verified summary\n") + def test_http_provenance_cannot_be_downgraded_to_local_scoring(self): + original = signed_http_result("B_noul_text", [row("first"), row("second")]) + self.assertEqual(score.score_config(original)["latency"]["total_cases"], 2) + for missing in ( + ("experiment",), + ("experiment", "experiment_sha256"), + ): + with self.subTest(missing=missing): + damaged = json.loads(json.dumps(original)) + for field in missing: + del damaged[field] + with self.assertRaisesRegex(ValueError, "missing its experiment identity"): + score.score_config(damaged) + + # Local evaluations record dataset_sha256 too; preserve their format. + local = { + "config": "local", "dataset_sha256": "a" * 64, + "rows": [row("local")], + } + self.assertEqual(score.score_config(local)["latency"]["total_cases"], 1) + + # Failed HTTP provenance checks cannot overwrite a scored snapshot. + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + self.stage_scripts(root) + (root / "results").mkdir() + damaged = json.loads(json.dumps(original)) + del damaged["experiment"] + del damaged["experiment_sha256"] + (root / "results" / "damaged.json").write_text( + json.dumps(damaged), encoding="utf-8", + ) + summary = root / "summary.json" + summary.write_bytes(b"last verified summary\n") + attempt = self.run_script(root, "score.py") + self.assertNotEqual(attempt.returncode, 0) + self.assertIn("missing its experiment identity", attempt.stderr) + self.assertEqual(summary.read_bytes(), b"last verified summary\n") + def test_http_result_fingerprints_bind_case_order_and_experiment(self): original = signed_http_result("B_noul_text", [row("first"), row("second")]) self.assertEqual(score.score_config(original)["latency"]["total_cases"], 2) From 11f4f62125a43c263ab77edf41590bf16c671c3d Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:10:19 -0800 Subject: [PATCH 60/63] fix(evals): bind HTTP scoring labels to recorded case annotations The scorer validated request and dataset fingerprints but never checked that each output row retained its original ground-truth labels or context-needed annotation. Relabelling completed rows could silently change evaluation accuracy with otherwise valid experiment identity. Bind those annotations to the captured experiment and refuse changed or unbound evidence before scoring. Add tests for label/context drift, incomplete identity, and preserving the last valid summary. Refs #4535 --- evals/intent_engine/HTTP_RUNNER.md | 12 ++++++++---- evals/intent_engine/run_http.py | 6 ++++++ evals/intent_engine/score.py | 5 +++++ evals/intent_engine/test_run_http.py | 16 ++++++++++++++++ evals/intent_engine/test_score.py | 17 +++++++++++++++-- 5 files changed, 50 insertions(+), 6 deletions(-) diff --git a/evals/intent_engine/HTTP_RUNNER.md b/evals/intent_engine/HTTP_RUNNER.md index 0aa3b2b665..e8f355dab6 100644 --- a/evals/intent_engine/HTTP_RUNNER.md +++ b/evals/intent_engine/HTTP_RUNNER.md @@ -34,8 +34,9 @@ The optional `--noul-temperature` is a separate client-side calibration step; it must be finite and strictly positive. The existing `.partial` log starts with the experiment identity. This binds the -whole dataset hash, selected case IDs and order, the exact rendered HTTP request -bytes for each case, endpoint hash, requested model, client calibration, and the +whole dataset hash, selected case IDs and order, the original labels and +context-needed annotations, the exact rendered HTTP request bytes for each +case, endpoint hash, requested model, client calibration, and the serving declaration. A completed result retains the same identity and each row's request fingerprint. The endpoint itself is not copied into the identity. @@ -84,8 +85,11 @@ Version-1 completed HTTP results are also refused by the scorer. Historical reports are not rewritten or retrospectively qualified. The scorer also rejects completed HTTP results whose experiment-identity digest, -per-case request fingerprints, recorded order, dataset digest, or configuration -disagree with the output. This detects accidental edits and mismatched runs; +per-case request fingerprints, recorded order, case labels/context annotations, +dataset digest, or configuration disagree with the output. Earlier version-2 HTTP +results without the case-annotation digest must be rerun with a new tag; they +cannot be independently scored against their original annotations. These checks +detect accidental edits and mismatched runs; these operator-written hashes do not authenticate the remote model or verify independent ground-truth labels. diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index afc9bedc39..788759c3b7 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -390,6 +390,12 @@ def main(argv=None): "config": cfg, "dataset_sha256": dataset_sha, "case_ids": list(cases), + # Preserve the original annotation evidence for later scoring. + # A result's labels or context status must not silently drift. + "case_annotations_sha256": digest([ + [case["id"], case["labels"], case["context_needed"]] + for case in dataset + ]), "requests_sha256": digest([[key, value[1]] for key, value in requests.items()]), "endpoint_sha256": hashlib.sha256(args.url.encode("utf-8")).hexdigest(), "requested_model": args.send_model, diff --git a/evals/intent_engine/score.py b/evals/intent_engine/score.py index 126754f81e..da9375d962 100644 --- a/evals/intent_engine/score.py +++ b/evals/intent_engine/score.py @@ -90,6 +90,11 @@ def validate_http_provenance(result, rows): case_ids = [row["id"] for row in rows] if experiment.get("case_ids") != case_ids: raise ValueError("HTTP experiment case IDs or ordering disagree with result rows") + annotations = [ + [row["id"], row["labels"], row["context_needed"]] for row in rows + ] + if experiment.get("case_annotations_sha256") != evidence_digest(annotations): + raise ValueError("HTTP case annotations disagree with experiment identity") requests = [] for row in rows: request_sha = row.get("request_sha256") diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index f37c06feff..0f8824dd41 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -88,10 +88,26 @@ def test_exact_resume_only_requests_the_missing_case(self): self.assertEqual([row["id"] for row in result["rows"]], ["first", "second"]) self.assertEqual(result["experiment"]["server_config"], self.server) self.assertEqual(result["experiment_sha256"], run_http.digest(result["experiment"])) + self.assertEqual(result["experiment"]["case_annotations_sha256"], run_http.digest([ + [case["id"], case["labels"], case["context_needed"]] + for case in self.dataset + ])) self.assertEqual(result["rows"][0]["server_ms"], 0) self.assertFalse(self.partial.exists()) + def test_completed_rows_cannot_be_relabelled_for_scoring(self): + with patch.object(run_http, "post", side_effect=self.response): + self.run_main() + original = json.loads(self.output.read_text()) + self.assertEqual(score.score_config(original)["latency"]["total_cases"], 2) + for field, value in (("labels", []), ("context_needed", False)): + with self.subTest(field=field): + changed = copy.deepcopy(original) + changed["rows"][0][field] = value + with self.assertRaisesRegex(ValueError, "case annotations disagree"): + score.score_config(changed) + def test_concurrent_same_tag_writers_cannot_corrupt_resumable_evidence(self): entered, release = Event(), Event() errors = [] diff --git a/evals/intent_engine/test_score.py b/evals/intent_engine/test_score.py index 1618236280..c5f7100b5f 100644 --- a/evals/intent_engine/test_score.py +++ b/evals/intent_engine/test_score.py @@ -42,6 +42,9 @@ def fingerprint(value): experiment = { "version": 2, "config": config, "dataset_sha256": "a" * 64, "case_ids": [item["id"] for item in rows], + "case_annotations_sha256": fingerprint([ + [item["id"], item["labels"], item["context_needed"]] for item in rows + ]), "requests_sha256": fingerprint( [[item["id"], item["request_sha256"]] for item in rows] ), @@ -409,6 +412,9 @@ def test_http_result_fingerprints_bind_case_order_and_experiment(self): ("missing_digest", "identity digest"), ("request", "request fingerprints"), ("case_order", "case IDs or ordering"), + ("labels", "case annotations disagree"), + ("context", "case annotations disagree"), + ("missing_case_digest", "case annotations disagree"), ("dataset", "dataset digest"), ("config", "configuration disagrees"), ]: @@ -421,6 +427,13 @@ def test_http_result_fingerprints_bind_case_order_and_experiment(self): changed["rows"][0]["request_sha256"] = "c" * 64 elif mutation == "case_order": changed["rows"].reverse() + elif mutation == "labels": + changed["rows"][0]["labels"] = [score.CATS[0]] + elif mutation == "context": + changed["rows"][0]["context_needed"] = True + elif mutation == "missing_case_digest": + del changed["experiment"]["case_annotations_sha256"] + changed["experiment_sha256"] = score.evidence_digest(changed["experiment"]) elif mutation == "dataset": changed["dataset_sha256"] = "f" * 64 elif mutation == "config": @@ -435,7 +448,7 @@ def test_http_result_fingerprints_bind_case_order_and_experiment(self): self.stage_scripts(root) (root / "results").mkdir() changed = json.loads(json.dumps(original)) - changed["rows"][1]["request_sha256"] = "c" * 64 + changed["rows"][1]["labels"] = [score.CATS[0]] (root / "results" / "bad.json").write_text( json.dumps(changed), encoding="utf-8" ) @@ -443,7 +456,7 @@ def test_http_result_fingerprints_bind_case_order_and_experiment(self): summary.write_bytes(b"last verified summary\n") attempt = self.run_script(root, "score.py") self.assertNotEqual(attempt.returncode, 0) - self.assertIn("request fingerprints", attempt.stderr) + self.assertIn("case annotations disagree", attempt.stderr) self.assertEqual(summary.read_bytes(), b"last verified summary\n") def test_invalid_probability_cannot_replace_previous_cli_summary(self): From a83262ffebbf1340544400e104e860c7d049330b Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:16:13 -0800 Subject: [PATCH 61/63] fix(evals): validate dataset before HTTP inference Reject malformed case labels, metadata and rendered inputs before opening results or spending tokens, rather than persisting unscorable evidence. Cover invalid cases and preserve the existing valid dataset behavior. Refs #4535 --- evals/intent_engine/run_http.py | 39 +++++++++++++++++++++++++--- evals/intent_engine/test_run_http.py | 33 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/evals/intent_engine/run_http.py b/evals/intent_engine/run_http.py index 788759c3b7..07f9340f7f 100644 --- a/evals/intent_engine/run_http.py +++ b/evals/intent_engine/run_http.py @@ -326,6 +326,39 @@ def resume_rows(partial, header, cases, requests, questions, temperature): return done +def validate_dataset(dataset, questions): + """Refuse unscorable or malformed input before spending inference tokens.""" + if not isinstance(dataset, list) or not dataset: + raise ValueError("dataset must be a nonempty list of cases") + ids = [] + seen = set() + for case in dataset: + if not isinstance(case, dict): + raise ValueError("dataset must contain case objects") + case_id = case.get("id") + if not isinstance(case_id, str) or not case_id or case_id in seen: + raise ValueError("dataset must have unique nonempty string case IDs") + seen.add(case_id) + ids.append(case_id) + labels = case.get("labels") + if (not isinstance(labels, list) + or any(not isinstance(label, str) or label not in questions for label in labels) + or len(set(labels)) != len(labels)): + raise ValueError(f"dataset case {case_id} has invalid labels") + if not isinstance(case.get("context_needed"), bool): + raise ValueError(f"dataset case {case_id} has invalid context_needed") + if not isinstance(case.get("current_prompt"), str): + raise ValueError(f"dataset case {case_id} has invalid current_prompt") + turns = case.get("turns") + if (not isinstance(turns, list) + or any(not isinstance(turn, dict) + or turn.get("role") not in ("user", "assistant", "tool") + or not isinstance(turn.get("text"), str) + for turn in turns)): + raise ValueError(f"dataset case {case_id} has invalid turns") + return ids + + def main(argv=None): ap = argparse.ArgumentParser(description=__doc__) ap.add_argument("--url", required=True) @@ -354,9 +387,8 @@ def main(argv=None): dataset_bytes = source.read() dataset = json.loads(dataset_bytes) dataset_sha = hashlib.sha256(dataset_bytes).hexdigest() - case_ids = [case["id"] for case in dataset] - if any(not isinstance(case_id, str) for case_id in case_ids) or len(set(case_ids)) != len(case_ids): - raise ValueError("dataset must have unique string case IDs") + questions = noul_questions() + case_ids = validate_dataset(dataset, questions) if args.subset: with open(args.subset, encoding="utf-8") as source: ids = json.load(source)["ids"] @@ -368,7 +400,6 @@ def main(argv=None): dataset = [case for case in dataset if case["id"] in keep] if not dataset: raise ValueError("the experiment must contain at least one case") - questions = noul_questions() cases = {case["id"]: case for case in dataset} os.makedirs(os.path.join(HERE, "results"), exist_ok=True) for cfg in args.configs: diff --git a/evals/intent_engine/test_run_http.py b/evals/intent_engine/test_run_http.py index 0f8824dd41..6d5e710698 100644 --- a/evals/intent_engine/test_run_http.py +++ b/evals/intent_engine/test_run_http.py @@ -78,6 +78,39 @@ def assert_refused_unchanged(self, extra=()): self.assertEqual(self.partial.read_bytes(), before) self.assertFalse(self.output.exists()) + def test_invalid_dataset_is_refused_before_network_or_partial_output(self): + malformed = [ + ("not_a_list", {"cases": self.dataset}), + ("not_an_object", [None]), + ("duplicate_id", [self.dataset[0], self.dataset[0]]), + ] + for field, value in ( + ("labels", ["not_a_question"]), + ("labels", ["impact", "impact"]), + ("labels", None), + ("context_needed", 1), + ("current_prompt", None), + ("turns", [{"role": "system", "text": "not a dataset turn"}]), + ("turns", [{"role": "tool", "text": 8}]), + ): + changed = copy.deepcopy(self.dataset) + changed[0][field] = value + malformed.append((field + "_" + repr(value), changed)) + + try: + for reason, dataset in malformed: + with self.subTest(reason=reason): + self.write("dataset.json", dataset) + with patch.object(run_http, "post") as post: + with self.assertRaisesRegex(ValueError, "dataset"): + self.run_main() + post.assert_not_called() + self.assertFalse(self.output.exists()) + self.assertFalse(self.partial.exists()) + self.assertFalse((self.root / "results").exists()) + finally: + self.write("dataset.json", self.dataset) + def test_exact_resume_only_requests_the_missing_case(self): self.interrupt() with patch.object(run_http, "post", side_effect=self.response) as post: From 600e5f94feb239c754146a13f2d690d08e428bda Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:35:08 -0800 Subject: [PATCH 62/63] style(retention): satisfy clippy in bounded text-artifact scans CI runs clippy with -D warnings, and the #4769 code fails it in two ways. The retention planner passed `&mut usize::MAX` for its entry budgets, which const_item_mutation rejects, and two doc comments left `ReadDir` unquoted. Name a local budget at each call. Each call still starts from its own usize::MAX, so behavior is unchanged. Co-Authored-By: Claude Opus 5.5 --- .../src/code_index_generations.rs | 6 ++++-- .../src/telemetry/text_artifact_scans.rs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/tracedecay-code-index-retention/src/code_index_generations.rs b/crates/tracedecay-code-index-retention/src/code_index_generations.rs index ee1cd18d21..c728f91383 100644 --- a/crates/tracedecay-code-index-retention/src/code_index_generations.rs +++ b/crates/tracedecay-code-index-retention/src/code_index_generations.rs @@ -956,12 +956,13 @@ fn prepare_next_code_generation_retention_page_cancellable( // when this exact census found bytes that may be unlinked. The executor // still refuses metadata-only plans, so no deletion can cross this gate // without the canonical full verification below. + let mut census_remaining_entries = usize::MAX; let mut census = plan_code_generation_retention_page_cancellable( store_root, vector_readable_sources, GenerationDigestVerificationV1::MetadataOnly, graph_replay_pool_root, - &mut usize::MAX, + &mut census_remaining_entries, is_cancelled, text_page, )?; @@ -987,12 +988,13 @@ fn prepare_next_code_generation_retention_page_cancellable( if !census.has_collectable_work() { return Ok(census); } + let mut plan_remaining_entries = usize::MAX; plan_code_generation_retention_page_cancellable( store_root, vector_readable_sources, GenerationDigestVerificationV1::Full, graph_replay_pool_root, - &mut usize::MAX, + &mut plan_remaining_entries, is_cancelled, text_page, ) diff --git a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs index 869d883fee..6f141ba3f9 100644 --- a/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs +++ b/crates/tracedecay-maintenance/src/telemetry/text_artifact_scans.rs @@ -40,7 +40,7 @@ impl StoreTelemetrySamplingRegistry { /// Release directory streams for scopes absent from a successfully read /// project scope inventory. A registered project can outlive many retired - /// worktrees; pruning by project alone would retain their open ReadDir + /// worktrees; pruning by project alone would retain their open `ReadDir` /// handles indefinitely. pub(crate) fn retain_text_artifact_scan_scopes( &self, @@ -57,7 +57,7 @@ impl StoreTelemetrySamplingRegistry { /// A scope selected for quarantine must not be pinned by an unfinished /// staging-directory scan. Reset even if a blocking caller still holds an - /// Arc to the scan, so its ReadDir handles are closed before the rename. + /// Arc to the scan, so its `ReadDir` handles are closed before the rename. /// The maintenance writer serializes this with scan preparation. pub(crate) fn release_text_artifact_scans_before_scope_collection( &self, From cc0665e5a384878c4d75ec640f7f729b3fff0148 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:35:12 -0800 Subject: [PATCH 63/63] test(sqlite): gate Linux-only descriptor assertion deleted_descriptors reads /proc/self/fd and exists only on Linux, but a #[cfg(unix)] test called it, so this crate's unit tests could not compile on macOS. The assertion still runs on Linux. Co-Authored-By: Claude Opus 5.5 --- crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs index fa3508e93d..2ad9b08b1d 100644 --- a/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs +++ b/crates/tracedecay-rusqlite-runtime/src/repository/attachment.rs @@ -1463,6 +1463,7 @@ mod tests { held_pin.try_clone().is_err(), "retaining a pin handle must not retain the descriptor after worker exit" ); + #[cfg(target_os = "linux")] assert!( deleted_descriptors(directory.path()).is_empty(), "the last lost worker exiting must release every deleted-file descriptor"