diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7ddc755b6e..5bc6c50c6a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0-beta.92" + ".": "1.0.0-beta.93" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f77e605e1..e229df574c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,87 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.0-beta.93](https://github.com/ScriptedAlchemy/tracedecay/compare/v1.0.0-beta.92...v1.0.0-beta.93) (2026-10-27) + + +### Features + +* **edits:** remove file undo and automatic restoration ([#4472](https://github.com/ScriptedAlchemy/tracedecay/issues/4472)) ([4098533](https://github.com/ScriptedAlchemy/tracedecay/commit/4098533106a89f5e5fe395622e13414314c5c671)) + + +### Bug Fixes + +* **automation:** refuse incomplete stored job documents ([#4468](https://github.com/ScriptedAlchemy/tracedecay/issues/4468)) ([645131b](https://github.com/ScriptedAlchemy/tracedecay/commit/645131b5c338d7e50f02486d3015407017d0ce87)) +* **automation:** retain stable task publication coordination ([bf96210](https://github.com/ScriptedAlchemy/tracedecay/commit/bf962101d773ed92dad400f9efaf8d742398b292)) +* **build:** rebase rules_rust patches onto 0.75.0 ([47647d8](https://github.com/ScriptedAlchemy/tracedecay/commit/47647d89cfa18c8bafc51b2a1e3bc1244d24e79d)) +* **ci:** bound Windows compiler concurrency ([fadecbd](https://github.com/ScriptedAlchemy/tracedecay/commit/fadecbd811625735291394e88f5fd25de9aa2eef)) +* **ci:** bound Windows compiler concurrency ([518ef74](https://github.com/ScriptedAlchemy/tracedecay/commit/518ef7431cf5649f38af9cdbb6b2760e962eb46f)) +* **ci:** bound Windows compiler concurrency ([5455c4a](https://github.com/ScriptedAlchemy/tracedecay/commit/5455c4a6b89340e6babbd0cfa2cb17d03dacfabd)) +* **ci:** scope native concurrency to Windows ([4ea8661](https://github.com/ScriptedAlchemy/tracedecay/commit/4ea866153115b89aee6bcefd6c7a8bf16a4bdc69)) +* **ci:** scope native concurrency to Windows ([a736653](https://github.com/ScriptedAlchemy/tracedecay/commit/a736653be7f232f012def463bab183fa0251dc2f)) +* **cli:** hold init --wait while the first generation is in flight ([#4494](https://github.com/ScriptedAlchemy/tracedecay/issues/4494)) ([722f7cc](https://github.com/ScriptedAlchemy/tracedecay/commit/722f7ccd83bc42b9cfe3a1dd722a44f97e08eeaa)) +* **code-graph:** pin segment reads within each publication pass ([c04194a](https://github.com/ScriptedAlchemy/tracedecay/commit/c04194aa5e46ef286853e55682b10ec872bd45eb)) +* **code-graph:** pin segment reads within each publication pass ([4806c93](https://github.com/ScriptedAlchemy/tracedecay/commit/4806c934e322da2929d22343d83dff1c4de0ba56)) +* **code-index:** bound cold builds and resume refused publication ([aef1060](https://github.com/ScriptedAlchemy/tracedecay/commit/aef1060d7bf7c0009ff6bc9e812344a5677b5406)) +* **code-index:** bound cold construction and retain refused publication ([3e10b5f](https://github.com/ScriptedAlchemy/tracedecay/commit/3e10b5fbb0a5d49b59c7fbe7216e43c6f10b0a2d)) +* **code-index:** keep a read-reseated graph across parks ([#4499](https://github.com/ScriptedAlchemy/tracedecay/issues/4499)) ([e9a3355](https://github.com/ScriptedAlchemy/tracedecay/commit/e9a3355fa1975ce46f3cd33b640622d92d0aac6d)) +* **code-index:** key panic quarantine on input, not pass progress ([#4572](https://github.com/ScriptedAlchemy/tracedecay/issues/4572)) ([f3d8946](https://github.com/ScriptedAlchemy/tracedecay/commit/f3d8946cd340b12cfbb6753a5eea42bb9e005283)) +* **code-index:** retry superseded publication fences ([dab12b4](https://github.com/ScriptedAlchemy/tracedecay/commit/dab12b408390013799b790a59687648699c6d0f7)) +* **code-index:** stop a refused cold pass from waking its own retry ([3434b35](https://github.com/ScriptedAlchemy/tracedecay/commit/3434b35c871fc802b3fa4cf9d233e33382390f2c)), closes [#4505](https://github.com/ScriptedAlchemy/tracedecay/issues/4505) +* **cursor:** apply diagnostic caps after lane selection ([#4491](https://github.com/ScriptedAlchemy/tracedecay/issues/4491)) ([96994d0](https://github.com/ScriptedAlchemy/tracedecay/commit/96994d0587c659c98d7c9897ca6b23cd7dbe736a)) +* **evals:** pass the eval self-tests on native Windows ([430e447](https://github.com/ScriptedAlchemy/tracedecay/commit/430e4475095c52ad8b2b0c36821eef32819c9dc6)) +* **evals:** pass the eval self-tests on native Windows ([c6129a6](https://github.com/ScriptedAlchemy/tracedecay/commit/c6129a628e15aac4a4ba3db46d35b67865b1db3b)) +* **extension:** make bridge shutdown terminal ([#4486](https://github.com/ScriptedAlchemy/tracedecay/issues/4486)) ([9b8789c](https://github.com/ScriptedAlchemy/tracedecay/commit/9b8789c94cf9a2d527a680be1e6997f96c057bbb)) +* **graph-db:** log drifting corruption verdicts at error level ([#4574](https://github.com/ScriptedAlchemy/tracedecay/issues/4574)) ([0d7c88d](https://github.com/ScriptedAlchemy/tracedecay/commit/0d7c88d0d32d8360c6a56b79b098d17baffa4111)) +* **graph:** preserve import evidence in caller traversal ([#4509](https://github.com/ScriptedAlchemy/tracedecay/issues/4509)) ([6ed67ce](https://github.com/ScriptedAlchemy/tracedecay/commit/6ed67ce8fde9d45a89ad9a53e9d9982ae251d0e2)) +* **graph:** resolve node ids before waiting on a released catalog ([#4498](https://github.com/ScriptedAlchemy/tracedecay/issues/4498)) ([ba7493d](https://github.com/ScriptedAlchemy/tracedecay/commit/ba7493d0744ea0fd42309286d6bda2c3164f3d8e)) +* **health:** share SCC analysis and count cycle edges exactly ([#4466](https://github.com/ScriptedAlchemy/tracedecay/issues/4466)) ([69ece22](https://github.com/ScriptedAlchemy/tracedecay/commit/69ece22393a0d0039f7f79b79b5d1077d0761ff1)) +* **lcm:** retry timed-out summarizers without a binding change ([59243c2](https://github.com/ScriptedAlchemy/tracedecay/commit/59243c2207583a23d0f52b336529f4ec97c13d71)) +* **lcm:** retry timed-out summarizers without a binding change ([5603495](https://github.com/ScriptedAlchemy/tracedecay/commit/56034958c1d9f913a73555e1ba5e731fe1ae4c83)), closes [#4522](https://github.com/ScriptedAlchemy/tracedecay/issues/4522) +* **lsp:** retain admitted diagnostic snapshots for pull ([#4524](https://github.com/ScriptedAlchemy/tracedecay/issues/4524)) ([6658a90](https://github.com/ScriptedAlchemy/tracedecay/commit/6658a900c2719419a11f0af1c4e7b6aa9b8e5d65)) +* **privacy:** redact flagged object keys in place ([60c4b85](https://github.com/ScriptedAlchemy/tracedecay/commit/60c4b854699060f6fa2dac77aacc2dcfa1dcdec1)) +* **privacy:** redact flagged object keys in place ([#4515](https://github.com/ScriptedAlchemy/tracedecay/issues/4515)) ([95e49f5](https://github.com/ScriptedAlchemy/tracedecay/commit/95e49f571127750b4aea32b3fe889d20454dd6cc)) +* **privacy:** stop treating compound identifiers as secrets ([36eedb3](https://github.com/ScriptedAlchemy/tracedecay/commit/36eedb3ee7cd127ad6f9106b201df47998e0a2e4)) +* **privacy:** stop treating compound identifiers as secrets ([d869740](https://github.com/ScriptedAlchemy/tracedecay/commit/d869740986811ca92be4c51ab16c3cfdae53562d)), closes [#4451](https://github.com/ScriptedAlchemy/tracedecay/issues/4451) +* **privacy:** verify descendant and repeated key redaction ([08f86e7](https://github.com/ScriptedAlchemy/tracedecay/commit/08f86e73e6aa4b3a27c0c676d65f0c7186849adf)) +* **runtime:** batch session skips and retain preparation writers ([#4495](https://github.com/ScriptedAlchemy/tracedecay/issues/4495)) ([fc598cb](https://github.com/ScriptedAlchemy/tracedecay/commit/fc598cba885191feb2b2d216e83834ea1b8c9de8)) +* **sdk:** bound SSE frames and scan fragmented lines once ([#4501](https://github.com/ScriptedAlchemy/tracedecay/issues/4501)) ([1d7e794](https://github.com/ScriptedAlchemy/tracedecay/commit/1d7e794f0dea4498905564d3ad253548727383ee)) +* **sdk:** own JSON response bodies through cancellation ([#4487](https://github.com/ScriptedAlchemy/tracedecay/issues/4487)) ([ef2809e](https://github.com/ScriptedAlchemy/tracedecay/commit/ef2809ec73e88e4f620a77130892256bd0a4a8b5)) +* **sdk:** refuse enrolled remote redirects ([#4471](https://github.com/ScriptedAlchemy/tracedecay/issues/4471)) ([c9b1d4c](https://github.com/ScriptedAlchemy/tracedecay/commit/c9b1d4c690fcbccdd4cfbf3cafb189d0527fc9d7)) +* **session:** recheck summaries without replaying projection ([d7b7857](https://github.com/ScriptedAlchemy/tracedecay/commit/d7b7857a262a05730db6e25e579c7e23b6b55802)) +* **session:** retain summary work after live projection ([dc524ef](https://github.com/ScriptedAlchemy/tracedecay/commit/dc524ef996bb8233020467f244e4f515afe12a44)) +* **sessions:** back off history passes while retained ingest is Blocked ([#4573](https://github.com/ScriptedAlchemy/tracedecay/issues/4573)) ([96fe61b](https://github.com/ScriptedAlchemy/tracedecay/commit/96fe61bd57afb21d3f756b65fd463853cdd330bb)) +* **sessions:** converge host ingest and hook redrive on hard failures ([#4567](https://github.com/ScriptedAlchemy/tracedecay/issues/4567)) ([cbaedba](https://github.com/ScriptedAlchemy/tracedecay/commit/cbaedbad31fd2d0061d2338a6a84bec883877adf)) +* **sessions:** keep Pi warning summaries across interrupted scans ([8edc48f](https://github.com/ScriptedAlchemy/tracedecay/commit/8edc48f5014d66e12585d44dade3f28d6ba6d6a5)) +* **sessions:** measure catch-up backlog from source cursors ([#4497](https://github.com/ScriptedAlchemy/tracedecay/issues/4497)) ([f5078ee](https://github.com/ScriptedAlchemy/tracedecay/commit/f5078ee2c32111e3cc900921db02da8ddd40cd0b)) +* **sessions:** mount detached checkouts' session retrieval ([#4496](https://github.com/ScriptedAlchemy/tracedecay/issues/4496)) ([10b5d95](https://github.com/ScriptedAlchemy/tracedecay/commit/10b5d958c87b4b15f8074767da559f544bbb3d8e)) +* **sessions:** resolve Codex scope once, off the polling worker ([#4500](https://github.com/ScriptedAlchemy/tracedecay/issues/4500)) ([4ff7319](https://github.com/ScriptedAlchemy/tracedecay/commit/4ff7319eee248f77cc3f7e44716e7d91a724e202)) +* **sessions:** suppress unchanged Pi discovery summaries ([55b27f9](https://github.com/ScriptedAlchemy/tracedecay/commit/55b27f973e7aec40b4f75aef2f66656e12af7417)) +* **sessions:** suppress unchanged Pi discovery summaries ([f7db15e](https://github.com/ScriptedAlchemy/tracedecay/commit/f7db15e98e5fa47c31f1da36f450bf2fe5f7150d)) +* **source-edit:** insert moved imports at Rust syntax boundaries ([#4516](https://github.com/ScriptedAlchemy/tracedecay/issues/4516)) ([df4ae5c](https://github.com/ScriptedAlchemy/tracedecay/commit/df4ae5c3392802d88d27c0fda92df87130f7db76)) +* **source-edit:** preserve concurrently created destinations ([#4504](https://github.com/ScriptedAlchemy/tracedecay/issues/4504)) ([5d1defa](https://github.com/ScriptedAlchemy/tracedecay/commit/5d1defae526c31db0a737e92b0c81760773bc366)), closes [#4415](https://github.com/ScriptedAlchemy/tracedecay/issues/4415) +* **source-edit:** preserve reexports when moving symbols ([#4493](https://github.com/ScriptedAlchemy/tracedecay/issues/4493)) ([0c9337f](https://github.com/ScriptedAlchemy/tracedecay/commit/0c9337f494f5c9ddabae100df9375e9804b15a2b)) +* **stack:** return shared preflight results directly ([393edb9](https://github.com/ScriptedAlchemy/tracedecay/commit/393edb94d23c19becee38f8849f01ede932759af)) +* **stack:** return shared preflight results directly ([5917017](https://github.com/ScriptedAlchemy/tracedecay/commit/5917017eccd92e05cc104b4d1fc371b05607eec9)) +* **status:** report resident memory no retained owner holds ([#4503](https://github.com/ScriptedAlchemy/tracedecay/issues/4503)) ([c75a45d](https://github.com/ScriptedAlchemy/tracedecay/commit/c75a45d73e0c9d1931e008cd0f2fed3184ba18b0)) +* **status:** report why no GitHub source was observed ([#4492](https://github.com/ScriptedAlchemy/tracedecay/issues/4492)) ([9819426](https://github.com/ScriptedAlchemy/tracedecay/commit/981942674d91d158dde18d01702a8c68cf704c4a)) +* **test:** complete daemon and HTTP fixture teardown ([58949d0](https://github.com/ScriptedAlchemy/tracedecay/commit/58949d0e94e0cb373b45358fa08cb89c732249ef)) +* **test:** drain queued connections before HTTP observation stops ([29f8e25](https://github.com/ScriptedAlchemy/tracedecay/commit/29f8e251f44b8d519070187aec00997d0c6fc3c6)) +* **test:** drain queued connections before HTTP observation stops ([790eeba](https://github.com/ScriptedAlchemy/tracedecay/commit/790eeba2bc4240f4f825172618a768a87f7082ad)) +* **workflow:** remove stale artifact storage size cap ([7ba08c9](https://github.com/ScriptedAlchemy/tracedecay/commit/7ba08c95ccddfc1aae75771d8b85a59f386f2e47)) + + +### Performance Improvements + +* **code-graph:** reread only re-sealed segments when proving a seal ([#4523](https://github.com/ScriptedAlchemy/tracedecay/issues/4523)) ([a201387](https://github.com/ScriptedAlchemy/tracedecay/commit/a201387aab7d14c9c897913f5c4dd77afa202b05)) +* **code-index:** compare an edit's same-named symbols as a set ([6451ced](https://github.com/ScriptedAlchemy/tracedecay/commit/6451ced555a4166d3586db50f81159e7c1c39d06)) +* **code-index:** compare an edit's same-named symbols as a set ([8154ec7](https://github.com/ScriptedAlchemy/tracedecay/commit/8154ec7201c48f8cb86b6f4dff7222a19de2cb58)), closes [#4520](https://github.com/ScriptedAlchemy/tracedecay/issues/4520) + + +### Reverts + +* **privacy:** restore entropy redaction for compound identifiers ([#4512](https://github.com/ScriptedAlchemy/tracedecay/issues/4512)) ([b0c2a1d](https://github.com/ScriptedAlchemy/tracedecay/commit/b0c2a1d0040b32d821b49c9ce44dec541fed030b)) + ## [1.0.0-beta.92](https://github.com/ScriptedAlchemy/tracedecay/compare/v1.0.0-beta.91...v1.0.0-beta.92) (2026-10-23) diff --git a/Cargo.lock b/Cargo.lock index eb823a0d0f..0a6543e0ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6792,6 +6792,7 @@ dependencies = [ "thiserror", "tracedecay-domain", "tracedecay-private-fs", + "tracedecay-runtime-core", "tracedecay-rusqlite-runtime", "tracedecay-store", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 2638e7ff20..23acebc1f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ resolver = "3" # inheritance table is the sanctioned single source of truth. [workspace.package] edition = "2024" -version = "1.0.0-beta.92" +version = "1.0.0-beta.93" [workspace.dependencies] # nightly-outcome-try is an asupersync default (Outcome's Try impls). It diff --git a/MODULE.bazel b/MODULE.bazel index e30399e489..e5c603e06c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,7 +4,7 @@ bazel_dep(name = "platforms", version = "1.1.0") bazel_dep(name = "bazel_skylib", version = "1.9.2") bazel_dep(name = "bazel_lib", version = "3.7.2") bazel_dep(name = "rules_python", version = "2.4.5") -bazel_dep(name = "rules_rust", version = "0.74.0") +bazel_dep(name = "rules_rust", version = "0.75.0") # Rustc adds every dependency search directory to PATH on Windows; large # graphs exceed its environment limit (rust-lang/rust#110889). Native # shared symlinks preserve artifact identities with one search directory. diff --git a/crates/tracedecay-application/src/advisory/fixtures/mod.rs b/crates/tracedecay-application/src/advisory/fixtures/mod.rs index 419793c837..c8a158fbc9 100644 --- a/crates/tracedecay-application/src/advisory/fixtures/mod.rs +++ b/crates/tracedecay-application/src/advisory/fixtures/mod.rs @@ -18,7 +18,7 @@ use tracedecay_domain::feedback::{ GitHubReviewAuthorClassV1, GitHubReviewCommentIdV1, GitHubReviewIdV1, GitHubReviewImmutableAnchorV1, GitHubReviewLifecycleV1, GitHubReviewStateV1, GitHubReviewThreadIdV1, ProximityAddressV1, ProximityCoverageV1, ProximityRelationPathV1, - ProximityRiskInputsV1, ProximityWarningClassV1, + ProximityWarningClassV1, }; use tracedecay_domain::{ CanonicalObservationEnvelopeV1, CommitId, ManifestDigest, RetrievalAnchorId, SessionId, @@ -136,9 +136,7 @@ pub struct AdvisoryProximityFixtureEvidenceV1 { pub encounter: FeedbackProximityEncounterV1, pub address: ProximityAddressV1, pub relation_paths: Vec, - pub risk_inputs: ProximityRiskInputsV1, pub warning_class: ProximityWarningClassV1, - pub raw_risk_basis_points: u16, pub observed_at: UtcMicros, pub expires_at: UtcMicros, pub coverage: ProximityCoverageV1, @@ -177,9 +175,7 @@ impl AdvisorySourceBackedCompositeFixtureV1 { encounter: evidence.encounter, address: evidence.address, relation_paths: evidence.relation_paths, - risk_inputs: evidence.risk_inputs, warning_class: evidence.warning_class, - raw_risk_basis_points: evidence.raw_risk_basis_points, observed_at: evidence.observed_at, expires_at: evidence.expires_at, coverage: evidence.coverage, diff --git a/crates/tracedecay-application/src/advisory/proximity_runtime.rs b/crates/tracedecay-application/src/advisory/proximity_runtime.rs index 4dcd7e5f7f..f7b0f69902 100644 --- a/crates/tracedecay-application/src/advisory/proximity_runtime.rs +++ b/crates/tracedecay-application/src/advisory/proximity_runtime.rs @@ -21,8 +21,8 @@ use tracedecay_domain::configuration::{ConfigurationRevisionId, ConfigurationVal use tracedecay_domain::feedback::{ FeedbackScopeV1, PROXIMITY_RISK_THRESHOLD_SETTING_KEY_V1, ProviderEvaluationStateV1, ProximityAddressV1, ProximityContributionIdV1, ProximityContributionV1, ProximityCoverageV1, - ProximityInclusionV1, ProximityObservationIdV1, ProximityRelationPathV1, ProximityRiskInputsV1, - ProximityTierV1, ProximityWarningClassV1, + ProximityInclusionV1, ProximityObservationIdV1, ProximityRelationPathV1, + ProximityWarningClassV1, }; use tracedecay_domain::{ CanonicalObservationEnvelopeV1, CodeGenerationId, ManifestDigest, RetrievalAnchorId, UtcMicros, @@ -45,8 +45,9 @@ pub use authority::{ const PROXIMITY_CONTRIBUTION_ID_DOMAIN_V1: &str = "tracedecay.advisory.proximity.contribution-id.v1"; -const PROXIMITY_CONFIGURATION_REVISION_DOMAIN_V1: &str = - "tracedecay.advisory.proximity.configuration-revision.v1"; + +/// Preserves the published numeric setting's relationship-hint admission. +const RELATIONSHIP_HINT_MAX_THRESHOLD_BASIS_POINTS_V1: u16 = 7_500; /// Exact Plan 20 threshold input for one evaluation. Revision and effective /// behavior digest are pinned together before provider evidence is read. @@ -93,13 +94,16 @@ impl ProximityThresholdPinV1 { && self.configuration_digest.validate().is_ok() && self.value_basis_points <= 10_000 } + + const fn admits_relationship_hints(&self) -> bool { + self.value_basis_points <= RELATIONSHIP_HINT_MAX_THRESHOLD_BASIS_POINTS_V1 + } } /// Authorized graph/query result tied to canonical session observations. /// -/// Full envelopes are transient provider input. Plan 09 receives only opaque -/// observation IDs, anchors, privacy-safe code shape, relation paths, risk -/// inputs, freshness, coverage, and inclusion state. +/// Full envelopes are transient provider input. Publication receives opaque +/// observation IDs, anchors, code addresses, relation paths, and coverage. #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub struct CanonicalProximityEvidenceV1 { @@ -108,9 +112,7 @@ pub struct CanonicalProximityEvidenceV1 { pub encounter: FeedbackProximityEncounterV1, pub address: ProximityAddressV1, pub relation_paths: Vec, - pub risk_inputs: ProximityRiskInputsV1, pub warning_class: ProximityWarningClassV1, - pub raw_risk_basis_points: u16, pub observed_at: UtcMicros, pub expires_at: UtcMicros, pub coverage: ProximityCoverageV1, @@ -126,8 +128,6 @@ impl CanonicalProximityEvidenceV1 { || self.encounter.expires_at != self.expires_at || self.address.validate().is_err() || self.address.scope != request.scope - || self.risk_inputs.validate().is_err() - || self.raw_risk_basis_points > 10_000 || self.observed_at.0 >= self.expires_at.0 || !matches!( self.coverage, @@ -544,23 +544,12 @@ fn build_proximity_contribution( .map(|observation| ProximityObservationIdV1::new(observation.stable_record_id().as_str())) .collect::, _>>() .ok()?; - let tier = if matches!( - evidence.warning_class, - ProximityWarningClassV1::SameFile - | ProximityWarningClassV1::OverlappingRange - | ProximityWarningClassV1::SameSymbol - ) { - ProximityTierV1::Immediate - } else { - ProximityTierV1::Configured - }; + let exact = evidence.warning_class.is_exact_overlap(); let inclusion = if evidence.expires_at.0 <= request.observed_at.0 || evidence.coverage == ProximityCoverageV1::Stale { ProximityInclusionV1::Stale - } else if tier == ProximityTierV1::Immediate - || evidence.raw_risk_basis_points >= threshold.value_basis_points - { + } else if exact || threshold.admits_relationship_hints() { ProximityInclusionV1::Included } else { ProximityInclusionV1::BelowThreshold @@ -580,26 +569,14 @@ fn build_proximity_contribution( evidence.warning_class, evidence.observed_at, evidence.expires_at, - tier, - (tier == ProximityTierV1::Configured).then_some(( + if exact { "immediate" } else { "configured" }, + (!exact).then_some(( &threshold.configuration_revision, &threshold.configuration_digest, )), )) .ok()?; let suffix = sha256_hex_suffix(identity.as_str()).unwrap_or(identity.as_str()); - let threshold_revision = if tier == ProximityTierV1::Configured { - Some( - canonical_sha256(&( - PROXIMITY_CONFIGURATION_REVISION_DOMAIN_V1, - &threshold.configuration_revision, - &threshold.configuration_digest, - )) - .ok()?, - ) - } else { - None - }; let contribution = ProximityContributionV1 { contribution_id: ProximityContributionIdV1::new(format!("contribution.proximity.{suffix}")) .ok()?, @@ -608,13 +585,6 @@ fn build_proximity_contribution( retrieval_anchor_ids: evidence.retrieval_anchor_ids, address: Some(evidence.address), relation_paths: evidence.relation_paths, - risk_inputs: Some(evidence.risk_inputs), - tier, - threshold_value_basis_points: (tier == ProximityTierV1::Configured) - .then_some(threshold.value_basis_points), - // One digest binds both canonical revision and effective behavior. - threshold_revision, - raw_risk_basis_points: Some(evidence.raw_risk_basis_points), observed_at: evidence.observed_at, expires_at: evidence.expires_at, coverage, @@ -642,12 +612,23 @@ mod tests { use std::sync::Mutex; use std::sync::atomic::{AtomicUsize, Ordering}; + use tracedecay_contracts::feedback::{ + FeedbackProximityAccessKindV1, FeedbackProximityIntervalV1, FeedbackProximityParticipantV1, + FeedbackProximityRelationV1, + }; use tracedecay_contracts::{ CancellationContext, CapabilityGrantId, CapabilityGrantSnapshot, Deadline, DisclosureClass, RequestId, ResolvedScope, }; use tracedecay_domain::configuration::{ConfigurationLayerIdV1, ConfigurationValueV1}; + use tracedecay_domain::feedback::ProximityRelationPathKindV1; use tracedecay_domain::{ActorId, CommitId, ProjectId, RefId, RepositoryId, WorktreeId}; + use tracedecay_domain::{ + AgentInstanceId, CanonicalMessageRoleV1, CanonicalObservationEvidenceV1, + CanonicalObservationFactV1, CanonicalObservationRelationsV1, FileOccurrenceId, + ObservationId, ObservationOrderingDomainV1, ObservationSourceIdentityV1, + ObservationSourceRangeV1, ProviderId, SessionId, SourceSpan, + }; use tracedecay_tool_catalog::{CapabilityId, UseCaseId}; use super::*; @@ -835,6 +816,176 @@ mod tests { ); } + #[test] + fn relationship_hints_follow_the_legacy_threshold_mapping() { + let revision = ConfigurationRevisionId::new("configuration.proximity-policy").unwrap(); + let digest = ManifestDigest::new(format!("sha256:{}", "a".repeat(64))).unwrap(); + for value in 0..=10_000_u16 { + let pin = + ProximityThresholdPinV1::new(revision.clone(), digest.clone(), value).expect("pin"); + let legacy_hint_score = 7_500_u16; + assert_eq!( + pin.admits_relationship_hints(), + legacy_hint_score >= value, + "threshold {value}" + ); + } + } + + fn encounter_evidence(scope: &FeedbackScopeV1) -> CanonicalProximityEvidenceV1 { + let provider = ProviderId::new("provider.cursor").unwrap(); + let address = ProximityAddressV1 { + scope: scope.clone(), + file: FileOccurrenceId::new("file.proximity").unwrap(), + span: Some(SourceSpan { + start_byte: 0, + end_byte: 5, + }), + symbol: None, + }; + let observations = (1..=2) + .map(|ordinal| { + CanonicalObservationEnvelopeV1::new( + provider.clone(), + "message", + ObservationId::new(format!("observation.proximity.{ordinal}")).unwrap(), + CanonicalObservationRelationsV1::new( + SessionId::new(format!("session.proximity.{ordinal}")).unwrap(), + ) + .with_agent_id( + ObservationId::new(format!("agent.proximity.{ordinal}")).unwrap(), + ), + vec![CanonicalObservationFactV1::Message { + role: CanonicalMessageRoleV1::Assistant, + content: serde_json::json!({ "text": "Editing shared code." }), + model: None, + timestamp: None, + }], + CanonicalObservationEvidenceV1::new( + ObservationOrderingDomainV1::SqliteRowId, + ObservationSourceRangeV1::new(ordinal, ordinal + 1).unwrap(), + ), + ) + .unwrap() + }) + .collect::>(); + let participants = observations + .iter() + .map(|observation| FeedbackProximityParticipantV1 { + source: ObservationSourceIdentityV1::for_provider( + provider.clone(), + observation.relations().session_id().clone(), + ) + .unwrap(), + agent_id: AgentInstanceId::new( + observation.relations().agent_id().unwrap().as_str(), + ) + .unwrap(), + worktree_id: Some(scope.worktree_id.clone()), + worktree_root: "/workspace".to_owned(), + branch_ref: Some(RefId::new(scope.branch_ref.clone()).unwrap()), + head_revision: Some(scope.head_commit_id.clone()), + access: FeedbackProximityAccessKindV1::Write, + activity: FeedbackProximityIntervalV1 { + start: UtcMicros(1), + end: UtcMicros(3), + }, + address: address.clone(), + }) + .collect(); + CanonicalProximityEvidenceV1 { + observations, + retrieval_anchor_ids: vec![RetrievalAnchorId::new("anchor.proximity").unwrap()], + encounter: FeedbackProximityEncounterV1 { + encounter_id: ManifestDigest::new(format!("sha256:{}", "b".repeat(64))).unwrap(), + scope: scope.clone(), + interval: FeedbackProximityIntervalV1 { + start: UtcMicros(1), + end: UtcMicros(3), + }, + participants, + relation: FeedbackProximityRelationV1::OverlappingEdit { + warning_class: ProximityWarningClassV1::SameFile, + }, + observed_at: UtcMicros(1), + expires_at: UtcMicros(4), + coverage: ProximityCoverageV1::Complete, + }, + address, + relation_paths: Vec::new(), + warning_class: ProximityWarningClassV1::SameFile, + observed_at: UtcMicros(1), + expires_at: UtcMicros(4), + coverage: ProximityCoverageV1::Complete, + } + } + + #[test] + fn encounter_policy_preserves_exact_identity_and_hint_admission() { + let (scope, _) = scope_and_context(); + let request = ProximityEvaluationRequestV1 { + scope: scope.clone(), + observed_at: UtcMicros(2), + }; + let evidence = encounter_evidence(&scope); + let revision = ConfigurationRevisionId::new("configuration.proximity-policy").unwrap(); + let digest = ManifestDigest::new(format!("sha256:{}", "a".repeat(64))).unwrap(); + let mut hint = evidence.clone(); + hint.warning_class = ProximityWarningClassV1::SharedDependency; + hint.relation_paths.push(ProximityRelationPathV1 { + kind: ProximityRelationPathKindV1::TransitiveDependency, + retrieval_anchor_id: Some(hint.retrieval_anchor_ids[0].clone()), + }); + let mut exact_identity = None; + for value in [0, 7_500, 7_501, 10_000] { + let pin = + ProximityThresholdPinV1::new(revision.clone(), digest.clone(), value).unwrap(); + let exact = build_proximity_contribution(&request, &pin, evidence.clone()).unwrap(); + assert_eq!(exact.inclusion, ProximityInclusionV1::Included); + assert_eq!(exact.address.as_ref(), Some(&evidence.address)); + if let Some(identity) = &exact_identity { + assert_eq!(&exact.contribution_id, identity); + } + exact_identity = Some(exact.contribution_id); + let related = build_proximity_contribution(&request, &pin, hint.clone()).unwrap(); + assert_eq!( + related.inclusion, + if value <= 7_500 { + ProximityInclusionV1::Included + } else { + ProximityInclusionV1::BelowThreshold + } + ); + let findings = related + .advisory_findings(AdvisoryFindingValidityWindowV1 { + valid_at: UtcMicros(2), + expires_at: UtcMicros(3), + }) + .unwrap() + .findings; + if value <= 7_500 { + assert_eq!(findings.len(), 1); + assert_eq!( + findings[0] + .diagnostic_projection + .as_ref() + .map(|projection| projection.safe_bounded_message.as_str()), + Some("Concurrent agent activity is related to this code"), + ); + } else { + assert!(findings.is_empty()); + } + } + let pin = ProximityThresholdPinV1::new(revision, digest, 0).unwrap(); + let stale_request = ProximityEvaluationRequestV1 { + observed_at: UtcMicros(4), + ..request + }; + let stale = build_proximity_contribution(&stale_request, &pin, evidence).unwrap(); + assert_eq!(stale.inclusion, ProximityInclusionV1::Stale); + assert_eq!(stale.coverage, ProximityCoverageV1::Stale); + } + #[tokio::test] async fn expired_evidence_returns_typed_stale_result() { let (scope, context) = scope_and_context(); diff --git a/crates/tracedecay-application/src/advisory/proximity_runtime/authority.rs b/crates/tracedecay-application/src/advisory/proximity_runtime/authority.rs index 1ac15adab9..a96c577499 100644 --- a/crates/tracedecay-application/src/advisory/proximity_runtime/authority.rs +++ b/crates/tracedecay-application/src/advisory/proximity_runtime/authority.rs @@ -16,16 +16,14 @@ use tracedecay_contracts::feedback::{ ProximityEvaluationRequestV1, }; use tracedecay_domain::feedback::{ - FeedbackScopeV1, ProximityAddressV1, ProximityBranchWorktreeIncompatibilityV1, - ProximityCoverageV1, ProximityRelationPathKindV1, ProximityRelationPathV1, - ProximityRelationStrengthV1, ProximityRiskInputsV1, ProximityWarningClassV1, + FeedbackScopeV1, ProximityAddressV1, ProximityCoverageV1, ProximityRelationPathKindV1, + ProximityRelationPathV1, ProximityWarningClassV1, }; use tracedecay_domain::{ AgentInstanceId, CanonicalObservationEnvelopeV1, CommitId, ContentDigest, FileOccurrenceId, ObservationScopeV1, ObservationSourceIdentityV1, RefId, RelationEdgeKindV1, SourceSpan, SymbolOccurrenceId, UtcMicros, canonical_sha256, }; -use tracedecay_graph_db::GraphCancellation; use tracedecay_store::{ObservationProjectionStore, ObservationReplayRequest, ObservationStore}; use super::{ @@ -64,13 +62,12 @@ struct ProximityCandidate { session_paths: BTreeMap, warning_class: ProximityWarningClassV1, relation_kinds: Vec, - relation_strength: ProximityRelationStrengthV1, } type VerifiedGraphPaths = BTreeMap; struct ProximityAssembly<'a> { - owner: &'a ProductionProximityEvidenceAuthorityV1, + normalized_worktree: &'a str, request: &'a ProximityEvaluationRequestV1, code_index_identity: Option<&'a crate::diagnostics_publication::CodeIndexPublicationIdentityV1>, verified_graph_paths: &'a VerifiedGraphPaths, @@ -78,10 +75,6 @@ struct ProximityAssembly<'a> { graph_nodes: &'a BTreeMap>, session_edit_spans: &'a BTreeMap<(SessionKey, String), Vec>, active: &'a BTreeMap, - reader: &'a CodeGraphInteractiveReader, - cancellation: Arc, - observed_seconds: i64, - since: i64, expires_at: UtcMicros, } @@ -134,44 +127,9 @@ impl ProximityAssembly<'_> { .graph_nodes .get(&candidate.path) .map_or(&[][..], Vec::as_slice); - let blast_radius_size = if path_nodes.is_empty() { + if path_nodes.is_empty() { omissions.insert(FeedbackProximityOmissionV1::MissingCodeAddress); - 1 - } else { - let seeds = path_nodes - .iter() - .map(|node| node.occurrence.clone()) - .collect::>(); - if let Ok(nodes) = self.reader.impact( - &seeds, - &[], - 1, - 100_000, - 100_000, - Arc::clone(&self.cancellation), - ) { - u32::try_from(nodes.impacted.len().max(1)).unwrap_or(u32::MAX) - } else { - omissions.insert(FeedbackProximityOmissionV1::CloneCoveragePartial); - u32::try_from(path_nodes.len()).unwrap_or(u32::MAX) - } - }; - let latest_activity = candidate - .session_keys - .iter() - .filter_map(|key| self.active.get(key)) - .filter_map(|hit| hit.last_ts.or(hit.committed_at).or(hit.first_ts)) - .max() - .unwrap_or(self.since); - let age = self.observed_seconds.saturating_sub(latest_activity).max(0); - let freshness = 10_000_u16.saturating_sub( - u16::try_from( - age.saturating_mul(10_000) - .div_euclid(ACTIVITY_HORIZON_SECONDS_V1) - .min(10_000), - ) - .unwrap_or(10_000), - ); + } let exact_address = self .verified_graph_paths .contains_key(&candidate.path) @@ -246,7 +204,7 @@ impl ProximityAssembly<'_> { .ok()?; let activity = activity_interval(hit)?; let normalized = normalize_worktree(&worktree_root); - let head_revision = if normalized == self.owner.normalized_worktree { + let head_revision = if normalized == self.normalized_worktree { Some(self.request.scope.head_commit_id.clone()) } else { hit.commit_sha @@ -259,7 +217,7 @@ impl ProximityAssembly<'_> { participants.push(FeedbackProximityParticipantV1 { source, agent_id, - worktree_id: (normalized == self.owner.normalized_worktree) + worktree_id: (normalized == self.normalized_worktree) .then(|| self.request.scope.worktree_id.clone()), worktree_root, branch_ref: hit.branch.as_deref().and_then(branch_ref), @@ -344,25 +302,7 @@ impl ProximityAssembly<'_> { retrieval_anchor_id: relation_anchor.clone(), }) .collect(), - risk_inputs: ProximityRiskInputsV1 { - overlap_size: u32::try_from(selected.len()).unwrap_or(u32::MAX), - blast_radius_size, - relation_strength: candidate.relation_strength, - branch_worktree_incompatibility: - ProximityBranchWorktreeIncompatibilityV1::Compatible, - freshness_decay_basis_points: freshness, - }, warning_class, - raw_risk_basis_points: if matches!( - warning_class, - ProximityWarningClassV1::SameFile - | ProximityWarningClassV1::OverlappingRange - | ProximityWarningClassV1::SameSymbol - ) { - 10_000 - } else { - 7_500 - }, observed_at: self.request.observed_at, expires_at: self.expires_at, coverage: ProximityCoverageV1::Complete, @@ -674,7 +614,6 @@ impl ProductionProximityEvidenceAuthorityV1 { ]), warning_class: ProximityWarningClassV1::SameFile, relation_kinds: Vec::new(), - relation_strength: ProximityRelationStrengthV1::Direct, } }) }) @@ -740,7 +679,6 @@ impl ProductionProximityEvidenceAuthorityV1 { ]), warning_class: relation.warning_class, relation_kinds: relation.kinds, - relation_strength: relation.strength, }); } } @@ -760,7 +698,7 @@ impl ProductionProximityEvidenceAuthorityV1 { } candidates.truncate(MAX_PROXIMITY_EVIDENCE_V1); let assembly = ProximityAssembly { - owner: self, + normalized_worktree: &self.normalized_worktree, request, code_index_identity: code_index_identity.as_ref(), verified_graph_paths: &verified_graph_paths, @@ -768,10 +706,6 @@ impl ProductionProximityEvidenceAuthorityV1 { graph_nodes: &graph_nodes, session_edit_spans: &session_edit_spans, active: &active, - reader: &reader, - cancellation: Arc::clone(&cancellation), - observed_seconds, - since, expires_at, }; let mut evidence = Vec::with_capacity(candidates.len()); @@ -904,7 +838,6 @@ fn participant_graph_address( struct GraphRelation { warning_class: ProximityWarningClassV1, kinds: Vec, - strength: ProximityRelationStrengthV1, } fn graph_relation( @@ -926,7 +859,6 @@ fn graph_relation( Some(GraphRelation { warning_class: ProximityWarningClassV1::SameSymbol, kinds: Vec::new(), - strength: ProximityRelationStrengthV1::Direct, }), false, ); @@ -951,7 +883,6 @@ fn graph_relation( Some(GraphRelation { warning_class: ProximityWarningClassV1::Neighborhood, kinds: vec![ProximityRelationPathKindV1::DirectDependency], - strength: ProximityRelationStrengthV1::Direct, }), false, ); @@ -974,7 +905,6 @@ fn graph_relation( Some(GraphRelation { warning_class: ProximityWarningClassV1::Neighborhood, kinds: vec![ProximityRelationPathKindV1::DirectCaller], - strength: ProximityRelationStrengthV1::Direct, }), false, ); @@ -996,7 +926,6 @@ fn graph_relation( Some(GraphRelation { warning_class: ProximityWarningClassV1::SharedCaller, kinds: vec![ProximityRelationPathKindV1::TransitiveCaller], - strength: ProximityRelationStrengthV1::Transitive, }), false, ); @@ -1006,7 +935,6 @@ fn graph_relation( Some(GraphRelation { warning_class: ProximityWarningClassV1::SharedDependency, kinds: vec![ProximityRelationPathKindV1::TransitiveDependency], - strength: ProximityRelationStrengthV1::Transitive, }), false, ); @@ -1016,7 +944,6 @@ fn graph_relation( Some(GraphRelation { warning_class: ProximityWarningClassV1::SharedTest, kinds: vec![ProximityRelationPathKindV1::AffectedTest], - strength: ProximityRelationStrengthV1::Transitive, }), false, ); @@ -1172,7 +1099,6 @@ const fn proximity_warning_rank(warning: ProximityWarningClassV1) -> u8 { ProximityWarningClassV1::SamePackage => 6, ProximityWarningClassV1::SameCrate => 7, ProximityWarningClassV1::Neighborhood => 8, - ProximityWarningClassV1::IncompatibleBranchWorktree => 9, } } diff --git a/crates/tracedecay-application/src/lsp_runtime/feedback_source.rs b/crates/tracedecay-application/src/lsp_runtime/feedback_source.rs index fd2c02c5c0..cc9d1a751c 100644 --- a/crates/tracedecay-application/src/lsp_runtime/feedback_source.rs +++ b/crates/tracedecay-application/src/lsp_runtime/feedback_source.rs @@ -14,7 +14,7 @@ use tracedecay_domain::feedback::{ FeedbackContentIdentityV1, FeedbackDiagnosticProducerV1, FeedbackFindingLifecycleV1, FeedbackFindingV1, }; -use tracedecay_domain::{ContentDigest, UtcMicros}; +use tracedecay_domain::{ContentDigest, ManifestDigest, UtcMicros}; use tracedecay_lsp::{ AdmittedRoot, CanonicalContextProjectionAuthority, CanonicalDiagnosticRefreshRequest, ContextCoverage, ContextExpansionEnvelope, ContextExpansionOutcome, ContextExpansionRequest, @@ -505,6 +505,21 @@ impl FeedbackCycleRuntimePort for ConcreteFeedbackLspSource { } impl ManagedDiagnosticSnapshotPort for ConcreteFeedbackLspSource { + fn current_authority( + &self, + request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + let source = self.clone(); + Box::pin(async move { + let scope = source + .scope + .resolve(request.root.clone(), Some(request.document_uri.clone())) + .await?; + crate::lsp_support::validate_managed_diagnostic_scope(&request, &scope)?; + crate::lsp_support::managed_diagnostic_authority_digest(&scope) + }) + } + fn snapshot( &self, request: CanonicalDiagnosticRefreshRequest, diff --git a/crates/tracedecay-application/src/lsp_support/factory.rs b/crates/tracedecay-application/src/lsp_support/factory.rs index b352e5c66c..fefed52f49 100644 --- a/crates/tracedecay-application/src/lsp_support/factory.rs +++ b/crates/tracedecay-application/src/lsp_support/factory.rs @@ -13,8 +13,9 @@ use tracedecay_lsp::{ ContextProjectionChange, ContextProjectionOutcome, ContextProjectionPort, ContextProjectionRegistration, ContextProjectionRequest, DaemonLspProviderBundle, DaemonLspRuntimeSession, DiagnosticRefreshAdmission, DiagnosticSnapshotAdapter, - DiagnosticSnapshotOutcome, DiagnosticSnapshotPort, FeedbackCycleAdapter, FeedbackCyclePort, - FeedbackCycleRequest, FeedbackCycleResponse, FeedbackCycleRuntimePort, GatewayCapabilities, + DiagnosticSnapshotOutcome, DiagnosticSnapshotPort, DiagnosticSnapshotValidation, + FeedbackCycleAdapter, FeedbackCyclePort, FeedbackCycleRequest, FeedbackCycleResponse, + FeedbackCycleRuntimePort, GatewayCapabilities, GenerationDiagnostics, LspAnalyzerCancellationAuthority, LspRequestId, LspRuntimeFailure, LspRuntimeFuture, LspSemanticDocumentSnapshot, NativeIntegrationStatusPort, OverlaySnapshot, SemanticProviderOutcome, SemanticProviderPort, SemanticRequest, SemanticResponse, @@ -486,6 +487,32 @@ impl DiagnosticSnapshotPort for FederatedDiagnostics { ) } + fn validate_document_snapshot( + &self, + root: &AdmittedRoot, + document_uri: &str, + overlay: Option<&OverlaySnapshot>, + snapshot: &GenerationDiagnostics, + ) -> DiagnosticSnapshotValidation { + self.roots.get(root.uri()).map_or( + DiagnosticSnapshotValidation::Failed { + failure_class: "root-not-authorized".to_owned(), + }, + |port| port.validate_document_snapshot(root, document_uri, overlay, snapshot), + ) + } + + fn retire_document_refresh( + &self, + root: &AdmittedRoot, + document_uri: &str, + operation_id: &str, + ) -> bool { + self.roots + .get(root.uri()) + .is_some_and(|port| port.retire_document_refresh(root, document_uri, operation_id)) + } + fn supports_workspace_diagnostics(&self) -> bool { !self.roots.is_empty() && self diff --git a/crates/tracedecay-application/src/lsp_support/runtime_adapters.rs b/crates/tracedecay-application/src/lsp_support/runtime_adapters.rs index e74b9bad1c..812b216dc9 100644 --- a/crates/tracedecay-application/src/lsp_support/runtime_adapters.rs +++ b/crates/tracedecay-application/src/lsp_support/runtime_adapters.rs @@ -4,11 +4,14 @@ use std::sync::Arc; use std::time::Duration; use tokio::sync::Mutex as AsyncMutex; +use tracedecay_domain::ManifestDigest; +#[cfg(test)] +use tracedecay_lsp::analyzer::broker::DiagnosticsSnapshot; use tracedecay_lsp::analyzer::broker::{ - CodeDiagnostic, DiagnosticBroker, DiagnosticSeverity as BrokerDiagnosticSeverity, - RefreshCommitOutcome, + BrokerDocumentEvidence, CodeDiagnostic, DiagnosticBroker, + DiagnosticSeverity as BrokerDiagnosticSeverity, RefreshCommitOutcome, }; -use tracedecay_lsp::analyzer::client::{DiagnosticDocumentCoverage, LspDocument}; +use tracedecay_lsp::analyzer::client::LspDocument; use tracedecay_lsp::{ AdmittedRoot, CanonicalDiagnosticRefreshRequest, CanonicalDiagnosticSnapshotAuthority, CanonicalWorkspaceDiagnosticRefreshRequest, DiagnosticSource, GatewayDiagnostic, @@ -166,6 +169,30 @@ where }) } + fn current_authority( + &self, + mut request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + let broker = Arc::clone(&self.broker); + let documents = Arc::clone(&self.documents); + let managed = Arc::clone(&self.managed); + Box::pin(async move { + let document = documents.load_document(request.clone()).await?; + request.expected_content_digest = Some(tracedecay_domain::ContentDigest::of_bytes( + document.text.as_bytes(), + )); + let document_uri = request.document_uri.clone(); + let managed = managed.current_authority(request).await?; + let evidence = broker + .lock() + .await + .document_diagnostic_evidence(&document) + .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-authority-unavailable"))?; + let (upstream, _) = project_upstream_evidence(evidence, document_uri.as_str())?; + merged_diagnostic_authority_digest(&upstream, &managed) + }) + } + fn supports_workspace_diagnostics(&self) -> bool { self.documents.is_mounted() } @@ -283,26 +310,33 @@ where document.text.as_bytes(), )); let language = document.language.clone(); - let relative_path = document.relative_path.clone(); - let (prepared, immediate_snapshot) = { + let (prepared, immediate_evidence) = { let mut broker = broker.lock().await; let prepared = broker - .prepare_refresh(&language, vec![document]) + .prepare_refresh(&language, vec![document.clone()]) .await .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-preparation-failed"))?; - let immediate_snapshot = prepared.is_none().then(|| broker.snapshot()); - (prepared, immediate_snapshot) + let immediate_evidence = if prepared.is_none() { + Some( + broker + .document_diagnostic_evidence(&document) + .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-coverage-incomplete"))?, + ) + } else { + None + }; + (prepared, immediate_evidence) }; - let requires_publication = prepared.is_some(); - let snapshot = if let Some(prepared) = prepared { + let evidence = if let Some(prepared) = prepared { let completed = prepared.collect_diagnostics(diagnostics_quiet_window).await; + let mut broker = broker.lock().await; match broker - .lock() - .await .finish_refresh_snapshot(completed) .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-refresh-failed"))? { - RefreshCommitOutcome::Applied(snapshot) => *snapshot, + RefreshCommitOutcome::Applied(_) => broker + .document_diagnostic_evidence(&document) + .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-coverage-incomplete"))?, RefreshCommitOutcome::Superseded => { return Err(LspRuntimeFailure::new( "diagnostic-broker-refresh-superseded", @@ -310,37 +344,11 @@ where } } } else { - immediate_snapshot + immediate_evidence .ok_or_else(|| LspRuntimeFailure::new("diagnostic-broker-snapshot-unavailable"))? }; - let document_coverage = snapshot - .coverage - .get(&language) - .and_then(|coverage| coverage.documents.get(&relative_path)); - if requires_publication - && !matches!( - document_coverage, - Some(DiagnosticDocumentCoverage::Published { content_digest, .. }) - if Some(content_digest) == request.expected_content_digest.as_ref() - ) - { - return Err(LspRuntimeFailure::new( - "diagnostic-broker-coverage-incomplete", - )); - } - let upstream_authority_digest = tracedecay_domain::canonical_sha256(&( - "tracedecay.lsp.upstream-diagnostic-authority.v1", - &snapshot.settings, - &snapshot.settings_unavailable, - document_coverage, - )) - .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-authority-identity-unavailable"))?; - let upstream = snapshot - .diagnostics - .into_iter() - .filter(|diagnostic| diagnostic.language == language && diagnostic.file == relative_path) - .map(|diagnostic| broker_diagnostic(request.document_uri.as_str(), diagnostic)) - .collect(); + let (upstream_authority_digest, upstream) = + project_upstream_evidence(evidence, request.document_uri.as_str())?; let expected_code_generation_id = request.expected_code_generation_id.clone(); let expected_snapshot_digest = request.expected_snapshot_digest.clone(); let managed = managed.snapshot(request).await?; @@ -355,12 +363,8 @@ where "managed-diagnostic-generation-stale", )); } - let authority_digest = tracedecay_domain::canonical_sha256(&( - "tracedecay.lsp.merged-diagnostic-authority.v1", - upstream_authority_digest, - &managed.authority_digest, - )) - .map_err(|_| LspRuntimeFailure::new("diagnostic-authority-identity-unavailable"))?; + let authority_digest = + merged_diagnostic_authority_digest(&upstream_authority_digest, &managed.authority_digest)?; Ok(GenerationDiagnostics { generation: managed.generation, authority_digest, @@ -369,6 +373,66 @@ where }) } +fn project_upstream_evidence( + evidence: BrokerDocumentEvidence, + document_uri: &str, +) -> Result<(ManifestDigest, Vec), LspRuntimeFailure> { + let (settings, settings_unavailable, coverage, nonparticipation, diagnostics) = match evidence { + BrokerDocumentEvidence::Published { + settings, + settings_unavailable, + coverage, + diagnostics, + } => ( + settings, + settings_unavailable, + Some(coverage), + None, + diagnostics, + ), + BrokerDocumentEvidence::NotParticipating { + settings, + settings_unavailable, + reason, + } => ( + settings, + settings_unavailable, + None, + Some(reason), + Vec::new(), + ), + }; + let (upstream, identity) = tracedecay_lsp::project_upstream_diagnostics( + diagnostics + .into_iter() + .map(|diagnostic| broker_diagnostic(document_uri, diagnostic)) + .collect(), + ) + .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-authority-identity-unavailable"))?; + let digest = tracedecay_domain::canonical_sha256(&( + "tracedecay.lsp.upstream-diagnostic-authority.v1", + settings, + settings_unavailable, + coverage, + nonparticipation, + identity, + )) + .map_err(|_| LspRuntimeFailure::new("diagnostic-broker-authority-identity-unavailable"))?; + Ok((digest, upstream)) +} + +fn merged_diagnostic_authority_digest( + upstream: &ManifestDigest, + managed: &ManifestDigest, +) -> Result { + tracedecay_domain::canonical_sha256(&( + "tracedecay.lsp.merged-diagnostic-authority.v1", + upstream, + managed, + )) + .map_err(|_| LspRuntimeFailure::new("diagnostic-authority-identity-unavailable")) +} + fn broker_diagnostic(document_uri: &str, diagnostic: CodeDiagnostic) -> GatewayDiagnostic { let start_line = diagnostic.line_start.saturating_sub(1); let end_line = diagnostic @@ -412,13 +476,22 @@ fn broker_diagnostic(document_uri: &str, diagnostic: CodeDiagnostic) -> GatewayD #[cfg(test)] mod tests { + use std::collections::{BTreeMap, VecDeque}; + use std::path::Path; + use std::sync::Mutex; use std::sync::atomic::{AtomicUsize, Ordering}; + use serde_json::{Value, json}; use tracedecay_domain::{CodeGenerationId, ContentDigest}; + use tracedecay_lsp::analyzer::adapters::{DiagnosticMode, LspAdapterDefinition}; use tracedecay_lsp::{ - AuthorizedLspWorkspace, CanonicalWorkspaceDiagnosticRefreshRequest, - IndexedWorkspaceDocument, ManagedDiagnosticSnapshot, + AuthorizedLspWorkspace, CanonicalWorkspaceDiagnosticRefreshRequest, ClientCapabilities, + DaemonLspProtocolSession, DiagnosticSnapshotAdapter, FeedbackCyclePort, + FeedbackCycleRequest, FeedbackCycleResponse, GatewayCapabilities, IndexedWorkspaceDocument, + ManagedDiagnosticSnapshot, UnavailableSemanticProvider, UpstreamCapabilities, + negotiate_capabilities, }; + use url::Url; use super::*; @@ -427,6 +500,26 @@ mod tests { struct PublishingWorkspaceIndex { reads: AtomicUsize, drift: WorkspaceIndexDrift, + documents: BTreeMap, + } + + impl PublishingWorkspaceIndex { + fn new(drift: WorkspaceIndexDrift) -> Self { + Self { + reads: AtomicUsize::new(0), + drift, + documents: BTreeMap::from([( + "file:///workspace/src/lib.rs".to_owned(), + LspDocument { + language: "unknown".to_owned(), + language_id: "unknown".to_owned(), + relative_path: "src/lib.rs".to_owned(), + text: "fn main() {}".to_owned(), + snapshot: None, + }, + )]), + } + } } #[derive(Clone, Copy)] @@ -438,16 +531,11 @@ mod tests { impl LspDiagnosticDocumentPort for PublishingWorkspaceIndex { fn load_document( &self, - _request: CanonicalDiagnosticRefreshRequest, + request: CanonicalDiagnosticRefreshRequest, ) -> LspRuntimeFuture> { - Box::pin(async { - Ok(LspDocument { - language: "unknown".to_owned(), - language_id: "unknown".to_owned(), - relative_path: "src/lib.rs".to_owned(), - text: "fn main() {}".to_owned(), - snapshot: None, - }) + let document = self.documents.get(&request.document_uri).cloned(); + Box::pin(async move { + document.ok_or_else(|| LspRuntimeFailure::new("fixture-document-not-found")) }) } } @@ -484,13 +572,24 @@ mod tests { } } - struct FixedManagedDiagnostics; + #[derive(Default)] + struct FixedManagedDiagnostics { + snapshots: AtomicUsize, + } impl ManagedDiagnosticSnapshotPort for FixedManagedDiagnostics { + fn current_authority( + &self, + _request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + Box::pin(async { Ok(digest('c')) }) + } + fn snapshot( &self, _request: CanonicalDiagnosticRefreshRequest, ) -> LspRuntimeFuture> { + self.snapshots.fetch_add(1, Ordering::SeqCst); Box::pin(async { Ok(ManagedDiagnosticSnapshot { generation: 1, @@ -503,6 +602,406 @@ mod tests { } } + struct DiagnosticTask(Mutex>>); + + struct DiagnosticTaskHandle(Arc); + + impl LspRuntimeTask for DiagnosticTaskHandle { + fn abort(&self) { + self.0.0.lock().unwrap().take(); + } + } + + #[derive(Default)] + struct DiagnosticRuntime { + tasks: Mutex>>, + started: AtomicUsize, + } + + impl LspRuntimeSpawner for DiagnosticRuntime { + fn spawn(&self, future: LspRuntimeFuture<()>) -> Box { + let task = Arc::new(DiagnosticTask(Mutex::new(Some(future)))); + self.tasks.lock().unwrap().push_back(Arc::clone(&task)); + self.started.fetch_add(1, Ordering::SeqCst); + Box::new(DiagnosticTaskHandle(task)) + } + } + + impl DiagnosticRuntime { + async fn complete_next(&self) { + let task = self.tasks.lock().unwrap().pop_front().unwrap(); + let future = task.0.lock().unwrap().take().unwrap(); + future.await; + } + } + + struct Feedback; + + impl FeedbackCyclePort for Feedback { + fn request_feedback_cycle(&self, _request: FeedbackCycleRequest) -> FeedbackCycleResponse { + FeedbackCycleResponse::Accepted + } + } + + fn file_uri(path: &Path) -> String { + Url::from_file_path(path).unwrap().to_string() + } + + const PUBLISHING_ANALYZER: &str = r#" +import json +import sys +from urllib.parse import urlparse + +def read_message(): + headers = {} + while True: + line = sys.stdin.buffer.readline() + if not line: + return None + if line in (b"\r\n", b"\n"): + break + name, value = line.decode("ascii").split(":", 1) + headers[name.lower()] = value.strip() + return json.loads(sys.stdin.buffer.read(int(headers["content-length"]))) + +def send(payload): + body = json.dumps(payload).encode("utf-8") + sys.stdout.buffer.write(b"Content-Length: " + str(len(body)).encode("ascii") + b"\r\n\r\n" + body) + sys.stdout.buffer.flush() + +while True: + message = read_message() + if message is None: + break + method = message.get("method") + if method == "initialize": + send({"jsonrpc": "2.0", "id": message["id"], "result": {"capabilities": {"textDocumentSync": 1}}}) + elif method in ("textDocument/didOpen", "textDocument/didChange"): + uri = message["params"]["textDocument"]["uri"] + with open(sys.argv[1], encoding="utf-8") as findings: + diagnostics = json.load(findings)[urlparse(uri).path.rsplit("/", 1)[-1]] + send({"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": { + "uri": uri, "diagnostics": diagnostics, + }}) +"#; + + struct BrokerDiagnosticHarness { + session: DaemonLspProtocolSession< + Feedback, + UnavailableSemanticProvider, + DiagnosticSnapshotAdapter, + >, + runtime: Arc, + broker: Arc>, + documents: Arc, + managed: Arc, + project: tempfile::TempDir, + next_request: u64, + } + + impl BrokerDiagnosticHarness { + fn new(findings: Value) -> Self { + let project = tempfile::tempdir().unwrap(); + let script = project.path().join("analyzer.py"); + let publications = project.path().join("findings.json"); + std::fs::write(&script, PUBLISHING_ANALYZER).unwrap(); + std::fs::write(&publications, serde_json::to_vec(&findings).unwrap()).unwrap(); + let python = if cfg!(windows) { + "python" + } else if std::path::Path::new("/usr/bin/python3").is_file() { + "/usr/bin/python3" + } else { + "python3" + }; + let broker = Arc::new(AsyncMutex::new(DiagnosticBroker::new_for_test( + project.path(), + vec![LspAdapterDefinition { + language: "fake".to_owned(), + language_id: "fake".to_owned(), + command: python.to_owned(), + args: vec![ + script.display().to_string(), + publications.display().to_string(), + ], + extensions: vec!["fake".to_owned()], + root_markers: Vec::new(), + install_options: Vec::new(), + diagnostics: DiagnosticMode::Push, + }], + ))); + let documents = Arc::new(PublishingWorkspaceIndex { + reads: AtomicUsize::new(0), + drift: WorkspaceIndexDrift::None, + documents: ["a.fake", "b.fake"] + .into_iter() + .map(|path| { + let document = LspDocument { + language: "fake".to_owned(), + language_id: "fake".to_owned(), + relative_path: path.to_owned(), + text: "fn main() {}".to_owned(), + snapshot: None, + }; + std::fs::write(project.path().join(path), &document.text).unwrap(); + (file_uri(&project.path().join(path)), document) + }) + .collect(), + }); + let managed = Arc::new(FixedManagedDiagnostics::default()); + let runtime = Arc::new(DiagnosticRuntime::default()); + let authority = Arc::new(BrokerDiagnosticSnapshotAuthority::new( + Arc::clone(&broker), + Arc::clone(&documents), + Arc::clone(&managed), + Duration::from_millis(150), + )); + let root = AdmittedRoot::authorized(file_uri(project.path()), digest('d')); + let workspace = AuthorizedLspWorkspace::new(Some(digest('e')), vec![root]).unwrap(); + let gateway = GatewayCapabilities::default(); + let upstream = UpstreamCapabilities { + supports_diagnostics: true, + ..UpstreamCapabilities::default() + }; + let session = DaemonLspProtocolSession::from_workspace_ports( + workspace, + negotiate_capabilities(&ClientCapabilities::default(), &gateway, &upstream), + gateway, + upstream, + Feedback, + UnavailableSemanticProvider, + DiagnosticSnapshotAdapter::new(runtime.clone(), authority), + ); + let mut harness = Self { + session, + runtime, + broker, + documents, + managed, + project, + next_request: 1, + }; + let initialized = harness.request( + "initialize", + json!({ + "rootUri": file_uri(harness.project.path()), + "capabilities": { + "general": { "positionEncodings": ["utf-16"] }, + "textDocument": { "diagnostic": {} }, + }, + }), + ); + assert!(initialized.get("error").is_none(), "{initialized}"); + harness.session.handle_payload( + &serde_json::to_vec(&json!({ + "jsonrpc": "2.0", "method": "initialized", "params": {}, + })) + .unwrap(), + 1, + ); + assert!(harness.session.drain_outbound().is_empty()); + harness + } + + fn uri(&self, path: &str) -> String { + file_uri(&self.project.path().join(path)) + } + + fn request(&mut self, method: &str, params: Value) -> Value { + let id = self.next_request; + self.next_request += 1; + self.session.handle_payload( + &serde_json::to_vec(&json!({ + "jsonrpc": "2.0", "id": id, "method": method, "params": params, + })) + .unwrap(), + id, + ); + self.session + .drain_outbound() + .iter() + .map(|message| serde_json::from_slice::(message).unwrap()) + .find(|message| message["id"] == id) + .expect("diagnostic protocol response") + } + + fn pull(&mut self, uri: &str, previous: Option<&str>) -> Value { + let mut params = json!({ "textDocument": { "uri": uri } }); + if let Some(previous) = previous { + params["previousResultId"] = json!(previous); + } + self.request("textDocument/diagnostic", params) + } + + async fn warm(&mut self, uri: &str) -> Value { + let pending = self.pull(uri, None); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + assert_eq!(pending["error"]["data"]["coverage"], "refresh-required"); + self.runtime.complete_next().await; + let full = self.pull(uri, None); + assert_eq!(full["result"]["kind"], "full", "{full}"); + full["result"].clone() + } + + async fn restart_analyzer_and_republish(&self, uri: &str) -> DiagnosticsSnapshot { + let document = self.documents.documents.get(uri).unwrap().clone(); + let mut broker = self.broker.lock().await; + let settings = broker.settings().clone(); + broker.update_settings(settings); + broker + .refresh_documents("fake", vec![document], Duration::from_millis(150)) + .await + .unwrap(); + broker.snapshot() + } + } + + fn analyzer_finding(message: &str, start: u32, end: u32) -> Value { + json!({ + "range": { "start": { "line": 0, "character": start }, "end": { "line": 0, "character": end } }, + "severity": 1, + "source": "fake-ls", + "message": message, + }) + } + + #[tokio::test] + async fn retained_report_rejects_changed_broker_findings_with_identical_coverage() { + let original_finding = analyzer_finding("first finding", 0, 1); + let mut harness = BrokerDiagnosticHarness::new(json!({ + "a.fake": [original_finding], "b.fake": [], + })); + let uri = harness.uri("a.fake"); + let original = harness.warm(&uri).await; + let result_id = original["resultId"].as_str().unwrap(); + assert_eq!(original["items"][0]["message"], "first finding"); + let before = harness.broker.lock().await.snapshot(); + + let identical = harness.restart_analyzer_and_republish(&uri).await; + assert_eq!(identical.coverage, before.coverage); + assert_eq!(identical.settings, before.settings); + assert_eq!(identical.diagnostics.len(), 1); + assert_eq!(identical.diagnostics[0].message, "first finding"); + assert_eq!(identical.diagnostics[0].character_start, Some(0)); + assert_eq!(identical.diagnostics[0].character_end, Some(1)); + assert_eq!( + harness.pull(&uri, Some(result_id))["result"], + json!({ "kind": "unchanged", "resultId": result_id }) + ); + assert_eq!(harness.managed.snapshots.load(Ordering::SeqCst), 1); + assert_eq!(harness.runtime.started.load(Ordering::SeqCst), 1); + + let changed_finding = analyzer_finding("replacement finding", 3, 7); + std::fs::write( + harness.project.path().join("findings.json"), + serde_json::to_vec(&json!({ "a.fake": [changed_finding], "b.fake": [] })).unwrap(), + ) + .unwrap(); + let changed = harness.restart_analyzer_and_republish(&uri).await; + assert_eq!(changed.coverage, before.coverage); + assert_eq!(changed.settings, before.settings); + assert_eq!(changed.settings_unavailable, before.settings_unavailable); + assert_eq!(changed.diagnostics.len(), 1); + assert_eq!(changed.diagnostics[0].message, "replacement finding"); + assert_eq!(changed.diagnostics[0].character_start, Some(3)); + assert_eq!(changed.diagnostics[0].character_end, Some(7)); + + let stale = harness.pull(&uri, Some(result_id)); + assert_eq!(stale["error"]["code"], -32802, "{stale}"); + assert!( + stale.get("result").is_none(), + "changed findings must reject retained reuse" + ); + harness.runtime.complete_next().await; + let replacement = harness.pull(&uri, Some(result_id)); + assert_eq!(replacement["result"]["kind"], "full", "{replacement}"); + assert_ne!(replacement["result"]["resultId"], original["resultId"]); + assert_eq!( + replacement["result"]["items"], + json!([{ + "range": { "start": { "line": 0, "character": 3 }, "end": { "line": 0, "character": 7 } }, + "severity": 1, "code": null, "source": "upstream", "message": "replacement finding", + }]) + ); + assert_eq!(harness.managed.snapshots.load(Ordering::SeqCst), 2); + assert_eq!(harness.runtime.started.load(Ordering::SeqCst), 2); + } + + #[tokio::test] + async fn retained_reports_survive_other_document_refreshes_in_the_same_language() { + let mut harness = BrokerDiagnosticHarness::new(json!({ + "a.fake": [analyzer_finding("retained finding", 0, 1)], "b.fake": [], + })); + let a = harness.uri("a.fake"); + let b = harness.uri("b.fake"); + let report_a = harness.warm(&a).await; + let report_b = harness.warm(&b).await; + assert_eq!(report_a["items"][0]["message"], "retained finding"); + assert_eq!(report_b["items"], json!([])); + let latest = harness.broker.lock().await.snapshot(); + assert_eq!(latest.diagnostics.len(), 1); + assert_eq!(latest.diagnostics[0].file, "a.fake"); + assert_eq!( + latest.coverage["fake"] + .documents + .keys() + .map(String::as_str) + .collect::>(), + vec!["b.fake"], + "dashboard coverage must still describe only the latest refresh" + ); + assert_eq!(harness.managed.snapshots.load(Ordering::SeqCst), 2); + assert_eq!(harness.runtime.started.load(Ordering::SeqCst), 2); + + for (uri, report) in [ + (&a, &report_a), + (&b, &report_b), + (&a, &report_a), + (&b, &report_b), + ] { + let result_id = report["resultId"].as_str().unwrap(); + let reused = harness.pull(uri, Some(result_id)); + assert_eq!( + reused["result"], + json!({ "kind": "unchanged", "resultId": result_id }), + "unchanged document must survive another document's refresh: {reused}" + ); + assert_eq!(harness.runtime.started.load(Ordering::SeqCst), 2); + assert_eq!(harness.managed.snapshots.load(Ordering::SeqCst), 2); + } + + let document_a = harness.documents.documents[&a].clone(); + harness + .broker + .lock() + .await + .refresh_documents("fake", vec![document_a], Duration::from_millis(150)) + .await + .unwrap(); + assert_eq!( + harness.pull(&b, report_b["resultId"].as_str())["result"], + json!({ "kind": "unchanged", "resultId": report_b["resultId"] }), + "a clean publication must also survive a later refresh of another document" + ); + assert_eq!(harness.managed.snapshots.load(Ordering::SeqCst), 2); + assert_eq!(harness.runtime.started.load(Ordering::SeqCst), 2); + + harness + .broker + .lock() + .await + .set_language_enabled("fake", false); + let stale = harness.pull(&a, report_a["resultId"].as_str()); + assert_eq!(stale["error"]["code"], -32802, "{stale}"); + assert!(stale.get("result").is_none()); + harness.runtime.complete_next().await; + let disabled = harness.pull(&a, report_a["resultId"].as_str()); + assert_eq!(disabled["result"]["kind"], "full", "{disabled}"); + assert_eq!(disabled["result"]["items"], json!([])); + assert_ne!(disabled["result"]["resultId"], report_a["resultId"]); + assert_eq!(harness.managed.snapshots.load(Ordering::SeqCst), 3); + assert_eq!(harness.runtime.started.load(Ordering::SeqCst), 3); + } + #[tokio::test] async fn workspace_sweep_rejects_a_generation_published_before_completion() { let root = AdmittedRoot::authorized("file:///workspace", digest('d')); @@ -512,11 +1011,8 @@ mod tests { "/workspace", Vec::new(), ))), - Arc::new(PublishingWorkspaceIndex { - reads: AtomicUsize::new(0), - drift: WorkspaceIndexDrift::Publish, - }), - Arc::new(FixedManagedDiagnostics), + Arc::new(PublishingWorkspaceIndex::new(WorkspaceIndexDrift::Publish)), + Arc::new(FixedManagedDiagnostics::default()), Duration::from_millis(1), ); @@ -535,6 +1031,13 @@ mod tests { struct MismatchedManagedDiagnostics; impl ManagedDiagnosticSnapshotPort for MismatchedManagedDiagnostics { + fn current_authority( + &self, + _request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + Box::pin(async { Ok(digest('c')) }) + } + fn snapshot( &self, _request: CanonicalDiagnosticRefreshRequest, @@ -560,10 +1063,7 @@ mod tests { "/workspace", Vec::new(), ))), - Arc::new(PublishingWorkspaceIndex { - reads: AtomicUsize::new(0), - drift: WorkspaceIndexDrift::None, - }), + Arc::new(PublishingWorkspaceIndex::new(WorkspaceIndexDrift::None)), Arc::new(MismatchedManagedDiagnostics), Duration::from_millis(1), ); diff --git a/crates/tracedecay-code-index-runtime/src/code_index_scheduler/reconcile_panic_guard.rs b/crates/tracedecay-code-index-runtime/src/code_index_scheduler/reconcile_panic_guard.rs index a9ba731bca..1d610fbbb5 100644 --- a/crates/tracedecay-code-index-runtime/src/code_index_scheduler/reconcile_panic_guard.rs +++ b/crates/tracedecay-code-index-runtime/src/code_index_scheduler/reconcile_panic_guard.rs @@ -80,13 +80,17 @@ impl ReconcilePanicGuardV1 { } } - /// Any pass that completed without panicking clears the accounting: the - /// next panic starts again at the floor. + /// Any pass that completed without panicking clears the retry + /// accounting: the next panic starts again at the floor. A quarantine + /// is keyed to the input that panicked, so progress from OTHER files + /// must not lift it — only changed input (a control epoch advance, + /// checked in [`Self::suppresses_pass`]) re-arms a quarantined guard. + /// Clearing the quarantine on any progress let one poisoned file + /// sawtooth panic→quarantine→progress→panic forever. pub fn record_progress(&mut self) { self.consecutive_panics = 0; self.backoff = RECONCILE_PANIC_BACKOFF_FLOOR; self.next_attempt_at = None; - self.quarantined = false; } /// Record a panicking pass and decide whether the same input is worth @@ -467,7 +471,7 @@ mod tests { } #[test] - fn a_progressing_pass_clears_the_accounting() { + fn a_progressing_pass_clears_the_accounting_but_not_the_quarantine() { let mut guard = ReconcilePanicGuardV1::new(); let now = origin(); for _ in 0..MAX_CONSECUTIVE_RECONCILE_PANICS_V1 { @@ -475,12 +479,22 @@ mod tests { } assert!(guard.suppresses_pass(now, 7)); + // A progressing pass is progress from OTHER files: the accounting + // clears, but the quarantined input stays suppressed until the + // control epoch advances. guard.record_progress(); - assert!(!guard.suppresses_pass(now, 7), "progress lifts suppression"); + assert!( + guard.suppresses_pass(now, 7), + "progress must not lift a quarantine over unchanged input" + ); assert_eq!(guard.consecutive_panics(), 0); + assert!( + !guard.suppresses_pass(now, 8), + "changed input re-arms the guard" + ); assert_eq!( - guard.record_panic(now, 7), + guard.record_panic(now, 8), ReconcilePanicDecisionV1::RetryAfter(RECONCILE_PANIC_BACKOFF_FLOOR), "the next panic restarts at the floor" ); diff --git a/crates/tracedecay-code-index-runtime/src/code_index_scheduler/registry/mount.rs b/crates/tracedecay-code-index-runtime/src/code_index_scheduler/registry/mount.rs index 8c2921d22d..8e106ac88a 100644 --- a/crates/tracedecay-code-index-runtime/src/code_index_scheduler/registry/mount.rs +++ b/crates/tracedecay-code-index-runtime/src/code_index_scheduler/registry/mount.rs @@ -3671,7 +3671,7 @@ impl CodeIndexSchedulerRegistryV1 { ReconcilePanicDecisionV1::RetryAfter(delay) => { tracing::warn!( event = "code_index_reconcile_panicked", - path = "background_worker", + path = %worker_project_root.display(), consecutive_panics = panic_guard.consecutive_panics(), error = %error, "code-index background reconcile panicked; retrying the same input with backoff" @@ -3680,10 +3680,10 @@ impl CodeIndexSchedulerRegistryV1 { } ReconcilePanicDecisionV1::Quarantine => tracing::warn!( event = "code_index_reconcile_quarantined", - path = "background_worker", + path = %worker_project_root.display(), consecutive_panics = panic_guard.consecutive_panics(), error = %error, - "code-index background reconcile is quarantined after repeated panics; changed input or a progressing pass resumes it" + "code-index background reconcile is quarantined after repeated panics; only changed input resumes it" ), } } diff --git a/crates/tracedecay-code-index-runtime/tests/code_index_scheduler/reconcile.rs b/crates/tracedecay-code-index-runtime/tests/code_index_scheduler/reconcile.rs index dc44db524e..5cc5227ece 100644 --- a/crates/tracedecay-code-index-runtime/tests/code_index_scheduler/reconcile.rs +++ b/crates/tracedecay-code-index-runtime/tests/code_index_scheduler/reconcile.rs @@ -13785,3 +13785,229 @@ fn a_moved_commit_refuses_the_sealed_generation_despite_identical_bytes() { "the rebuilt generation must name the commit the checkout is on" ); } + +mod diagnostic_authority { + use std::collections::BTreeSet; + use std::sync::Arc; + use std::time::Duration; + + use tempfile::TempDir; + use tracedecay_application::ProjectSourceAccessSnapshot; + use tracedecay_application::diagnostics_store::DiagnosticsStore; + use tracedecay_application::feedback::concrete::open_feedback_runtime; + use tracedecay_application::lsp_runtime::{ + BrokerDiagnosticSnapshotAuthority, ConcreteFeedbackLspSource, + DiagnosticsStoreLspFeedbackProjection, LspCodeIndexProjectionIdentityPort, + LspTestRunProjectionPort, LspWorkspaceDocumentIndexPort, RegisteredProjectLspAuthority, + }; + use tracedecay_domain::configuration::{ + AuthorityRef, ConfigurationRevisionId, ScopeSourceBinding, SourceBindingId, SourceKindV1, + }; + use tracedecay_domain::test_fixtures::{digest, id}; + use tracedecay_domain::{ContentDigest, UtcMicros}; + use tracedecay_lsp::analyzer::broker::DiagnosticBroker; + use tracedecay_lsp::{ + AdmittedRoot, CanonicalDiagnosticRefreshRequest, CanonicalDiagnosticSnapshotAuthority, + ContextProjectionOutcome, FeedbackCycleRequest, FeedbackCycleRuntimePort, + IndexedWorkspaceDocuments, LspRuntimeFailure, LspRuntimeFuture, + }; + use tracedecay_runtime_core::db::{Database, DatabaseAuthority, TestDatabaseRuntimeMode}; + + use super::{ + CodeIndexSchedulerRegistryV1, GitFixture, test_project_id, wait_for_generation_change, + wait_for_live_complete_generation, + }; + use crate::code_index_scheduler::identity::resolved_scope_for_project; + + // Currentness reads must not execute diagnostics, test runs, or workspace sweeps. + struct UnexpectedDiagnosticWork; + + impl FeedbackCycleRuntimePort for UnexpectedDiagnosticWork { + fn execute( + &self, + _: FeedbackCycleRequest, + ) -> LspRuntimeFuture> { + panic!("authority validation must not execute a feedback cycle") + } + } + + impl LspTestRunProjectionPort for UnexpectedDiagnosticWork { + fn snapshot( + &self, + _: AdmittedRoot, + _: Option, + _: Option, + ) -> LspRuntimeFuture { + panic!("authority validation must not execute tests") + } + } + + impl LspWorkspaceDocumentIndexPort for UnexpectedDiagnosticWork { + fn indexed_documents( + &self, + _: AdmittedRoot, + _: usize, + ) -> LspRuntimeFuture> { + panic!("document authority validation must not enumerate the workspace") + } + } + + #[tokio::test] + async fn diagnostic_authority_changes_when_an_unchanged_documents_dependency_is_published() { + let source = "pub fn alpha() -> u32 { 1 }\n"; + let fixture = GitFixture::new(&[ + ("src/lib.rs", source), + ("src/dependency.rs", "pub fn dependency() -> u32 { 1 }\n"), + ]); + let storage = TempDir::new().unwrap(); + let registry = CodeIndexSchedulerRegistryV1::new(1); + registry + .mount_worktree( + test_project_id(), + fixture.path(), + storage.path().join("index"), + ) + .await + .unwrap(); + let initial = wait_for_live_complete_generation(®istry, fixture.path()).await; + let initial_generation = initial.generation().manifest().generation_id.clone(); + let scope = resolved_scope_for_project(fixture.path(), &test_project_id()).unwrap(); + let database_path = storage.path().join("feedback.db"); + crate::register_test_schema_installer(); + let database_authority = + DatabaseAuthority::acquire_test(&database_path, "diagnostic authority publication") + .unwrap(); + let (database, _guard) = Database::publish_test_runtime( + &database_path, + &database_authority, + TestDatabaseRuntimeMode::Initialize, + ) + .await + .unwrap(); + let access = ProjectSourceAccessSnapshot { + scope: scope.clone(), + requester: id("actor.diagnostic-authority"), + binding: ScopeSourceBinding::new( + SourceBindingId::new("binding.diagnostic-authority").unwrap(), + SourceKindV1::Cursor, + id(digest('a').as_str()), + AuthorityRef::Project(scope.project_id.clone()), + ) + .unwrap(), + configuration_revision: ConfigurationRevisionId::new( + "configuration.diagnostic-authority", + ) + .unwrap(), + configuration_digest: digest('b'), + configuration_provenance_digest: digest('c'), + effective_capabilities: BTreeSet::new(), + grant_expires_at: UtcMicros(i64::MAX), + }; + let runtime = Arc::new( + open_feedback_runtime( + database.clone(), + fixture.path(), + storage.path().join("handles"), + scope.clone(), + access, + ) + .await + .unwrap(), + ); + let project = Arc::new( + RegisteredProjectLspAuthority::new( + runtime.clone(), + Arc::new(registry.clone()), + Arc::new(UnexpectedDiagnosticWork), + ) + .unwrap(), + ); + let projection = Arc::new(DiagnosticsStoreLspFeedbackProjection::new( + Arc::new(DiagnosticsStore::new(database)), + project.clone(), + )); + let managed = Arc::new(ConcreteFeedbackLspSource::new( + runtime, + |_| Arc::new(UnexpectedDiagnosticWork), + project.clone(), + projection, + Arc::new(UnexpectedDiagnosticWork), + )); + let authority = BrokerDiagnosticSnapshotAuthority::new( + Arc::new(tokio::sync::Mutex::new(DiagnosticBroker::new_for_test( + fixture.path(), + Vec::new(), + ))), + project, + managed, + Duration::from_millis(1), + ); + let request = CanonicalDiagnosticRefreshRequest { + root: AdmittedRoot::authorized( + url::Url::from_directory_path(fixture.path()) + .unwrap() + .to_string(), + scope.scope_digest, + ), + document_uri: url::Url::from_file_path(fixture.path().join("src/lib.rs")) + .unwrap() + .to_string(), + overlay: None, + source_generation: None, + expected_content_digest: Some(ContentDigest::of_bytes(source.as_bytes())), + expected_code_generation_id: None, + expected_snapshot_digest: None, + }; + let first = authority.current_authority(request.clone()).await.unwrap(); + assert_eq!( + first, + authority.current_authority(request.clone()).await.unwrap() + ); + fixture.edit("src/dependency.rs", "pub fn dependency() -> u32 { 2 }\n"); + registry + .notify_hook_paths(fixture.path(), &["src/dependency.rs".to_owned()]) + .await; + let successor = + wait_for_generation_change(®istry, fixture.path(), &initial_generation).await; + assert_ne!(successor, initial_generation); + wait_for_live_complete_generation(®istry, fixture.path()).await; + let identity = registry + .current_identity(fixture.path().to_path_buf(), Some("src/lib.rs".to_owned())) + .await + .unwrap(); + assert_eq!( + identity.document_content_digest, + request.expected_content_digest + ); + assert_eq!( + authority + .current_authority(request.clone()) + .await + .unwrap_err() + .class(), + "lsp-code-index-source-revision-unavailable" + ); + fixture.commit_all("publish changed dependency"); + registry + .notify_hook_paths(fixture.path(), &["src/dependency.rs".to_owned()]) + .await; + wait_for_generation_change(®istry, fixture.path(), &successor).await; + wait_for_live_complete_generation(®istry, fixture.path()).await; + let second = authority.current_authority(request.clone()).await.unwrap(); + assert_ne!( + first, second, + "unchanged A must observe the real successor containing changed B" + ); + let mut stale = request; + stale.expected_code_generation_id = Some(initial_generation); + assert_eq!( + authority + .current_authority(stale) + .await + .unwrap_err() + .class(), + "managed-diagnostic-generation-stale" + ); + registry.shutdown().await; + } +} diff --git a/crates/tracedecay-contracts/src/advisory.rs b/crates/tracedecay-contracts/src/advisory.rs index 08d1b55a19..ac0efe7bf8 100644 --- a/crates/tracedecay-contracts/src/advisory.rs +++ b/crates/tracedecay-contracts/src/advisory.rs @@ -26,10 +26,9 @@ pub use tracedecay_domain::feedback::{ GitHubReviewReadOperationV1, GitHubReviewRemapStateV1, GitHubReviewStateV1, GitHubReviewThreadIdV1, MAX_CI_FAILURE_CALLER_EVIDENCE_V1, MAX_CI_FAILURE_RERUN_HINTS_V1, MAX_CI_FAILURE_TEST_EVIDENCE_V1, PROXIMITY_RISK_THRESHOLD_SETTING_KEY_V1, ProximityAddressV1, - ProximityBranchWorktreeIncompatibilityV1, ProximityContributionIdV1, ProximityContributionV1, - ProximityCoverageV1, ProximityInclusionV1, ProximityObservationIdV1, - ProximityRelationPathKindV1, ProximityRelationPathV1, ProximityRelationStrengthV1, - ProximityRiskInputsV1, ProximityTierV1, ProximityWarningClassV1, + ProximityContributionIdV1, ProximityContributionV1, ProximityCoverageV1, ProximityInclusionV1, + ProximityObservationIdV1, ProximityRelationPathKindV1, ProximityRelationPathV1, + ProximityWarningClassV1, }; /// The window of one advisory cycle. It opens when the cycle starts and @@ -232,8 +231,12 @@ impl AdvisoryFindingContributorV1 for ProximityContributionV1 { symbol: address.symbol.clone(), code: "agent-proximity".to_owned(), severity: DiagnosticSeverityV1::Warning, - safe_bounded_message: "Concurrent agent activity overlaps this code" - .to_owned(), + safe_bounded_message: if self.warning_class.is_exact_overlap() { + "Concurrent agent activity overlaps this code" + } else { + "Concurrent agent activity is related to this code" + } + .to_owned(), producer: FeedbackDiagnosticProducerV1::Proximity, code_description_uri: None, }) diff --git a/crates/tracedecay-contracts/src/lib.rs b/crates/tracedecay-contracts/src/lib.rs index 880a59d359..1edbdfd75c 100644 --- a/crates/tracedecay-contracts/src/lib.rs +++ b/crates/tracedecay-contracts/src/lib.rs @@ -114,10 +114,9 @@ pub use advisory::{ GitHubReviewReadOperationV1, GitHubReviewRemapStateV1, GitHubReviewStateV1, GitHubReviewThreadIdV1, MAX_CI_FAILURE_CALLER_EVIDENCE_V1, MAX_CI_FAILURE_RERUN_HINTS_V1, MAX_CI_FAILURE_TEST_EVIDENCE_V1, PROXIMITY_RISK_THRESHOLD_SETTING_KEY_V1, ProximityAddressV1, - ProximityBranchWorktreeIncompatibilityV1, ProximityContributionIdV1, ProximityContributionV1, - ProximityCoverageV1, ProximityInclusionV1, ProximityObservationIdV1, - ProximityRelationPathKindV1, ProximityRelationPathV1, ProximityRelationStrengthV1, - ProximityRiskInputsV1, ProximityTierV1, ProximityWarningClassV1, + ProximityContributionIdV1, ProximityContributionV1, ProximityCoverageV1, ProximityInclusionV1, + ProximityObservationIdV1, ProximityRelationPathKindV1, ProximityRelationPathV1, + ProximityWarningClassV1, }; pub use authorization::AuthorizationRequest; pub use clock::{ClockError, now_micros, try_now_micros}; diff --git a/crates/tracedecay-contracts/tests/contracts_suite/feedback_advisory_cycle.rs b/crates/tracedecay-contracts/tests/contracts_suite/feedback_advisory_cycle.rs index 80d6f11e30..6eab8b2dc3 100644 --- a/crates/tracedecay-contracts/tests/contracts_suite/feedback_advisory_cycle.rs +++ b/crates/tracedecay-contracts/tests/contracts_suite/feedback_advisory_cycle.rs @@ -295,17 +295,6 @@ fn feedback_sources_share_one_cycle_result_and_canonical_anchors() { symbol: Some(symbol), }), relation_paths: Vec::new(), - risk_inputs: Some(ProximityRiskInputsV1 { - overlap_size: 1, - blast_radius_size: 1, - relation_strength: ProximityRelationStrengthV1::Direct, - branch_worktree_incompatibility: ProximityBranchWorktreeIncompatibilityV1::Compatible, - freshness_decay_basis_points: 10_000, - }), - tier: ProximityTierV1::Immediate, - threshold_value_basis_points: None, - threshold_revision: None, - raw_risk_basis_points: Some(10_000), observed_at: UtcMicros(1), expires_at: UtcMicros(100), coverage: ProximityCoverageV1::Complete, diff --git a/crates/tracedecay-domain/src/feedback/proximity.rs b/crates/tracedecay-domain/src/feedback/proximity.rs index 18413d7391..a9b90ff56b 100644 --- a/crates/tracedecay-domain/src/feedback/proximity.rs +++ b/crates/tracedecay-domain/src/feedback/proximity.rs @@ -9,7 +9,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Deserializer, Serialize}; use crate::code_intelligence::identity::{FileOccurrenceId, SourceSpan, SymbolOccurrenceId}; -use crate::research::{DomainError, ManifestDigest, RetrievalAnchorId, UtcMicros}; +use crate::research::{DomainError, RetrievalAnchorId, UtcMicros}; use super::FeedbackScopeV1; @@ -23,15 +23,6 @@ crate::canonical_text::validated_string_newtype!( ProximityObservationIdV1 => "proximity observation id", ); -#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] -#[serde(rename_all = "snake_case")] -pub enum ProximityTierV1 { - /// Exact same-file/range/symbol conflicts emit without a risk threshold. - Immediate, - /// Package/crate/neighborhood relations require configured risk gating. - Configured, -} - #[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ProximityWarningClassV1 { @@ -44,7 +35,17 @@ pub enum ProximityWarningClassV1 { SharedCaller, SharedDependency, SharedTest, - IncompatibleBranchWorktree, +} + +impl ProximityWarningClassV1 { + /// Same-file, overlapping-range, and same-symbol encounters are exact + /// evidence of concurrent edits. Every other class is a relationship hint. + pub const fn is_exact_overlap(self) -> bool { + matches!( + self, + Self::SameFile | Self::OverlappingRange | Self::SameSymbol + ) + } } #[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] @@ -60,22 +61,6 @@ pub enum ProximityRelationPathKindV1 { NeighborhoodMembership, } -#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] -#[serde(rename_all = "snake_case")] -pub enum ProximityRelationStrengthV1 { - Direct, - Transitive, -} - -#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] -#[serde(rename_all = "snake_case")] -pub enum ProximityBranchWorktreeIncompatibilityV1 { - Compatible, - BranchDiverged, - WorktreeDiverged, - Incompatible, -} - #[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ProximityCoverageV1 { @@ -135,32 +120,10 @@ impl ProximityRelationPathV1 { } } -/// Explicit threshold inputs. Scores use basis points to preserve equality and -/// persistence semantics without encoding a local scoring implementation. -#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] -#[serde(deny_unknown_fields)] -pub struct ProximityRiskInputsV1 { - pub overlap_size: u32, - pub blast_radius_size: u32, - pub relation_strength: ProximityRelationStrengthV1, - pub branch_worktree_incompatibility: ProximityBranchWorktreeIncompatibilityV1, - pub freshness_decay_basis_points: u16, -} - -impl ProximityRiskInputsV1 { - pub fn validate(&self) -> Result<(), DomainError> { - if self.freshness_decay_basis_points > 10_000 { - return Err(DomainError::NonCanonical { - field: "proximity freshness decay basis points", - }); - } - Ok(()) - } -} - -/// Reference-only provenance for one proximity candidate. `BelowThreshold` is -/// a successful zero-candidate result; no tier emits a lock, schedules work, -/// or continues an agent. +/// Reference-only provenance for one proximity candidate. `BelowThreshold` +/// marks a relationship hint the effective policy excluded; it is a successful +/// zero-candidate result. No inclusion emits a lock, schedules work, or +/// continues an agent. #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub struct ProximityContributionV1 { @@ -170,11 +133,6 @@ pub struct ProximityContributionV1 { pub retrieval_anchor_ids: Vec, pub address: Option, pub relation_paths: Vec, - pub risk_inputs: Option, - pub tier: ProximityTierV1, - pub threshold_value_basis_points: Option, - pub threshold_revision: Option, - pub raw_risk_basis_points: Option, pub observed_at: UtcMicros, pub expires_at: UtcMicros, pub coverage: ProximityCoverageV1, @@ -191,25 +149,6 @@ impl ProximityContributionV1 { pub fn validate(&self) -> Result<(), DomainError> { self.contribution_id.validate()?; - let immediate_class = matches!( - self.warning_class, - ProximityWarningClassV1::SameFile - | ProximityWarningClassV1::OverlappingRange - | ProximityWarningClassV1::SameSymbol - ); - match (self.tier, immediate_class) { - (ProximityTierV1::Immediate, true) | (ProximityTierV1::Configured, false) => {} - (ProximityTierV1::Immediate, false) => { - return Err(DomainError::NonCanonical { - field: "immediate proximity warning class", - }); - } - (ProximityTierV1::Configured, true) => { - return Err(DomainError::NonCanonical { - field: "configured proximity warning class", - }); - } - } let concealed = matches!( self.inclusion, ProximityInclusionV1::Denied | ProximityInclusionV1::Private @@ -226,17 +165,6 @@ impl ProximityContributionV1 { for path in &self.relation_paths { path.validate()?; } - self.risk_inputs - .as_ref() - .map_or(Ok(()), ProximityRiskInputsV1::validate)?; - if self - .raw_risk_basis_points - .is_some_and(|value| value > 10_000) - { - return Err(DomainError::NonCanonical { - field: "proximity raw risk basis points", - }); - } let coverage_matches = matches!( (self.inclusion, self.coverage), ( @@ -254,45 +182,11 @@ impl ProximityContributionV1 { }); } - if concealed { - if self.threshold_value_basis_points.is_some() || self.threshold_revision.is_some() { - return Err(DomainError::NonCanonical { - field: "concealed proximity threshold", - }); - } - } else { - match ( - self.tier, - self.threshold_value_basis_points, - self.threshold_revision.as_ref(), - ) { - (ProximityTierV1::Immediate, None, None) => {} - (ProximityTierV1::Immediate, _, _) => { - return Err(DomainError::NonCanonical { - field: "immediate proximity threshold", - }); - } - (ProximityTierV1::Configured, Some(value), Some(revision)) => { - if value > 10_000 { - return Err(DomainError::NonCanonical { - field: "configured proximity threshold basis points", - }); - } - revision.validate()?; - } - (ProximityTierV1::Configured, _, _) => { - return Err(DomainError::NonCanonical { - field: "configured proximity threshold", - }); - } - } - } - if self.inclusion == ProximityInclusionV1::BelowThreshold - && self.tier != ProximityTierV1::Configured + && self.warning_class.is_exact_overlap() { return Err(DomainError::NonCanonical { - field: "immediate proximity below threshold", + field: "exact proximity below threshold", }); } if concealed { @@ -300,8 +194,6 @@ impl ProximityContributionV1 { || !self.retrieval_anchor_ids.is_empty() || self.address.is_some() || !self.relation_paths.is_empty() - || self.risk_inputs.is_some() - || self.raw_risk_basis_points.is_some() { return Err(DomainError::NonCanonical { field: "concealed proximity evidence", @@ -310,8 +202,6 @@ impl ProximityContributionV1 { } else if self.source_observation_ids.is_empty() || self.retrieval_anchor_ids.is_empty() || self.address.is_none() - || self.risk_inputs.is_none() - || self.raw_risk_basis_points.is_none() { return Err(DomainError::NonCanonical { field: "proximity evidence", @@ -349,12 +239,6 @@ impl ProximityContributionV1 { ProximityWarningClassV1::SharedTest => { has_relation(ProximityRelationPathKindV1::AffectedTest) } - ProximityWarningClassV1::IncompatibleBranchWorktree => { - self.risk_inputs.as_ref().is_some_and(|inputs| { - inputs.branch_worktree_incompatibility - != ProximityBranchWorktreeIncompatibilityV1::Compatible - }) - } }; if !exact_shape { return Err(DomainError::NonCanonical { @@ -363,23 +247,6 @@ impl ProximityContributionV1 { } } - if let (ProximityTierV1::Configured, Some(threshold), Some(raw_risk)) = ( - self.tier, - self.threshold_value_basis_points, - self.raw_risk_basis_points, - ) { - let threshold_relation_is_valid = match self.inclusion { - ProximityInclusionV1::BelowThreshold => raw_risk < threshold, - ProximityInclusionV1::Included => raw_risk >= threshold, - _ => true, - }; - if !threshold_relation_is_valid { - return Err(DomainError::NonCanonical { - field: "proximity threshold inclusion", - }); - } - } - if self.expires_at.0 <= self.observed_at.0 { return Err(DomainError::NonCanonical { field: "proximity expiry", @@ -401,11 +268,6 @@ mod tests { retrieval_anchor_ids: Vec::new(), address: None, relation_paths: Vec::new(), - risk_inputs: None, - tier: ProximityTierV1::Configured, - threshold_value_basis_points: None, - threshold_revision: None, - raw_risk_basis_points: None, observed_at: UtcMicros(1), expires_at: UtcMicros(2), coverage: ProximityCoverageV1::Private, @@ -414,14 +276,17 @@ mod tests { } #[test] - fn private_proximity_exposes_no_evidence_or_threshold_inputs() { + fn private_proximity_exposes_no_evidence() { let contribution = concealed_private_contribution(); contribution.validate().unwrap(); assert!(!contribution.is_expired_at(UtcMicros(1))); assert!(contribution.is_expired_at(UtcMicros(2))); let mut leaking = contribution; - leaking.raw_risk_basis_points = Some(9_000); + leaking.relation_paths.push(ProximityRelationPathV1 { + kind: ProximityRelationPathKindV1::DirectCaller, + retrieval_anchor_id: None, + }); assert!(leaking.validate().is_err()); } @@ -436,4 +301,18 @@ mod tests { contribution.coverage = ProximityCoverageV1::Denied; assert!(contribution.validate().is_ok()); } + + #[test] + fn exact_overlap_is_never_below_threshold() { + let mut contribution = concealed_private_contribution(); + contribution.warning_class = ProximityWarningClassV1::SameFile; + contribution.inclusion = ProximityInclusionV1::BelowThreshold; + contribution.coverage = ProximityCoverageV1::Complete; + assert_eq!( + contribution.validate().unwrap_err().to_string(), + "exact proximity below threshold is not canonical" + ); + assert!(ProximityWarningClassV1::SameSymbol.is_exact_overlap()); + assert!(!ProximityWarningClassV1::SharedDependency.is_exact_overlap()); + } } diff --git a/crates/tracedecay-domain/src/lib.rs b/crates/tracedecay-domain/src/lib.rs index 946657283e..111cebe2f6 100644 --- a/crates/tracedecay-domain/src/lib.rs +++ b/crates/tracedecay-domain/src/lib.rs @@ -183,10 +183,9 @@ pub use feedback::{ GitHubReviewThreadIdV1, MAX_CI_FAILURE_CALLER_EVIDENCE_V1, MAX_CI_FAILURE_RERUN_HINTS_V1, MAX_CI_FAILURE_TEST_EVIDENCE_V1, MAX_GITHUB_PULL_REQUEST_TITLE_BYTES_V1, MAX_GITHUB_REVIEW_THREAD_PATH_BYTES_V1, PROXIMITY_RISK_THRESHOLD_SETTING_KEY_V1, - ProviderEvaluationStateV1, ProximityAddressV1, ProximityBranchWorktreeIncompatibilityV1, - ProximityContributionIdV1, ProximityContributionV1, ProximityCoverageV1, ProximityInclusionV1, - ProximityObservationIdV1, ProximityRelationPathKindV1, ProximityRelationPathV1, - ProximityRelationStrengthV1, ProximityRiskInputsV1, ProximityTierV1, ProximityWarningClassV1, + ProviderEvaluationStateV1, ProximityAddressV1, ProximityContributionIdV1, + ProximityContributionV1, ProximityCoverageV1, ProximityInclusionV1, ProximityObservationIdV1, + ProximityRelationPathKindV1, ProximityRelationPathV1, ProximityWarningClassV1, derive_feedback_finding_id, derive_overlay_feedback_finding_id, }; pub use git::{ diff --git a/crates/tracedecay-graph-db/BUILD.bazel b/crates/tracedecay-graph-db/BUILD.bazel index 27205813c5..740dee679b 100644 --- a/crates/tracedecay-graph-db/BUILD.bazel +++ b/crates/tracedecay-graph-db/BUILD.bazel @@ -62,7 +62,7 @@ rust_test( crate_root = "tests/at_rest_compact_mutation_probe.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -77,7 +77,7 @@ rust_test( crate_root = "tests/at_rest_grafeo_probe.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -92,7 +92,7 @@ rust_test( crate_root = "tests/at_rest_snapshot.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -107,7 +107,7 @@ rust_test( crate_root = "tests/generation_cycle_rss.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -122,7 +122,7 @@ rust_test( crate_root = "tests/graph_db_suite/main.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -137,7 +137,7 @@ rust_test( crate_root = "tests/replay_hydrate_probe.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -154,7 +154,7 @@ rust_test( crate_root = "benches/code_traversal.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -171,7 +171,7 @@ rust_test( crate_root = "benches/mixed_read_write.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -188,7 +188,7 @@ rust_test( crate_root = "benches/native_state_100k.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -205,7 +205,7 @@ rust_test( crate_root = "benches/publication_scale.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -222,7 +222,7 @@ rust_test( crate_root = "benches/replay_after_mismatch.rs", edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-graph-db:tracedecay-graph-db__+eval-helpers_+test-helpers__dev", "//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), @@ -243,7 +243,7 @@ rust_test( crate_features = ["eval-helpers", "test-helpers"], edition = crate_edition(), version = "0.1.0", - deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], + deps = all_crate_deps(normal = True, normal_dev = True) + ["//crates/tracedecay-domain:tracedecay-domain__dev", "//crates/tracedecay-private-fs:tracedecay-private-fs__+test-helpers__dev", "//crates/tracedecay-runtime-core:tracedecay-runtime-core__+test-helpers_+test-transport__dev", "//crates/tracedecay-rusqlite-runtime:tracedecay-rusqlite-runtime__+test-runtime_+test-transport__dev", "//crates/tracedecay-store:tracedecay-store__dev"], proc_macro_deps = all_crate_deps(proc_macro = True, proc_macro_dev = True), aliases = aliases(normal = True, normal_dev = True), rustc_flags = perf_rustc_flags(2), diff --git a/crates/tracedecay-graph-db/Cargo.toml b/crates/tracedecay-graph-db/Cargo.toml index 405e4c8904..cfebdaa1b9 100644 --- a/crates/tracedecay-graph-db/Cargo.toml +++ b/crates/tracedecay-graph-db/Cargo.toml @@ -48,6 +48,7 @@ tempfile.workspace = true [dev-dependencies] criterion.workspace = true tracedecay-rusqlite-runtime = { path = "../tracedecay-rusqlite-runtime" } +tracedecay-runtime-core = { path = "../tracedecay-runtime-core", features = ["test-helpers"] } [[bench]] name = "native_state_100k" diff --git a/crates/tracedecay-graph-db/src/corrupt_store.rs b/crates/tracedecay-graph-db/src/corrupt_store.rs index bd78b28292..b1323c7483 100644 --- a/crates/tracedecay-graph-db/src/corrupt_store.rs +++ b/crates/tracedecay-graph-db/src/corrupt_store.rs @@ -82,6 +82,20 @@ pub(crate) fn recover_deterministically_corrupt_container_with( Err(other) => return Err(other), }; if second_fault != first_fault { + // A drifting fault is terminal for this container and invisible by + // design: nothing is deleted and nothing is rebuilt, and every + // later open repeats the verdict. Say so once per decision, at + // error level, with the operator action, so a permanently corrupt + // container is not indistinguishable from a healthy one. + tracing::error!( + event = "store_corrupt_not_deterministic", + container = %container.display(), + first_fault = %first_fault, + second_fault = %second_fault, + "graph container corruption is not deterministic; deletion refused. \ + This store stays corrupt until an operator acts: move the medium, \ + or rebuild the project store from its canonical replay authorities." + ); return Err(GraphDbError::Corrupt { message: format!( "graph container corruption is not deterministic; refusing deletion: \ @@ -338,12 +352,19 @@ mod tests { let temp = tempfile::tempdir().unwrap(); let container = seeded_family(temp.path()); - let error = recover_deterministically_corrupt_container( - &container, - "block 18 CRC mismatch", - &|| Err(corrupt("block 7 CRC mismatch")), - ) - .unwrap_err(); + let (error, logs) = tracedecay_runtime_core::logging::capture_formatted_tracing(|| { + recover_deterministically_corrupt_container( + &container, + "block 18 CRC mismatch", + &|| Err(corrupt("block 7 CRC mismatch")), + ) + .unwrap_err() + }); + assert_eq!( + logs.matches("store_corrupt_not_deterministic").count(), + 1, + "the drifting-fault refusal must log its operator event exactly once" + ); assert!( matches!(&error, GraphDbError::Corrupt { message } diff --git a/crates/tracedecay-host-admission/src/host_admission_batch_test.rs b/crates/tracedecay-host-admission/src/host_admission_batch_test.rs index 2232f01a03..a9d1016328 100644 --- a/crates/tracedecay-host-admission/src/host_admission_batch_test.rs +++ b/crates/tracedecay-host-admission/src/host_admission_batch_test.rs @@ -1,3 +1,4 @@ +use std::io::Write as _; use std::num::NonZeroUsize; use std::process::Command; use std::sync::Arc; @@ -18,9 +19,18 @@ use tracedecay_domain::{ use tracedecay_global_db::tests::harness::{HostAdmissionTestRuntimeV1, writer_telemetry}; use tracedecay_privacy::{ObservationRecordParseErrorV1, parse_normalized_observation_record_v1}; use tracedecay_runtime_core::background_cpu::ProcessBackgroundCpuV1; +use tracedecay_runtime_core::db::engine::params; +use tracedecay_runtime_core::resident_memory::{ + DEFAULT_PROCESS_RESIDENT_MEMORY_LIMIT_V1, ProcessResidentMemoryV1, +}; use tracedecay_sessions::admission::{HostAdmission, HostAdmissionScope}; +use tracedecay_sessions::runtime::hosts::codex::{ + CodexDiscoveryHub, codex_observation_source_v2, + try_admit_codex_jsonl_observations_for_profile_with_admission, +}; use tracedecay_store::{ - AnchoredObservationWrite, ObservationPersistOutcome, ObservationWrite, + AnchoredObservationWrite, ObservationCoverageReason, ObservationCursorAdvance, + ObservationPersistOutcome, ObservationReplayRequest, ObservationWrite, build_observation_resolution_authorization_v1, build_observation_retrieval_anchor, runtime::DEFAULT_MAX_READERS_PER_HOT_SHARD, }; @@ -183,6 +193,408 @@ async fn empty_capture_batch_opens_no_writer_transaction() { assert_eq!(committed_transactions(database), before); } +#[asupersync::test] +async fn exact_parse_offset_replacement_keeps_an_unordered_fingerprint_and_foreign_winner() { + let tmp = TempDir::new().unwrap(); + let runtime = HostAdmissionTestRuntimeV1::profile(tmp.path()) + .await + .unwrap(); + let (facade, _) = profile_facade(&runtime); + let scope = ObservationScopeV1::Profile; + let key = "host-frontier://claude/refused"; + let first = ParseOffset { + byte_offset: 100, + mtime: 900, + file_id: 7, + }; + let later = ParseOffset { + byte_offset: 200, + mtime: 100, + file_id: 7, + }; + HostAdmission::replace_parse_offset(&facade, &scope, key, ParseOffset::default(), first) + .await + .unwrap(); + HostAdmission::replace_parse_offset(&facade, &scope, key, first, later) + .await + .unwrap(); + assert_eq!( + HostAdmission::get_parse_offset(&facade, &scope, key) + .await + .unwrap(), + Some(later) + ); + let stale = HostAdmission::replace_parse_offset(&facade, &scope, key, first, first) + .await + .unwrap_err(); + assert_eq!(stale.reason_code, Some("parse_offset_conflict")); + assert_eq!( + HostAdmission::get_parse_offset(&facade, &scope, key) + .await + .unwrap(), + Some(later) + ); + let foreign = ParseOffset { + byte_offset: 50, + mtime: u64::MAX, + file_id: 8, + }; + HostAdmission::replace_parse_offset(&facade, &scope, key, later, foreign) + .await + .unwrap(); + assert_eq!( + HostAdmission::replace_parse_offset(&facade, &scope, key, later, first) + .await + .unwrap_err() + .reason_code, + Some("parse_offset_conflict") + ); + assert_eq!( + HostAdmission::get_parse_offset(&facade, &scope, key) + .await + .unwrap(), + Some(foreign) + ); +} + +#[asupersync::test] +async fn jsonl_capture_resumes_after_durable_scope_coverage_through_a_fresh_facade() { + let tmp = TempDir::new().unwrap(); + let workspace = tmp.path().join("workspace"); + let registered = tmp.path().join("registered"); + std::fs::create_dir_all(&workspace).unwrap(); + std::fs::create_dir_all(®istered).unwrap(); + let path = tmp.path().join("rollout.jsonl"); + let session = "session.host-admission.jsonl-coverage"; + let lines = [ + json!({"timestamp": "2026-01-01T00:00:00Z", "type": "session_meta", + "payload": {"id": session, "cwd": workspace}}), + json!({"timestamp": "2026-01-01T00:00:01Z", "type": "turn_context", + "payload": {"cwd": registered}}), + json!({"timestamp": "2026-01-01T00:00:02Z", "type": "event_msg", + "payload": {"type": "user_message", "message": "project-owned message"}}), + ]; + let contents = lines + .iter() + .map(ToString::to_string) + .collect::>() + .join("\n") + + "\n"; + std::fs::write(&path, &contents).unwrap(); + CodexDiscoveryHub::default() + .configure_preparation_resources( + Arc::new(ProcessResidentMemoryV1::new( + DEFAULT_PROCESS_RESIDENT_MEMORY_LIMIT_V1, + )), + background_cpu_for_host_admission_test(), + ) + .unwrap(); + let runtime = HostAdmissionTestRuntimeV1::profile(tmp.path().join("profile")) + .await + .unwrap(); + let (facade, database) = profile_facade(&runtime); + let roots = [registered]; + let first = try_admit_codex_jsonl_observations_for_profile_with_admission( + &path, None, &roots, &facade, None, + ) + .await + .unwrap(); + assert_eq!(first.frames_persisted, 1); + assert_eq!(first.frames_skipped, 2); + let source = codex_observation_source_v2(session).unwrap(); + let scope = ObservationScopeV1::Profile; + let covered = HostAdmission::get_source_cursor(&facade, &source, &scope) + .await + .unwrap() + .unwrap(); + assert_eq!(covered.position(), contents.len() as u64); + assert!(covered.resume_fingerprint().is_some()); + let store = database.observation_store(); + assert_eq!( + store + .replay_observations(ObservationReplayRequest::new(0, 10).unwrap()) + .await + .unwrap() + .len(), + 1 + ); + drop(facade); + let (fresh, _) = profile_facade(&runtime); + let settled = try_admit_codex_jsonl_observations_for_profile_with_admission( + &path, None, &roots, &fresh, None, + ) + .await + .unwrap(); + assert_eq!(settled.bytes_consumed, 0); + assert_eq!( + HostAdmission::get_source_cursor(&fresh, &source, &scope) + .await + .unwrap(), + Some(covered) + ); + let appended = [ + json!({"timestamp": "2026-01-01T00:00:03Z", "type": "turn_context", + "payload": {"cwd": workspace}}), + json!({"timestamp": "2026-01-01T00:00:04Z", "type": "event_msg", + "payload": {"type": "user_message", "message": "profile-owned later message"}}), + ] + .iter() + .map(ToString::to_string) + .collect::>() + .join("\n") + + "\n"; + std::fs::OpenOptions::new() + .append(true) + .open(&path) + .unwrap() + .write_all(appended.as_bytes()) + .unwrap(); + let resumed = try_admit_codex_jsonl_observations_for_profile_with_admission( + &path, None, &roots, &fresh, None, + ) + .await + .unwrap(); + assert_eq!(resumed.frames_persisted, 2); + assert_eq!(resumed.bytes_consumed, appended.len() as u64); + assert_eq!( + HostAdmission::get_source_cursor(&fresh, &source, &scope) + .await + .unwrap() + .unwrap() + .position(), + (contents.len() + appended.len()) as u64 + ); + assert_eq!( + store + .replay_observations(ObservationReplayRequest::new(0, 10).unwrap()) + .await + .unwrap() + .len(), + 3 + ); + let mut previous = HostAdmission::get_source_cursor(&fresh, &source, &scope) + .await + .unwrap() + .unwrap(); + let mut saw_lower_fingerprint = false; + for ordinal in 0..16 { + let line = format!( + "{}\n", + json!({"timestamp": "2026-01-01T00:00:05Z", "type": "event_msg", + "payload": {"type": "user_message", "message": format!("append {ordinal}")}}) + ); + std::fs::OpenOptions::new() + .append(true) + .open(&path) + .unwrap() + .write_all(line.as_bytes()) + .unwrap(); + let pass = try_admit_codex_jsonl_observations_for_profile_with_admission( + &path, None, &roots, &fresh, None, + ) + .await + .unwrap(); + assert_eq!(pass.frames_persisted, 1); + let current = HostAdmission::get_source_cursor(&fresh, &source, &scope) + .await + .unwrap() + .unwrap(); + assert_eq!(current.position(), previous.position() + line.len() as u64); + assert_eq!(current.generation(), previous.generation()); + if current.resume_fingerprint().unwrap() < previous.resume_fingerprint().unwrap() { + saw_lower_fingerprint = true; + break; + } + previous = current; + } + assert!( + saw_lower_fingerprint, + "the actual byte-frontier must commit even when its prefix fingerprint decreases" + ); +} + +#[asupersync::test] +async fn refused_record_coverage_conflict_cannot_authorize_a_later_capture() { + let tmp = TempDir::new().unwrap(); + let runtime = HostAdmissionTestRuntimeV1::profile(tmp.path()) + .await + .unwrap(); + let (facade, database) = profile_facade(&runtime); + let session = SessionId::new("session.host-admission.coverage-conflict").unwrap(); + let mut requests = sequential_capture_requests(&session, 3); + let first = requests.remove(0); + let source = first.identity().source().clone(); + let scope = first.scope().clone(); + let generation = first.identity().generation(); + let original = HostAdmission::capture_observation(&facade, first) + .await + .unwrap(); + let original_id = match original { + CaptureObservationOutcome::Persisted { outcome, .. } + | CaptureObservationOutcome::AcceptedForReplay { outcome, .. } => { + outcome.receipt().observation().observation_id().clone() + } + other => panic!("first record must persist: {other:?}"), + }; + let before = HostAdmission::get_source_cursor(&facade, &source, &scope) + .await + .unwrap(); + let refused_range = requests.remove(0).identity().position(); + let later = requests.remove(0); + let advance = ObservationCursorAdvance::for_ordering( + source.clone(), + scope.clone(), + generation, + ObservationOrderingDomainV1::FileBytes, + before.clone(), + refused_range, + ObservationCoverageReason::AdmissionRefused, + ) + .unwrap(); + let source_json = serde_json::to_string(&source).unwrap(); + let scope_json = serde_json::to_string(&scope).unwrap(); + let coverage_json = serde_json::to_string(&advance.coverage()).unwrap(); + let transaction = database.begin_write_transaction().await.unwrap(); + transaction + .execute( + "INSERT INTO source_cursor_advances + (source_json, scope_json, coverage_json, reason, receipt_id) + VALUES (?1, ?2, ?3, 'blank_frame', NULL)", + params![ + source_json.as_str(), + scope_json.as_str(), + coverage_json.as_str() + ], + ) + .await + .unwrap(); + transaction.commit().await.unwrap(); + + let failed = facade + .advance_non_durable_source_cursor(advance.clone(), ObservationCancellation::default()) + .await + .unwrap_err(); + assert_eq!( + failed.reason_code, + Some("observation_cursor_advance_ledger_disagreement") + ); + assert!(!failed.retryable); + assert_eq!( + HostAdmission::get_source_cursor(&facade, &source, &scope) + .await + .unwrap(), + before + ); + let later_error = HostAdmission::capture_observation(&facade, later) + .await + .unwrap_err(); + assert_eq!(later_error.reason_code, Some("cursor_conflict")); + let store = database.observation_store(); + let retained = store.get_observation(&original_id).await.unwrap().unwrap(); + assert_eq!( + store + .replay_observations(ObservationReplayRequest::new(0, 10).unwrap()) + .await + .unwrap() + .len(), + 1 + ); + let snapshot = database.read_snapshot().await.unwrap(); + let mut rows = snapshot + .query( + "SELECT reason FROM source_cursor_advances + WHERE source_json = ?1 AND scope_json = ?2 AND coverage_json = ?3", + params![ + source_json.as_str(), + scope_json.as_str(), + coverage_json.as_str() + ], + ) + .await + .unwrap(); + assert_eq!( + rows.next() + .await + .unwrap() + .unwrap() + .get::(0) + .unwrap(), + "blank_frame" + ); + drop(rows); + drop(snapshot); + + let transaction = database.begin_write_transaction().await.unwrap(); + let mut rows = transaction + .query( + "SELECT sql FROM sqlite_master + WHERE type = 'trigger' AND name = 'source_cursor_advances_immutable_delete_v1'", + (), + ) + .await + .unwrap(); + let delete_guard = rows + .next() + .await + .unwrap() + .unwrap() + .get::(0) + .unwrap(); + drop(rows); + transaction + .execute_batch("DROP TRIGGER source_cursor_advances_immutable_delete_v1") + .await + .unwrap(); + transaction + .execute( + "DELETE FROM source_cursor_advances + WHERE source_json = ?1 AND scope_json = ?2 AND coverage_json = ?3", + params![ + source_json.as_str(), + scope_json.as_str(), + coverage_json.as_str() + ], + ) + .await + .unwrap(); + transaction.execute_batch(&delete_guard).await.unwrap(); + transaction.commit().await.unwrap(); + facade + .advance_non_durable_source_cursor(advance, ObservationCancellation::default()) + .await + .unwrap(); + let last = sequential_capture_requests(&session, 3).remove(2); + let end = last.identity().position().end(); + let captured = HostAdmission::capture_observation(&facade, last) + .await + .unwrap(); + assert!(matches!( + captured, + CaptureObservationOutcome::Persisted { .. } + | CaptureObservationOutcome::AcceptedForReplay { .. } + )); + assert_eq!( + HostAdmission::get_source_cursor(&facade, &source, &scope) + .await + .unwrap() + .unwrap() + .position(), + end + ); + assert_eq!( + store + .replay_observations(ObservationReplayRequest::new(0, 10).unwrap()) + .await + .unwrap() + .len(), + 2 + ); + assert_eq!( + store.get_observation(&original_id).await.unwrap().unwrap(), + retained + ); +} + #[asupersync::test] async fn provider_capture_reads_a_cursor_direct_host_admission_refuses() { let tmp = TempDir::new().unwrap(); diff --git a/crates/tracedecay-lsp/src/analyzer/broker.rs b/crates/tracedecay-lsp/src/analyzer/broker.rs index f998238077..21b5c94b03 100644 --- a/crates/tracedecay-lsp/src/analyzer/broker.rs +++ b/crates/tracedecay-lsp/src/analyzer/broker.rs @@ -10,7 +10,7 @@ use super::activity::{adapter_workspace_root_from_canonical_root, canonicalize_p use super::adapters::{LspAdapterDefinition, LspInstallOption}; use super::client::{ DiagnosticCoverage, DiagnosticDocumentCoverage, DiagnosticRootCoverage, LspDocument, - LspRefreshTimeouts, file_uri, + LspRefreshTimeouts, document_identity, file_uri, }; use super::error::{AnalyzerResult as Result, AnalyzerRuntimeError as TraceDecayError}; pub use super::launch::command_available; @@ -201,6 +201,44 @@ pub enum RefreshCommitOutcome { Superseded, } +#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)] +pub enum DiagnosticEvidenceUnavailable { + #[error("diagnostic document identity is invalid")] + DocumentIdentityInvalid, + #[error("diagnostic source is unavailable")] + SourceUnavailable, + #[error("diagnostic publication is not committed")] + PublicationUncommitted, + #[error("diagnostic document content changed")] + ContentChanged, + #[error("diagnostic overlay admission is stale")] + OverlayStale, + #[error("diagnostic analyzer incarnation is retired")] + IncarnationRetired, + #[error("diagnostic document metadata is unavailable")] + MetadataUnavailable, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +pub enum DiagnosticNonparticipation { + Disabled, + Inactive, +} + +pub enum BrokerDocumentEvidence { + Published { + settings: CodeDiagnosticsSettings, + settings_unavailable: Option, + coverage: DiagnosticDocumentCoverage, + diagnostics: Vec, + }, + NotParticipating { + settings: CodeDiagnosticsSettings, + settings_unavailable: Option, + reason: DiagnosticNonparticipation, + }, +} + #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] struct LspSessionKey { language: String, @@ -378,7 +416,7 @@ impl DiagnosticBroker { pub fn update_adapters(&mut self, adapters: Vec) { self.adapters = adapters; - self.clients.clear(); + self.remove_all_clients(); self.clear_launches(); } @@ -482,9 +520,43 @@ impl DiagnosticBroker { language: &str, documents: Vec, ) -> Result> { - // A new attempt supersedes the previous scope's publication evidence, - // including when preparation fails before any analyzer can run. + let epoch = self.next_refresh_epoch(language); self.coverage.remove(language); + let paths = documents + .iter() + .map(|document| { + let path = self.project_root.join(&document.relative_path); + let uri = document + .snapshot + .as_ref() + .map_or_else(|| file_uri(&path), |snapshot| snapshot.uri.clone()); + document_identity(&path, &uri) + }) + .collect::>>(); + let mut invalidation_failure = None; + for (key, client) in &self.clients { + if key.language == language + && let Err(error) = client.documents.invalidate(paths.as_deref(), epoch) + { + invalidation_failure = Some(error); + } + } + if let Some(error) = invalidation_failure { + return Err(TraceDecayError::new(error.to_string())); + } + if paths.is_none() { + return Err(TraceDecayError::new( + DiagnosticEvidenceUnavailable::DocumentIdentityInvalid.to_string(), + )); + } + if documents + .iter() + .any(|document| document.language != language) + { + return Err(TraceDecayError::new( + "diagnostic document language does not match the refresh scope", + )); + } if !self.settings.language_enabled(language) { self.engine_overrides .insert(language.to_string(), EngineState::Disabled); @@ -560,7 +632,6 @@ impl DiagnosticBroker { } self.engine_overrides .insert(language.to_string(), EngineState::Refreshing); - let epoch = self.next_refresh_epoch(language); let reservation = self .refresh_capacity .reserve(resolved_roots.len()) @@ -589,14 +660,34 @@ impl DiagnosticBroker { SharedAnalyzerClient::new(AdmittedRoot::new(file_uri(&workspace_root))) }) .clone(); - RefreshBatch { + let claims = documents + .iter() + .map(|document| { + let path = canonical_project_root.join(&document.relative_path); + let uri = document + .snapshot + .as_ref() + .map_or_else(|| file_uri(&path), |snapshot| snapshot.uri.clone()); + let identity = document_identity(&path, &uri).ok_or_else(|| { + TraceDecayError::new( + DiagnosticEvidenceUnavailable::DocumentIdentityInvalid.to_string(), + ) + })?; + client + .documents + .claim(identity, epoch) + .map_err(|error| TraceDecayError::new(error.to_string())) + }) + .collect::>>()?; + Ok(RefreshBatch { workspace_root, launch, documents, client, - } + claims, + }) }) - .collect(); + .collect::>>()?; Ok(Some(PreparedRefresh::new( language.to_string(), canonical_project_root, @@ -717,19 +808,49 @@ impl DiagnosticBroker { self.clear_language(&language); return Ok(RefreshCommitOutcome::Superseded); } - if !self.command_matches_current_settings(&language, &completed.command) { + if !self.project_languages.contains(&language) + || !self.command_matches_current_settings(&language, &completed.command) + || completed.sources.iter().any(|(key, source)| { + !self + .clients + .get(key) + .is_some_and(|current| Arc::ptr_eq(current, source)) + }) + { return Ok(RefreshCommitOutcome::Superseded); } match completed.result { Ok(mut refresh) => { + let mut committed = BTreeSet::new(); + let mut findings = Vec::new(); + for publication in &completed.publications { + let file = publication.relative_path(); + match publication.commit(|accepted| { + findings.extend(accepted.diagnostics.iter().cloned()); + }) { + Ok(()) => { + committed.insert(file.to_owned()); + } + Err(error) => { + tracing::debug!(%error, file, "diagnostic publication lost commit eligibility"); + refresh.coverage.documents.insert( + file.to_owned(), + DiagnosticDocumentCoverage::StalePublication, + ); + } + } + } + for (file, coverage) in &mut refresh.coverage.documents { + if matches!(coverage, DiagnosticDocumentCoverage::Published { .. }) + && !committed.contains(file) + { + *coverage = DiagnosticDocumentCoverage::StalePublication; + } + } self.diagnostics.retain(|diagnostic| { - diagnostic.language != language - || !matches!( - refresh.coverage.documents.get(&diagnostic.file), - Some(DiagnosticDocumentCoverage::Published { .. }) - ) + diagnostic.language != language || !committed.contains(&diagnostic.file) }); - self.diagnostics.append(&mut refresh.diagnostics); + self.diagnostics.append(&mut findings); // Replace the scope instead of accumulating a historical document // map. Unrequested retained findings must not inherit fresh coverage. self.coverage @@ -813,7 +934,7 @@ impl DiagnosticBroker { // These settings were just persisted, so whatever the broker could not // read at mount time is no longer what it is serving. self.settings_unavailable = None; - self.clients.clear(); + self.remove_all_clients(); self.coverage.clear(); self.clear_launches(); self.launch_refusals.clear(); @@ -832,6 +953,77 @@ impl DiagnosticBroker { } } + pub fn document_diagnostic_evidence( + &self, + document: &LspDocument, + ) -> std::result::Result { + let reason = if !self.settings.language_enabled(&document.language) { + Some(DiagnosticNonparticipation::Disabled) + } else if !self.project_languages.contains(&document.language) { + Some(DiagnosticNonparticipation::Inactive) + } else { + None + }; + if let Some(reason) = reason { + return Ok(BrokerDocumentEvidence::NotParticipating { + settings: self.settings.clone(), + settings_unavailable: self.settings_unavailable.clone(), + reason, + }); + } + let adapter = self + .adapters + .iter() + .find(|adapter| adapter.language == document.language) + .ok_or(DiagnosticEvidenceUnavailable::SourceUnavailable)?; + let root = canonicalize_project_root(&self.project_root) + .map_err(|_| DiagnosticEvidenceUnavailable::DocumentIdentityInvalid)?; + let path = root.join(&document.relative_path); + let uri = document + .snapshot + .as_ref() + .map_or_else(|| file_uri(&path), |snapshot| snapshot.uri.clone()); + let identity = document_identity(&path, &uri) + .ok_or(DiagnosticEvidenceUnavailable::DocumentIdentityInvalid)?; + let workspace_root = match adapter_workspace_root_from_canonical_root( + &root, + adapter, + &document.relative_path, + ) { + Some(workspace_root) => workspace_root, + None => root, + }; + let key = LspSessionKey { + language: document.language.clone(), + command: self + .settings + .command_for(&document.language, &adapter.command), + workspace_root, + }; + let client = self + .clients + .get(&key) + .ok_or(DiagnosticEvidenceUnavailable::SourceUnavailable)?; + client + .documents + .read_committed(&identity, &uri, document, |coverage| { + BrokerDocumentEvidence::Published { + settings: self.settings.clone(), + settings_unavailable: self.settings_unavailable.clone(), + coverage: coverage.clone(), + diagnostics: self + .diagnostics + .iter() + .filter(|finding| { + finding.language == document.language + && finding.file == document.relative_path + }) + .cloned() + .collect(), + } + }) + } + pub fn cache_diagnostic(&mut self, diagnostic: CodeDiagnostic) { self.diagnostics.push(diagnostic); } @@ -918,9 +1110,25 @@ impl DiagnosticBroker { self.coverage.remove(language); } + fn remove_all_clients(&mut self) { + for epoch in self.refresh_epochs.values_mut() { + *epoch = epoch.saturating_add(1); + } + for client in self.clients.values() { + client.documents.retire(None); + } + self.clients.clear(); + } + fn remove_language_clients(&mut self, language: &str) { - self.clients - .retain(|key, _| key.language.as_str() != language); + self.clients.retain(|key, client| { + if key.language == language { + client.documents.retire(None); + false + } else { + true + } + }); } fn next_refresh_epoch(&mut self, language: &str) -> u64 { diff --git a/crates/tracedecay-lsp/src/analyzer/broker/refresh.rs b/crates/tracedecay-lsp/src/analyzer/broker/refresh.rs index 0c82e0087a..c8445c1342 100644 --- a/crates/tracedecay-lsp/src/analyzer/broker/refresh.rs +++ b/crates/tracedecay-lsp/src/analyzer/broker/refresh.rs @@ -10,13 +10,14 @@ use tokio::sync::{OwnedSemaphorePermit, Semaphore}; use tracedecay_runtime_core::native_runtime; use super::super::client::{ - DiagnosticDocumentCoverage, DiagnosticRefreshResult, DiagnosticRootCoverage, LspDocument, - LspRefreshError, LspRefreshTimeouts, StdioLspClientStartup, + CollectedDocumentPublication, DiagnosticDocumentCoverage, DiagnosticRefreshResult, + DiagnosticRootCoverage, DocumentRefreshClaim, LspDocument, LspRefreshError, LspRefreshTimeouts, + StdioLspClientStartup, }; use super::super::error::AnalyzerRuntimeError as TraceDecayError; use super::super::launch::AnalyzerLaunch; -use super::EngineState; use super::shared_client::{AnalyzerClientUse, SharedAnalyzerClient}; +use super::{EngineState, LspSessionKey}; use crate::AnalyzerEvent; pub(crate) struct RefreshBatch { @@ -27,6 +28,7 @@ pub(crate) struct RefreshBatch { pub(crate) launch: AnalyzerLaunch, pub(crate) documents: Vec, pub(crate) client: Arc, + pub(crate) claims: Vec, } /// Each analyzer may wait behind at most this many independent workspace-root @@ -112,6 +114,8 @@ pub struct CompletedRefresh { pub(crate) epoch: u64, pub(crate) result: std::result::Result, pub(crate) root_failures: BTreeMap, + pub(super) sources: Vec<(LspSessionKey, Arc)>, + pub(crate) publications: Vec, } impl CompletedRefresh { @@ -171,10 +175,24 @@ impl PreparedRefresh { let language = self.language.clone(); let command = self.spawn.command.clone(); let epoch = self.epoch; + let sources = self + .batches + .iter() + .map(|batch| { + ( + LspSessionKey { + language: language.clone(), + command: command.clone(), + workspace_root: batch.workspace_root.clone(), + }, + Arc::clone(&batch.client), + ) + }) + .collect(); let collected = self.collect(timeouts).await; - let (result, root_failures) = match collected { - Ok((result, failures)) => (Ok(result), failures), - Err(error) => (Err(error), BTreeMap::new()), + let (result, root_failures, publications) = match collected { + Ok((result, failures, publications)) => (Ok(result), failures, publications), + Err(error) => (Err(error), BTreeMap::new(), Vec::new()), }; CompletedRefresh { language, @@ -182,6 +200,8 @@ impl PreparedRefresh { epoch, result, root_failures, + sources, + publications, } } @@ -189,7 +209,11 @@ impl PreparedRefresh { self, timeouts: LspRefreshTimeouts, ) -> std::result::Result< - (DiagnosticRefreshResult, BTreeMap), + ( + DiagnosticRefreshResult, + BTreeMap, + Vec, + ), RefreshFailure, > { // Batches run concurrently inside this future rather than as spawned @@ -237,9 +261,11 @@ impl PreparedRefresh { completed.sort_by_key(|(ordinal, _, _, _)| *ordinal); let mut refresh = DiagnosticRefreshResult::default(); let mut failures = BTreeMap::new(); + let mut publications = Vec::new(); for (_, workspace_root, documents, result) in completed { match result { - Ok(Ok((_, batch))) => { + Ok(Ok((_, batch, accepted))) => { + publications.extend(accepted); refresh.diagnostics.extend(batch.diagnostics); refresh.coverage.documents.extend(batch.coverage.documents); refresh @@ -278,7 +304,7 @@ impl PreparedRefresh { } } } - Ok((refresh, failures)) + Ok((refresh, failures, publications)) } } @@ -290,7 +316,14 @@ async fn collect_refresh_batch( spawn: AnalyzerSpawn, timeouts: LspRefreshTimeouts, _run_permit: OwnedSemaphorePermit, -) -> std::result::Result<(usize, DiagnosticRefreshResult), RefreshFailure> { +) -> std::result::Result< + ( + usize, + DiagnosticRefreshResult, + Vec, + ), + RefreshFailure, +> { let AnalyzerSpawn { command, args } = spawn; let launch = batch.launch; let shared = batch.client; @@ -311,8 +344,14 @@ async fn collect_refresh_batch( ))); }; let mut use_of_analyzer = AnalyzerClientUse::new(&shared, client_slot, attempt, None); - let startup = - StdioLspClientStartup::start(launch, args, batch.workspace_root.clone(), timeouts); + let startup = StdioLspClientStartup::start( + launch, + args, + batch.workspace_root.clone(), + timeouts, + Arc::clone(&shared.documents), + attempt, + ); match startup { Ok(startup) => use_of_analyzer.start(startup), Err(error) => { @@ -359,7 +398,7 @@ async fn collect_refresh_batch( let result = match use_of_analyzer.client.as_mut() { Some(client) => { client - .collect_document_diagnostics(&project_root, batch.documents, timeouts) + .collect_claimed_diagnostics(&project_root, batch.documents, timeouts, batch.claims) .await } None => Err(LspRefreshError::Transport { @@ -367,9 +406,9 @@ async fn collect_refresh_batch( }), }; match result { - Ok(diagnostics) => { + Ok((diagnostics, publications)) => { use_of_analyzer.restore(AnalyzerEvent::Ready); - Ok((ordinal, diagnostics)) + Ok((ordinal, diagnostics, publications)) } Err(error) => { let failure = RefreshFailure::client(&error); diff --git a/crates/tracedecay-lsp/src/analyzer/broker/semantic_authority.rs b/crates/tracedecay-lsp/src/analyzer/broker/semantic_authority.rs index cdfedd5780..91886760fb 100644 --- a/crates/tracedecay-lsp/src/analyzer/broker/semantic_authority.rs +++ b/crates/tracedecay-lsp/src/analyzer/broker/semantic_authority.rs @@ -150,6 +150,8 @@ impl StdioLspSemanticAuthority { self.inner.args.clone(), self.inner.project_root.clone(), self.inner.timeouts, + Arc::clone(&self.inner.shared.documents), + attempt, ); match startup { Ok(startup) => usage.start(startup), @@ -313,6 +315,8 @@ impl LspSemanticRequestAuthority for StdioLspSemanticAuthority { inner.args.clone(), inner.project_root.clone(), timeouts, + Arc::clone(&inner.shared.documents), + attempt, ) { Ok(startup) => startup, Err(error) => { diff --git a/crates/tracedecay-lsp/src/analyzer/broker/shared_client.rs b/crates/tracedecay-lsp/src/analyzer/broker/shared_client.rs index a1f73cbed6..07498a9339 100644 --- a/crates/tracedecay-lsp/src/analyzer/broker/shared_client.rs +++ b/crates/tracedecay-lsp/src/analyzer/broker/shared_client.rs @@ -14,7 +14,7 @@ use std::sync::{Arc, Mutex as SyncMutex}; use tokio::sync::{Mutex, MutexGuard}; use super::super::client::{ - StdioLspClient, StdioLspClientStartup, StdioLspClientStartupSettlement, + AnalyzerDocuments, StdioLspClient, StdioLspClientStartup, StdioLspClientStartupSettlement, }; use super::super::error::{AnalyzerResult, AnalyzerRuntimeError}; use crate::{AdmittedRoot, AnalyzerEvent, AnalyzerState, AnalyzerSupervisor}; @@ -120,6 +120,7 @@ impl SharedAnalyzerClientSlot { pub(crate) struct SharedAnalyzerClient { client: Mutex, supervisor: SyncMutex, + pub(crate) documents: Arc, } impl SharedAnalyzerClient { @@ -127,6 +128,7 @@ impl SharedAnalyzerClient { Arc::new(Self { client: Mutex::new(SharedAnalyzerClientSlot::new()), supervisor: SyncMutex::new(AnalyzerSupervisor::new(root)), + documents: AnalyzerDocuments::new(), }) } @@ -310,6 +312,7 @@ impl<'a> AnalyzerClientUse<'a> { } pub(crate) fn retire(mut self, event: AnalyzerEvent) { + self.shared.documents.retire(Some(self.attempt)); self.concluded = true; self.shared.record(self.attempt, event); } @@ -319,6 +322,7 @@ impl Drop for AnalyzerClientUse<'_> { fn drop(&mut self) { self.client_slot.cancel_startup(); if !self.concluded { + self.shared.documents.retire(Some(self.attempt)); self.shared.record(self.attempt, AnalyzerEvent::Retired); } if let Some(client) = self.client.take() { diff --git a/crates/tracedecay-lsp/src/analyzer/broker/tests.rs b/crates/tracedecay-lsp/src/analyzer/broker/tests.rs index e52443322d..d91debbb36 100644 --- a/crates/tracedecay-lsp/src/analyzer/broker/tests.rs +++ b/crates/tracedecay-lsp/src/analyzer/broker/tests.rs @@ -814,6 +814,8 @@ fn superseded_refresh_cannot_supply_a_snapshot_to_its_caller() { epoch, result: Ok(crate::analyzer::client::DiagnosticRefreshResult::default()), root_failures: BTreeMap::new(), + sources: Vec::new(), + publications: Vec::new(), }; assert!(matches!( @@ -825,84 +827,3 @@ fn superseded_refresh_cannot_supply_a_snapshot_to_its_caller() { Ok(RefreshCommitOutcome::Superseded) )); } - -#[test] -fn partial_root_refresh_replaces_only_published_document_diagnostics() { - let mut broker = DiagnosticBroker::new_for_test( - "/project", - vec![adapter("fake", "fake-ls", "fake", "workspace.marker")], - ); - broker.refresh_epochs.insert("fake".to_owned(), 1); - broker.diagnostics = vec![ - code_diagnostic("src/a.fake", "old a"), - code_diagnostic("member/src/b.fake", "old b"), - ]; - let root = PathBuf::from("/project/member"); - let failure = super::refresh::RefreshFailure::crashed_message("member exited".to_owned()); - let completed = CompletedRefresh { - language: "fake".to_owned(), - command: "fake-ls".to_owned(), - epoch: 1, - result: Ok(crate::analyzer::client::DiagnosticRefreshResult { - diagnostics: vec![code_diagnostic("src/a.fake", "new a")], - coverage: crate::analyzer::client::DiagnosticCoverage { - documents: BTreeMap::from([ - ( - "src/a.fake".to_owned(), - DiagnosticDocumentCoverage::Published { - version_verified: true, - content_digest: tracedecay_domain::ContentDigest::of_bytes(b"new a"), - }, - ), - ( - "member/src/b.fake".to_owned(), - DiagnosticDocumentCoverage::RootFailed, - ), - ]), - roots: BTreeMap::from([ - ( - PathBuf::from("/project"), - crate::analyzer::client::DiagnosticRootCoverage::Completed, - ), - ( - root.clone(), - crate::analyzer::client::DiagnosticRootCoverage::Failed, - ), - ]), - }, - }), - root_failures: BTreeMap::from([(root, failure)]), - }; - - assert!( - broker.finish_refresh_snapshot(completed).is_err(), - "the caller must see that one root was incomplete" - ); - let diagnostics = broker.snapshot().diagnostics; - assert_eq!(diagnostics.len(), 2); - assert!( - diagnostics - .iter() - .any(|diagnostic| diagnostic.file == "src/a.fake" && diagnostic.message == "new a") - ); - assert!(diagnostics.iter().any(|diagnostic| { - diagnostic.file == "member/src/b.fake" && diagnostic.message == "old b" - })); -} - -fn code_diagnostic(file: &str, message: &str) -> CodeDiagnostic { - CodeDiagnostic { - language: "fake".to_owned(), - source: "fake-ls".to_owned(), - file: file.to_owned(), - line_start: 0, - line_end: 0, - character_start: None, - character_end: None, - severity: DiagnosticSeverity::Error, - code: None, - message: message.to_owned(), - enclosing_node: None, - updated_at: 0, - } -} diff --git a/crates/tracedecay-lsp/src/analyzer/client.rs b/crates/tracedecay-lsp/src/analyzer/client.rs index 168a8819fb..7a1e47cdff 100644 --- a/crates/tracedecay-lsp/src/analyzer/client.rs +++ b/crates/tracedecay-lsp/src/analyzer/client.rs @@ -27,9 +27,9 @@ use tracedecay_daemon_protocol::{ConnectionLocalRequestSequence, FramePoll}; use tracedecay_domain::ContentDigest; use tracedecay_runtime_core::native_runtime; use tracedecay_runtime_core::native_runtime::{NativeTask, NativeTaskOutcome}; -use tracedecay_runtime_core::path_safety::{canonicalize_existing_prefix, plain_host_path}; +use tracedecay_runtime_core::path_safety::plain_host_path; -use super::broker::{CodeDiagnostic, DiagnosticSeverity}; +use super::broker::{CodeDiagnostic, DiagnosticEvidenceUnavailable, DiagnosticSeverity}; use super::error::{ AnalyzerCancellation as CancellationToken, AnalyzerResult as Result, AnalyzerRuntimeError as TraceDecayError, @@ -39,6 +39,12 @@ use super::process::AnalyzerProcess; use crate::{AnalyzerEvent, AsyncContentLengthError, UpstreamCapabilities}; +mod documents; +use documents::{AcceptedDiagnosticPublication, PublicationEligibility, SynchronizedDocument}; +pub(crate) use documents::{ + AnalyzerDocuments, CollectedDocumentPublication, DocumentRefreshClaim, document_identity, +}; + const MIN_MESSAGE_IO_TIMEOUT: Duration = Duration::from_secs(2); const MIN_INITIALIZE_RESPONSE_TIMEOUT: Duration = Duration::from_secs(3); @@ -383,19 +389,12 @@ pub async fn collect_document_diagnostics_with_timeouts( .map_err(TraceDecayError::from) } -struct SynchronizedDocument { - uri: String, - wire_version: i32, - text: String, - snapshot: Option, - diagnostics: Option<(Vec, DiagnosticDocumentCoverage)>, -} - pub struct StdioLspClient { command: String, workspace_root: PathBuf, upstream_capabilities: UpstreamCapabilities, - documents: BTreeMap, + documents: Arc, + attempt: u32, next_request_id: ConnectionLocalRequestSequence, /// Killed and reaped when the client drops. process: AnalyzerProcess, @@ -426,7 +425,12 @@ impl StdioLspClientStartup { args: Vec, project_root: PathBuf, timeouts: LspRefreshTimeouts, + documents: Arc, + attempt: u32, ) -> Result { + documents + .activate(attempt) + .map_err(|error| TraceDecayError::new(error.to_string()))?; let cancellation = CancellationToken::new(); let startup_cancellation = cancellation.clone(); let result = Arc::new(Mutex::new(None)); @@ -438,6 +442,8 @@ impl StdioLspClientStartup { &project_root, timeouts, &startup_cancellation, + documents, + attempt, ) .await; { @@ -567,12 +573,18 @@ impl StdioLspClient { timeouts: LspRefreshTimeouts, ) -> Result { let cancellation = CancellationToken::new(); + let documents = AnalyzerDocuments::new(); + documents + .activate(0) + .map_err(|error| TraceDecayError::new(error.to_string()))?; match Self::start_with_launch_until_cancelled( launch, args, project_root, timeouts, &cancellation, + documents, + 0, ) .await { @@ -591,6 +603,8 @@ impl StdioLspClient { project_root: &Path, timeouts: LspRefreshTimeouts, cancellation: &CancellationToken, + documents: Arc, + attempt: u32, ) -> StdioLspClientStartupSettlement { let timeouts = timeouts.with_deadline(timeouts.operation_deadline()); let deadline = timeouts.operation_deadline(); @@ -721,7 +735,8 @@ impl StdioLspClient { upstream_capabilities: UpstreamCapabilities::from_initialize_response( &initialize_response, ), - documents: BTreeMap::new(), + documents, + attempt, next_request_id: ConnectionLocalRequestSequence::starting_at(2), process, }) @@ -795,7 +810,12 @@ impl StdioLspClient { class: "admitted semantic document snapshot is invalid".to_owned(), }); } - if self.snapshot_is_stale(&identity, snapshot) { + if self + .snapshot_is_stale(&identity, snapshot) + .map_err(|error| LspSemanticRequestError::InvalidResponse { + class: error.to_string(), + })? + { return Err(LspSemanticRequestError::InvalidResponse { class: "admitted semantic document snapshot is stale".to_owned(), }); @@ -820,16 +840,17 @@ impl StdioLspClient { &self, identity: &Path, snapshot: &crate::LspSemanticDocumentSnapshot, - ) -> bool { - !snapshot.lifetime.is_open() - || self.documents.get(identity).is_some_and(|current| { + ) -> std::result::Result { + let state = self.documents.lock()?; + Ok(!snapshot.lifetime.is_open() + || state.documents.get(identity).is_some_and(|current| { current.snapshot.as_ref().is_some_and(|admitted| { admitted.lifetime == snapshot.lifetime && (admitted.version > snapshot.version || (admitted.version == snapshot.version && current.text != snapshot.text.as_ref())) }) - }) + })) } async fn synchronize_document( @@ -841,26 +862,37 @@ impl StdioLspClient { snapshot: Option<&crate::LspSemanticDocumentSnapshot>, timeouts: LspRefreshTimeouts, ) -> std::result::Result { - if let Some(current) = self.documents.get_mut(identity) - && current.uri == uri - && current.text == text - { - current.snapshot = snapshot.cloned(); - return Ok(current.wire_version); - } - let current_version = self - .documents - .get(identity) - .map_or(0, |current| current.wire_version); + let (current_version, previous_uri) = { + let mut state = self.documents.lock().map_err(|error| { + LspMessageWriteError::Failed(TraceDecayError::new(error.to_string())) + })?; + if state.attempt != Some(self.attempt) { + return Err(LspMessageWriteError::Failed(TraceDecayError::Unavailable)); + } + if let Some(current) = state.documents.get_mut(identity) { + if current.uri == uri && current.text == text { + if current.snapshot.as_ref() != snapshot + && !matches!(current.eligibility, PublicationEligibility::Refreshing(_)) + { + current.eligibility = PublicationEligibility::Unverified; + } + current.snapshot = snapshot.cloned(); + return Ok(current.wire_version); + } + current.accepted = None; + if !matches!(current.eligibility, PublicationEligibility::Refreshing(_)) { + current.eligibility = PublicationEligibility::Unverified; + } + (current.wire_version, Some(current.uri.clone())) + } else { + (0, None) + } + }; let version = current_version.checked_add(1).ok_or_else(|| { LspMessageWriteError::Failed(TraceDecayError::Config { message: "analyzer document version is exhausted".to_owned(), }) })?; - let previous_uri = self - .documents - .get(identity) - .map(|current| current.uri.clone()); let notification = if previous_uri.as_deref() == Some(uri) { json!({ "jsonrpc": "2.0", @@ -906,16 +938,32 @@ impl StdioLspClient { .request_deadline() .min(Instant::now() + timeouts.refresh); write_message_until(&self.process, notification, deadline, timeouts.message_io).await?; - self.documents.insert( - identity.to_path_buf(), - SynchronizedDocument { - uri: uri.to_owned(), - wire_version: version, - text: text.to_owned(), - snapshot: snapshot.cloned(), - diagnostics: None, - }, - ); + let mut state = self.documents.lock().map_err(|error| { + LspMessageWriteError::Failed(TraceDecayError::new(error.to_string())) + })?; + if state.attempt != Some(self.attempt) { + return Err(LspMessageWriteError::Failed(TraceDecayError::Unavailable)); + } + if let Some(current) = state.documents.get_mut(identity) { + uri.clone_into(&mut current.uri); + current.wire_version = version; + text.clone_into(&mut current.text); + current.snapshot = snapshot.cloned(); + current.accepted = None; + } else { + state.documents.insert( + identity.to_path_buf(), + SynchronizedDocument { + uri: uri.to_owned(), + wire_version: version, + text: text.to_owned(), + snapshot: snapshot.cloned(), + accepted: None, + epoch: 0, + eligibility: PublicationEligibility::Unverified, + }, + ); + } Ok(version) } @@ -1302,6 +1350,25 @@ impl StdioLspClient { documents: Vec, timeouts: LspRefreshTimeouts, ) -> std::result::Result { + self.collect_claimed_diagnostics(project_root, documents, timeouts, Vec::new()) + .await + .map(|(result, _)| result) + } + + pub(crate) async fn collect_claimed_diagnostics( + &mut self, + project_root: &Path, + documents: Vec, + timeouts: LspRefreshTimeouts, + claims: Vec, + ) -> std::result::Result< + (DiagnosticRefreshResult, Vec), + LspRefreshError, + > { + let mut claims = claims + .into_iter() + .map(|claim| (claim.path().to_path_buf(), claim)) + .collect::>(); let deadline = timeouts.request_deadline(); let mut uri_to_document = BTreeMap::new(); let mut expected_versions = BTreeMap::new(); @@ -1316,6 +1383,15 @@ impl StdioLspClient { document_identity(&path, &uri).ok_or_else(|| LspRefreshError::InvalidResponse { message: "admitted diagnostic document URI is invalid".to_owned(), })?; + if let Some(claim) = claims.get(&identity) + && !claim.is_current().map_err(document_refresh_error)? + { + result.coverage.documents.insert( + document.relative_path.clone(), + DiagnosticDocumentCoverage::StalePublication, + ); + continue; + } if let Some(snapshot) = document.snapshot.as_ref() { if snapshot.text.as_ref() != document.text || ContentDigest::of_bytes(document.text.as_bytes()) != snapshot.content_digest @@ -1324,7 +1400,10 @@ impl StdioLspClient { message: "admitted diagnostic document snapshot is invalid".to_owned(), }); } - if self.snapshot_is_stale(&identity, snapshot) { + if self + .snapshot_is_stale(&identity, snapshot) + .map_err(document_refresh_error)? + { // A queued editor admission may expire before this client // is acquired. It is stale caller work, not an analyzer // protocol failure; do not send its text or retire the @@ -1335,17 +1414,18 @@ impl StdioLspClient { ); continue; } - } else if let Some(current) = self.documents.get(&identity) - && current - .snapshot - .as_ref() - .is_some_and(|snapshot| snapshot.lifetime.is_open()) - { - // Only the overlay store can keep this admission alive. Closing - // or dropping its session returns a later sweep to disk text. - document.text.clone_from(¤t.text); - document.snapshot = current.snapshot.clone(); - uri.clone_from(¤t.uri); + } else { + let state = self.documents.lock().map_err(document_refresh_error)?; + if let Some(current) = state.documents.get(&identity) + && current + .snapshot + .as_ref() + .is_some_and(|snapshot| snapshot.lifetime.is_open()) + { + document.text.clone_from(¤t.text); + document.snapshot = current.snapshot.clone(); + uri.clone_from(¤t.uri); + } } let version = self .synchronize_document( @@ -1358,32 +1438,45 @@ impl StdioLspClient { ) .await .map_err(refresh_write_error)?; + if let Some(claim) = claims.get(&identity) { + match claim.bind() { + Ok(()) => {} + Err(DiagnosticEvidenceUnavailable::PublicationUncommitted) => { + result.coverage.documents.insert( + document.relative_path.clone(), + DiagnosticDocumentCoverage::StalePublication, + ); + continue; + } + Err(error) => return Err(document_refresh_error(error)), + } + } expected_versions.insert(uri.clone(), version); uri_to_document.insert(uri, (identity, document)); } if uri_to_document.is_empty() { - return Ok(result); + return Ok((result, Vec::new())); } - let mut diagnostics_by_uri: BTreeMap> = BTreeMap::new(); + let mut publications_by_uri: BTreeMap> = + BTreeMap::new(); let mut coverage_by_uri = BTreeMap::new(); let mut current_publications = BTreeSet::new(); - // An unchanged document sends no notification, so the server need not - // publish again. Its last accepted publication remains authoritative - // for this wire version. Synchronizing changed text replaces the - // document record and discards that publication. - for (uri, (identity, _)) in &uri_to_document { - if let Some((diagnostics, coverage)) = self - .documents - .get(identity) - .and_then(|document| document.diagnostics.as_ref()) - { - diagnostics_by_uri.insert(uri.clone(), diagnostics.clone()); - coverage_by_uri.insert(uri.clone(), coverage.clone()); + { + let state = self.documents.lock().map_err(document_refresh_error)?; + for (uri, (identity, _)) in &uri_to_document { + if let Some(accepted) = state + .documents + .get(identity) + .and_then(|document| document.accepted.as_ref()) + { + publications_by_uri.insert(uri.clone(), Arc::clone(accepted)); + coverage_by_uri.insert(uri.clone(), accepted.coverage.clone()); + } } } let refresh_deadline = deadline.min(Instant::now() + timeouts.refresh); - let mut quiet_deadline = (diagnostics_by_uri.len() == uri_to_document.len()) + let mut quiet_deadline = (publications_by_uri.len() == uri_to_document.len()) .then(|| refresh_deadline.min(Instant::now() + timeouts.diagnostics_quiet)); loop { let now = Instant::now(); @@ -1441,8 +1534,12 @@ impl StdioLspClient { published.uri.as_str().to_owned(), DiagnosticDocumentCoverage::StalePublication, ); - if let Some(current) = self.documents.get_mut(identity) { - current.diagnostics = None; + let mut state = self.documents.lock().map_err(document_refresh_error)?; + if let Some(current) = state.documents.get_mut(identity) { + current.accepted = None; + if !matches!(current.eligibility, PublicationEligibility::Refreshing(_)) { + current.eligibility = PublicationEligibility::Unverified; + } } } continue; @@ -1456,12 +1553,27 @@ impl StdioLspClient { .into_iter() .map(|diagnostic| code_diagnostic(diagnostic, document, &self.command)) .collect::>(); - if let Some(current) = self.documents.get_mut(identity) { - current.diagnostics = Some((diagnostics.clone(), coverage.clone())); + let accepted = Arc::new(AcceptedDiagnosticPublication { + diagnostics, + coverage: coverage.clone(), + }); + { + let mut state = self.documents.lock().map_err(document_refresh_error)?; + if state.attempt != Some(self.attempt) { + return Err(document_refresh_error( + DiagnosticEvidenceUnavailable::IncarnationRetired, + )); + } + if let Some(current) = state.documents.get_mut(identity) { + current.accepted = Some(Arc::clone(&accepted)); + if !matches!(current.eligibility, PublicationEligibility::Refreshing(_)) { + current.eligibility = PublicationEligibility::Unverified; + } + } } current_publications.insert(published.uri.as_str().to_owned()); coverage_by_uri.insert(published.uri.as_str().to_owned(), coverage); - diagnostics_by_uri.insert(published.uri.as_str().to_owned(), diagnostics); + publications_by_uri.insert(published.uri.as_str().to_owned(), accepted); quiet_deadline = Some(refresh_deadline.min(Instant::now() + timeouts.diagnostics_quiet)); } @@ -1470,7 +1582,7 @@ impl StdioLspClient { // looks partial here. Requiring every requested URI throws away the real // diagnostics of the one file that did report. Only treat the batch as a // genuine timeout when nothing arrived at all. - if diagnostics_by_uri.is_empty() && !uri_to_document.is_empty() { + if publications_by_uri.is_empty() && !uri_to_document.is_empty() { return Err(LspRefreshError::NoPublication { message: format!( "LSP diagnostics collection timed out after {} ms without a publication", @@ -1478,6 +1590,7 @@ impl StdioLspClient { ), }); } + let mut collected = Vec::new(); for (uri, (identity, document)) in &uri_to_document { if document .snapshot @@ -1485,8 +1598,12 @@ impl StdioLspClient { .is_some_and(|snapshot| !snapshot.lifetime.is_open()) { coverage_by_uri.insert(uri.clone(), DiagnosticDocumentCoverage::StalePublication); - if let Some(current) = self.documents.get_mut(identity) { - current.diagnostics = None; + let mut state = self.documents.lock().map_err(document_refresh_error)?; + if let Some(current) = state.documents.get_mut(identity) { + current.accepted = None; + if !matches!(current.eligibility, PublicationEligibility::Refreshing(_)) { + current.eligibility = PublicationEligibility::Unverified; + } } } let coverage = coverage_by_uri @@ -1497,16 +1614,29 @@ impl StdioLspClient { // a newly received publication for a closed overlay must likewise // not replace or append to that retained evidence. if matches!(coverage, DiagnosticDocumentCoverage::Published { .. }) - && let Some(diagnostics) = diagnostics_by_uri.remove(uri) + && let Some(accepted) = publications_by_uri.remove(uri) { - result.diagnostics.extend(diagnostics); + result + .diagnostics + .extend(accepted.diagnostics.iter().cloned()); + if let Some(claim) = claims.remove(identity) + && let Some(version) = expected_versions.get(uri) + { + collected.push(claim.collected( + accepted, + document.clone(), + uri.clone(), + *version, + self.attempt, + )); + } } result .coverage .documents .insert(document.relative_path.clone(), coverage); } - Ok(result) + Ok((result, collected)) } async fn closed_refresh_error(&self, deadline: Instant) -> LspRefreshError { @@ -1556,6 +1686,7 @@ impl StdioLspClient { /// stores this future when an in-flight owner is dropped, and no successor /// may acquire that slot until the future completes. pub(crate) fn reap(mut self) -> impl Future> + Send { + self.documents.retire(Some(self.attempt)); // The slot retains this future so no successor can overlap the old // process. Start termination before returning it: cancellation may // have no successor to poll the retained settlement future. @@ -1572,6 +1703,12 @@ impl StdioLspClient { } } +impl Drop for StdioLspClient { + fn drop(&mut self) { + self.documents.retire(Some(self.attempt)); + } +} + fn is_current_diagnostic_publication( published: &PublishDiagnosticsParams, expected_versions: &BTreeMap, @@ -1704,6 +1841,12 @@ fn semantic_write_error(error: LspMessageWriteError) -> LspSemanticRequestError } } +fn document_refresh_error(error: DiagnosticEvidenceUnavailable) -> LspRefreshError { + LspRefreshError::InvalidResponse { + message: error.to_string(), + } +} + fn refresh_transport_error(error: TraceDecayError) -> LspRefreshError { LspRefreshError::Transport { message: error.to_string(), @@ -1965,16 +2108,6 @@ pub(crate) fn file_uri(path: &Path) -> String { file_uri_from_path_text(&absolute.to_string_lossy()) } -/// Key the shared ledger by filesystem identity while keeping the admitted -/// presentation URI on the wire. A disk sweep through the registered root -/// and an editor request through a root alias must reach the same record. -fn document_identity(path: &Path, uri: &str) -> Option { - let (_, uri_path) = crate::gateway::strict_file_uri_path(uri)?; - let path = canonicalize_existing_prefix(path)?; - let uri_path = canonicalize_existing_prefix(&uri_path)?; - (path == uri_path).then_some(path) -} - fn read_semantic_document(path: &Path) -> std::result::Result { let file = std::fs::File::open(path) .map_err(|error| format!("failed to read semantic document: {error}"))?; @@ -2117,10 +2250,11 @@ mod tests { use serde_json::json; use super::{ - AnalyzerLaunch, JsonRpcMessage, LspRefreshTimeouts, LspSemanticRequestError, - NativeTaskOutcome, StdioLspClientStartup, StdioLspClientStartupSettlement, - cancel_request_message, decode_message, decode_semantic_request, encode_semantic_request, - file_uri_from_path_text, is_current_diagnostic_publication, + AnalyzerDocuments, AnalyzerLaunch, JsonRpcMessage, LspRefreshTimeouts, + LspSemanticRequestError, NativeTaskOutcome, StdioLspClientStartup, + StdioLspClientStartupSettlement, cancel_request_message, decode_message, + decode_semantic_request, encode_semantic_request, file_uri_from_path_text, + is_current_diagnostic_publication, }; #[cfg(unix)] @@ -2175,6 +2309,8 @@ while True: Duration::from_secs(10), Duration::from_millis(50), ), + AnalyzerDocuments::new(), + 0, ) .unwrap(); assert!(matches!( @@ -2229,6 +2365,8 @@ while True: Vec::new(), temp.path().to_path_buf(), LspRefreshTimeouts::from_diagnostics_quiet_window(Duration::from_secs(1)), + AnalyzerDocuments::new(), + 0, ) .unwrap(); assert!(matches!( diff --git a/crates/tracedecay-lsp/src/analyzer/client/documents.rs b/crates/tracedecay-lsp/src/analyzer/client/documents.rs new file mode 100644 index 0000000000..a0e842bd43 --- /dev/null +++ b/crates/tracedecay-lsp/src/analyzer/client/documents.rs @@ -0,0 +1,274 @@ +use std::collections::BTreeMap; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, MutexGuard}; + +use tracedecay_runtime_core::path_safety::canonicalize_existing_prefix; + +use super::{DiagnosticDocumentCoverage, LspDocument}; +use crate::LspSemanticDocumentSnapshot; +use crate::analyzer::broker::{CodeDiagnostic, DiagnosticEvidenceUnavailable}; + +pub(crate) struct AnalyzerDocuments { + state: Mutex, +} + +pub(super) struct DocumentState { + pub(super) attempt: Option, + pub(super) documents: BTreeMap, +} + +pub(super) struct SynchronizedDocument { + pub(super) uri: String, + pub(super) wire_version: i32, + pub(super) text: String, + pub(super) snapshot: Option, + pub(super) accepted: Option>, + pub(super) epoch: u64, + pub(super) eligibility: PublicationEligibility, +} + +pub(super) enum PublicationEligibility { + Unverified, + Refreshing(Arc), + Committed, +} + +pub(crate) struct AcceptedDiagnosticPublication { + pub(crate) diagnostics: Vec, + pub(crate) coverage: DiagnosticDocumentCoverage, +} + +pub(super) struct RefreshClaimIdentity { + path: PathBuf, + epoch: u64, +} + +pub(crate) struct DocumentRefreshClaim { + owner: Arc, + identity: Arc, +} + +pub(crate) struct CollectedDocumentPublication { + claim: DocumentRefreshClaim, + accepted: Arc, + document: LspDocument, + uri: String, + wire_version: i32, + attempt: u32, +} + +impl AnalyzerDocuments { + pub(crate) fn new() -> Arc { + Arc::new(Self { + state: Mutex::new(DocumentState { + attempt: None, + documents: BTreeMap::new(), + }), + }) + } + + pub(super) fn lock( + &self, + ) -> Result, DiagnosticEvidenceUnavailable> { + self.state + .lock() + .map_err(|_| DiagnosticEvidenceUnavailable::MetadataUnavailable) + } + + pub(crate) fn activate(&self, attempt: u32) -> Result<(), DiagnosticEvidenceUnavailable> { + let mut state = self.lock()?; + state.documents.clear(); + state.attempt = Some(attempt); + Ok(()) + } + + pub(crate) fn retire(&self, attempt: Option) { + let mut state = match self.state.lock() { + Ok(state) => state, + Err(poisoned) => poisoned.into_inner(), + }; + if attempt.is_none() || state.attempt == attempt { + state.attempt = None; + state.documents.clear(); + } + } + + pub(crate) fn invalidate( + &self, + paths: Option<&[PathBuf]>, + epoch: u64, + ) -> Result<(), DiagnosticEvidenceUnavailable> { + let mut state = self.lock()?; + let invalidate = |document: &mut SynchronizedDocument| { + document.epoch = epoch; + document.eligibility = PublicationEligibility::Unverified; + }; + match paths { + Some(paths) => { + for path in paths { + if let Some(document) = state.documents.get_mut(path) { + invalidate(document); + } + } + } + None => state.documents.values_mut().for_each(invalidate), + } + Ok(()) + } + + pub(crate) fn claim( + self: &Arc, + path: PathBuf, + epoch: u64, + ) -> Result { + let claim = DocumentRefreshClaim { + owner: Arc::clone(self), + identity: Arc::new(RefreshClaimIdentity { path, epoch }), + }; + claim.bind()?; + Ok(claim) + } + + pub(crate) fn read_committed( + &self, + path: &Path, + uri: &str, + document: &LspDocument, + read: impl FnOnce(&DiagnosticDocumentCoverage) -> T, + ) -> Result { + let state = self.lock()?; + if state.attempt.is_none() { + return Err(DiagnosticEvidenceUnavailable::IncarnationRetired); + } + let current = state + .documents + .get(path) + .ok_or(DiagnosticEvidenceUnavailable::SourceUnavailable)?; + validate_document(current, uri, document)?; + if !matches!(current.eligibility, PublicationEligibility::Committed) { + return Err(DiagnosticEvidenceUnavailable::PublicationUncommitted); + } + let accepted = current + .accepted + .as_ref() + .ok_or(DiagnosticEvidenceUnavailable::PublicationUncommitted)?; + Ok(read(&accepted.coverage)) + } +} + +impl DocumentRefreshClaim { + pub(crate) fn path(&self) -> &Path { + &self.identity.path + } + + pub(crate) fn is_current(&self) -> Result { + let state = self.owner.lock()?; + Ok(state.documents.get(self.path()).is_none_or(|document| { + document.epoch < self.identity.epoch + || matches!(&document.eligibility, PublicationEligibility::Refreshing(identity) if Arc::ptr_eq(identity, &self.identity)) + })) + } + + pub(crate) fn bind(&self) -> Result<(), DiagnosticEvidenceUnavailable> { + let mut state = self.owner.lock()?; + if let Some(document) = state.documents.get_mut(self.path()) { + if document.epoch > self.identity.epoch { + return Err(DiagnosticEvidenceUnavailable::PublicationUncommitted); + } + document.epoch = self.identity.epoch; + document.eligibility = PublicationEligibility::Refreshing(Arc::clone(&self.identity)); + } + Ok(()) + } + + pub(crate) fn collected( + self, + accepted: Arc, + document: LspDocument, + uri: String, + wire_version: i32, + attempt: u32, + ) -> CollectedDocumentPublication { + CollectedDocumentPublication { + claim: self, + accepted, + document, + uri, + wire_version, + attempt, + } + } +} + +impl Drop for DocumentRefreshClaim { + fn drop(&mut self) { + let mut state = match self.owner.state.lock() { + Ok(state) => state, + Err(poisoned) => poisoned.into_inner(), + }; + if let Some(document) = state.documents.get_mut(self.path()) + && matches!(&document.eligibility, PublicationEligibility::Refreshing(identity) if Arc::ptr_eq(identity, &self.identity)) + { + document.eligibility = PublicationEligibility::Unverified; + } + } +} + +impl CollectedDocumentPublication { + pub(crate) fn relative_path(&self) -> &str { + &self.document.relative_path + } + + pub(crate) fn commit( + &self, + install: impl FnOnce(&AcceptedDiagnosticPublication), + ) -> Result<(), DiagnosticEvidenceUnavailable> { + let mut state = self.claim.owner.lock()?; + if state.attempt != Some(self.attempt) { + return Err(DiagnosticEvidenceUnavailable::IncarnationRetired); + } + let current = state + .documents + .get_mut(self.claim.path()) + .ok_or(DiagnosticEvidenceUnavailable::SourceUnavailable)?; + validate_document(current, &self.uri, &self.document)?; + if current.wire_version != self.wire_version + || !matches!(¤t.eligibility, PublicationEligibility::Refreshing(identity) if Arc::ptr_eq(identity, &self.claim.identity)) + || !current + .accepted + .as_ref() + .is_some_and(|accepted| Arc::ptr_eq(accepted, &self.accepted)) + { + return Err(DiagnosticEvidenceUnavailable::PublicationUncommitted); + } + install(&self.accepted); + current.eligibility = PublicationEligibility::Committed; + Ok(()) + } +} + +fn validate_document( + current: &SynchronizedDocument, + uri: &str, + document: &LspDocument, +) -> Result<(), DiagnosticEvidenceUnavailable> { + if current.uri != uri || current.text != document.text { + return Err(DiagnosticEvidenceUnavailable::ContentChanged); + } + if current.snapshot != document.snapshot + || current + .snapshot + .as_ref() + .is_some_and(|snapshot| !snapshot.lifetime.is_open()) + { + return Err(DiagnosticEvidenceUnavailable::OverlayStale); + } + Ok(()) +} + +pub(crate) fn document_identity(path: &Path, uri: &str) -> Option { + let (_, uri_path) = crate::gateway::strict_file_uri_path(uri)?; + let path = canonicalize_existing_prefix(path)?; + let uri_path = canonicalize_existing_prefix(&uri_path)?; + (path == uri_path).then_some(path) +} diff --git a/crates/tracedecay-lsp/src/diagnostics.rs b/crates/tracedecay-lsp/src/diagnostics.rs index 67152dc624..82c1a899f1 100644 --- a/crates/tracedecay-lsp/src/diagnostics.rs +++ b/crates/tracedecay-lsp/src/diagnostics.rs @@ -7,6 +7,8 @@ use std::collections::BTreeSet; use crate::analyzer::broker::DiagnosticSeverity; +use crate::rpc::{DiagnosticSerializationCapabilities, diagnostic_value}; +use tracedecay_domain::ManifestDigest; pub const MAX_DOCUMENT_DIAGNOSTICS: usize = 200; pub const MAX_DIAGNOSTIC_MESSAGE_BYTES: usize = 512; @@ -321,6 +323,32 @@ pub fn merge_diagnostics( DiagnosticMerge::new(upstream, tracedecay) } +#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] +#[error("diagnostic projection identity is unavailable")] +pub struct DiagnosticProjectionError; + +/// Returns the bounded upstream projection and its full observable identity. +pub fn project_upstream_diagnostics( + diagnostics: Vec, +) -> Result<(Vec, ManifestDigest), DiagnosticProjectionError> { + let items = merge_diagnostics(diagnostics, Vec::new()).into_items(); + let identity = items + .iter() + .map(|item| { + ( + &item.uri, + diagnostic_value( + item.clone(), + DiagnosticSerializationCapabilities::full_identity(), + ), + ) + }) + .collect::>(); + let digest = + tracedecay_domain::canonical_sha256(&identity).map_err(|_| DiagnosticProjectionError)?; + Ok((items, digest)) +} + /// UTF position conversion failures are explicit; positions inside a surrogate /// pair are never rounded to a neighboring byte. #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -466,6 +494,39 @@ mod tests { } } + #[test] + fn upstream_projection_identity_uses_normalized_order_and_complete_wire_fields() { + let a = diagnostic(DiagnosticSource::Upstream, "a"); + let b = diagnostic(DiagnosticSource::TraceDecay, "b"); + let (items, digest) = + project_upstream_diagnostics(vec![b.clone(), a.clone(), a.clone()]).unwrap(); + let (reordered, reordered_digest) = + project_upstream_diagnostics(vec![a.clone(), b]).unwrap(); + assert_eq!(items, reordered); + assert_eq!(digest, reordered_digest); + assert!( + items + .iter() + .all(|item| item.source == DiagnosticSource::Upstream) + ); + + let (_, original) = project_upstream_diagnostics(vec![a.clone()]).unwrap(); + let mut related = a.clone(); + related + .related_information + .push(GatewayDiagnosticRelatedInformation { + uri: "file:///root/b.rs".to_owned(), + range: a.range, + message: "related".to_owned(), + }); + let (_, with_related) = project_upstream_diagnostics(vec![related]).unwrap(); + assert_ne!(original, with_related); + let mut described = a; + described.code_description_uri = Some("https://example.test/diagnostic".to_owned()); + let (_, with_description) = project_upstream_diagnostics(vec![described]).unwrap(); + assert_ne!(original, with_description); + } + #[test] fn merge_is_deterministic_deduplicated_and_provenance_preserving() { let upstream = diagnostic(DiagnosticSource::TraceDecay, "same"); diff --git a/crates/tracedecay-lsp/src/lib.rs b/crates/tracedecay-lsp/src/lib.rs index 1c67a047e0..902c97a6c0 100644 --- a/crates/tracedecay-lsp/src/lib.rs +++ b/crates/tracedecay-lsp/src/lib.rs @@ -77,14 +77,14 @@ pub use context::{ TRACEDECAY_CONTEXT_METHOD, TRACEDECAY_CONTEXT_REVISION, TRACEDECAY_SUBSCRIBE_METHOD, }; pub use diagnostics::{ - DiagnosticMerge, DiagnosticSource, DocumentDiagnosticReport, GatewayDiagnostic, - GatewayDiagnosticCoverage, GatewayDiagnosticData, GatewayDiagnosticIdentity, + DiagnosticMerge, DiagnosticProjectionError, DiagnosticSource, DocumentDiagnosticReport, + GatewayDiagnostic, GatewayDiagnosticCoverage, GatewayDiagnosticData, GatewayDiagnosticIdentity, GatewayDiagnosticLifecycle, GatewayDiagnosticProviderState, GatewayDiagnosticRelatedInformation, LspPosition, LspRange, MAX_DIAGNOSTIC_MESSAGE_BYTES, MAX_DIAGNOSTIC_RELATED_INFORMATION, MAX_DIAGNOSTIC_RELATED_MESSAGE_BYTES, MAX_DIAGNOSTIC_URI_BYTES, MAX_DOCUMENT_DIAGNOSTICS, PositionError, TRACEDECAY_DIAGNOSTIC_DATA_REVISION, byte_offset_to_utf16_position, merge_diagnostics, - utf16_position_to_byte_offset, + project_upstream_diagnostics, utf16_position_to_byte_offset, }; pub use framing::{ AsyncContentLengthError, ContentLengthCodec, ContentLengthCodecError, MAX_LSP_HEADER_BYTES, @@ -125,8 +125,8 @@ pub use provider::{ AnalyzerCancellationPort, AnalyzerEvent, AnalyzerSemanticAdapter, AnalyzerState, AnalyzerSupervisor, AnalyzerTransitionError, DiagnosticRefreshAdmission, DiagnosticRefreshIdentity, DiagnosticSnapshotOutcome, DiagnosticSnapshotPort, - GenerationDiagnostics, MAX_ANALYZER_RESTARTS, MAX_DIAGNOSTIC_OPERATION_ID_BYTES, - UnavailableDiagnosticSnapshotProvider, + DiagnosticSnapshotValidation, GenerationDiagnostics, MAX_ANALYZER_RESTARTS, + MAX_DIAGNOSTIC_OPERATION_ID_BYTES, UnavailableDiagnosticSnapshotProvider, }; pub use session::{ AuthorizedLspSession, AuthorizedLspWorkspace, CancellationOutcome, CompletionDisposition, diff --git a/crates/tracedecay-lsp/src/operation_table.rs b/crates/tracedecay-lsp/src/operation_table.rs index 3aef0a46a4..efbce9425b 100644 --- a/crates/tracedecay-lsp/src/operation_table.rs +++ b/crates/tracedecay-lsp/src/operation_table.rs @@ -178,6 +178,28 @@ where false } } + + /// Retires one exact operation without requiring a caller to reconstruct + /// the input key after that document's lifetime has already changed. + pub(crate) fn cancel_matching(&self, matches: impl Fn(&K, &M) -> bool) -> bool + where + K: Clone, + { + let pending = { + let mut in_flight = self.in_flight(); + let key = in_flight + .iter() + .find(|(key, pending)| matches(key, &pending.metadata)) + .map(|(key, _)| key.clone()); + key.and_then(|key| in_flight.remove(&key)) + }; + if let Some(pending) = pending { + pending.task.abort(); + true + } else { + false + } + } } impl Drop for BoundedOperationTable { diff --git a/crates/tracedecay-lsp/src/overlay.rs b/crates/tracedecay-lsp/src/overlay.rs index 7d6893b09f..66189dfdd7 100644 --- a/crates/tracedecay-lsp/src/overlay.rs +++ b/crates/tracedecay-lsp/src/overlay.rs @@ -8,16 +8,18 @@ use std::collections::BTreeMap; use std::sync::{Arc, Weak}; +use futures_util::FutureExt; + use tracedecay_code_extraction::incremental::ParseDocumentIdentity; use tracedecay_daemon_protocol::ProcessLocalRequestSequence; use tracedecay_domain::{ContentDigest, ManifestDigest, canonical_sha256}; use crate::diagnostics::{LspRange, PositionError}; use crate::gateway::operation_table::{BoundedOperationTable, OperationAdmission, OperationPoll}; -use crate::gateway::{AdmittedRoot, LspRuntimeFuture, LspRuntimeSpawner}; +use crate::gateway::{AdmittedRoot, LspRuntimeFailure, LspRuntimeFuture, LspRuntimeSpawner}; use crate::provider::{ DiagnosticRefreshAdmission, DiagnosticRefreshIdentity, DiagnosticSnapshotOutcome, - DiagnosticSnapshotPort, + DiagnosticSnapshotPort, DiagnosticSnapshotValidation, GenerationDiagnostics, }; use crate::session::AuthorizedLspWorkspace; use crate::workspace_diagnostics::WorkspaceDiagnosticSnapshotOutcome; @@ -394,12 +396,18 @@ pub const MAX_DIAGNOSTIC_OPERATIONS: usize = 128; #[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] struct DiagnosticOperationKey { root_uri: String, + scope_digest: Option, document_uri: String, overlay_version: i64, overlay_language_id: Option, overlay_digest: Option, } +enum DiagnosticValidationPreparation { + Completed(Result), + IdentityExhausted, +} + pub struct DiagnosticSnapshotAdapter { runtime: Arc, authority: Arc, @@ -435,6 +443,7 @@ impl DiagnosticSnapshotAdapter { ) -> DiagnosticOperationKey { DiagnosticOperationKey { root_uri: root.uri().to_owned(), + scope_digest: root.scope_digest().cloned(), document_uri: document_uri.to_owned(), overlay_version: overlay.map_or(0, |overlay| overlay.version), overlay_language_id: overlay.map(|overlay| overlay.language_id.clone()), @@ -499,7 +508,16 @@ impl DiagnosticSnapshotPort for DiagnosticSnapshotAdapter { target_generation: None, }; let operation = Box::pin(async move { - match authority.refresh(request).await { + let refreshed = async { + let diagnostics = authority.refresh(request.clone()).await?; + let current = authority.current_authority(request).await?; + if current != diagnostics.authority_digest { + return Err(LspRuntimeFailure::new("diagnostic-authority-stale")); + } + Ok(diagnostics) + } + .await; + match refreshed { Ok(diagnostics) => DiagnosticSnapshotOutcome::Ready { diagnostics, completed_operation_id: Some(operation_id), @@ -534,6 +552,104 @@ impl DiagnosticSnapshotPort for DiagnosticSnapshotAdapter { } } + fn validate_document_snapshot( + &self, + root: &AdmittedRoot, + document_uri: &str, + overlay: Option<&OverlaySnapshot>, + snapshot: &GenerationDiagnostics, + ) -> DiagnosticSnapshotValidation { + let key = Self::key(root, document_uri, overlay); + let admission = self.operations.admit_with(key, self.runtime.as_ref(), || { + // The table owns capacity before even the first poll. A ready read + // releases that permit without creating a task; a pending read keeps + // the same permit and cancellation ownership as a full refresh. + let mut current = self + .authority + .current_authority(CanonicalDiagnosticRefreshRequest { + root: root.clone(), + document_uri: document_uri.to_owned(), + overlay: overlay.cloned(), + source_generation: Some(snapshot.generation), + expected_content_digest: overlay.map(|overlay| overlay.content_digest.clone()), + expected_code_generation_id: None, + expected_snapshot_digest: None, + }); + if let Some(result) = current.as_mut().now_or_never() { + return Err(DiagnosticValidationPreparation::Completed( + result.map(|digest| digest == snapshot.authority_digest), + )); + } + let operation_id = self + .next_operation + .next_string("lsp-diagnostic-") + .map_err(|_| DiagnosticValidationPreparation::IdentityExhausted)?; + let snapshot = snapshot.clone(); + let identity = DiagnosticRefreshIdentity { + operation_id: operation_id.clone(), + source_generation: Some(snapshot.generation), + target_generation: None, + }; + let operation = Box::pin(async move { + match current.await { + Ok(digest) if digest == snapshot.authority_digest => { + DiagnosticSnapshotOutcome::Ready { + diagnostics: snapshot, + completed_operation_id: Some(operation_id), + } + } + Ok(_) => DiagnosticSnapshotOutcome::Partial { + source_generation: Some(snapshot.generation), + coverage: "refresh-required".to_owned(), + }, + Err(error) => DiagnosticSnapshotOutcome::Failed { + source_generation: Some(snapshot.generation), + failure_class: error.class().to_owned(), + }, + } + }) as LspRuntimeFuture; + Ok((identity, operation)) + }); + match admission { + Err(DiagnosticValidationPreparation::Completed(Ok(true))) => { + DiagnosticSnapshotValidation::Current + } + Err(DiagnosticValidationPreparation::Completed(Ok(false))) => { + DiagnosticSnapshotValidation::Changed + } + Err(DiagnosticValidationPreparation::Completed(Err(error))) => { + DiagnosticSnapshotValidation::Failed { + failure_class: error.class().to_owned(), + } + } + Err(DiagnosticValidationPreparation::IdentityExhausted) => { + DiagnosticSnapshotValidation::Failed { + failure_class: "diagnostic-identity-exhausted".to_owned(), + } + } + Ok(OperationAdmission::Started(identity) | OperationAdmission::Existing(identity)) => { + DiagnosticSnapshotValidation::Pending(identity) + } + Ok(OperationAdmission::Saturated) => DiagnosticSnapshotValidation::Failed { + failure_class: "diagnostic-capacity".to_owned(), + }, + } + } + + fn retire_document_refresh( + &self, + root: &AdmittedRoot, + document_uri: &str, + operation_id: &str, + ) -> bool { + self.operations.cancel_matching(|key, identity| { + key.root_uri == root.uri() + && key.scope_digest.as_ref() == root.scope_digest() + && key.document_uri == document_uri + && identity.operation_id == operation_id + }) + } + fn supports_workspace_diagnostics(&self) -> bool { self.workspace.supports() } diff --git a/crates/tracedecay-lsp/src/overlay/diagnostic_authority.rs b/crates/tracedecay-lsp/src/overlay/diagnostic_authority.rs index 4eb3f9f4d7..f7319dfd0f 100644 --- a/crates/tracedecay-lsp/src/overlay/diagnostic_authority.rs +++ b/crates/tracedecay-lsp/src/overlay/diagnostic_authority.rs @@ -30,6 +30,12 @@ pub struct ManagedDiagnosticSnapshot { } pub trait ManagedDiagnosticSnapshotPort: Send + Sync { + /// Resolves current canonical scope without executing another diagnostic cycle. + fn current_authority( + &self, + request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture>; + fn snapshot( &self, request: CanonicalDiagnosticRefreshRequest, @@ -42,6 +48,13 @@ pub trait CanonicalDiagnosticSnapshotAuthority: Send + Sync { request: CanonicalDiagnosticRefreshRequest, ) -> LspRuntimeFuture>; + fn current_authority( + &self, + _request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + Box::pin(async { Err(LspRuntimeFailure::new("diagnostic-authority-unavailable")) }) + } + fn supports_workspace_diagnostics(&self) -> bool { false } diff --git a/crates/tracedecay-lsp/src/protocol.rs b/crates/tracedecay-lsp/src/protocol.rs index 0da33a001d..96a0b00abb 100644 --- a/crates/tracedecay-lsp/src/protocol.rs +++ b/crates/tracedecay-lsp/src/protocol.rs @@ -76,6 +76,7 @@ pub const MAX_QUEUED_OUTBOUND_MESSAGES: usize = 64; pub(crate) const TRACEDECAY_NATIVE_DIAGNOSTICS_METHOD: &str = "tracedecay/nativeDiagnostics"; mod context_controller; +mod diagnostic_snapshots; mod diagnostics_controller; mod dynamic_diagnostics_controller; mod lifecycle_controller; @@ -284,6 +285,8 @@ where .cloned() .collect::>(); self.clear_removed_workspace_root_state(&removed_roots); + self.clear_document_diagnostics(); + self.diagnostics.published.clear(); self.diagnostics.workspace_snapshots.clear(); self.diagnostics.workspace_failures.clear(); self.lifecycle.gateway.replace_workspace(workspace); @@ -363,8 +366,7 @@ where .overlays .open(&root, uri.clone(), language_id, version, text) .map_err(|error| self.close_for_overlay_error(error))?; - self.diagnostics.workspace_snapshots.clear(); - self.diagnostics.workspace_failures.clear(); + self.invalidate_document(&uri, &root); // A close followed by a reopen starts a new document incarnation; LSP // versions need not remain monotone across that boundary. Remove any // queued/acknowledged publication ordering state before publishing the @@ -402,7 +404,7 @@ where self.require_ready()?; let text_document = text_document(params)?; let uri = required_nonempty_string(text_document, "uri")?; - self.require_document_root(&uri)?; + let root = self.document_root(&uri)?; let version = required_i64(text_document, "version")?; let changes = params .get("contentChanges") @@ -422,7 +424,7 @@ where .overlays .change(&uri, version, &changes) .map_err(|error| self.close_for_overlay_error(error))?; - self.invalidate_document(&uri); + self.invalidate_document(&uri, &root); self.diagnostics.native_upstream.remove(&uri); self.lifecycle .control @@ -444,13 +446,13 @@ where ) -> Result<(), RpcFailure> { self.require_ready()?; let uri = required_nonempty_string(text_document(params)?, "uri")?; - self.require_document_root(&uri)?; + let root = self.document_root(&uri)?; let closed = self .lifecycle .overlays .close(&uri) .map_err(overlay_failure)?; - self.invalidate_document(&uri); + self.invalidate_document(&uri, &root); self.diagnostics.native_upstream.remove(&uri); self.lifecycle .control @@ -472,8 +474,8 @@ where ) -> Result<(), RpcFailure> { self.require_ready()?; let uri = required_nonempty_string(text_document(params)?, "uri")?; - self.require_document_root(&uri)?; - self.invalidate_document(&uri); + let root = self.document_root(&uri)?; + self.invalidate_document(&uri, &root); if matches!( self.lifecycle.gateway.document_saved(uri.clone()), FeedbackCycleResponse::Accepted @@ -490,7 +492,9 @@ where Ok(()) } - fn invalidate_document(&mut self, uri: &str) { + fn invalidate_document(&mut self, uri: &str, root: &AdmittedRoot) { + self.invalidate_root_diagnostics(root); + self.invalidate_document_diagnostics(uri); self.diagnostics.workspace_snapshots.clear(); self.diagnostics.workspace_failures.clear(); self.discard_document_context(uri); diff --git a/crates/tracedecay-lsp/src/protocol/diagnostic_snapshots.rs b/crates/tracedecay-lsp/src/protocol/diagnostic_snapshots.rs new file mode 100644 index 0000000000..35876f38dd --- /dev/null +++ b/crates/tracedecay-lsp/src/protocol/diagnostic_snapshots.rs @@ -0,0 +1,438 @@ +use std::collections::BTreeSet; + +use tracedecay_domain::{ContentDigest, ManifestDigest}; + +use crate::diagnostics::DiagnosticMerge; +use crate::gateway::{AdmittedRoot, FeedbackCyclePort, SemanticProviderPort}; +use crate::overlay::{OverlayLifetime, OverlaySnapshot}; +use crate::provider::{ + DiagnosticRefreshIdentity, DiagnosticSnapshotOutcome, DiagnosticSnapshotPort, + DiagnosticSnapshotValidation, GenerationDiagnostics, +}; +use crate::rpc::{DiagnosticSerializationCapabilities, diagnostic_value}; +use crate::workspace_diagnostics::{ + MAX_WORKSPACE_DIAGNOSTIC_BYTES, MAX_WORKSPACE_DIAGNOSTIC_RESULTS, +}; + +use super::DaemonLspProtocolSession; +use super::diagnostics_controller::{PublishedDiagnostic, valid_refresh_identity}; + +#[derive(Clone, Debug, Eq, PartialEq)] +pub(super) struct DiagnosticDocumentIdentity { + pub(super) root: AdmittedRoot, + scope_set_digest: Option, + version: i64, + language_id: Option, + content_digest: Option, + lifetime: Option, +} + +impl DiagnosticDocumentIdentity { + pub(super) fn new( + root: &AdmittedRoot, + scope_set_digest: Option<&ManifestDigest>, + overlay: Option<&OverlaySnapshot>, + ) -> Self { + Self { + root: root.clone(), + scope_set_digest: scope_set_digest.cloned(), + version: overlay.map_or(0, |overlay| overlay.version), + language_id: overlay.map(|overlay| overlay.language_id.clone()), + content_digest: overlay.map(|overlay| overlay.content_digest.clone()), + lifetime: overlay.map(|overlay| overlay.lifetime.clone()), + } + } +} + +#[derive(Clone)] +pub(super) struct PendingDiagnosticRefresh { + pub(super) identity: DiagnosticRefreshIdentity, + pub(super) document: DiagnosticDocumentIdentity, + pub(super) state: DiagnosticRefreshState, +} + +#[derive(Clone, Copy, Eq, PartialEq)] +pub(super) enum DiagnosticRefreshState { + Refreshing, + ValidatingPull, + PublicationPending, +} + +#[derive(Clone, Copy, Eq, PartialEq)] +pub(super) enum DiagnosticSnapshotDelivery { + Admitted, + SettledValidation, +} + +pub(super) struct RetainedDiagnosticSnapshot { + document: DiagnosticDocumentIdentity, + outcome: DiagnosticSnapshotOutcome, + delivery: DiagnosticSnapshotDelivery, +} + +impl DaemonLspProtocolSession +where + P: FeedbackCyclePort, + S: SemanticProviderPort, + D: DiagnosticSnapshotPort, +{ + /// The adapter transfers a completion once. The session admits it once, + /// then owns the bounded report used by both push and pull presentation. + pub(super) fn document_diagnostic_snapshot( + &mut self, + root: &AdmittedRoot, + uri: &str, + overlay: Option<&OverlaySnapshot>, + for_pull: bool, + ) -> DiagnosticSnapshotOutcome { + let document = DiagnosticDocumentIdentity::new( + root, + self.lifecycle.gateway.workspace().scope_set_digest(), + overlay, + ); + if self + .diagnostics + .active_refreshes + .get(uri) + .is_some_and(|pending| pending.document != document) + { + self.invalidate_document_diagnostics(uri); + } + if self + .diagnostics + .document_snapshots + .get(uri) + .is_some_and(|retained| retained.document != document) + { + self.diagnostics.document_snapshots.remove(uri); + } + + let outcome = self + .diagnostics + .provider + .document_diagnostics(root, uri, overlay); + if matches!(&outcome, DiagnosticSnapshotOutcome::Partial { coverage, .. } + if coverage == "refresh-required") + { + let Some(retained) = self.diagnostics.document_snapshots.get(uri) else { + return outcome; + }; + let DiagnosticSnapshotOutcome::Ready { diagnostics, .. } = &retained.outcome else { + return retained.outcome.clone(); + }; + let source_generation = Some(diagnostics.generation); + let validation = self.diagnostics.provider.validate_document_snapshot( + root, + uri, + overlay, + diagnostics, + ); + let outcome = match validation { + DiagnosticSnapshotValidation::Current => return retained.outcome.clone(), + DiagnosticSnapshotValidation::Changed => DiagnosticSnapshotOutcome::Partial { + source_generation, + coverage: "refresh-required".to_owned(), + }, + DiagnosticSnapshotValidation::Pending(identity) => { + if valid_refresh_identity(&identity, source_generation) { + self.diagnostics.active_refreshes.insert( + uri.to_owned(), + PendingDiagnosticRefresh { + identity: identity.clone(), + document, + state: if for_pull { + DiagnosticRefreshState::ValidatingPull + } else { + DiagnosticRefreshState::Refreshing + }, + }, + ); + DiagnosticSnapshotOutcome::Refreshing(identity) + } else { + let _ = self.diagnostics.provider.retire_document_refresh( + root, + uri, + &identity.operation_id, + ); + DiagnosticSnapshotOutcome::Failed { + source_generation, + failure_class: "invalid-refresh-identity".to_owned(), + } + } + } + DiagnosticSnapshotValidation::Failed { failure_class } => { + DiagnosticSnapshotOutcome::Failed { + source_generation, + failure_class, + } + } + }; + self.diagnostics.document_snapshots.remove(uri); + self.discard_queued_document_publications(uri); + return outcome; + } + self.admit_document_diagnostic_snapshot( + uri, + document, + outcome, + DiagnosticSnapshotDelivery::Admitted, + ) + } + + pub(super) fn admit_document_diagnostic_snapshot( + &mut self, + uri: &str, + document: DiagnosticDocumentIdentity, + outcome: DiagnosticSnapshotOutcome, + delivery: DiagnosticSnapshotDelivery, + ) -> DiagnosticSnapshotOutcome { + let outcome = match outcome { + DiagnosticSnapshotOutcome::Ready { + mut diagnostics, + completed_operation_id, + } => { + let pending = self.diagnostics.active_refreshes.get(uri); + if let Some(pending) = pending { + if pending.document != document + || completed_operation_id.as_deref() + != Some(pending.identity.operation_id.as_str()) + { + return DiagnosticSnapshotOutcome::Refreshing(pending.identity.clone()); + } + } else if completed_operation_id.is_some() { + return DiagnosticSnapshotOutcome::Partial { + source_generation: None, + coverage: "refresh-required".to_owned(), + }; + } + let invalid_generation = self + .diagnostics + .active_refreshes + .get(uri) + .filter(|_| completed_operation_id.is_some()) + .is_some_and(|pending| { + pending + .identity + .target_generation + .is_some_and(|target| target != diagnostics.generation) + || pending + .identity + .source_generation + .is_some_and(|source| diagnostics.generation < source) + }); + let superseded = self + .diagnostics + .published + .get(uri) + .is_some_and(|published| { + published.version == document.version + && published.generation > diagnostics.generation + && published.scope_digest == document.root.scope_digest().cloned() + && published.scope_set_digest == document.scope_set_digest + }) + || self + .diagnostics + .document_snapshots + .get(uri) + .is_some_and(|retained| { + matches!(&retained.outcome, DiagnosticSnapshotOutcome::Ready { + diagnostics: previous, .. + } if previous.generation > diagnostics.generation) + }); + if superseded || invalid_generation { + DiagnosticSnapshotOutcome::Failed { + source_generation: Some(diagnostics.generation), + failure_class: "superseded-generation".to_owned(), + } + } else { + // Keep the producer lanes separate: push and pull can have + // different capabilities. Each lane's sorted prefix suffices + // for the bounded merge, including Cursor's hidden lanes. + diagnostics.upstream = + DiagnosticMerge::for_document(uri, diagnostics.upstream, Vec::new()).items; + diagnostics.tracedecay = + DiagnosticMerge::for_document(uri, Vec::new(), diagnostics.tracedecay) + .items; + match diagnostic_snapshot_fits(&diagnostics) { + Ok(()) => DiagnosticSnapshotOutcome::Ready { + diagnostics, + completed_operation_id, + }, + Err(failure_class) => DiagnosticSnapshotOutcome::Failed { + source_generation: Some(diagnostics.generation), + failure_class: failure_class.to_owned(), + }, + } + } + } + DiagnosticSnapshotOutcome::Refreshing(identity) => { + self.diagnostics.document_snapshots.remove(uri); + return DiagnosticSnapshotOutcome::Refreshing(identity); + } + terminal => terminal, + }; + + if !self.reserve_document_diagnostic_snapshot(uri) { + return DiagnosticSnapshotOutcome::Failed { + source_generation: None, + failure_class: "diagnostic-result-capacity".to_owned(), + }; + } + if let DiagnosticSnapshotOutcome::Ready { diagnostics, .. } = &outcome { + // Admission establishes the generation floor even if pushing the + // report is backpressured or only pull delivery is negotiated. + self.diagnostics.published.insert( + uri.to_owned(), + PublishedDiagnostic { + version: document.version, + generation: diagnostics.generation, + scope_digest: document.root.scope_digest().cloned(), + scope_set_digest: document.scope_set_digest.clone(), + }, + ); + } + self.diagnostics.document_snapshots.insert( + uri.to_owned(), + RetainedDiagnosticSnapshot { + document, + outcome: outcome.clone(), + delivery, + }, + ); + outcome + } + + pub(super) fn take_settled_diagnostic_validation( + &mut self, + uri: &str, + document: &DiagnosticDocumentIdentity, + ) -> Option { + let retained = self.diagnostics.document_snapshots.get_mut(uri)?; + if retained.document != *document { + self.diagnostics.document_snapshots.remove(uri); + return None; + } + if retained.delivery != DiagnosticSnapshotDelivery::SettledValidation { + return None; + } + let outcome = retained.outcome.clone(); + if matches!(&outcome, DiagnosticSnapshotOutcome::Ready { .. }) { + retained.delivery = DiagnosticSnapshotDelivery::Admitted; + } else { + self.diagnostics.document_snapshots.remove(uri); + } + Some(outcome) + } + + pub(super) fn pending_diagnostic_publication( + &self, + uri: &str, + pending: &PendingDiagnosticRefresh, + ) -> DiagnosticSnapshotOutcome { + if let Some(retained) = self.diagnostics.document_snapshots.get(uri) + && retained.document == pending.document + && matches!(&retained.outcome, DiagnosticSnapshotOutcome::Ready { + completed_operation_id: Some(operation_id), .. + } if operation_id == &pending.identity.operation_id) + { + return retained.outcome.clone(); + } + DiagnosticSnapshotOutcome::Failed { + source_generation: pending.identity.source_generation, + failure_class: "diagnostic-publication-unavailable".to_owned(), + } + } + + pub(super) fn reserve_document_diagnostic_snapshot(&mut self, uri: &str) -> bool { + if self.diagnostics.document_snapshots.contains_key(uri) + || self.diagnostics.document_snapshots.len() < MAX_WORKSPACE_DIAGNOSTIC_RESULTS + { + return true; + } + // Open documents retain their current report. Unopened pull results + // share the existing bounded result policy and can be recomputed after + // eviction; an active completion must keep its publication retry. + let evicted = self + .diagnostics + .document_snapshots + .keys() + .find(|candidate| { + self.lifecycle.overlays.version(candidate).is_none() + && !self.diagnostics.active_refreshes.contains_key(*candidate) + }) + .cloned(); + let Some(evicted) = evicted else { + return false; + }; + self.diagnostics.document_snapshots.remove(&evicted); + self.diagnostics.published.remove(&evicted); + true + } + + pub(super) fn retire_diagnostic_refresh(&mut self, uri: &str) { + if let Some(pending) = self.diagnostics.active_refreshes.remove(uri) { + // Removing result ownership and requesting abort do not assert that + // accepted analyzer work has already stopped. + let _ = self.diagnostics.provider.retire_document_refresh( + &pending.document.root, + uri, + &pending.identity.operation_id, + ); + } + } + + /// A dependency edit can invalidate any report in its admitted root. Route + /// each document through the workspace authority so nested roots stay isolated. + pub(super) fn invalidate_root_diagnostics(&mut self, root: &AdmittedRoot) { + let documents: BTreeSet<_> = self + .diagnostics + .document_snapshots + .keys() + .chain(self.diagnostics.active_refreshes.keys()) + .chain(self.diagnostics.published.keys()) + .filter(|uri| self.document_root(uri).is_ok_and(|owner| &owner == root)) + .cloned() + .collect(); + let invalidated = !documents.is_empty(); + for uri in documents { + self.invalidate_document_diagnostics(&uri); + self.discard_queued_document_publications(&uri); + } + if invalidated { + self.queue_diagnostic_refresh(); + } + } + + pub(super) fn invalidate_document_diagnostics(&mut self, uri: &str) { + self.retire_diagnostic_refresh(uri); + self.diagnostics.document_snapshots.remove(uri); + if self.lifecycle.overlays.version(uri).is_none() { + self.diagnostics.published.remove(uri); + } + } + + pub(super) fn clear_document_diagnostics(&mut self) { + let documents: Vec<_> = self.diagnostics.active_refreshes.keys().cloned().collect(); + for uri in documents { + self.retire_diagnostic_refresh(&uri); + } + self.diagnostics.document_snapshots.clear(); + } +} + +fn diagnostic_snapshot_fits(snapshot: &GenerationDiagnostics) -> Result<(), &'static str> { + // Count every retained field against the existing diagnostic result byte + // bound, including fields that either presentation may omit. + let mut remaining = MAX_WORKSPACE_DIAGNOSTIC_BYTES; + for diagnostic in snapshot.upstream.iter().chain(&snapshot.tracedecay) { + let value = diagnostic_value( + diagnostic.clone(), + DiagnosticSerializationCapabilities::full_identity(), + ); + let bytes = serde_json::to_vec(&value).map_err(|_| "diagnostic-serialization-failed")?; + remaining = remaining + .checked_sub(bytes.len().saturating_add(diagnostic.uri.len())) + .ok_or("diagnostic-result-byte-capacity")?; + } + Ok(()) +} diff --git a/crates/tracedecay-lsp/src/protocol/diagnostics_controller.rs b/crates/tracedecay-lsp/src/protocol/diagnostics_controller.rs index fc66f5f5b0..353b556e45 100644 --- a/crates/tracedecay-lsp/src/protocol/diagnostics_controller.rs +++ b/crates/tracedecay-lsp/src/protocol/diagnostics_controller.rs @@ -1,4 +1,8 @@ -use super::outbound_controller::PublicationTag; +use super::diagnostic_snapshots::{ + DiagnosticDocumentIdentity, DiagnosticRefreshState, DiagnosticSnapshotDelivery, + PendingDiagnosticRefresh, RetainedDiagnosticSnapshot, +}; +use super::outbound_controller::{PublicationRejection, PublicationTag}; use super::workspace_diagnostics_controller::WorkspaceDiagnosticResultIdentity; use super::{ BTreeMap, ConnectionLocalRequestSequence, DaemonLspProtocolSession, DebouncedDiagnosticKind, @@ -27,13 +31,6 @@ pub(super) struct PublishedDiagnostic { pub(super) scope_set_digest: Option, } -#[derive(Clone)] -pub(super) struct PendingDiagnosticRefresh { - pub(super) identity: DiagnosticRefreshIdentity, - pub(super) overlay_version: i64, - pub(super) scope_digest: Option, - pub(super) scope_set_digest: Option, -} #[derive(Clone, Eq, PartialEq)] pub(super) struct NativeDiagnosticSnapshot { pub(super) version: i64, @@ -47,6 +44,7 @@ where pub(super) provider: D, pub(super) debounce: OverlayDiagnosticDebouncer, pub(super) published: BTreeMap, + pub(super) document_snapshots: BTreeMap, pub(super) native_upstream: BTreeMap, pub(super) cursor_native_mode: bool, pub(super) next_server_request_id: ConnectionLocalRequestSequence, @@ -67,6 +65,7 @@ where provider, debounce: OverlayDiagnosticDebouncer::default(), published: BTreeMap::new(), + document_snapshots: BTreeMap::new(), native_upstream: BTreeMap::new(), cursor_native_mode: false, next_server_request_id: ConnectionLocalRequestSequence::starting_at(1), @@ -234,6 +233,7 @@ where self.diagnostics .native_upstream .insert(uri.clone(), snapshot); + self.invalidate_document_diagnostics(&uri); if !self .diagnostics .debounce @@ -264,17 +264,54 @@ where self.lifecycle.gateway.request_document_diagnostics(uri), |()| Value::Null, )?; - self.poll_diagnostic_refresh(uri); let overlay = self.lifecycle.overlays.snapshot(uri); let root = self.document_root(uri)?; - let outcome = self + let document = DiagnosticDocumentIdentity::new( + &root, + self.lifecycle.gateway.workspace().scope_set_digest(), + overlay.as_ref(), + ); + let mut settled = self.take_settled_diagnostic_validation(uri, &document); + let validating = self .diagnostics - .provider - .document_diagnostics(&root, uri, overlay.as_ref()); + .active_refreshes + .get(uri) + .is_some_and(|pending| { + pending.document == document + && pending.state == DiagnosticRefreshState::ValidatingPull + }); + let completed = if settled.is_none() { + let completed = self.poll_diagnostic_refresh(uri); + settled = self.take_settled_diagnostic_validation(uri, &document); + completed + } else { + None + }; + let consumed_validation = settled.is_some() + || (validating + && completed.as_ref().is_some_and(|outcome| { + !matches!(outcome, DiagnosticSnapshotOutcome::Refreshing(_)) + })); + let outcome = settled.or(completed).unwrap_or_else(|| { + self.document_diagnostic_snapshot(&root, uri, overlay.as_ref(), true) + }); let version = overlay.as_ref().map_or(0, |overlay| overlay.version); - let source_generation = diagnostic_source_generation(&outcome); - let _refresh_failure = - self.request_diagnostic_refresh(uri, version, overlay.as_ref(), source_generation); + if !consumed_validation && !matches!(&outcome, DiagnosticSnapshotOutcome::Ready { .. }) { + let source_generation = diagnostic_source_generation(&outcome); + if let Some(failure_class) = + self.request_diagnostic_refresh(uri, overlay.as_ref(), source_generation) + && (matches!(&outcome, DiagnosticSnapshotOutcome::Partial { coverage, .. } + if coverage == "refresh-required") + || matches!(&outcome, DiagnosticSnapshotOutcome::Refreshing(_))) + { + return Err(refresh_pending_failure( + None, + None, + None, + Some(failure_class), + )); + } + } let diagnostics = match outcome { DiagnosticSnapshotOutcome::Ready { diagnostics, .. } => diagnostics, DiagnosticSnapshotOutcome::Refreshing(refresh) => { @@ -303,36 +340,14 @@ where )); } }; + self.diagnostics.debounce.cancel(uri); let generation = diagnostics.generation; - if self - .diagnostics - .published - .get(uri) - .is_some_and(|published| { - published.version == version - && published.generation > generation - && published.scope_digest == root.scope_digest().cloned() - && published.scope_set_digest - == self - .lifecycle - .gateway - .workspace() - .scope_set_digest() - .cloned() - }) - { - return Err(refresh_pending_failure( - None, - None, - None, - Some("superseded-generation".to_owned()), - )); - } let result_id = diagnostic_result_id( self.lifecycle.gateway.workspace().scope_set_digest(), root.scope_digest(), self.lifecycle.gateway.workspace().root_ordinal(&root), generation, + &diagnostics.authority_digest, version, ); let merged = self.merge_document_diagnostics( @@ -358,22 +373,6 @@ where DiagnosticSerializationCapabilities::pull(self.lifecycle.gateway.capabilities()), )); } - if overlay.is_some() { - self.diagnostics.published.insert( - uri.to_owned(), - PublishedDiagnostic { - version, - generation, - scope_digest: root.scope_digest().cloned(), - scope_set_digest: self - .lifecycle - .gateway - .workspace() - .scope_set_digest() - .cloned(), - }, - ); - } Ok(value) } @@ -395,12 +394,15 @@ where .get(&scheduled.uri) .map_or(0, |published| published.generation); self.discard_document_publications(&scheduled.uri); - if self.publish_diagnostics( - &scheduled.uri, - scheduled.version, - generation, - Vec::new(), - ) { + if self + .publish_diagnostics( + &scheduled.uri, + scheduled.version, + generation, + Vec::new(), + ) + .is_ok() + { self.diagnostics.published.remove(&scheduled.uri); self.queue_diagnostic_refresh(); } @@ -410,17 +412,11 @@ where let Ok(root) = self.document_root(&scheduled.uri) else { continue; }; - let outcome = self.diagnostics.provider.document_diagnostics( + let outcome = self.document_diagnostic_snapshot( &root, &scheduled.uri, overlay.as_ref(), - ); - let source_generation = diagnostic_source_generation(&outcome); - let _ = self.request_diagnostic_refresh( - &scheduled.uri, - scheduled.version, - overlay.as_ref(), - source_generation, + false, ); if let DiagnosticSnapshotOutcome::Ready { diagnostics, .. } = outcome { let _ = self.publish_complete_snapshot( @@ -428,6 +424,13 @@ where scheduled.version, diagnostics, ); + } else { + let source_generation = diagnostic_source_generation(&outcome); + let _ = self.request_diagnostic_refresh( + &scheduled.uri, + overlay.as_ref(), + source_generation, + ); } } } @@ -437,21 +440,29 @@ where pub(super) fn request_diagnostic_refresh( &mut self, uri: &str, - version: i64, overlay: Option<&crate::overlay::OverlaySnapshot>, source_generation: Option, ) -> Option { + let Ok(root) = self.document_root(uri) else { + return Some("document-root-unavailable".to_owned()); + }; + let document = DiagnosticDocumentIdentity::new( + &root, + self.lifecycle.gateway.workspace().scope_set_digest(), + overlay, + ); if self .diagnostics .active_refreshes .get(uri) - .is_some_and(|pending| pending.overlay_version == version) + .is_some_and(|pending| pending.document == document) { return None; } - let Ok(root) = self.document_root(uri) else { - return Some("document-root-unavailable".to_owned()); - }; + self.retire_diagnostic_refresh(uri); + if !self.reserve_document_diagnostic_snapshot(uri) { + return Some("diagnostic-result-capacity".to_owned()); + } match self.diagnostics.provider.request_document_refresh( &root, uri, @@ -461,20 +472,21 @@ where DiagnosticRefreshAdmission::Started(identity) | DiagnosticRefreshAdmission::AlreadyRunning(identity) => { if !valid_refresh_identity(&identity, source_generation) { + let _ = self.diagnostics.provider.retire_document_refresh( + &root, + uri, + &identity.operation_id, + ); return Some("invalid-refresh-identity".to_owned()); } + self.diagnostics.document_snapshots.remove(uri); + self.diagnostics.debounce.cancel(uri); self.diagnostics.active_refreshes.insert( uri.to_owned(), PendingDiagnosticRefresh { identity, - overlay_version: version, - scope_digest: root.scope_digest().cloned(), - scope_set_digest: self - .lifecycle - .gateway - .workspace() - .scope_set_digest() - .cloned(), + document, + state: DiagnosticRefreshState::Refreshing, }, ); None @@ -484,81 +496,92 @@ where } pub(super) fn poll_diagnostic_refreshes(&mut self) { - let documents: Vec<_> = self.diagnostics.active_refreshes.keys().cloned().collect(); - for document in documents { + let (validations, publications): (Vec<_>, Vec<_>) = self + .diagnostics + .active_refreshes + .iter() + .map(|(uri, pending)| (uri.clone(), pending.state)) + .partition(|(_, state)| *state == DiagnosticRefreshState::ValidatingPull); + for (uri, _) in validations { + self.poll_diagnostic_refresh(&uri); + } + for (uri, _) in publications { if !self.has_outbound_capacity(MAX_PUBLICATION_BYTES) { break; } - self.poll_diagnostic_refresh(&document); + self.poll_diagnostic_refresh(&uri); } } #[tracing::instrument(name = "lsp.diagnostics.refresh_poll", level = "trace", skip_all)] - pub(super) fn poll_diagnostic_refresh(&mut self, uri: &str) { - let Some(pending) = self.diagnostics.active_refreshes.get(uri).cloned() else { - return; - }; - let version = self.lifecycle.overlays.version(uri).unwrap_or_default(); - if version != pending.overlay_version { - self.diagnostics.active_refreshes.remove(uri); - return; - } + pub(super) fn poll_diagnostic_refresh( + &mut self, + uri: &str, + ) -> Option { + let pending = self.diagnostics.active_refreshes.get(uri).cloned()?; let overlay = self.lifecycle.overlays.snapshot(uri); + let version = overlay.as_ref().map_or(0, |overlay| overlay.version); let Ok(root) = self.document_root(uri) else { - self.diagnostics.active_refreshes.remove(uri); - return; + self.invalidate_document_diagnostics(uri); + return None; }; - if pending.scope_digest != root.scope_digest().cloned() - || pending.scope_set_digest - != self - .lifecycle - .gateway - .workspace() - .scope_set_digest() - .cloned() + if pending.document + != DiagnosticDocumentIdentity::new( + &root, + self.lifecycle.gateway.workspace().scope_set_digest(), + overlay.as_ref(), + ) { - self.diagnostics.active_refreshes.remove(uri); - return; + self.invalidate_document_diagnostics(uri); + return None; } - match self - .diagnostics - .provider - .document_diagnostics(&root, uri, overlay.as_ref()) - { + let outcome = if pending.state == DiagnosticRefreshState::PublicationPending { + self.pending_diagnostic_publication(uri, &pending) + } else { + let outcome = + self.diagnostics + .provider + .document_diagnostics(&root, uri, overlay.as_ref()); + self.admit_document_diagnostic_snapshot( + uri, + pending.document.clone(), + outcome, + if pending.state == DiagnosticRefreshState::ValidatingPull { + DiagnosticSnapshotDelivery::SettledValidation + } else { + DiagnosticSnapshotDelivery::Admitted + }, + ) + }; + if pending.state == DiagnosticRefreshState::ValidatingPull { + if !matches!(&outcome, DiagnosticSnapshotOutcome::Refreshing(_)) { + self.retire_diagnostic_refresh(uri); + } + return Some(outcome); + } + match outcome.clone() { DiagnosticSnapshotOutcome::Ready { diagnostics, completed_operation_id, } if completed_operation_id.as_deref() == Some(pending.identity.operation_id.as_str()) => { - let generation = diagnostics.generation; - let target_matches = pending - .identity - .target_generation - .is_none_or(|target| target == generation); - let source_not_superseded = pending - .identity - .source_generation - .is_none_or(|source| generation >= source); - let publication_not_superseded = - self.diagnostics.published.get(uri).is_none_or(|published| { - published.version != version || published.generation <= generation - }); - if target_matches && source_not_superseded && publication_not_superseded { - if self.publish_complete_snapshot(uri, version, diagnostics) { - self.diagnostics.active_refreshes.remove(uri); - } - } else { - self.diagnostics.active_refreshes.remove(uri); + if self.publish_complete_snapshot(uri, version, diagnostics) + != Err(PublicationRejection::Backpressured) + { + self.retire_diagnostic_refresh(uri); + } else if let Some(pending) = self.diagnostics.active_refreshes.get_mut(uri) { + pending.state = DiagnosticRefreshState::PublicationPending; } } DiagnosticSnapshotOutcome::Partial { .. } | DiagnosticSnapshotOutcome::Failed { .. } => { - self.diagnostics.active_refreshes.remove(uri); + self.retire_diagnostic_refresh(uri); self.queue_diagnostic_refresh(); } DiagnosticSnapshotOutcome::Ready { .. } | DiagnosticSnapshotOutcome::Refreshing(_) => {} } + Some(outcome) } pub(super) fn publish_complete_snapshot( @@ -566,7 +589,7 @@ where uri: &str, version: i64, snapshot: crate::provider::GenerationDiagnostics, - ) -> bool { + ) -> Result<(), PublicationRejection> { let generation = snapshot.generation; if self .diagnostics @@ -576,7 +599,7 @@ where published.version == version && published.generation > generation }) { - return false; + return Err(PublicationRejection::Discarded); } let merged = self.merge_document_diagnostics( uri, @@ -587,19 +610,23 @@ where .capabilities() .publish_diagnostics_data, ); - if self + let publication = if self .lifecycle .gateway .capabilities() .supports_publish_diagnostics - && !self.publish_diagnostics( + { + self.publish_diagnostics( uri, version, generation, self.scope_diagnostic_related_information(merged.items), ) - { - return false; + } else { + Ok(()) + }; + if publication == Err(PublicationRejection::Backpressured) { + return publication; } self.diagnostics.published.insert( uri.to_owned(), @@ -619,7 +646,7 @@ where }, ); self.queue_diagnostic_refresh(); - true + publication } #[tracing::instrument(name = "lsp_diagnostics_merge_document", level = "trace", skip_all)] @@ -665,14 +692,14 @@ where version: i64, generation: u64, diagnostics: Vec, - ) -> bool { + ) -> Result<(), PublicationRejection> { if !self .lifecycle .gateway .capabilities() .supports_publish_diagnostics { - return false; + return Err(PublicationRejection::Discarded); } let capabilities = self.lifecycle.gateway.capabilities(); let mut params = json!({ @@ -900,7 +927,7 @@ pub(super) fn workspace_diagnostic_failure( } } -fn valid_refresh_identity( +pub(super) fn valid_refresh_identity( identity: &DiagnosticRefreshIdentity, source_generation: Option, ) -> bool { diff --git a/crates/tracedecay-lsp/src/protocol/lifecycle_controller.rs b/crates/tracedecay-lsp/src/protocol/lifecycle_controller.rs index 77d7ca74d2..4b2b8b2a38 100644 --- a/crates/tracedecay-lsp/src/protocol/lifecycle_controller.rs +++ b/crates/tracedecay-lsp/src/protocol/lifecycle_controller.rs @@ -264,6 +264,7 @@ where } } } + self.clear_document_diagnostics(); self.lifecycle.overlays.clear(); self.diagnostics.debounce.clear(); self.outbound.queue.clear(); @@ -274,7 +275,6 @@ where self.diagnostics.cursor_native_mode = false; self.diagnostics.refresh_request = None; self.diagnostics.refresh_needed = false; - self.diagnostics.active_refreshes.clear(); self.diagnostics.workspace_results.clear(); self.diagnostics.workspace_snapshots.clear(); self.diagnostics.workspace_failures.clear(); @@ -292,6 +292,17 @@ where pub(super) fn clear_removed_workspace_root_state(&mut self, removed: &[AdmittedRoot]) { let belongs_to_removed_root = |uri: &str| removed.iter().any(|root| root.contains_document(uri)); + let diagnostic_documents = self + .diagnostics + .active_refreshes + .keys() + .chain(self.diagnostics.document_snapshots.keys()) + .filter(|uri| belongs_to_removed_root(uri)) + .cloned() + .collect::>(); + for uri in diagnostic_documents { + self.invalidate_document_diagnostics(&uri); + } let request_ids = self .semantic .pending @@ -327,9 +338,6 @@ where self.diagnostics .native_upstream .retain(|uri, _| !belongs_to_removed_root(uri)); - self.diagnostics - .active_refreshes - .retain(|uri, _| !belongs_to_removed_root(uri)); self.diagnostics .workspace_results .retain(|uri, _| !belongs_to_removed_root(uri)); @@ -449,6 +457,9 @@ where self.cancel_pending_operations(); match self.lifecycle.control.shutdown() { Ok(()) => { + self.clear_document_diagnostics(); + self.diagnostics.published.clear(); + self.diagnostics.debounce.clear(); let _ = self.enqueue_value(success_response(response_id, Value::Null)); } Err(_) => { diff --git a/crates/tracedecay-lsp/src/protocol/outbound_controller.rs b/crates/tracedecay-lsp/src/protocol/outbound_controller.rs index 21edca37a3..79304a4305 100644 --- a/crates/tracedecay-lsp/src/protocol/outbound_controller.rs +++ b/crates/tracedecay-lsp/src/protocol/outbound_controller.rs @@ -23,6 +23,12 @@ pub(super) struct PublicationTag { pub(super) generation: u64, } +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub(super) enum PublicationRejection { + Discarded, + Backpressured, +} + #[derive(Clone, Debug, Eq, PartialEq)] pub(super) struct QueuedFrame { pub(super) payload: LspFrame, @@ -181,16 +187,18 @@ where true } - pub(super) fn enqueue_publication(&mut self, value: Value, tag: PublicationTag) -> bool { + pub(super) fn enqueue_publication( + &mut self, + value: Value, + tag: PublicationTag, + ) -> Result<(), PublicationRejection> { let Ok(payload) = serde_json::to_vec(&value) else { - return false; + return Err(PublicationRejection::Discarded); }; if payload.len() > MAX_PUBLICATION_BYTES { - return false; - } - if self.publication_replacement(&payload, &tag).is_err() { - return false; + return Err(PublicationRejection::Discarded); } + self.publication_replacement(&payload, &tag)?; match self.lifecycle.control.admit_payload_publication( tag.uri.clone(), tag.version, @@ -198,12 +206,18 @@ where &payload, ) { PublicationAdmission::Accepted => {} - PublicationAdmission::Duplicate | PublicationAdmission::Stale => return false, - PublicationAdmission::TooLarge { .. } | PublicationAdmission::SessionUnavailable => { - return false; + PublicationAdmission::Duplicate + | PublicationAdmission::Stale + | PublicationAdmission::TooLarge { .. } + | PublicationAdmission::SessionUnavailable => { + return Err(PublicationRejection::Discarded); } } - self.enqueue_frame(payload, Some(tag), None) + if self.enqueue_frame(payload, Some(tag), None) { + Ok(()) + } else { + Err(PublicationRejection::Backpressured) + } } pub(super) fn enqueue_frame( @@ -258,7 +272,7 @@ where &self, payload: &[u8], tag: &PublicationTag, - ) -> Result, ()> { + ) -> Result, PublicationRejection> { let replacement = self .outbound .queue @@ -276,12 +290,15 @@ where .and_then(|index| self.outbound.queue.get(index)) .map_or(0, |frame| frame.payload.len()); if let Some(index) = replacement { - let existing = self.outbound.queue[index].publication.as_ref().ok_or(())?; + let existing = self.outbound.queue[index] + .publication + .as_ref() + .ok_or(PublicationRejection::Discarded)?; if (tag.version, tag.generation) < (existing.version, existing.generation) || ((tag.version, tag.generation) == (existing.version, existing.generation) && self.outbound.queue[index].payload == payload) { - return Err(()); + return Err(PublicationRejection::Discarded); } } let projected_messages = self.outbound.queue.len() + usize::from(replacement.is_none()); @@ -293,14 +310,21 @@ where if projected_messages > MAX_ORDINARY_OUTBOUND_MESSAGES || projected_bytes > MAX_ORDINARY_OUTBOUND_BYTES { - return Err(()); + return Err(PublicationRejection::Backpressured); } Ok(replacement) } pub(super) fn discard_document_publications(&mut self, uri: &str) { self.discard_document_context(uri); - self.diagnostics.active_refreshes.remove(uri); + self.invalidate_document_diagnostics(uri); + self.discard_queued_document_publications(uri); + self.lifecycle.control.remove_publication(uri); + self.diagnostics.published.remove(uri); + } + + pub(super) fn discard_queued_document_publications(&mut self, uri: &str) { + let mut discarded = false; let mut retained = VecDeque::with_capacity(self.outbound.queue.len()); let mut index = 0_usize; while let Some(frame) = self.outbound.queue.pop_front() { @@ -312,6 +336,7 @@ where .as_ref() .is_some_and(|publication| publication.uri == uri) { + discarded = true; self.outbound.queued_bytes = self .outbound .queued_bytes @@ -321,8 +346,11 @@ where } } self.outbound.queue = retained; - self.lifecycle.control.remove_publication(uri); - self.diagnostics.published.remove(uri); + if discarded { + // A dropped queue entry was never acknowledged; a fresh identical + // report still needs delivery. Preserve already acknowledged dedupe. + self.lifecycle.control.remove_publication(uri); + } } pub(super) fn has_outbound_capacity(&self, reserve_bytes: usize) -> bool { diff --git a/crates/tracedecay-lsp/src/protocol/tests.rs b/crates/tracedecay-lsp/src/protocol/tests.rs index 960e44f6fa..04bb61446e 100644 --- a/crates/tracedecay-lsp/src/protocol/tests.rs +++ b/crates/tracedecay-lsp/src/protocol/tests.rs @@ -18,6 +18,7 @@ use tracedecay_domain::{ContentDigest, ManifestDigest}; use tracedecay_tool_catalog::{BindingSurface, CatalogContributionInputV1, CatalogContributionV1}; mod diagnostic_publication; +mod diagnostic_snapshots; mod semantic_lifecycle; mod workspace_diagnostics; diff --git a/crates/tracedecay-lsp/src/protocol/tests/diagnostic_publication.rs b/crates/tracedecay-lsp/src/protocol/tests/diagnostic_publication.rs index 687290d789..ded8004001 100644 --- a/crates/tracedecay-lsp/src/protocol/tests/diagnostic_publication.rs +++ b/crates/tracedecay-lsp/src/protocol/tests/diagnostic_publication.rs @@ -164,7 +164,11 @@ fn assert_diagnostic_delivery( .collect::>(); assert!(messages.windows(2).all(|pair| pair[0] < pair[1])); }; - assert!(session.publish_complete_snapshot("file:///root/a.rs", 1, snapshot.clone())); + assert!( + session + .publish_complete_snapshot("file:///root/a.rs", 1, snapshot.clone()) + .is_ok() + ); let publication: Value = session .drain_outbound() .iter() @@ -666,7 +670,10 @@ fn pull_diagnostics_are_generation_bound_and_return_unchanged_for_same_result_id let first = session.drain_outbound(); let first: Value = serde_json::from_slice(&first[0]).unwrap(); let result_id = first["result"]["resultId"].as_str().unwrap().to_owned(); - assert_eq!(result_id, "generation:9:version:0"); + assert_eq!( + result_id, + format!("generation:9:version:0:authority:sha256:{}", "a".repeat(64)) + ); let request = json!({ "jsonrpc": "2.0", "id": 4, diff --git a/crates/tracedecay-lsp/src/protocol/tests/diagnostic_snapshots.rs b/crates/tracedecay-lsp/src/protocol/tests/diagnostic_snapshots.rs new file mode 100644 index 0000000000..0841a12b5c --- /dev/null +++ b/crates/tracedecay-lsp/src/protocol/tests/diagnostic_snapshots.rs @@ -0,0 +1,1465 @@ +use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering}; +use std::sync::{Arc, Mutex}; +use std::task::{Context, Poll, Waker}; + +use serde_json::{Value, json}; +use tracedecay_domain::ManifestDigest; +use tracedecay_domain::test_fixtures::digest; + +use super::{Feedback, Semantics}; +use crate::analyzer::broker::DiagnosticSeverity; +use crate::capabilities::{ + ClientCapabilities, GatewayCapabilities, UpstreamCapabilities, negotiate_capabilities, +}; +use crate::diagnostics::{DiagnosticSource, GatewayDiagnostic, LspPosition, LspRange}; +use crate::gateway::{ + AdmittedRoot, LspRuntimeFailure, LspRuntimeFuture, LspRuntimeSpawner, LspRuntimeTask, +}; +use crate::overlay::{ + CanonicalDiagnosticRefreshRequest, CanonicalDiagnosticSnapshotAuthority, + DiagnosticSnapshotAdapter, MAX_DIAGNOSTIC_OPERATIONS, OverlaySnapshot, +}; +use crate::protocol::{DaemonLspProtocolSession, MAX_QUEUED_OUTBOUND_MESSAGES}; +use crate::provider::{ + DiagnosticRefreshAdmission, DiagnosticSnapshotOutcome, DiagnosticSnapshotPort, + DiagnosticSnapshotValidation, GenerationDiagnostics, +}; +use crate::session::AuthorizedLspWorkspace; +use crate::workspace_diagnostics::{ + MAX_WORKSPACE_DIAGNOSTIC_BYTES, MAX_WORKSPACE_DIAGNOSTIC_RESULTS, +}; + +const DOCUMENT: &str = "file:///root/a.rs"; + +#[derive(Default)] +struct ControlledRuntime(Mutex>>); + +struct ControlledTask(Mutex>>); + +impl LspRuntimeTask for Arc { + // Accepted work can finish after an advisory abort. Keep the future so a + // test can explicitly deliver that late completion to the retired channel. + fn abort(&self) {} +} + +impl LspRuntimeSpawner for ControlledRuntime { + fn spawn(&self, future: LspRuntimeFuture<()>) -> Box { + let task = Arc::new(ControlledTask(Mutex::new(Some(future)))); + self.0.lock().unwrap().push(Arc::clone(&task)); + Box::new(task) + } +} + +impl ControlledRuntime { + fn complete_next(&self) { + let tasks = self.0.lock().unwrap(); + let mut future = tasks + .iter() + .find_map(|task| task.0.lock().unwrap().take()) + .expect("an admitted diagnostic computation must be waiting"); + assert_eq!( + future + .as_mut() + .poll(&mut Context::from_waker(Waker::noop())), + Poll::Ready(()), + ); + } + + fn started(&self) -> usize { + self.0.lock().unwrap().len() + } +} + +#[derive(Default)] +struct DiagnosticAuthority { + generation: AtomicU64, + next_generation: Mutex>, + next_failure: Mutex>, + next_code: Mutex>, + authority_digest: Arc>>, + validation_pending: Arc, + validation_failure: Arc>>, +} + +impl CanonicalDiagnosticSnapshotAuthority for DiagnosticAuthority { + fn current_authority( + &self, + _request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + let digest = Arc::clone(&self.authority_digest); + let pending = Arc::clone(&self.validation_pending); + let failure = Arc::clone(&self.validation_failure); + Box::pin(std::future::poll_fn(move |_| { + if pending.load(Ordering::SeqCst) { + Poll::Pending + } else if let Some(failure) = failure.lock().unwrap().take() { + Poll::Ready(Err(LspRuntimeFailure::new(failure))) + } else { + Poll::Ready(Ok(digest + .lock() + .unwrap() + .clone() + .unwrap_or_else(|| tracedecay_domain::test_fixtures::digest('a')))) + } + })) + } + + fn refresh( + &self, + request: CanonicalDiagnosticRefreshRequest, + ) -> LspRuntimeFuture> { + let next_generation = self.generation.fetch_add(1, Ordering::SeqCst) + 1; + let generation = self + .next_generation + .lock() + .unwrap() + .take() + .unwrap_or(next_generation); + let failure = self.next_failure.lock().unwrap().take(); + let code = self + .next_code + .lock() + .unwrap() + .take() + .unwrap_or_else(|| "retained-snapshot".to_owned()); + let version = request + .overlay + .as_ref() + .map_or(0, |overlay| overlay.version); + let authority_digest = self + .authority_digest + .lock() + .unwrap() + .clone() + .unwrap_or_else(|| digest('a')); + Box::pin(async move { + if let Some(failure) = failure { + return Err(LspRuntimeFailure::new(failure)); + } + Ok(GenerationDiagnostics { + generation, + authority_digest, + upstream: vec![GatewayDiagnostic { + uri: request.document_uri, + range: LspRange { + start: LspPosition { + line: 0, + character: 0, + }, + end: LspPosition { + line: 0, + character: 1, + }, + }, + severity: Some(DiagnosticSeverity::Warning), + code: Some(code), + code_description_uri: None, + message: format!("generation {generation}, version {version}"), + source: DiagnosticSource::Upstream, + related_information: Vec::new(), + data: None, + }], + tracedecay: Vec::new(), + }) + }) + } +} + +// This wrapper only selects a scheduler interleaving. All operation admission, +// completion ownership, and retirement still belong to the real adapter. +struct ControlledDiagnosticPort { + adapter: DiagnosticSnapshotAdapter, + runtime: Arc, + complete_after_read: AtomicBool, + reads: AtomicUsize, +} + +impl DiagnosticSnapshotPort for ControlledDiagnosticPort { + fn document_diagnostics( + &self, + root: &AdmittedRoot, + document_uri: &str, + overlay: Option<&OverlaySnapshot>, + ) -> DiagnosticSnapshotOutcome { + self.reads.fetch_add(1, Ordering::SeqCst); + let outcome = self + .adapter + .document_diagnostics(root, document_uri, overlay); + if matches!(outcome, DiagnosticSnapshotOutcome::Refreshing(_)) + && self.complete_after_read.swap(false, Ordering::SeqCst) + { + self.runtime.complete_next(); + } + outcome + } + + fn request_document_refresh( + &self, + root: &AdmittedRoot, + document_uri: &str, + overlay: Option<&OverlaySnapshot>, + source_generation: Option, + ) -> DiagnosticRefreshAdmission { + self.adapter + .request_document_refresh(root, document_uri, overlay, source_generation) + } + + fn validate_document_snapshot( + &self, + root: &AdmittedRoot, + document_uri: &str, + overlay: Option<&OverlaySnapshot>, + snapshot: &GenerationDiagnostics, + ) -> DiagnosticSnapshotValidation { + self.adapter + .validate_document_snapshot(root, document_uri, overlay, snapshot) + } + + fn retire_document_refresh( + &self, + root: &AdmittedRoot, + document_uri: &str, + operation_id: &str, + ) -> bool { + self.adapter + .retire_document_refresh(root, document_uri, operation_id) + } +} + +struct Harness { + session: DaemonLspProtocolSession, + runtime: Arc, + authority: Arc, + now_ms: u64, + message_duration_ms: u64, + next_request_id: u64, +} + +impl Harness { + fn new(push: bool) -> Self { + Self::with_refresh_support(push, false) + } + + fn with_refresh_support(push: bool, refresh_support: bool) -> Self { + let runtime = Arc::new(ControlledRuntime::default()); + let authority = Arc::new(DiagnosticAuthority::default()); + let provider = ControlledDiagnosticPort { + adapter: DiagnosticSnapshotAdapter::new(runtime.clone(), authority.clone()), + runtime: runtime.clone(), + complete_after_read: AtomicBool::new(false), + reads: AtomicUsize::new(0), + }; + let capabilities = GatewayCapabilities { + supports_workspace_folders: true, + ..GatewayCapabilities::default() + }; + let upstream = UpstreamCapabilities { + supports_diagnostics: true, + ..UpstreamCapabilities::default() + }; + let workspace = AuthorizedLspWorkspace::new( + Some(digest('c')), + vec![AdmittedRoot::authorized("file:///root", digest('b'))], + ) + .unwrap(); + let session = DaemonLspProtocolSession::from_workspace_ports( + workspace, + negotiate_capabilities(&ClientCapabilities::default(), &capabilities, &upstream), + capabilities, + upstream, + Feedback::default(), + Semantics, + provider, + ); + let mut harness = Self { + session, + runtime, + authority, + now_ms: 0, + message_duration_ms: 1, + next_request_id: 1, + }; + let mut capabilities = json!({ + "general": { "positionEncodings": ["utf-16"] }, + "textDocument": { "diagnostic": {} }, + "workspace": { "workspaceFolders": true }, + }); + if push { + capabilities["textDocument"]["publishDiagnostics"] = json!({ "versionSupport": true }); + } + if refresh_support { + capabilities["workspace"]["diagnostic"] = json!({ "refreshSupport": true }); + } + let initialized = harness.request( + "initialize", + json!({ "rootUri": "file:///root", "capabilities": capabilities }), + ); + assert!(initialized.get("error").is_none(), "{initialized}"); + harness.notify("initialized", json!({})); + assert_eq!( + harness + .session + .lifecycle + .gateway + .capabilities() + .supports_publish_diagnostics, + push, + ); + assert_eq!( + harness + .session + .lifecycle + .gateway + .capabilities() + .supports_workspace_diagnostic_refresh, + refresh_support, + ); + harness + } + + fn send(&mut self, value: Value) -> Vec { + self.now_ms += self.message_duration_ms; + self.session + .handle_payload(&serde_json::to_vec(&value).unwrap(), self.now_ms); + self.messages() + } + + fn messages(&mut self) -> Vec { + self.session + .drain_outbound() + .iter() + .map(|message| serde_json::from_slice(message).unwrap()) + .collect() + } + + fn request(&mut self, method: &str, params: Value) -> Value { + let id = self.next_request_id; + self.next_request_id += 1; + self.send(json!({ "jsonrpc": "2.0", "id": id, "method": method, "params": params })) + .into_iter() + .find(|message| message["id"] == id) + .expect("the protocol must answer the request") + } + + fn notify(&mut self, method: &str, params: Value) -> Vec { + self.send(json!({ "jsonrpc": "2.0", "method": method, "params": params })) + } + + fn open(&mut self, version: i64) { + self.notify("textDocument/didOpen", json!({ + "textDocument": { "uri": DOCUMENT, "languageId": "rust", "version": version, "text": "fn a() {}" }, + })); + assert_eq!(self.session.overlays().version(DOCUMENT), Some(version)); + } + + fn start_refresh(&mut self) { + self.now_ms += crate::overlay::OVERLAY_DIAGNOSTIC_DEBOUNCE_MS; + self.session.flush_due(self.now_ms); + self.messages(); + } + + fn pull(&mut self, previous_result: Option<&str>) -> Value { + self.pull_document(DOCUMENT, previous_result) + } + + fn pull_document(&mut self, uri: &str, previous_result: Option<&str>) -> Value { + let mut params = json!({ "textDocument": { "uri": uri } }); + if let Some(previous) = previous_result { + params["previousResultId"] = json!(previous); + } + self.request("textDocument/diagnostic", params) + } +} + +fn assert_full(response: &Value, generation: u64, version: i64) -> String { + assert_eq!(response["result"]["kind"], "full", "{response}"); + assert_eq!( + response["result"]["items"], + expected_items(generation, version) + ); + response["result"]["resultId"].as_str().unwrap().to_owned() +} + +fn expected_items(generation: u64, version: i64) -> Value { + json!([{ + "range": { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 1 } }, + "severity": 2, + "code": "retained-snapshot", + "source": "upstream", + "message": format!("generation {generation}, version {version}"), + }]) +} + +#[test] +fn completed_refresh_is_a_repeatable_document_snapshot() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + assert_eq!(harness.runtime.started(), 1); + harness.runtime.complete_next(); + + let result_id = assert_full(&harness.pull(None), 1, 1); + let repeated = harness.pull(Some(&result_id)); + assert_eq!( + repeated["result"], + json!({ "kind": "unchanged", "resultId": result_id }) + ); + assert_eq!( + harness.runtime.started(), + 1, + "reading a fresh snapshot must not restart computation" + ); +} + +#[test] +fn background_publication_preserves_the_snapshot_for_pull() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + let messages = harness.messages(); + let publication = messages + .iter() + .find(|message| message["method"] == "textDocument/publishDiagnostics") + .expect("completed refresh must publish its diagnostics"); + assert_eq!(publication["params"]["diagnostics"], expected_items(1, 1)); + + assert_full(&harness.pull(None), 1, 1); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn pull_only_clients_keep_completions_between_protocol_ticks() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert!(harness.messages().is_empty(), "push is not negotiated"); + + let result_id = assert_full(&harness.pull(None), 1, 1); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn a_pending_pull_becomes_full_after_its_admitted_work_completes() { + let mut harness = Harness::new(false); + harness.open(1); + let pending = harness.pull(None); + assert!(pending.get("error").is_some(), "{pending}"); + assert!(pending.get("result").is_none()); + assert_eq!(harness.runtime.started(), 1); + + harness.runtime.complete_next(); + assert_full(&harness.pull(None), 1, 1); + harness.start_refresh(); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn completion_between_reads_is_retained_for_later_pulls() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness + .session + .diagnostics + .provider + .complete_after_read + .store(true, Ordering::SeqCst); + + let first = harness.pull(None); + assert!( + !harness + .session + .diagnostics + .provider + .complete_after_read + .load(Ordering::SeqCst) + ); + let full = if first.get("error").is_some() { + assert_eq!(first["error"]["code"], -32802); + harness.pull(None) + } else { + first + }; + let result_id = assert_full(&full, 1, 1); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn content_changes_invalidate_the_retained_document_snapshot() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let old_result = assert_full(&harness.pull(None), 1, 1); + + harness.notify( + "textDocument/didChange", + json!({ + "textDocument": { "uri": DOCUMENT, "version": 2 }, + "contentChanges": [{ "text": "fn changed() {}" }], + }), + ); + let pending = harness.pull(Some(&old_result)); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + assert!(pending.get("result").is_none()); + harness.runtime.complete_next(); + let new_result = assert_full(&harness.pull(Some(&old_result)), 2, 2); + assert_ne!(old_result, new_result); + assert_eq!( + harness.pull(Some(&new_result))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn save_refreshes_a_snapshot_even_when_the_overlay_version_is_unchanged() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let old_result = assert_full(&harness.pull(None), 1, 1); + + harness.notify( + "textDocument/didSave", + json!({ "textDocument": { "uri": DOCUMENT } }), + ); + let pending = harness.pull(Some(&old_result)); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + harness.runtime.complete_next(); + let new_result = assert_full(&harness.pull(Some(&old_result)), 2, 1); + assert_ne!(old_result, new_result); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn retained_reads_revalidate_authority_before_returning_unchanged() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let old = assert_full(&harness.pull(None), 1, 1); + *harness.authority.authority_digest.lock().unwrap() = Some(digest('b')); + *harness.authority.next_generation.lock().unwrap() = Some(1); + let stale = harness.pull(Some(&old)); + assert_eq!(stale["error"]["code"], -32802, "{stale}"); + assert!(stale.get("result").is_none()); + harness.runtime.complete_next(); + let current = assert_full(&harness.pull(Some(&old)), 1, 1); + assert_ne!(current, old); + assert_eq!(harness.pull(Some(¤t))["result"]["kind"], "unchanged"); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn changed_authority_discards_queued_stale_publications() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + *harness.authority.authority_digest.lock().unwrap() = Some(digest('b')); + let messages = harness.send(json!({ + "jsonrpc": "2.0", "id": 999, "method": "textDocument/diagnostic", + "params": { "textDocument": { "uri": DOCUMENT } }, + })); + assert!( + messages + .iter() + .any(|message| { message["id"] == 999 && message["error"]["code"] == -32802 }), + "{messages:?}" + ); + assert!( + !messages.iter().any(|message| { + message["method"] == "textDocument/publishDiagnostics" + && message["params"]["uri"] == DOCUMENT + }), + "{messages:?}" + ); +} + +#[test] +fn pending_authority_validation_is_not_consumed_by_background_publication() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let result = assert_full(&harness.pull(None), 1, 1); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + let pending = harness.pull(Some(&result)); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + assert!(pending.get("result").is_none()); + harness.session.flush_due(harness.now_ms); + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert_eq!(harness.pull(Some(&result))["result"]["kind"], "unchanged"); + assert_eq!(harness.runtime.started(), 2); + assert_eq!( + harness.authority.generation.load(Ordering::SeqCst), + 1, + "validation must not execute a new analyzer refresh" + ); +} + +#[test] +fn settled_pull_validations_release_capacity_without_client_retries() { + let mut harness = Harness::with_refresh_support(true, true); + let mut reports = Vec::new(); + for index in 0..MAX_DIAGNOSTIC_OPERATIONS { + let uri = format!("file:///root/retained-{index:03}.rs"); + assert_eq!(harness.pull_document(&uri, None)["error"]["code"], -32802); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull_document(&uri, None), index as u64 + 1, 0); + reports.push((uri, result_id)); + } + assert_eq!(harness.runtime.started(), reports.len()); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + for (uri, result_id) in &reports { + let pending = harness.pull_document(uri, Some(result_id)); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + assert!(pending["error"]["data"]["operationId"].as_str().is_some()); + assert!(pending.get("result").is_none()); + } + assert_eq!(harness.runtime.started(), reports.len() * 2); + + let fresh_uri = "file:///root/fresh.rs"; + let saturated = harness.pull_document(fresh_uri, None); + assert_eq!(saturated["error"]["code"], -32802, "{saturated}"); + assert_eq!( + saturated["error"]["data"]["failureClass"], + "diagnostic-capacity" + ); + assert_eq!(harness.runtime.started(), reports.len() * 2); + + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + for _ in &reports { + harness.runtime.complete_next(); + } + harness.session.flush_due(harness.now_ms); + assert!( + harness.messages().is_empty(), + "validation settlement must emit neither diagnostics nor a workspace refresh" + ); + + let admitted = harness.pull_document(fresh_uri, None); + assert_eq!(admitted["error"]["code"], -32802, "{admitted}"); + assert_eq!( + admitted["error"]["data"]["coverage"], "refresh-required", + "{admitted}" + ); + let started = harness.runtime.started(); + assert_eq!( + started, + reports.len() * 2 + 1, + "settled validations must release capacity without another pull: {admitted}" + ); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + let (uri, result_id) = reports.last().unwrap(); + assert_eq!( + harness.pull_document(uri, Some(result_id))["result"], + json!({ "kind": "unchanged", "resultId": result_id }), + "a surviving report must consume its settled validation" + ); + assert_eq!(harness.runtime.started(), started); + assert_eq!( + harness.authority.generation.load(Ordering::SeqCst), + reports.len() as u64 + ); + + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + harness.runtime.complete_next(); + assert_full( + &harness.pull_document(fresh_uri, None), + reports.len() as u64 + 1, + 0, + ); +} + +#[test] +fn dependency_changes_invalidate_retained_document_diagnostics() { + for (method, params) in [ + ( + "textDocument/didSave", + json!({ "textDocument": { "uri": "file:///root/b.rs" } }), + ), + ( + "textDocument/didChange", + json!({ + "textDocument": { "uri": "file:///root/b.rs", "version": 2 }, + "contentChanges": [{ "text": "pub fn changed_dependency() {}" }], + }), + ), + ] { + let mut harness = Harness::new(false); + harness.notify( + "textDocument/didOpen", + json!({ + "textDocument": { + "uri": "file:///root/b.rs", "languageId": "rust", "version": 1, + "text": "pub fn dependency() {}", + }, + }), + ); + harness.open(1); + assert_eq!(harness.pull(None)["error"]["code"], -32802); + harness.runtime.complete_next(); + let old_result = assert_full(&harness.pull(None), 1, 1); + + harness.notify(method, params); + let pending = harness.pull(Some(&old_result)); + assert_eq!(pending["error"]["code"], -32802, "{method}: {pending}"); + assert!(pending.get("result").is_none()); + while harness + .runtime + .0 + .lock() + .unwrap() + .iter() + .any(|task| task.0.lock().unwrap().is_some()) + { + harness.runtime.complete_next(); + } + let generation = harness.authority.generation.load(Ordering::SeqCst); + let new_result = assert_full(&harness.pull(Some(&old_result)), generation, 1); + assert_ne!(new_result, old_result); + let started = harness.runtime.started(); + assert_eq!( + harness.pull(Some(&new_result))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), started); + } +} + +#[test] +fn dependency_invalidation_retires_late_work_and_preserves_other_roots() { + let mut harness = Harness::new(false); + harness.notify( + "workspace/didChangeWorkspaceFolders", + json!({ + "event": { + "added": [ + { "uri": "file:///other", "name": "other" }, + { "uri": "file:///root/nested", "name": "nested" }, + ], + "removed": [], + }, + }), + ); + let mutation = harness.session.pending_workspace_folder_mutation().unwrap(); + harness + .session + .apply_workspace_folder_mutation( + &mutation, + AuthorizedLspWorkspace::new( + Some(digest('d')), + vec![ + AdmittedRoot::authorized("file:///root", digest('b')), + AdmittedRoot::authorized("file:///other", digest('e')), + AdmittedRoot::authorized("file:///root/nested", digest('f')), + ], + ) + .unwrap(), + ) + .unwrap(); + let mut unaffected = Vec::new(); + for (index, uri) in ["file:///other/a.rs", "file:///root/nested/a.rs"] + .into_iter() + .enumerate() + { + assert_eq!(harness.pull_document(uri, None)["error"]["code"], -32802); + harness.runtime.complete_next(); + let result = assert_full(&harness.pull_document(uri, None), index as u64 + 1, 0); + unaffected.push((uri, result)); + } + harness.open(1); + assert_eq!(harness.pull(None)["error"]["code"], -32802); + harness.notify( + "textDocument/didSave", + json!({ + "textDocument": { "uri": "file:///root/b.rs" }, + }), + ); + assert_eq!(harness.pull(None)["error"]["code"], -32802); + // The first A operation finishes after B invalidated its ownership. + harness.runtime.complete_next(); + let late = harness.pull(None); + assert_eq!(late["error"]["code"], -32802, "{late}"); + assert!(late.get("result").is_none()); + harness.runtime.complete_next(); + harness.runtime.complete_next(); + assert_full(&harness.pull(None), 5, 1); + for (uri, result) in unaffected { + assert_eq!( + harness.pull_document(uri, Some(&result))["result"]["kind"], + "unchanged" + ); + } + assert_eq!(harness.runtime.started(), 5); +} + +#[test] +fn dependency_invalidation_discards_queued_stale_publications() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + // Leave A's completed publication queued while the dependency changes. + let messages = harness.notify( + "textDocument/didSave", + json!({ + "textDocument": { "uri": "file:///root/b.rs" }, + }), + ); + assert!( + !messages.iter().any(|message| { + message["method"] == "textDocument/publishDiagnostics" + && message["params"]["uri"] == DOCUMENT + }), + "{messages:?}" + ); + assert_eq!(harness.pull(None)["error"]["code"], -32802); +} + +#[test] +fn late_completion_cannot_answer_a_reopened_document_lifetime() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.notify( + "textDocument/didClose", + json!({ "textDocument": { "uri": DOCUMENT } }), + ); + harness.open(1); + assert_eq!(harness.pull(None)["error"]["code"], -32802); + assert_eq!(harness.runtime.started(), 2); + + harness.runtime.complete_next(); + let still_pending = harness.pull(None); + assert_eq!(still_pending["error"]["code"], -32802, "{still_pending}"); + assert!(still_pending.get("result").is_none()); + assert_eq!( + harness.runtime.started(), + 2, + "the successor must keep its operation" + ); + harness.runtime.complete_next(); + assert_full(&harness.pull(None), 2, 1); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn workspace_scope_changes_invalidate_retained_document_evidence() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let old_result = assert_full(&harness.pull(None), 1, 1); + + harness.notify( + "workspace/didChangeWorkspaceFolders", + json!({ + "event": { "added": [{ "uri": "file:///other", "name": "other" }], "removed": [] }, + }), + ); + let mutation = harness.session.pending_workspace_folder_mutation().unwrap(); + let workspace = AuthorizedLspWorkspace::new( + Some(digest('d')), + vec![ + AdmittedRoot::authorized("file:///root", digest('b')), + AdmittedRoot::authorized("file:///other", digest('e')), + ], + ) + .unwrap(); + harness + .session + .apply_workspace_folder_mutation(&mutation, workspace) + .unwrap(); + let pending = harness.pull(Some(&old_result)); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + harness.runtime.complete_next(); + let new_result = assert_full(&harness.pull(Some(&old_result)), 2, 1); + assert_ne!(old_result, new_result); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn unopened_documents_have_repeatable_completed_reports() { + let mut harness = Harness::new(false); + assert_eq!(harness.pull(None)["error"]["code"], -32802); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull(None), 1, 0); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn unopened_document_snapshots_reuse_the_existing_result_bound() { + let mut harness = Harness::new(false); + let mut latest = None; + for index in 0..=MAX_WORKSPACE_DIAGNOSTIC_RESULTS { + let uri = format!("file:///root/closed-{index}.rs"); + assert_eq!(harness.pull_document(&uri, None)["error"]["code"], -32802); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull_document(&uri, None), index as u64 + 1, 0); + assert!( + harness.session.diagnostics.document_snapshots.len() + <= MAX_WORKSPACE_DIAGNOSTIC_RESULTS + ); + assert!(harness.session.diagnostics.published.len() <= MAX_WORKSPACE_DIAGNOSTIC_RESULTS); + latest = Some((uri, result_id)); + } + let (uri, result_id) = latest.unwrap(); + assert_eq!( + harness.pull_document(&uri, Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!( + harness.runtime.started(), + MAX_WORKSPACE_DIAGNOSTIC_RESULTS + 1 + ); +} + +fn assert_incomplete_refresh_replaces_old_snapshot(failure: &'static str, field: &str) { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let old_result = assert_full(&harness.pull(None), 1, 1); + + *harness.authority.next_failure.lock().unwrap() = Some(failure); + harness.notify( + "textDocument/didSave", + json!({ "textDocument": { "uri": DOCUMENT } }), + ); + harness.runtime.complete_next(); + let failed = harness.pull(Some(&old_result)); + assert_eq!(failed["error"]["code"], -32802, "{failed}"); + assert_eq!(failed["error"]["data"][field], failure); + assert!(failed.get("result").is_none()); + let repeated = harness.pull(Some(&old_result)); + assert_eq!(repeated["error"]["code"], -32802, "{repeated}"); + assert!(repeated["error"]["data"]["operationId"].as_str().is_some()); + assert!(repeated.get("result").is_none()); + assert_eq!( + harness.runtime.started(), + 3, + "the observed failure admits one coalesced retry" + ); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull(Some(&old_result)), 3, 1); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 3); +} + +#[test] +fn partial_refreshes_do_not_restore_the_previous_complete_snapshot() { + assert_incomplete_refresh_replaces_old_snapshot( + "diagnostic-broker-coverage-incomplete", + "coverage", + ); +} + +#[test] +fn failed_refreshes_do_not_restore_the_previous_complete_snapshot() { + assert_incomplete_refresh_replaces_old_snapshot("provider-unavailable", "failureClass"); +} + +#[test] +fn publication_backpressure_does_not_discard_a_completed_snapshot() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + for _ in 0..MAX_QUEUED_OUTBOUND_MESSAGES { + if !harness.session.enqueue_value(json!({ + "jsonrpc": "2.0", "method": "window/logMessage", + "params": { "type": 3, "message": "transport occupied" }, + })) { + break; + } + } + assert!( + !harness + .session + .has_outbound_capacity(crate::MAX_PUBLICATION_BYTES) + ); + harness.session.poll_diagnostic_refresh(DOCUMENT); + harness.messages(); + + assert_full(&harness.pull(None), 1, 1); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn shutdown_releases_ready_snapshots_and_retires_late_completions() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + assert_full(&harness.pull(None), 1, 1); + + let pending_uri = "file:///root/pending.rs"; + let root = harness.session.root().clone(); + assert_eq!( + harness.pull_document(pending_uri, None)["error"]["code"], + -32802 + ); + assert_eq!(harness.session.diagnostics.document_snapshots.len(), 1); + assert_eq!(harness.session.diagnostics.active_refreshes.len(), 1); + let shutdown = harness.request("shutdown", Value::Null); + assert!(shutdown.get("error").is_none(), "{shutdown}"); + assert_eq!(shutdown.get("result"), Some(&Value::Null)); + assert!(harness.session.diagnostics.document_snapshots.is_empty()); + assert!(harness.session.diagnostics.active_refreshes.is_empty()); + assert!(harness.session.diagnostics.published.is_empty()); + + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert_eq!(harness.messages(), Vec::::new()); + assert!(matches!( + harness.session.diagnostics.provider.adapter.document_diagnostics(&root, pending_uri, None), + DiagnosticSnapshotOutcome::Partial { coverage, .. } if coverage == "refresh-required" + )); + assert!(harness.session.diagnostics.document_snapshots.is_empty()); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn oversized_diagnostic_codes_refuse_then_recover_with_fresh_work() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + *harness.authority.next_code.lock().unwrap() = + Some("x".repeat(MAX_WORKSPACE_DIAGNOSTIC_BYTES + 1)); + harness.runtime.complete_next(); + + let refused = harness.pull(None); + assert_eq!(refused["error"]["code"], -32802, "{refused}"); + assert_eq!( + refused["error"]["data"]["failureClass"], + "diagnostic-result-byte-capacity", + ); + assert!(refused.get("result").is_none()); + let pending = harness.pull(None); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + assert!(pending["error"]["data"]["operationId"].as_str().is_some()); + assert!(pending.get("result").is_none()); + assert!(harness.session.diagnostics.published.is_empty()); + assert_eq!(harness.runtime.started(), 2); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull(None), 2, 1); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 2); +} + +fn assert_completed_refresh_is_not_polled_again(harness: &mut Harness) { + assert!(harness.session.diagnostics.active_refreshes.is_empty()); + let reads = harness + .session + .diagnostics + .provider + .reads + .load(Ordering::SeqCst); + harness.session.flush_due(harness.now_ms); + harness.session.flush_due(harness.now_ms + 1); + assert_eq!( + harness + .session + .diagnostics + .provider + .reads + .load(Ordering::SeqCst), + reads + ); + assert_eq!(harness.messages(), Vec::::new()); +} + +#[test] +fn an_identical_same_generation_publication_retires_the_completed_refresh() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull(None), 1, 1); + + *harness.authority.next_generation.lock().unwrap() = Some(1); + harness.notify( + "textDocument/didSave", + json!({ "textDocument": { "uri": DOCUMENT } }), + ); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert!( + harness.messages().is_empty(), + "an acknowledged identical report is not republished" + ); + assert_completed_refresh_is_not_polled_again(&mut harness); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 2); +} + +#[test] +fn a_report_too_large_for_push_remains_available_to_pull_without_polling_again() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + let code = "x".repeat(300 * 1024); + *harness.authority.next_code.lock().unwrap() = Some(code.clone()); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert!( + harness.messages().is_empty(), + "the oversized push must be refused" + ); + assert_completed_refresh_is_not_polled_again(&mut harness); + + let full = harness.pull(None); + assert_eq!(full["result"]["kind"], "full", "{full}"); + let mut expected = expected_items(1, 1); + expected[0]["code"] = json!(code); + assert_eq!(full["result"]["items"], expected); + let result_id = full["result"]["resultId"].as_str().unwrap(); + assert_eq!(harness.pull(Some(result_id))["result"]["kind"], "unchanged"); + assert_eq!(harness.runtime.started(), 1); +} + +#[test] +fn open_document_snapshots_refuse_new_results_when_the_bound_is_owned() { + let mut harness = Harness::new(false); + // Capacity admission is independent of time; all messages share one tick. + harness.message_duration_ms = 0; + for index in 0..MAX_WORKSPACE_DIAGNOSTIC_RESULTS { + // Admit all overlays before computing reports: opening another file + // now correctly invalidates dependent reports in the same root. + let uri = format!("file:///root/open-{index}.rs"); + harness.notify("textDocument/didOpen", json!({ + "textDocument": { "uri": uri, "languageId": "rust", "version": 1, "text": "fn a() {}" }, + })); + } + for index in 0..MAX_WORKSPACE_DIAGNOSTIC_RESULTS { + let uri = format!("file:///root/open-{index}.rs"); + assert_eq!(harness.pull_document(&uri, None)["error"]["code"], -32802); + harness.runtime.complete_next(); + assert_full(&harness.pull_document(&uri, None), index as u64 + 1, 1); + } + + let refused = harness.pull(None); + assert_eq!(refused["error"]["code"], -32802, "{refused}"); + assert_eq!( + refused["error"]["data"]["failureClass"], + "diagnostic-result-capacity" + ); + assert!(refused.get("result").is_none()); + assert_eq!( + harness.session.diagnostics.document_snapshots.len(), + MAX_WORKSPACE_DIAGNOSTIC_RESULTS + ); + assert_eq!(harness.runtime.started(), MAX_WORKSPACE_DIAGNOSTIC_RESULTS); +} + +fn fill_outbound_queue(harness: &mut Harness) -> usize { + let mut queued = 0; + for _ in 0..MAX_QUEUED_OUTBOUND_MESSAGES { + if !harness.session.enqueue_value(json!({ + "jsonrpc": "2.0", "method": "window/logMessage", + "params": { "type": 3, "message": "transport occupied" }, + })) { + break; + } + queued += 1; + } + assert!( + !harness + .session + .has_outbound_capacity(crate::MAX_PUBLICATION_BYTES) + ); + queued +} + +fn validation_harness() -> (Harness, String) { + let mut harness = Harness::with_refresh_support(true, true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let messages = harness.send(json!({ + "jsonrpc": "2.0", "id": "initial-report", "method": "textDocument/diagnostic", + "params": { "textDocument": { "uri": DOCUMENT } }, + })); + let report = messages + .iter() + .find(|message| message["id"] == "initial-report") + .unwrap(); + let result_id = assert_full(report, 1, 1); + let refresh = messages + .iter() + .find(|message| message["method"] == "workspace/diagnostic/refresh") + .unwrap(); + assert_eq!( + harness.send(json!({ + "jsonrpc": "2.0", "id": refresh["id"], "result": null, + })), + Vec::::new() + ); + (harness, result_id) +} + +fn assert_settled_validation_failure(failure: Option<&'static str>, background: bool) { + let (mut harness, result_id) = validation_harness(); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + assert_eq!(harness.pull(Some(&result_id))["error"]["code"], -32802); + assert_eq!(harness.runtime.started(), 2); + + *harness.authority.validation_failure.lock().unwrap() = failure; + if failure.is_none() { + *harness.authority.authority_digest.lock().unwrap() = Some(digest('b')); + } + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + harness.runtime.complete_next(); + if background { + let queued = fill_outbound_queue(&mut harness); + harness.session.flush_due(harness.now_ms); + let messages = harness.messages(); + assert_eq!(messages.len(), queued); + assert!( + messages + .iter() + .all(|message| message["method"] == "window/logMessage") + ); + assert!(harness.session.diagnostics.active_refreshes.is_empty()); + } + + let messages = harness.send(json!({ + "jsonrpc": "2.0", "id": "validation-result", "method": "textDocument/diagnostic", + "params": { "textDocument": { "uri": DOCUMENT }, "previousResultId": result_id }, + })); + assert_eq!( + messages.len(), + 1, + "validation consumption must emit only its response: {messages:?}" + ); + let failed = &messages[0]; + assert_eq!(failed["id"], "validation-result"); + assert_eq!(failed["error"]["code"], -32802, "{failed}"); + assert!(failed.get("result").is_none()); + match failure { + Some(failure) => assert_eq!(failed["error"]["data"]["failureClass"], failure), + None => assert_eq!(failed["error"]["data"]["coverage"], "refresh-required"), + } + assert_eq!( + harness.runtime.started(), + 2, + "consuming a terminal validation must not admit refresh work" + ); + assert!(harness.session.diagnostics.active_refreshes.is_empty()); + assert!(harness.session.diagnostics.document_snapshots.is_empty()); + assert_eq!(harness.authority.generation.load(Ordering::SeqCst), 1); + + let retry = harness.pull(Some(&result_id)); + assert_eq!( + retry["error"]["data"]["coverage"], "refresh-required", + "{retry}" + ); + assert_eq!(harness.runtime.started(), 3); + harness.runtime.complete_next(); + assert_full(&harness.pull(Some(&result_id)), 2, 1); +} + +#[test] +fn partial_pull_validation_settles_under_backpressure_and_is_consumed_once() { + assert_settled_validation_failure(None, true); +} + +#[test] +fn failed_pull_validation_settles_under_backpressure_and_is_consumed_once() { + assert_settled_validation_failure(Some("provider-unavailable"), true); +} + +#[test] +fn directly_consumed_failed_validation_does_not_admit_a_refresh() { + assert_settled_validation_failure(Some("provider-unavailable"), false); +} + +#[test] +fn settled_ready_validation_is_consumed_once_and_preserves_the_generation_floor() { + let (mut harness, result_id) = validation_harness(); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + assert_eq!(harness.pull(Some(&result_id))["error"]["code"], -32802); + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + harness.runtime.complete_next(); + let queued = fill_outbound_queue(&mut harness); + harness.session.flush_due(harness.now_ms); + let messages = harness.messages(); + assert_eq!(messages.len(), queued); + assert!( + messages + .iter() + .all(|message| message["method"] == "window/logMessage") + ); + assert!(harness.session.diagnostics.active_refreshes.is_empty()); + + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + assert_eq!( + harness.pull(Some(&result_id))["result"]["kind"], + "unchanged" + ); + assert_eq!(harness.runtime.started(), 2); + let validating = harness.pull(Some(&result_id)); + assert_eq!(validating["error"]["code"], -32802, "{validating}"); + assert!( + validating["error"]["data"]["operationId"] + .as_str() + .is_some() + ); + assert_eq!(harness.runtime.started(), 3); + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert_eq!(harness.messages(), Vec::::new()); + + *harness.authority.next_generation.lock().unwrap() = Some(0); + harness.notify( + "textDocument/didSave", + json!({ "textDocument": { "uri": DOCUMENT } }), + ); + harness.runtime.complete_next(); + let stale = harness.pull(Some(&result_id)); + assert_eq!( + stale["error"]["data"]["failureClass"], "superseded-generation", + "{stale}" + ); + assert!(stale.get("result").is_none()); +} + +#[test] +fn publication_retry_uses_the_admitted_snapshot_without_polling_or_revalidation() { + let mut harness = Harness::new(true); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + fill_outbound_queue(&mut harness); + harness.session.poll_diagnostic_refresh(DOCUMENT); + harness.messages(); + let reads = harness + .session + .diagnostics + .provider + .reads + .load(Ordering::SeqCst); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + harness.session.flush_due(harness.now_ms); + let messages = harness.messages(); + assert_eq!(messages.len(), 1, "{messages:?}"); + assert_eq!(messages[0]["method"], "textDocument/publishDiagnostics"); + assert_eq!(messages[0]["params"]["diagnostics"], expected_items(1, 1)); + assert_eq!( + harness + .session + .diagnostics + .provider + .reads + .load(Ordering::SeqCst), + reads + ); + assert_eq!(harness.runtime.started(), 1); + assert_completed_refresh_is_not_polled_again(&mut harness); +} + +#[test] +fn late_validation_cannot_answer_a_reopened_document_or_retire_its_refresh() { + let mut harness = Harness::new(false); + harness.open(1); + harness.start_refresh(); + harness.runtime.complete_next(); + let result_id = assert_full(&harness.pull(None), 1, 1); + harness + .authority + .validation_pending + .store(true, Ordering::SeqCst); + assert_eq!(harness.pull(Some(&result_id))["error"]["code"], -32802); + harness.notify( + "textDocument/didClose", + json!({ "textDocument": { "uri": DOCUMENT } }), + ); + harness.open(1); + assert_eq!(harness.pull(Some(&result_id))["error"]["code"], -32802); + assert_eq!(harness.runtime.started(), 3); + harness + .authority + .validation_pending + .store(false, Ordering::SeqCst); + harness.runtime.complete_next(); + harness.session.flush_due(harness.now_ms); + assert_eq!(harness.messages(), Vec::::new()); + let pending = harness.pull(Some(&result_id)); + assert_eq!(pending["error"]["code"], -32802, "{pending}"); + assert!(pending["error"]["data"]["operationId"].as_str().is_some()); + assert_eq!(harness.runtime.started(), 3); + harness.runtime.complete_next(); + assert_full(&harness.pull(Some(&result_id)), 2, 1); +} diff --git a/crates/tracedecay-lsp/src/provider.rs b/crates/tracedecay-lsp/src/provider.rs index efadb03008..77357e8c30 100644 --- a/crates/tracedecay-lsp/src/provider.rs +++ b/crates/tracedecay-lsp/src/provider.rs @@ -401,8 +401,17 @@ pub enum DiagnosticSnapshotOutcome { }, } +/// Currentness of a retained report, checked against its canonical authority. +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum DiagnosticSnapshotValidation { + Current, + Changed, + Pending(DiagnosticRefreshIdentity), + Failed { failure_class: String }, +} + /// Port implemented by a daemon/application adapter. It is a read projection; -/// no diagnostic record is owned or persisted by the gateway. Refresh methods +/// the session retains admitted reports only for its ephemeral lifetime. Refresh methods /// are non-blocking: the provider starts canonical upstream/compiler work and /// later reports `Ready` with the matching completed operation identity. /// Unsaved overlays are ephemeral inputs and must never be persisted by the @@ -427,6 +436,27 @@ pub trait DiagnosticSnapshotPort { } } + fn validate_document_snapshot( + &self, + _root: &AdmittedRoot, + _document_uri: &str, + _overlay: Option<&OverlaySnapshot>, + _snapshot: &GenerationDiagnostics, + ) -> DiagnosticSnapshotValidation { + DiagnosticSnapshotValidation::Changed + } + + /// Releases one refresh's result ownership and requests task cancellation. + /// A successful retirement does not prove accepted analyzer work has stopped. + fn retire_document_refresh( + &self, + _root: &AdmittedRoot, + _document_uri: &str, + _operation_id: &str, + ) -> bool { + false + } + fn supports_workspace_diagnostics(&self) -> bool { false } @@ -478,6 +508,25 @@ where (**self).request_document_refresh(root, document_uri, overlay, source_generation) } + fn validate_document_snapshot( + &self, + root: &AdmittedRoot, + document_uri: &str, + overlay: Option<&OverlaySnapshot>, + snapshot: &GenerationDiagnostics, + ) -> DiagnosticSnapshotValidation { + (**self).validate_document_snapshot(root, document_uri, overlay, snapshot) + } + + fn retire_document_refresh( + &self, + root: &AdmittedRoot, + document_uri: &str, + operation_id: &str, + ) -> bool { + (**self).retire_document_refresh(root, document_uri, operation_id) + } + fn supports_workspace_diagnostics(&self) -> bool { (**self).supports_workspace_diagnostics() } diff --git a/crates/tracedecay-lsp/src/rpc.rs b/crates/tracedecay-lsp/src/rpc.rs index 2fb32ca545..a8cfdeb1e7 100644 --- a/crates/tracedecay-lsp/src/rpc.rs +++ b/crates/tracedecay-lsp/src/rpc.rs @@ -717,15 +717,16 @@ pub(crate) fn diagnostic_result_id( scope_digest: Option<&ManifestDigest>, root_ordinal: Option, generation: u64, + authority: &ManifestDigest, version: i64, ) -> String { match (scope_set_digest, scope_digest, root_ordinal) { (Some(scope_set), Some(scope), Some(root_ordinal)) => format!( - "scope-set={};scope={};root={root_ordinal};generation={generation};version={version}", + "scope-set={};scope={};root={root_ordinal};generation={generation};version={version};authority={authority}", scope_set.as_str(), scope.as_str() ), - _ => format!("generation:{generation}:version:{version}"), + _ => format!("generation:{generation}:version:{version}:authority:{authority}"), } } diff --git a/crates/tracedecay-lsp/tests/lsp_suite/analyzer_runtime/broker_refresh.rs b/crates/tracedecay-lsp/tests/lsp_suite/analyzer_runtime/broker_refresh.rs index f96336f169..ec59d9ed31 100644 --- a/crates/tracedecay-lsp/tests/lsp_suite/analyzer_runtime/broker_refresh.rs +++ b/crates/tracedecay-lsp/tests/lsp_suite/analyzer_runtime/broker_refresh.rs @@ -3399,3 +3399,371 @@ async fn semantic_cancellation_reaches_and_releases_the_registered_operation() { assert!(!authority.cancel_request(&root, &request_id)); assert!(!authority.cancel_request(&root, &LspRequestId::Number(20))); } + +#[tokio::test] +async fn partial_root_refresh_replaces_only_published_document_diagnostics() { + let temp = tempfile::tempdir().unwrap(); + for root in [temp.path().to_path_buf(), temp.path().join("member")] { + std::fs::create_dir_all(root.join("src")).unwrap(); + std::fs::write(root.join("workspace.marker"), "").unwrap(); + } + let script_path = temp.path().join("partial_root_lsp.py"); + let publish = FAKE_DIAGNOSTIC_PUBLISH.replace( + r#""fake type error""#, + r#""old b" if uri.endswith("b.fake") else ("old a" if text == "old a" else "new a")"#, + ); + let body = format!( + r#" text = message["params"].get("contentChanges", [message["params"]["textDocument"]])[0]["text"] + if text == "fail b": + sys.exit(17) +{publish}"# + ); + std::fs::write(&script_path, fake_lsp_script_with_preamble("", &body)).unwrap(); + let adapter = fake_adapter_with_root_markers( + FAKE_LANGUAGE, + "fake", + python_command(), + vec![script_path.display().to_string()], + vec!["workspace.marker".to_owned()], + ); + let mut broker = lsp::broker::DiagnosticBroker::new_for_test(temp.path(), vec![adapter]); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![ + fake_document(FAKE_LANGUAGE, "src/a.fake", "old a"), + fake_document(FAKE_LANGUAGE, "member/src/b.fake", "old b"), + ], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + let completed = broker + .prepare_refresh( + FAKE_LANGUAGE, + vec![ + fake_document(FAKE_LANGUAGE, "src/a.fake", "new a"), + fake_document(FAKE_LANGUAGE, "member/src/b.fake", "fail b"), + ], + ) + .await + .unwrap() + .unwrap() + .collect_diagnostics_with_timeouts(loaded_runner_fake_lsp_timeouts()) + .await; + assert!( + broker.finish_refresh_snapshot(completed).is_err(), + "the caller must see that one root was incomplete" + ); + let diagnostics = broker.snapshot().diagnostics; + assert_eq!(diagnostics.len(), 2); + assert!( + diagnostics + .iter() + .any(|diagnostic| diagnostic.file == "src/a.fake" && diagnostic.message == "new a") + ); + assert!( + diagnostics + .iter() + .any(|diagnostic| diagnostic.file == "member/src/b.fake" + && diagnostic.message == "old b") + ); + let a = fake_document(FAKE_LANGUAGE, "src/a.fake", "new a"); + assert!(matches!( + broker.document_diagnostic_evidence(&a), + Ok(lsp::broker::BrokerDocumentEvidence::Published { .. }) + )); + let b = fake_document(FAKE_LANGUAGE, "member/src/b.fake", "old b"); + assert!(broker.document_diagnostic_evidence(&b).is_err()); + broker + .refresh_documents_with_timeouts(FAKE_LANGUAGE, vec![a], loaded_runner_fake_lsp_timeouts()) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&b).is_err()); +} + +#[tokio::test] +async fn queue_denial_keeps_requested_evidence_unavailable_after_an_unrelated_refresh() { + let temp = tempfile::tempdir().unwrap(); + let script_path = temp.path().join("evidence_lsp.py"); + std::fs::write(&script_path, fake_lsp_script()).unwrap(); + let mut broker = lsp::broker::DiagnosticBroker::new_for_test( + temp.path(), + vec![fake_python_adapter(FAKE_LANGUAGE, "fake", &script_path)], + ); + let a = fake_document(FAKE_LANGUAGE, "src/a.fake", "a"); + let b = fake_document(FAKE_LANGUAGE, "src/b.fake", "b"); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone(), b.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&a).is_ok()); + let mut queued = Vec::new(); + for _ in 0..lsp::broker::MAX_ANALYZER_QUEUED_ROOT_BATCHES { + queued.push( + broker + .prepare_refresh(FAKE_LANGUAGE, vec![b.clone()]) + .await + .unwrap() + .unwrap(), + ); + } + let Err(error) = broker.prepare_refresh(FAKE_LANGUAGE, vec![a.clone()]).await else { + panic!("a full queue must reject the requested document before client acquisition"); + }; + assert!(error.to_string().contains("queue saturated")); + drop(queued); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![b.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&b).is_ok()); + assert!(matches!( + broker.document_diagnostic_evidence(&a), + Err(lsp::broker::DiagnosticEvidenceUnavailable::PublicationUncommitted) + )); + let snapshot = broker.snapshot(); + assert_eq!(snapshot.diagnostics.len(), 2); + assert!( + !snapshot.coverage[FAKE_LANGUAGE] + .documents + .contains_key(&a.relative_path) + ); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&a).is_ok()); +} + +#[tokio::test] +async fn identical_empty_collection_requires_commit_and_stale_cleanup_preserves_its_successor() { + let temp = tempfile::tempdir().unwrap(); + let script_path = temp.path().join("empty_evidence_lsp.py"); + std::fs::write( + &script_path, + fake_lsp_script_with_preamble("", EMPTY_DIAGNOSTIC_PUBLISH), + ) + .unwrap(); + let mut broker = lsp::broker::DiagnosticBroker::new_for_test( + temp.path(), + vec![fake_python_adapter(FAKE_LANGUAGE, "fake", &script_path)], + ); + let a = fake_document(FAKE_LANGUAGE, "src/a.fake", "a"); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + let initial = broker.snapshot(); + let stale = broker + .prepare_refresh(FAKE_LANGUAGE, vec![a.clone()]) + .await + .unwrap() + .unwrap() + .collect_diagnostics_with_timeouts(loaded_runner_fake_lsp_timeouts()) + .await; + assert!(stale.is_ok()); + assert!(stale.diagnostic_refresh().unwrap().diagnostics.is_empty()); + assert_eq!( + stale.diagnostic_refresh().unwrap().coverage, + initial.coverage[FAKE_LANGUAGE] + ); + assert!(matches!( + broker.document_diagnostic_evidence(&a), + Err(lsp::broker::DiagnosticEvidenceUnavailable::PublicationUncommitted) + )); + let abandoned = broker + .prepare_refresh(FAKE_LANGUAGE, vec![a.clone()]) + .await + .unwrap() + .unwrap() + .collect_diagnostics_with_timeouts(loaded_runner_fake_lsp_timeouts()) + .await; + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(matches!( + broker.finish_refresh_snapshot(stale).unwrap(), + lsp::broker::RefreshCommitOutcome::Superseded + )); + drop(abandoned); + let lsp::broker::BrokerDocumentEvidence::Published { diagnostics, .. } = + broker.document_diagnostic_evidence(&a).unwrap() + else { + panic!("the successor empty publication must remain committed"); + }; + assert!(diagnostics.is_empty()); + let cancelled = broker + .prepare_refresh(FAKE_LANGUAGE, vec![a.clone()]) + .await + .unwrap() + .unwrap(); + drop(cancelled); + assert!(matches!( + broker.document_diagnostic_evidence(&a), + Err(lsp::broker::DiagnosticEvidenceUnavailable::PublicationUncommitted) + )); +} + +#[tokio::test] +async fn identical_settings_replacement_rejects_collected_work_from_the_old_client() { + let temp = tempfile::tempdir().unwrap(); + let script_path = temp.path().join("replaced_evidence_lsp.py"); + std::fs::write(&script_path, fake_lsp_script()).unwrap(); + let adapter = fake_python_adapter(FAKE_LANGUAGE, "fake", &script_path); + let mut broker = + lsp::broker::DiagnosticBroker::new_for_test(temp.path(), vec![adapter.clone()]); + let a = fake_document(FAKE_LANGUAGE, "src/a.fake", "a"); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + let stale = broker + .prepare_refresh(FAKE_LANGUAGE, vec![a.clone()]) + .await + .unwrap() + .unwrap() + .collect_diagnostics_with_timeouts(loaded_runner_fake_lsp_timeouts()) + .await; + broker.update_settings(broker.snapshot().settings); + assert!(broker.document_diagnostic_evidence(&a).is_err()); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(matches!( + broker.finish_refresh_snapshot(stale).unwrap(), + lsp::broker::RefreshCommitOutcome::Superseded + )); + assert!(broker.document_diagnostic_evidence(&a).is_ok()); + let stale = broker + .prepare_refresh(FAKE_LANGUAGE, vec![a.clone()]) + .await + .unwrap() + .unwrap(); + broker.update_adapters(vec![adapter]); + let stale = stale + .collect_diagnostics_with_timeouts(loaded_runner_fake_lsp_timeouts()) + .await; + assert!(matches!( + broker.finish_refresh_snapshot(stale).unwrap(), + lsp::broker::RefreshCommitOutcome::Superseded + )); + assert!(broker.document_diagnostic_evidence(&a).is_err()); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&a).is_ok()); +} + +#[tokio::test] +async fn semantic_retirement_revokes_committed_diagnostic_evidence() { + let temp = tempfile::tempdir().unwrap(); + std::fs::create_dir_all(temp.path().join("src")).unwrap(); + std::fs::write(temp.path().join(FAKE_PATH), "a").unwrap(); + let control = FakeLspPhaseControl::bind().await; + let script_path = temp.path().join("semantic_evidence_lsp.py"); + let mut script = fake_lsp_script_with_preamble( + &control.script_preamble(&["semantic-request"]), + EMPTY_DIAGNOSTIC_PUBLISH, + ); + script.push_str( + r#" elif message.get("method") == "textDocument/documentSymbol": + tracedecay_maybe_phase("semantic-request") +"#, + ); + std::fs::write(&script_path, script).unwrap(); + let mut broker = lsp::broker::DiagnosticBroker::new_for_test( + temp.path(), + vec![fake_python_adapter(FAKE_LANGUAGE, "fake", &script_path)], + ); + let a = fake_document(FAKE_LANGUAGE, FAKE_PATH, "a"); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&a).is_ok()); + let root_uri = url::Url::from_directory_path(temp.path()) + .unwrap() + .to_string(); + let authority = broker + .semantic_authority_if_available( + FAKE_LANGUAGE, + temp.path().to_path_buf(), + root_uri.clone(), + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap() + .unwrap(); + let root = AdmittedRoot::new(root_uri.clone()); + let id = LspRequestId::Number(31); + let operation = tokio::spawn( + authority.start( + root.clone(), + id.clone(), + tracedecay_lsp::lsp_semantic_request(&SemanticRequest::DocumentSymbols { + document_uri: format!("{root_uri}{FAKE_PATH}"), + }) + .unwrap(), + ), + ); + let reached = control.wait_for("semantic-request").await; + assert!(authority.cancel_request(&root, &id)); + assert!(matches!( + operation.await.unwrap(), + tracedecay_lsp::LspSemanticOperationOutcome::Partial { .. } + )); + drop(reached); + assert!(matches!( + broker.document_diagnostic_evidence(&a), + Err(lsp::broker::DiagnosticEvidenceUnavailable::IncarnationRetired) + )); + broker + .refresh_documents_with_timeouts( + FAKE_LANGUAGE, + vec![a.clone()], + loaded_runner_fake_lsp_timeouts(), + ) + .await + .unwrap(); + assert!(broker.document_diagnostic_evidence(&a).is_ok()); +} diff --git a/crates/tracedecay-session-runtime/src/session_temporal_refresh_scheduler/worker.rs b/crates/tracedecay-session-runtime/src/session_temporal_refresh_scheduler/worker.rs index 901c61ed04..ecb0385c6e 100644 --- a/crates/tracedecay-session-runtime/src/session_temporal_refresh_scheduler/worker.rs +++ b/crates/tracedecay-session-runtime/src/session_temporal_refresh_scheduler/worker.rs @@ -233,6 +233,15 @@ pub(super) async fn run_session_temporal_refresh_scheduler( history_admission: Arc, policy: SessionTemporalRefreshPolicy, ) { + // A Blocked outcome is terminal per host (for example + // `projection_store_corrupt`, retryable=false upstream): the same pass + // over the same broken store re-fails identically on every wake. Back + // the history pass off exponentially instead of re-reading the store at + // full cadence; any progressing pass clears it. + const BLOCKED_HISTORY_BACKOFF_FLOOR: Duration = Duration::from_secs(60); + const BLOCKED_HISTORY_BACKOFF_CAP: Duration = Duration::from_secs(60 * 60); + let mut blocked_history_attempts = 0u32; + let mut blocked_history_until: Option = None; let mut retry_attempt = 0u32; let mut summary_retry_attempt = 0u32; let mut summary_recheck = false; @@ -276,10 +285,12 @@ pub(super) async fn run_session_temporal_refresh_scheduler( } // A granted turn this iteration does not spend on history is // returned before the summary page queues for a permit of its own. + let history_suppressed = history_requested + && blocked_history_until.is_some_and(|until| Instant::now() < until); let granted = granted_history_admission .take() - .filter(|_| history_requested); - let history_outcome = if history_requested { + .filter(|_| history_requested && !history_suppressed); + let history_outcome = if history_requested && !history_suppressed { let history_pass: Pin + Send + '_>> = Box::pin(session_history_refresh( &history, @@ -321,7 +332,25 @@ pub(super) async fn run_session_temporal_refresh_scheduler( ); } Some(SessionHistoricalIngestOutcome::Blocked { reason_code, .. }) => { - tracing::warn!(reason_code, "retained historical session ingest is blocked"); + blocked_history_attempts = blocked_history_attempts.saturating_add(1); + let backoff = BLOCKED_HISTORY_BACKOFF_FLOOR + .saturating_mul(1_u32 << blocked_history_attempts.saturating_sub(1).min(6)) + .min(BLOCKED_HISTORY_BACKOFF_CAP); + blocked_history_until = Some(Instant::now() + backoff); + if blocked_history_attempts == 1 { + tracing::error!( + reason_code, + retry_after_secs = backoff.as_secs(), + "retained historical session ingest is blocked; backing off and retrying hourly at most until the store heals or is rebuilt" + ); + } else { + tracing::warn!( + reason_code, + attempt = blocked_history_attempts, + retry_after_secs = backoff.as_secs(), + "retained historical session ingest is blocked; history passes back off" + ); + } } Some( SessionHistoricalIngestOutcome::Complete @@ -336,6 +365,20 @@ pub(super) async fn run_session_temporal_refresh_scheduler( ) || history_outcome .as_ref() .is_some_and(SessionHistoricalIngestOutcome::made_progress); + // A pass that made progress does NOT prove the blocked cause + // healed: one healthy provider advancing while another stays + // blocked reports Blocked { made_progress: true }, and the + // blocked provider would be re-read at full cadence again. The + // backoff resets only on an outcome with no blocker at all. + if history_requires_projection + && !matches!( + history_outcome, + Some(SessionHistoricalIngestOutcome::Blocked { .. }) + ) + { + blocked_history_attempts = 0; + blocked_history_until = None; + } let mut report = if projection_requested || state.has_requests() || history_requires_projection diff --git a/crates/tracedecay-sessions/src/runtime/hosts/pi.rs b/crates/tracedecay-sessions/src/runtime/hosts/pi.rs index c8d77c3571..ebee062b68 100644 --- a/crates/tracedecay-sessions/src/runtime/hosts/pi.rs +++ b/crates/tracedecay-sessions/src/runtime/hosts/pi.rs @@ -11,6 +11,7 @@ use std::collections::BinaryHeap; use std::ffi::OsStr; use std::io::{self, BufRead, Read}; use std::path::{Path, PathBuf}; +use std::sync::PoisonError; use std::time::Instant; use tracedecay_capture::pi::{self as pi_capture, PiSessionHeader}; @@ -59,6 +60,122 @@ const MAX_DISCOVERY_UNITS: usize = MAX_DISCOVERY_CANDIDATES * 2; const PI_DISCOVERY_FRONTIER_KEY: &str = "host-frontier://pi/discovery/v1"; const PI_QUEUE_FRONTIER_KEY: &str = "host-frontier://pi/queue/v1"; const PI_FRONTIER_VERSION: u64 = 1; +/// Durable per-path completion memos: a file admitted to EOF with this +/// `(len, mtime)` never re-enters admission until it changes. Without this, +/// the in-process [`SourceLedger`] forgets every converged source at each +/// daemon restart and the whole corpus (observed: 1,029 files / 713 MB) is +/// re-admitted from scratch, re-hitting every deterministic refusal again. +const PI_COMPLETE_MEMO_PREFIX: &str = "host-memo://pi/complete/v1/"; +/// Durable per-path header-quarantine memos: a file whose header cannot be +/// parsed is skipped until its `(len, mtime)` changes, instead of being +/// re-opened and re-failed on every sweep pass. +const PI_QUARANTINE_MEMO_PREFIX: &str = "host-memo://pi/quarantine/v1/"; + +fn path_memo_key(prefix: &str, path: &Path) -> String { + use sha2::{Digest, Sha256}; + let mut hasher = Sha256::new(); + hasher.update(b"tracedecay-pi-path-memo-v1"); + hasher.update(path.to_string_lossy().as_bytes()); + let digest = hasher.finalize(); + let mut key = String::with_capacity(prefix.len() + 16); + key.push_str(prefix); + for byte in &digest[..8] { + key.push_str(&format!("{byte:02x}")); + } + key +} + +/// Cheap `(len, mtime, inode)` file stamp; any append, rewrite, or +/// replacement changes it. The inode (unix) closes the equal-length, +/// timestamp-preserving replacement case an atomic rename produces. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +struct PathFileStamp { + len: u64, + mtime_secs: u64, + #[allow(dead_code, reason = "windows keeps the slot for symmetry")] + inode: u64, +} + +fn file_stamp(metadata: &std::fs::Metadata) -> PathFileStamp { + // Sub-second precision on platforms that expose it: a rewrite within + // the same second changes the stamp, so a fixed malformed file is + // retried immediately instead of after the next whole-second tick. + #[cfg(unix)] + let (mtime_secs, inode) = { + use std::os::unix::fs::MetadataExt; + ( + metadata.mtime().unsigned_abs().saturating_mul(1_000_000_000) + + metadata.mtime_nsec().unsigned_abs(), + metadata.ino(), + ) + }; + #[cfg(not(unix))] + let (mtime_secs, inode) = ( + metadata + .modified() + .ok() + .and_then(|time| time.duration_since(std::time::UNIX_EPOCH).ok()) + .map(|duration| duration.as_nanos() as u64) + .unwrap_or(0), + 0, + ); + PathFileStamp { + len: metadata.len(), + mtime_secs, + inode, + } +} + +/// Reads a path memo when its recorded stamp still matches the file. +async fn path_memo_matches( + facade: &dyn HostAdmission, + scope: &ObservationScopeV1, + prefix: &str, + path: &Path, + stamp: PathFileStamp, +) -> bool { + let key = path_memo_key(prefix, path); + matches!( + facade.get_parse_offset(scope, &key).await, + Ok(Some(ParseOffset { + byte_offset: len, + mtime: mtime_secs, + file_id: inode, + })) if len == stamp.len + && mtime_secs == stamp.mtime_secs + && inode == stamp.inode + ) +} + +/// Best-effort durable memo write; a memo failure never fails the sweep. +async fn write_path_memo( + facade: &dyn HostAdmission, + scope: &ObservationScopeV1, + prefix: &str, + path: &Path, + stamp: PathFileStamp, +) { + let key = path_memo_key(prefix, path); + if let Err(error) = facade + .advance_parse_offset( + scope, + &key, + ParseOffset { + byte_offset: stamp.len, + mtime: stamp.mtime_secs, + file_id: stamp.inode, + }, + ) + .await + { + tracing::debug!( + provider = PROVIDER, + path = %path.display(), + error = ?error, + "Pi path memo write failed; the next sweep will re-check the file" + ); + } +} /// Discovery failures already reported, keyed by the failing file's digest, so /// a malformed file re-scanned every pass logs once per state change. @@ -68,6 +185,28 @@ static PI_DISCOVERY_FAILURE_GATE: StateChangeLogGate< > = StateChangeLogGate::new(); static PI_DISCOVERY_SUMMARY_GATE: StateChangeLogGate = StateChangeLogGate::new(); +/// Session files whose header parse failed, with the stamp observed at the +/// failure. Discovery re-reads such files on every pass otherwise; the entry +/// drops as soon as the file's `(len, mtime)` changes. +static PI_INVALID_HEADER_SKIP: std::sync::OnceLock< + std::sync::Mutex>, +> = std::sync::OnceLock::new(); + +fn invalid_header_skip_holds(path: &Path, stamp: PathFileStamp) -> bool { + PI_INVALID_HEADER_SKIP + .get_or_init(|| std::sync::Mutex::new(std::collections::HashSet::new())) + .lock() + .unwrap_or_else(PoisonError::into_inner) + .contains(&(path.to_path_buf(), stamp)) +} + +fn invalid_header_skip_record(path: &Path, stamp: PathFileStamp) { + PI_INVALID_HEADER_SKIP + .get_or_init(|| std::sync::Mutex::new(std::collections::HashSet::new())) + .lock() + .unwrap_or_else(PoisonError::into_inner) + .insert((path.to_path_buf(), stamp)); +} /// The agent directory Pi loads for `home`. `PI_CODING_AGENT_DIR` relocates /// it only to an absolute directory inside `home`: a sandbox or tempdir home @@ -271,6 +410,14 @@ impl PiSource { } Err(error) => return Err(error), }; + let candidate_stamp = std::fs::metadata(&candidate) + .ok() + .map(|meta| file_stamp(&meta)); + if candidate_stamp + .is_some_and(|stamp| invalid_header_skip_holds(&candidate, stamp)) + { + continue; + } let header = match read_session_header(&candidate) { Ok(HeaderRead::Header(header)) => header, Ok(HeaderRead::Incomplete) => { @@ -278,6 +425,13 @@ impl PiSource { continue; } Err((kind, error)) => { + if let (PiDiscoveryFailureKind::InvalidSessionHeader, Some(stamp)) = + (kind, candidate_stamp) + { + // Only a malformed header is deterministic; + // an unavailable header stays retryable. + invalid_header_skip_record(&candidate, stamp); + } discovery.record_failure(kind, &candidate, &error, &mut budget); continue; } @@ -764,6 +918,22 @@ async fn admit_scheduled_file( cancellation: &ObservationCancellation, outcome: &mut PiCaptureOutcome, ) -> TranscriptIngestResult> { + // Durable convergence memos come first: an unchanged file that already + // converged (or was header-quarantined) in a previous daemon run must not + // re-enter admission, or every restart re-pays the whole corpus. + let stamp = { + let path_buf = path.to_path_buf(); + run_blocking_transcript_section("pi", move || std::fs::metadata(&path_buf).ok().map(|meta| file_stamp(&meta))) + .await? + }; + if let Some(stamp) = stamp { + if path_memo_matches(facade, scope, PI_COMPLETE_MEMO_PREFIX, path, stamp).await { + return Ok(None); + } + if path_memo_matches(facade, scope, PI_QUARANTINE_MEMO_PREFIX, path, stamp).await { + return Ok(None); + } + } let path_buf = path.to_path_buf(); let header = match run_blocking_transcript_section("pi", move || read_session_header(&path_buf)) .await? @@ -775,6 +945,12 @@ async fn admit_scheduled_file( } Err((kind, error)) => { warn_isolated_source(path, kind, error.kind()); + if let (PiDiscoveryFailureKind::InvalidSessionHeader, Some(stamp)) = (kind, stamp) { + // Only a malformed header quarantines durably; an + // unavailable header (sharing violation, transient io) + // stays retryable on every sweep. + write_path_memo(facade, scope, PI_QUARANTINE_MEMO_PREFIX, path, stamp).await; + } outcome.discovery_failures = outcome.discovery_failures.saturating_add(1); outcome.deferred = true; return Ok(None); @@ -789,6 +965,13 @@ async fn admit_scheduled_file( .bytes_consumed .saturating_add(progress.bytes_consumed); outcome.deferred |= progress.source_deferred; + if !progress.source_deferred + && let Some(stamp) = stamp + { + // The pass read this file to EOF within its budget; an unchanged + // (len, mtime) file needs no further admission work ever again. + write_path_memo(facade, scope, PI_COMPLETE_MEMO_PREFIX, path, stamp).await; + } Ok(Some(progress)) } diff --git a/crates/tracedecay-sessions/src/runtime/hosts/pi_tests.rs b/crates/tracedecay-sessions/src/runtime/hosts/pi_tests.rs index 2ac8464cc2..567e0bb9bb 100644 --- a/crates/tracedecay-sessions/src/runtime/hosts/pi_tests.rs +++ b/crates/tracedecay-sessions/src/runtime/hosts/pi_tests.rs @@ -167,6 +167,8 @@ fn discovery_summary_reports_changes_and_recovery_without_repeating_unchanged_fa 0, "an interrupted empty scan must not clear the admitted summary" ); + // The rewrite touches every file, so the sub-second stamp invalidates + // the quarantine and all 25 files re-fail: a changed file is retried. first.write_malformed_files(25); let changed = report(&first); assert_eq!(changed.failure_count, 25); @@ -189,14 +191,12 @@ fn discovery_summary_reports_changes_and_recovery_without_repeating_unchanged_fa .unwrap(); } let fully_reported = report(&first); + // All remaining files are unchanged and quarantined: no failures. assert_eq!( - fully_reported.failure_count, - MAX_DISCOVERY_FAILURE_EVIDENCE as u64 - ); - assert_eq!( - fully_reported.failures.len(), - MAX_DISCOVERY_FAILURE_EVIDENCE + fully_reported.failure_count, 0, + "quarantined files stop counting against discovery" ); + assert_eq!(fully_reported.failures.len(), 0); assert_eq!(summary_count(&first, &fully_reported), 0); first.write_malformed_files(25); assert_eq!( @@ -232,21 +232,36 @@ async fn repeated_discovery_summary_keeps_malformed_sources_and_coverage_refused let malformed = MAX_DISCOVERY_FAILURE_EVIDENCE + 1; layout.write_malformed_files(malformed); let admission = MemoryHostAdmission::default(); - for _ in 0..2 { - let outcome = capture(&layout, &admission).await; - assert_eq!(outcome.discovery_failures, malformed as u64); - assert!(outcome.deferred); - assert!(admission.observations().is_empty()); - let coverage = admission - .get_parse_offset(&ObservationScopeV1::Profile, "host-coverage://pi/v1") - .await - .unwrap() - .unwrap(); - assert_eq!( - coverage.file_id, 2, - "malformed sources retain partial coverage" - ); - } + let first_outcome = capture(&layout, &admission).await; + assert_eq!(first_outcome.discovery_failures, malformed as u64); + assert!(first_outcome.deferred); + assert!(admission.observations().is_empty()); + let coverage = admission + .get_parse_offset(&ObservationScopeV1::Profile, "host-coverage://pi/v1") + .await + .unwrap() + .unwrap(); + assert_eq!( + coverage.file_id, 2, + "malformed sources retain partial coverage" + ); + // A later pass quarantines the unchanged malformed files: they are not + // re-opened, not re-counted, and the refused coverage is retained. + let second_outcome = capture(&layout, &admission).await; + assert_eq!( + second_outcome.discovery_failures, 0, + "unchanged malformed files are not re-failed" + ); + assert!(!second_outcome.deferred, "a clean pass is not deferred"); + assert!(admission.observations().is_empty()); + let coverage = admission + .get_parse_offset(&ObservationScopeV1::Profile, "host-coverage://pi/v1") + .await + .unwrap(); + assert!( + coverage.is_some(), + "coverage for the malformed source is retained after quarantine" + ); } #[tokio::test] @@ -602,3 +617,43 @@ fn system_prompt_replay_is_not_projected_as_conversation() { .all(|fact| matches!(fact, CanonicalObservationFactV1::Unknown { .. })) ); } + +/// A fresh `SourceSweep` models a daemon restart: the in-process source +/// ledger starts empty, so only the durable completion memo can keep a +/// converged, unchanged session file out of admission. +#[tokio::test] +async fn converged_session_file_is_not_re_admitted_by_a_fresh_sweep() { + let layout = Layout::new(); + layout.write_fixture(); + let admission = MemoryHostAdmission::default(); + let first = capture(&layout, &admission).await; + assert!(!first.deferred); + let first_counts = admission.capture_call_counts(); + let second = capture(&layout, &admission).await; + assert!(!second.deferred); + assert_eq!( + admission.capture_call_counts(), + first_counts, + "an unchanged, fully admitted file must not be re-admitted" + ); +} + +/// An unchanged malformed file is quarantined durably after its first +/// failure; later sweeps (fresh or not) neither re-read it nor count it. +#[tokio::test] +async fn malformed_session_header_is_not_re_failed_by_a_fresh_sweep() { + let layout = Layout::new(); + layout.write_fixture(); + layout.write_malformed_files(1); + let admission = MemoryHostAdmission::default(); + let first = capture(&layout, &admission).await; + assert!( + first.discovery_failures >= 1, + "the malformed file must fail once" + ); + let second = capture(&layout, &admission).await; + assert_eq!( + second.discovery_failures, 0, + "an unchanged malformed file must be quarantined after its first failure" + ); +} diff --git a/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission.rs b/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission.rs index 672ecdf3d4..c1fc237094 100644 --- a/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission.rs +++ b/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission.rs @@ -7,6 +7,7 @@ use std::num::NonZeroU64; #[cfg(unix)] use std::os::unix::fs::MetadataExt; use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, OnceLock, PoisonError}; use tokio::sync::Notify; @@ -1843,6 +1844,7 @@ struct ActiveAdmission<'request> { generation: ObservationSourceGenerationV1, file_identity: u64, cancellation: ObservationCancellation, + refusal_warned: AtomicBool, } impl ActiveAdmission<'_> { @@ -2121,25 +2123,32 @@ impl ActiveAdmission<'_> { if is_deterministic_content_refusal(&outcome) && !self.cancellation.is_cancelled() => { - tracing::warn!( - provider = self.provider, - session = self.source.session_id().as_str(), - offset = checkpoint.offset, - reason = outcome.reason_code.unwrap_or("host_admission_refused"), - cause = outcome.cause.as_deref().unwrap_or("unspecified"), - "admission refused a record; covering past it" - ); - self.advance_coverage( - expected_cursor, - checkpoint, + if self.refusal_warned.swap(true, Ordering::Relaxed) { + tracing::debug!( + provider = self.provider, + session = self.source.session_id().as_str(), + offset = checkpoint.offset, + reason = outcome.reason_code.unwrap_or("host_admission_refused"), + "admission refused another record; covering past it" + ); + } else { + tracing::warn!( + provider = self.provider, + session = self.source.session_id().as_str(), + offset = checkpoint.offset, + reason = outcome.reason_code.unwrap_or("host_admission_refused"), + cause = outcome.cause.as_deref().unwrap_or("unspecified"), + "admission refused a record; covering past it" + ); + } + let advance_reason = if outcome.reason_code == Some("observation_identity_collision") { ObservationCoverageReason::ObservationIdentityCollision } else { ObservationCoverageReason::AdmissionRefused - }, - None, - ) - .await?; + }; + self.advance_coverage(expected_cursor, checkpoint, advance_reason, None) + .await?; Ok(DurableFrameDisposition::Refused) } Err(outcome) => { @@ -2476,6 +2485,7 @@ pub(in crate::runtime) async fn admit_jsonl_observations( generation, file_identity: raw.file_identity, cancellation, + refusal_warned: AtomicBool::new(false), }; let mut skipped = raw.skipped.iter().copied().peekable(); let mut pending: Vec = Vec::new(); diff --git a/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission/tests.rs b/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission/tests.rs index 0fe154fb6d..2b2d4ea76b 100644 --- a/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission/tests.rs +++ b/crates/tracedecay-sessions/src/runtime/observation/jsonl_observation_admission/tests.rs @@ -20,6 +20,7 @@ use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; use serde_json::json; +use sha2::{Digest, Sha256}; use tracedecay_domain::{ CanonicalMessageRoleV1, CanonicalObservationEnvelopeV1, CanonicalObservationEvidenceV1, CanonicalObservationFactV1, CanonicalObservationRelationsV1, ObservationId, @@ -62,6 +63,8 @@ struct SeamSpyAdmission { scripted_capture_error_once: Mutex>, scripted_batch_error: Mutex>, scripted_cursor_refusal: Mutex>, + scripted_coverage_error: Mutex>, + cancel_on_coverage: AtomicBool, report_no_cursor: AtomicBool, capture_calls: AtomicU64, capture_collision_dispositions: Mutex>, @@ -966,6 +969,12 @@ impl HostAdmission for SeamSpyAdmission { .push(advance.clone()); let peer_through = self.peer_covers_advance_through.lock().unwrap().take(); Box::pin(async move { + if self.cancel_on_coverage.swap(false, Ordering::SeqCst) { + cancellation.cancel(); + } + if let Some(outcome) = self.scripted_coverage_error.lock().unwrap().clone() { + return Err(outcome); + } if let Some(offset) = peer_through { let next = advance.next_cursor(); let peer = ObservationCursorAdvance::new( @@ -1741,6 +1750,165 @@ async fn content_refusals_cover_past_so_the_stream_converges() { ); } +#[tokio::test] +async fn failed_refusal_coverage_blocks_without_skipping_the_later_message() { + let (_temp, path, len) = rollout_fixture(); + let spy = SeamSpyAdmission::default(); + spy.script_batch_error(HostAdmissionOutcome::deterministic_content_refusal( + "invalid_observation_contract", + )); + spy.script_capture_error_once(HostAdmissionOutcome::deterministic_content_refusal( + "invalid_observation_contract", + )); + *spy.scripted_coverage_error.lock().unwrap() = Some(HostAdmissionOutcome::degraded( + "observation_cursor_advance_ledger_disagreement", + )); + + let failed = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await; + assert!( + matches!( + failed, + Err(TranscriptIngestError::NonDurableRecord { offset: 0, .. }) + ), + "uncovered refusal bytes must block, not claim pass success: {failed:?}" + ); + assert_eq!(stored_cursor(&spy).await, None); + assert!(spy.inner.observations().is_empty()); + assert!(spy.inner.non_durable_advances().is_empty()); + + *spy.scripted_coverage_error.lock().unwrap() = None; + spy.script_batch_error(HostAdmissionOutcome::deterministic_content_refusal( + "invalid_observation_contract", + )); + spy.script_capture_error_once(HostAdmissionOutcome::deterministic_content_refusal( + "invalid_observation_contract", + )); + let recovered = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await + .unwrap(); + assert_eq!(recovered.frames_refused, 1); + assert_eq!(recovered.frames_persisted, 1); + assert_eq!(stored_cursor(&spy).await.unwrap().position(), len); + assert_eq!(spy.inner.observations().len(), 1); + assert_eq!( + spy.inner.non_durable_advances()[0].reason(), + ObservationCoverageReason::AdmissionRefused + ); +} + +#[tokio::test] +async fn cancellation_during_refusal_coverage_preserves_the_uncovered_cursor() { + let (_temp, path, _) = rollout_fixture(); + let spy = SeamSpyAdmission::default(); + spy.script_capture_error(HostAdmissionOutcome::deterministic_content_refusal( + "invalid_observation_contract", + )); + spy.cancel_on_coverage.store(true, Ordering::SeqCst); + let failed = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await; + assert!(matches!( + failed, + Err(TranscriptIngestError::Cancelled { .. }) + )); + assert_eq!(stored_cursor(&spy).await, None); + assert!(spy.inner.observations().is_empty()); + assert!(spy.inner.non_durable_advances().is_empty()); +} + +#[tokio::test] +async fn a_refusal_memo_cannot_authorize_uncovered_bytes_or_hide_an_in_place_rewrite() { + let (_temp, path, len) = rollout_fixture(); + let spy = SeamSpyAdmission::default(); + let contents = std::fs::read(&path).unwrap(); + let header_end = contents.iter().position(|byte| *byte == b'\n').unwrap() + 1; + let initial = try_admit_codex_jsonl_observations_for_profile_with_admission( + &path, + None, + &[], + &spy, + Some(header_end as u64), + ) + .await + .unwrap(); + assert_eq!(initial.frames_persisted, 1); + let committed = stored_cursor(&spy).await.unwrap(); + let (page, _) = super::shared_jsonl_page(&path, StoredCursor::default(), None, None, false) + .await + .unwrap(); + let source = crate::runtime::hosts::codex::codex_observation_source_v2(SESSION_ID).unwrap(); + let mut hasher = Sha256::new(); + hasher.update(b"tracedecay-refusal-memo-v1"); + hasher.update(b"codex"); + hasher.update(source.session_id().as_str().as_bytes()); + hasher.update(source.source_key().as_str().as_bytes()); + let key = format!( + "host-memo://codex/refused/v1/{}", + hex::encode(&hasher.finalize()[..8]) + ); + let foreign = ParseOffset { + byte_offset: len, + mtime: page.frames.last().unwrap().resume_fingerprint, + file_id: committed.generation().generation_id(), + }; + spy.advance_parse_offset(&ObservationScopeV1::Profile, &key, foreign) + .await + .unwrap(); + + let appended = format!( + "{}\n", + json!({ + "timestamp": "2026-01-01T00:00:02.000Z", + "type": "event_msg", + "payload": {"type": "user_message", "message": "later valid message"} + }) + ); + std::fs::OpenOptions::new() + .append(true) + .open(&path) + .unwrap() + .write_all(appended.as_bytes()) + .unwrap(); + let resumed = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await + .unwrap(); + assert_eq!( + resumed.frames_persisted, 2, + "both uncovered messages must persist" + ); + assert_eq!(spy.inner.observations().len(), 3); + assert_eq!( + spy.get_parse_offset(&ObservationScopeV1::Profile, &key) + .await + .unwrap(), + Some(foreign), + "foreign parse-offset state must remain untouched" + ); + + let edited = std::fs::read_to_string(&path) + .unwrap() + .replace("seam contract message", "edit contract message"); + std::fs::write(&path, edited).unwrap(); + let rewritten = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await + .unwrap(); + assert!( + rewritten.frames_persisted > 0, + "rewritten uncovered bytes must be re-admitted" + ); + assert_eq!( + spy.get_parse_offset(&ObservationScopeV1::Profile, &key) + .await + .unwrap(), + Some(foreign) + ); +} + #[tokio::test] async fn an_unchanged_resumed_rollout_does_not_rebuild_its_prior_context() { let (_temp, path, len) = rollout_fixture(); @@ -2783,3 +2951,83 @@ async fn renamed_rewrite_of_a_middle_record_reingests_only_the_bytes_after_the_e ); assert_eq!(admission.observations().len(), 401); } + +struct RefusalWarnings(Arc); + +impl tracing::Subscriber for RefusalWarnings { + fn enabled(&self, metadata: &tracing::Metadata<'_>) -> bool { + *metadata.level() == tracing::Level::WARN + } + + fn new_span(&self, _: &tracing::span::Attributes<'_>) -> tracing::span::Id { + tracing::span::Id::from_u64(1) + } + + fn record(&self, _: &tracing::span::Id, _: &tracing::span::Record<'_>) {} + fn record_follows_from(&self, _: &tracing::span::Id, _: &tracing::span::Id) {} + fn enter(&self, _: &tracing::span::Id) {} + fn exit(&self, _: &tracing::span::Id) {} + + fn event(&self, event: &tracing::Event<'_>) { + struct MessageVisitor(bool); + impl tracing::field::Visit for MessageVisitor { + fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) { + if field.name() == "message" + && format!("{value:?}") == "admission refused a record; covering past it" + { + self.0 = true; + } + } + } + let mut visitor = MessageVisitor(false); + event.record(&mut visitor); + if visitor.0 { + self.0.fetch_add(1, Ordering::Relaxed); + } + } +} + +#[tokio::test] +async fn refusal_warnings_latch_per_pass_and_recur_for_new_uncovered_records() { + let (_temp, path, _) = rollout_fixture(); + let spy = SeamSpyAdmission::default(); + spy.script_capture_error(HostAdmissionOutcome::deterministic_content_refusal( + "invalid_observation_contract", + )); + let warnings = Arc::new(AtomicU64::new(0)); + let _guard = tracedecay_runtime_core::logging::set_tracing_capture(RefusalWarnings( + Arc::clone(&warnings), + )); + let first = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await + .unwrap(); + assert_eq!(first.frames_refused, 2); + assert_eq!(warnings.load(Ordering::Relaxed), 1); + let settled = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await + .unwrap(); + assert_eq!(settled.bytes_consumed, 0); + assert_eq!(warnings.load(Ordering::Relaxed), 1); + let appended = format!( + "{}\n", + json!({ + "timestamp": "2026-01-01T00:00:02.000Z", + "type": "event_msg", + "payload": {"type": "user_message", "message": "new refusal"} + }) + ); + std::fs::OpenOptions::new() + .append(true) + .open(&path) + .unwrap() + .write_all(appended.as_bytes()) + .unwrap(); + let next = + try_admit_codex_jsonl_observations_for_profile_with_admission(&path, None, &[], &spy, None) + .await + .unwrap(); + assert_eq!(next.frames_refused, 1); + assert_eq!(warnings.load(Ordering::Relaxed), 2); +} diff --git a/crates/tracedecay-source-edit/src/edits/execute_tests.rs b/crates/tracedecay-source-edit/src/edits/execute_tests.rs index f1e11c8cc5..be4829064e 100644 --- a/crates/tracedecay-source-edit/src/edits/execute_tests.rs +++ b/crates/tracedecay-source-edit/src/edits/execute_tests.rs @@ -346,12 +346,22 @@ fn assert_import_fixture_compiles(project: &Path) { ); } +const MARKER_DESTINATION: &str = "pub fn marker() {}\n"; + async fn assert_move_import_ownership(import: &str, binding: &str, preserve: bool) { + assert_move_into_destination(import, binding, preserve, MARKER_DESTINATION).await; +} + +async fn assert_move_into_destination( + import: &str, + binding: &str, + preserve: bool, + original_destination: &str, +) { let project = tempdir().unwrap(); fs::create_dir_all(project.path().join("src")).unwrap(); let moved_symbol = format!("pub fn moved(value: {binding}) -> {binding} {{\n value\n}}"); let original_source = format!("{import}\n\n{moved_symbol}\n\npub fn remains() {{}}\n"); - let original_destination = "pub fn marker() {}\n"; // This module never refers to `moved`; its dependency on the original // export path must survive moving that function to a different module. let consumer_type = if preserve { @@ -510,6 +520,89 @@ async fn move_symbol_still_removes_an_unused_private_import() { assert_move_import_ownership("use crate::model::Widget;", "Widget", false).await; } +#[tokio::test] +async fn move_symbol_inserts_imports_after_a_multiline_use_group() { + assert_move_into_destination( + "use crate::model::Widget;", + "Widget", + false, + "use std::{\n fmt::Debug,\n};\n\npub fn marker(_: &dyn Debug) {}\n", + ) + .await; +} + +#[tokio::test] +async fn move_symbol_preserves_an_outer_attribute_after_a_same_line_import() { + assert_move_into_destination( + "use crate::model::Widget;", + "Widget", + false, + "use std::fmt::Debug; #[cfg(any())]\npub fn marker(_: &dyn Debug) {}\n", + ) + .await; +} + +#[tokio::test] +async fn move_symbol_inserts_imports_after_module_inner_attributes() { + assert_move_into_destination( + "use crate::model::Widget;", + "Widget", + false, + "#![allow(dead_code)]\npub fn marker() {}\n", + ) + .await; +} + +#[tokio::test] +async fn move_symbol_refuses_a_destination_that_does_not_parse() { + let project = tempdir().unwrap(); + fs::create_dir_all(project.path().join("src")).unwrap(); + let source = + "use crate::model::Widget;\n\npub fn moved(value: Widget) -> Widget {\n value\n}\n"; + let broken = "pub fn marker( {\n"; + for (path, content) in [ + ("src/api.rs", source), + ("src/model.rs", "pub struct Widget;\n"), + ("src/relocated.rs", broken), + ] { + fs::write(project.path().join(path), content).unwrap(); + } + let (graph, _) = fixture_graph(project.path()).await; + let code_graph = fixture_symbol_code_graph( + "src/api.rs", + source, + "pub fn moved(value: Widget) -> Widget {\n value\n}", + "moved", + "api::moved", + ); + let request = fixture_request_for_edit( + SourceEditRequest::MoveSymbol { + symbol: "moved".to_owned(), + dest_file: "src/relocated.rs".to_owned(), + dry_run: true, + update_references: false, + }, + "source-edit.move-unparseable-destination", + ); + let outcome = resolve_source_edit_preview( + &graph, + &code_graph, + &request.context, + request.observed_at, + request_graph_cancellation(&request.context), + request.edit.clone(), + ) + .await; + assert!( + outcome.is_err() || !outcome.unwrap().outcome.success(), + "an unparseable destination must refuse the move" + ); + assert_eq!( + fs::read_to_string(project.path().join("src/relocated.rs")).unwrap(), + broken + ); +} + #[tokio::test] async fn move_symbol_preserves_a_destination_created_at_publication() { let project = tempdir().unwrap(); diff --git a/crates/tracedecay-source-edit/src/edits/mod.rs b/crates/tracedecay-source-edit/src/edits/mod.rs index aaeea9e24b..9fdb30eb60 100644 --- a/crates/tracedecay-source-edit/src/edits/mod.rs +++ b/crates/tracedecay-source-edit/src/edits/mod.rs @@ -18,8 +18,8 @@ mod test_support; pub(crate) use ast_grep::ast_grep_rewrite; pub(crate) use preview::{ - LeadingKind, MAX_PREVIEW_DIFF_LINES, PREVIEW_DIFF_CONTEXT, bounded_region_diff, - classify_leading_line, edit_success_message, + MAX_PREVIEW_DIFF_LINES, PREVIEW_DIFF_CONTEXT, bounded_region_diff, edit_success_message, + is_inner_doc_line, }; pub(crate) use primitives::{ insert_at, insert_at_symbol, multi_str_replace, replace_symbol, splice_lines, str_replace, diff --git a/crates/tracedecay-source-edit/src/edits/move_destination_tests.rs b/crates/tracedecay-source-edit/src/edits/move_destination_tests.rs index e953cb550e..bffa5cd565 100644 --- a/crates/tracedecay-source-edit/src/edits/move_destination_tests.rs +++ b/crates/tracedecay-source-edit/src/edits/move_destination_tests.rs @@ -3,9 +3,11 @@ use std::path::Path; use std::process::Command; use tempfile::tempdir; +use tracedecay_contracts::source_edit::MoveHint; use tracedecay_contracts::{ EffectTermination, SourceEditKind, SourceEditRequest, source_edit_operation, }; +use tracedecay_domain::errors::TraceDecayError; use super::test_support::{ fixture_authorization, fixture_graph, fixture_request_for_edit, fixture_symbol_code_graph, @@ -40,10 +42,31 @@ async fn move_with_destination_header( newline: &str, destination_exists: bool, ) { + move_with_destination_dependency( + before_import, + after_import, + newline, + destination_exists, + "use crate::model::Widget;", + "Widget", + Some("use crate::model::Widget;"), + ) + .await; +} + +async fn move_with_destination_dependency( + before_import: &str, + after_import: &str, + newline: &str, + destination_exists: bool, + source_import: &str, + binding: &str, + expected_import: Option<&str>, +) -> Vec { let project = tempdir().unwrap(); fs::create_dir(project.path().join("src")).unwrap(); - let moved_text = "pub fn moved(value: Widget) -> Widget {\n value\n}"; - let source = format!("use crate::model::Widget;\n\n{moved_text}\n"); + let moved_text = format!("pub fn moved(value: {binding}) -> {binding} {{\n value\n}}"); + let source = format!("{source_import}\n\n{moved_text}\n"); let destination = format!("{before_import}{after_import}"); fs::write(project.path().join("src/source.rs"), &source).unwrap(); fs::write(project.path().join("src/model.rs"), "pub struct Widget;\n").unwrap(); @@ -60,7 +83,7 @@ async fn move_with_destination_header( let code_graph = fixture_symbol_code_graph( "src/source.rs", &source, - moved_text, + &moved_text, "moved", "source::moved", ); @@ -87,7 +110,10 @@ async fn move_with_destination_header( panic!("expected a move preview"); }; assert!(result.success, "{}", result.message); - assert_eq!(result.applied_imports, ["use crate::model::Widget;"]); + assert_eq!( + result.applied_imports, + expected_import.into_iter().collect::>() + ); assert_eq!(preview.planned_files.len(), 2); assert_eq!( fs::read_to_string(project.path().join("src/source.rs")).unwrap(), @@ -123,8 +149,8 @@ async fn move_with_destination_header( } compile_move_destination_fixture(project.path()); let actual = fs::read_to_string(project.path().join("src/relocated.rs")).unwrap(); - let unchanged_destination = - format!("{before_import}use crate::model::Widget;{newline}{after_import}"); + let inserted = expected_import.map_or_else(String::new, |import| format!("{import}{newline}")); + let unchanged_destination = format!("{before_import}{inserted}{after_import}"); assert!(actual.starts_with(&unchanged_destination), "{actual:?}"); assert!(actual.ends_with(&format!("{moved_text}\n"))); let mut parser = tree_sitter::Parser::new(); @@ -132,15 +158,31 @@ async fn move_with_destination_header( parser.set_language(&language).unwrap(); let tree = parser.parse(&actual, None).unwrap(); assert!(!tree.root_node().has_error()); - assert!( - tree.root_node() - .named_children(&mut tree.walk()) - .any(|node| { - node.kind() == "use_declaration" - && node.utf8_text(actual.as_bytes()).unwrap() == "use crate::model::Widget;" - }), - "the dependency must be at the destination module root" + let original_tree = parser.parse(&destination, None).unwrap(); + let original_imports = original_tree + .root_node() + .named_children(&mut original_tree.walk()) + .filter(|node| node.kind() == "use_declaration") + .count(); + let actual_imports: Vec<_> = tree + .root_node() + .named_children(&mut tree.walk()) + .filter(|node| node.kind() == "use_declaration") + .collect(); + assert_eq!( + actual_imports.len(), + original_imports + usize::from(expected_import.is_some()), + "the move must add only the expected dependency import" ); + if let Some(expected_import) = expected_import { + assert!( + actual_imports + .iter() + .any(|node| node.utf8_text(actual.as_bytes()).unwrap() == expected_import), + "the dependency must be at the destination module root" + ); + } + result.impact.clone() } #[tokio::test] @@ -170,11 +212,158 @@ async fn move_symbol_imports_preserve_destination_syntax_in_preview_and_apply() "\u{feff}#!/usr/bin/env rust-script\n//! Destination module.\n", "pub fn marker() {}\n", ), + ("use std::fmt::Debug as _;\n", "pub fn marker() {}\n"), ] { move_with_destination_header(before, after, "\n", true).await; } } +#[tokio::test] +async fn move_symbol_ignores_destination_imports_in_comments_and_nested_scopes() { + for (before, after) in [ + ( + "/* Import example:\nuse crate::model::Widget;\n*/\n", + "pub fn marker() {}\n", + ), + ( + "", + "mod nested {\n use crate::model::Widget;\n pub fn marker(value: Widget) -> Widget { value }\n}\npub fn marker() {}\n", + ), + ] { + move_with_destination_header(before, after, "\n", true).await; + } +} + +#[tokio::test] +async fn move_symbol_preserves_dependency_aliases_across_trivia() { + for import in [ + "use crate::model::Widget as\n Alias;", + "use crate::model::Widget\tas\tAlias;", + "use crate::model::Widget as /* local name */ Alias;", + ] { + move_with_destination_dependency( + "", + "pub fn marker() {}\n", + "\n", + true, + import, + "Alias", + Some(import), + ) + .await; + } +} + +#[tokio::test] +async fn move_symbol_reuses_equivalent_destination_imports() { + for destination_import in [ + "use crate::model::{Widget};\n", + "use crate::{model::{Widget}};\n", + "use crate /* root */ ::\n model :: Widget;\n", + "use crate::model::{Widget, *};\n", + ] { + move_with_destination_dependency( + destination_import, + "pub fn marker() {}\n", + "\n", + true, + "use crate::model::Widget;", + "Widget", + None, + ) + .await; + } + move_with_destination_dependency( + "use crate::{model::{Widget as /* retained alias */ Alias}};\n", + "pub fn marker() {}\n", + "\n", + true, + "use crate::model::Widget as\n Alias;", + "Alias", + None, + ) + .await; +} + +#[tokio::test] +async fn move_symbol_reuses_lint_attributed_destination_imports() { + for (destination_import, source_import, binding) in [ + ( + "#[allow(unused_imports)]\nuse crate::model::Widget;\n", + "use crate::model::Widget;", + "Widget", + ), + ( + "#[warn(\n unsafe_code,\n)]\n// Keep the lint policy and public alias.\n#[deny(non_snake_case)]\npub use crate::{model::{Widget as Alias}};\n", + "use crate::model::Widget as Alias;", + "Alias", + ), + ] { + move_with_destination_dependency( + destination_import, + "pub fn marker() {}\n", + "\n", + true, + source_import, + binding, + None, + ) + .await; + } +} + +#[tokio::test] +async fn move_symbol_preserves_destination_item_bindings() { + let import = "use crate::relocated::Widget as\n Alias;"; + move_with_destination_dependency( + "", + "pub struct Widget;\n", + "\n", + true, + import, + "Alias", + Some(import), + ) + .await; + move_with_destination_dependency( + "use std::fmt::*;\n", + "pub struct Widget;\n", + "\n", + true, + "use crate::relocated::Widget;", + "Widget", + None, + ) + .await; +} + +#[tokio::test] +async fn move_symbol_reports_aliases_that_require_manual_imports() { + for source_import in [ + "use super::model::Widget as\n Alias;", + "#[cfg(all())]\nuse crate::model::Widget as /* source configuration */ Alias;", + ] { + let hints = move_with_destination_dependency( + "use crate::model::Widget as Alias;\n", + "pub fn marker() {}\n", + "\n", + true, + source_import, + "Alias", + None, + ) + .await; + assert_eq!( + hints + .iter() + .filter(|hint| hint.kind == "import_needed") + .count(), + 1, + "an unportable alias must remain visible in the dependency report" + ); + } +} + #[tokio::test] async fn move_symbol_preserves_destination_bytes_when_adding_imports() { move_with_destination_header( @@ -190,12 +379,46 @@ async fn move_symbol_preserves_destination_bytes_when_adding_imports() { } #[tokio::test] -async fn move_symbol_refuses_unparseable_destination_before_preview_or_apply() { +async fn move_symbol_refuses_unsupported_destination_before_preview_or_apply() { for (destination, dependency) in [ ("use std::{\n", true), ("pub fn marker() {\n", false), ("/* unclosed destination comment", true), ("/// Detached documentation.\n#[inline]\n", false), + ( + "#[cfg(any())]\nuse crate::model::Widget;\npub fn marker() {}\n", + true, + ), + ( + "#[cfg(all())]\nuse crate::model::Widget;\npub fn marker() {}\n", + true, + ), + ( + "#[cfg(any())]\nuse crate::{model::{Widget}};\npub fn marker() {}\n", + true, + ), + ( + "#[cfg(all())]\nuse crate::model::\n Widget;\npub fn marker() {}\n", + true, + ), + ( + "#[cfg_attr(all(), cfg(any()))]\n#[allow(unused_imports)]\nuse crate::model::Widget;\npub fn marker() {}\n", + true, + ), + ( + "#[custom::allow(unused_imports)]\n#[allow(unused_imports)]\nuse crate::model::Widget;\npub fn marker() {}\n", + true, + ), + ( + "#[transform]\n#[deny(unsafe_code)]\nuse crate::model::Widget;\npub fn marker() {}\n", + true, + ), + ("use std::fmt::Error as Widget;\npub fn marker() {}\n", true), + ("pub struct Widget;\npub fn marker() {}\n", true), + ( + "mod other { pub struct Widget; }\nuse self::other::*;\npub fn marker(value: Widget) -> Widget { value }\n", + true, + ), ] { let project = tempdir().unwrap(); fs::create_dir(project.path().join("src")).unwrap(); @@ -232,10 +455,11 @@ async fn move_symbol_refuses_unparseable_destination_before_preview_or_apply() { request.edit.clone(), ) .await; - assert!( - preview.is_err(), - "malformed destination must not get an accepted preview" - ); + assert!(matches!( + preview, + Err(TraceDecayError::ProjectRoute { reason_code, retryable: false, .. }) + if reason_code == "source-edit-destination-syntax-unsupported" + )); let authorization = fixture_authorization(&request); let applied = execute_source_edit( &graph, diff --git a/crates/tracedecay-source-edit/src/edits/preview.rs b/crates/tracedecay-source-edit/src/edits/preview.rs index d2227df442..11ce2e0035 100644 --- a/crates/tracedecay-source-edit/src/edits/preview.rs +++ b/crates/tracedecay-source-edit/src/edits/preview.rs @@ -53,6 +53,12 @@ pub(crate) fn classify_leading_line(line: &str) -> LeadingKind { } } +/// True for a `//!` inner module-doc line, which documents the enclosing +/// module and can never belong to a moved item. +pub(crate) fn is_inner_doc_line(line: &str) -> bool { + classify_leading_line(line) == LeadingKind::InnerDoc +} + /// Unchanged context lines shown on each side of the changed region in a /// dry-run preview diff. pub(crate) const PREVIEW_DIFF_CONTEXT: usize = 3; @@ -142,43 +148,14 @@ pub(crate) fn bounded_region_diff( #[cfg(test)] mod tests { - use super::{LeadingKind, bounded_region_diff, classify_leading_line}; + use super::{bounded_region_diff, is_inner_doc_line}; #[test] - fn classify_leading_line_covers_every_kind() { - assert_eq!(classify_leading_line(""), LeadingKind::Blank); - assert_eq!(classify_leading_line(" \t"), LeadingKind::Blank); - assert_eq!(classify_leading_line("//! inner"), LeadingKind::InnerDoc); - assert_eq!(classify_leading_line("/// outer"), LeadingKind::OuterDoc); - assert_eq!( - classify_leading_line("/** block doc */"), - LeadingKind::OuterDoc - ); - assert_eq!(classify_leading_line("// plain"), LeadingKind::LineComment); - assert_eq!( - classify_leading_line("/* block */"), - LeadingKind::BlockComment - ); - assert_eq!(classify_leading_line("#[inline]"), LeadingKind::Attribute); - assert_eq!( - classify_leading_line("#![allow(dead_code)]"), - LeadingKind::Attribute - ); - assert_eq!( - classify_leading_line("use crate::x;"), - LeadingKind::UseImport - ); - assert_eq!( - classify_leading_line("pub use crate::x;"), - LeadingKind::UseImport - ); - assert_eq!( - classify_leading_line("extern crate foo;"), - LeadingKind::UseImport - ); - assert_eq!(classify_leading_line("fn f() {}"), LeadingKind::Code); - // Leading whitespace never changes the classification. - assert_eq!(classify_leading_line(" //! inner"), LeadingKind::InnerDoc); + fn inner_doc_lines_are_recognized_regardless_of_indent() { + assert!(is_inner_doc_line("//! inner")); + assert!(is_inner_doc_line(" //! inner")); + assert!(!is_inner_doc_line("/// outer")); + assert!(!is_inner_doc_line("// plain")); } #[test] diff --git a/crates/tracedecay-source-edit/src/move_symbol/mod.rs b/crates/tracedecay-source-edit/src/move_symbol/mod.rs index 9d5b50c0f4..62548bfe73 100644 --- a/crates/tracedecay-source-edit/src/move_symbol/mod.rs +++ b/crates/tracedecay-source-edit/src/move_symbol/mod.rs @@ -26,8 +26,8 @@ use tracedecay_domain::errors::{Result, TraceDecayError}; use tracedecay_graph_query::{map_code_graph_read_runtime_error, map_projection_error}; use crate::edits::{ - EditSymbolV1, LeadingKind, classify_leading_line, edit_success_message, - edit_symbol_from_summary, resolve_symbol_for_edit, splice_lines, + EditSymbolV1, edit_success_message, edit_symbol_from_summary, is_inner_doc_line, + resolve_symbol_for_edit, splice_lines, }; use fs_guards::{ @@ -130,8 +130,7 @@ pub(crate) async fn move_symbol( // module, not the following item. Advance past it so the source keeps its // module doc and the destination doesn't receive a stray `//!` mid-file // (a hard E0753). - while start < end_inclusive && classify_leading_line(src_lines[start]) == LeadingKind::InnerDoc - { + while start < end_inclusive && is_inner_doc_line(src_lines[start]) { start += 1; } let moved_text = src_lines[start..=end_inclusive].join("\n"); @@ -214,7 +213,7 @@ pub(crate) async fn move_symbol( &analysis.auto_imports, &dest_original, dest_module.as_deref(), - ); + )?; let dest_modified = build_dest_content(&dest_rel, &dest_original, &applied_imports, &moved_text)?; @@ -487,7 +486,7 @@ async fn analyze_dependencies( if matched.is_empty() { continue; } - if stmt.leaves.len() == 1 && !stmt.glob { + if stmt.leaves.len() == 1 && !stmt.has_unnamed_dependencies { if let Some(import) = portable_dependency_import(&stmt) { out.auto_imports.push(import); } else { @@ -535,7 +534,7 @@ async fn analyze_dependencies( file: dest_rel.to_string(), line: None, detail: format!( - "moved body uses {names:?} from a grouped/glob import in {source_rel}" + "moved body uses {names:?} from a grouped or unnamed import in {source_rel}" ), suggestion: Some(format!( "add an import for {names:?} at the destination (from `{}`)", diff --git a/crates/tracedecay-source-edit/src/move_symbol/rendering.rs b/crates/tracedecay-source-edit/src/move_symbol/rendering.rs index 099b1c66dd..78591e7961 100644 --- a/crates/tracedecay-source-edit/src/move_symbol/rendering.rs +++ b/crates/tracedecay-source-edit/src/move_symbol/rendering.rs @@ -8,9 +8,12 @@ use std::collections::HashSet; use tracedecay_code_extraction::ts_provider::parse_extractor_source; use tracedecay_domain::errors::{Result, TraceDecayError}; +use tree_sitter::Tree; use crate::edits::{MAX_PREVIEW_DIFF_LINES, PREVIEW_DIFF_CONTEXT, bounded_region_diff}; +use super::use_parsing::{destination_import_is_unconditional, use_bindings}; + /// Removes `lines[start..=end]` and collapses the blank-line separator the /// removed item left behind so the source stays tidy. pub(super) fn remove_span_with_cleanup(lines: &[&str], start: usize, end: usize) -> Vec { @@ -100,16 +103,21 @@ fn destination_syntax_error(message: impl Into) -> TraceDecayError { TraceDecayError::project_route("source-edit-destination-syntax-unsupported", false, message) } -fn rust_import_offset(source: &str) -> Result { +fn parse_rust_destination(source: &str) -> Result { let tree = parse_extractor_source("rust", "Rust", source).map_err(|error| { destination_syntax_error(format!("cannot parse Rust destination: {error}")) })?; - let root = tree.root_node(); - if root.has_error() { + if tree.root_node().has_error() { return Err(destination_syntax_error( "Rust destination contains incomplete or unsupported syntax", )); } + Ok(tree) +} + +fn rust_import_offset(source: &str) -> Result { + let tree = parse_rust_destination(source)?; + let root = tree.root_node(); let mut offset = None; let mut seen_item = false; let mut pending_outer = false; @@ -146,39 +154,138 @@ fn rust_import_offset(source: &str) -> Result { Ok(offset.unwrap_or(source.len())) } -/// Drops imports already present verbatim in the destination and de-duplicates -/// within the batch, preserving order. +/// Drops matching unconditional module imports and de-duplicates within the +/// batch. Text in comments or nested scopes cannot supply a module binding. +/// Without name resolution, declared names and unknown wildcard bindings +/// conservatively prevent insertion that could change existing uses. pub(super) fn dedup_preserve( imports: &[String], dest_original: &str, dest_module: Option<&str>, -) -> Vec { - let mut seen: HashSet = HashSet::new(); +) -> Result> { + if imports.is_empty() { + return Ok(Vec::new()); + } + let tree = parse_rust_destination(dest_original)?; + let mut existing = HashSet::new(); + let mut bound_names = HashSet::new(); + let mut declared_names = HashSet::new(); + let mut attributed = HashSet::new(); + let mut has_wildcard = false; + for node in tree.root_node().named_children(&mut tree.walk()) { + if node.kind() != "use_declaration" { + if let Some(name) = node + .child_by_field_name("alias") + .or_else(|| node.child_by_field_name("name")) + .and_then(|name| name.utf8_text(dest_original.as_bytes()).ok()) + { + declared_names.insert(name.to_owned()); + } + continue; + } + let bindings = node + .child_by_field_name("argument") + .and_then(|argument| use_bindings(argument, dest_original.as_bytes())) + .ok_or_else(|| { + destination_syntax_error("cannot identify a complete destination import") + })?; + has_wildcard |= bindings.wildcard; + let unconditional = destination_import_is_unconditional(node, dest_original.as_bytes()); + for leaf in bindings.leaves { + if unconditional { + bound_names.insert(leaf.binding.clone()); + existing.insert(leaf); + } else { + attributed.insert(leaf.binding); + } + } + } + let import_source = imports.join("\n"); + let import_tree = parse_rust_destination(&import_source)?; + let mut cursor = import_tree.walk(); + let mut declarations = import_tree + .root_node() + .named_children(&mut cursor) + .filter(|node| node.kind() == "use_declaration"); let mut out = Vec::new(); for imp in imports { - let trimmed = imp.trim(); - if dest_original.lines().any(|l| l.trim() == trimmed) { + let declaration = declarations.next().ok_or_else(|| { + destination_syntax_error("cannot identify an automatic dependency import") + })?; + let bindings = declaration + .child_by_field_name("argument") + .and_then(|argument| use_bindings(argument, import_source.as_bytes())) + .ok_or_else(|| { + destination_syntax_error("cannot identify an automatic dependency binding") + })?; + let [leaf] = bindings.leaves.as_slice() else { + return Err(destination_syntax_error( + "automatic dependency import must provide exactly one named binding", + )); + }; + if bindings.wildcard + || bindings.anonymous + || declaration.utf8_text(import_source.as_bytes()).ok() != Some(imp.trim()) + { + return Err(destination_syntax_error( + "automatic dependency import must be one complete named declaration", + )); + } + if existing.contains(leaf) { continue; } + if attributed.contains(&leaf.binding) { + // A conditional import may or may not bind the name. Neither + // dropping the dependency nor adding an unconditional duplicate + // is safe without resolving that configuration. + return Err(destination_syntax_error(format!( + "automatic import conflicts with an attributed destination binding: {}", + leaf.binding + ))); + } + if bound_names.contains(&leaf.binding) { + return Err(destination_syntax_error(format!( + "automatic import conflicts with a different destination binding: {}", + leaf.binding + ))); + } // An import of an item the destination module itself declares // (`use crate::SweepType;` inserted into `src/lib.rs`) would be a // self-import: the name is already in scope at the destination. if let Some(dest_module) = dest_module - && let Some(rest) = trimmed - .strip_prefix("use ") - .and_then(|rest| rest.strip_suffix(';')) - && rest + && let Some(path) = &leaf.canonical_path + && path .strip_prefix(dest_module) .and_then(|tail| tail.strip_prefix("::")) - .is_some_and(|leaf| !leaf.contains("::")) + .is_some_and(|name| !name.contains("::") && name == leaf.binding) { continue; } - if seen.insert(trimmed.to_string()) { - out.push(imp.clone()); + if declared_names.contains(&leaf.binding) { + return Err(destination_syntax_error(format!( + "automatic import overlaps a destination item name: {}", + leaf.binding + ))); } + if has_wildcard { + // An explicit binding can silently replace a name supplied by a + // glob. Without resolving it, the existing uses cannot be proven + // to retain their meaning. Anonymous aliases do not bind names. + return Err(destination_syntax_error(format!( + "automatic import may shadow a destination wildcard binding: {}", + leaf.binding + ))); + } + bound_names.insert(leaf.binding.clone()); + existing.insert(leaf.clone()); + out.push(imp.clone()); } - out + if declarations.next().is_some() { + return Err(destination_syntax_error( + "automatic dependency import contains extra declarations", + )); + } + Ok(out) } /// Removes each orphaned single-leaf `use` line (only the moved symbol needed @@ -380,7 +487,8 @@ mod tests { ], "use c::D;\n", None, - ); + ) + .unwrap(); assert_eq!(out, vec!["use a::B;".to_string()]); } @@ -402,7 +510,8 @@ mod tests { ], "pub struct SweepType { pub value: i32 }\n", Some("crate"), - ); + ) + .unwrap(); assert_eq!(out, vec!["use crate::nested::Other;".to_string()]); } } diff --git a/crates/tracedecay-source-edit/src/move_symbol/use_parsing.rs b/crates/tracedecay-source-edit/src/move_symbol/use_parsing.rs index 9688e6db3c..4a6c38041b 100644 --- a/crates/tracedecay-source-edit/src/move_symbol/use_parsing.rs +++ b/crates/tracedecay-source-edit/src/move_symbol/use_parsing.rs @@ -10,9 +10,20 @@ use std::collections::HashSet; use tree_sitter::{Node as TsNode, Parser}; /// A single binding brought into scope by a `use` statement. +#[derive(Clone, Eq, Hash, PartialEq)] pub(super) struct UseLeaf { /// The name as referenced in code (the alias when `as` is present). pub(super) binding: String, + /// The syntax-derived path, independent of grouping, whitespace and + /// comments. An unverified fallback never supplies a path identity. + pub(super) canonical_path: Option, +} + +#[derive(Default)] +pub(super) struct UseBindings { + pub(super) wildcard: bool, + pub(super) anonymous: bool, + pub(super) leaves: Vec, } /// A parsed `use` statement from a source file. @@ -27,8 +38,9 @@ pub(super) struct UseStatement { pub(super) removable: bool, /// 1-based line of the statement. pub(super) line: u32, - /// Whether the statement is a glob import (`use a::*;`). - pub(super) glob: bool, + /// A glob or anonymous (`as _`) import cannot be attributed to one named + /// dependency, so moving a named leaf must not relocate the whole import. + pub(super) has_unnamed_dependencies: bool, pub(super) leaves: Vec, } @@ -97,21 +109,56 @@ fn source_relative_use_path(node: TsNode<'_>) -> bool { } } -fn has_outer_attributes(node: TsNode<'_>) -> bool { - let mut previous = node.prev_named_sibling(); - while let Some(sibling) = previous { - match sibling.kind() { - "attribute_item" => return true, - "line_comment" | "block_comment" => { - if sibling.child_by_field_name("outer").is_some() { - return true; - } - previous = sibling.prev_named_sibling(); - } - _ => return false, - } - } - false +pub(super) fn has_outer_attributes(node: TsNode<'_>) -> bool { + outer_attributes(node).next().is_some() +} + +/// Built-in lint attributes leave an existing destination binding available. +/// Source relocation still rejects every attached attribute so its scope and +/// ownership cannot silently change. Unknown attributes may transform imports. +pub(super) fn destination_import_is_unconditional(node: TsNode<'_>, src: &[u8]) -> bool { + outer_attributes(node).all(|attribute| is_lint_attribute(attribute, src)) +} + +fn outer_attributes(node: TsNode<'_>) -> impl Iterator> { + std::iter::successors(node.prev_named_sibling(), |node| node.prev_named_sibling()) + .take_while(|node| { + matches!( + node.kind(), + "attribute_item" | "line_comment" | "block_comment" + ) + }) + .filter(|node| { + node.kind() == "attribute_item" || node.child_by_field_name("outer").is_some() + }) +} + +fn is_lint_attribute(node: TsNode<'_>, src: &[u8]) -> bool { + let Some(attribute) = node + .named_children(&mut node.walk()) + .find(|child| child.kind() == "attribute") + else { + return false; + }; + let Some(path) = attribute + .named_children(&mut attribute.walk()) + .find(|child| !matches!(child.kind(), "line_comment" | "block_comment")) + else { + return false; + }; + path.kind() == "identifier" + && matches!( + path.utf8_text(src), + Ok("allow" | "expect" | "warn" | "deny" | "forbid") + ) + && attribute + .child_by_field_name("arguments") + .is_some_and(|arguments| { + arguments.kind() == "token_tree" + && arguments + .child(0) + .is_some_and(|delimiter| delimiter.kind() == "(") + }) } /// Tree-sitter path: collect every `use_declaration` node (top-level and inside @@ -140,7 +187,7 @@ fn collect_use_declarations( if let Ok(text) = node.utf8_text(src) && let Some(argument) = node.child_by_field_name("argument") && let Ok(path) = argument.utf8_text(src) - && let Some((glob, leaves)) = parse_use_bindings(path) + && let Some(bindings) = use_bindings(argument, src) { let mut cursor = node.walk(); let plain_declaration = syntax_complete && !has_outer_attributes(node); @@ -154,8 +201,8 @@ fn collect_use_declarations( .then(|| path.to_string()), removable, line: node.start_position().row as u32 + 1, - glob, - leaves, + has_unnamed_dependencies: bindings.wildcard || bindings.anonymous, + leaves: bindings.leaves, }); } // `use_declaration` nodes do not nest; no need to descend further. @@ -186,13 +233,13 @@ fn parse_use_statements_linescan(source: &str) -> Vec { else { continue; }; - if let Some((glob, leaves)) = parse_use_bindings(path) { + if let Some((has_unnamed_dependencies, leaves)) = fallback_use_bindings(path) { out.push(UseStatement { text: raw.to_string(), portable_path: None, removable: false, line: (idx + 1) as u32, - glob, + has_unnamed_dependencies, leaves, }); } @@ -200,30 +247,132 @@ fn parse_use_statements_linescan(source: &str) -> Vec { out } -/// Parses bindings from the import argument, after the syntax authority has -/// separated visibility and the declaration boundary. -fn parse_use_bindings(body: &str) -> Option<(bool, Vec)> { +/// Reads binding identities from the grammar's argument fields. The original +/// argument remains the rendering payload; only comparison ignores trivia. +pub(super) fn use_bindings(argument: TsNode<'_>, src: &[u8]) -> Option { + let mut bindings = UseBindings::default(); + collect_use_bindings(argument, None, src, &mut bindings)?; + Some(bindings) +} + +fn collect_use_bindings( + node: TsNode<'_>, + prefix: Option<&str>, + src: &[u8], + bindings: &mut UseBindings, +) -> Option<()> { + match node.kind() { + "scoped_use_list" => { + let path = match node.child_by_field_name("path") { + Some(path) => canonical_use_path(path, src)?, + None => "::".to_owned(), + }; + let path = join_use_path(prefix, &path)?; + collect_use_bindings( + node.child_by_field_name("list")?, + Some(&path), + src, + bindings, + )?; + } + "use_list" => { + for child in node.named_children(&mut node.walk()) { + if !matches!(child.kind(), "line_comment" | "block_comment") { + collect_use_bindings(child, prefix, src, bindings)?; + } + } + } + "use_wildcard" => bindings.wildcard = true, + _ => { + let (path, alias) = if node.kind() == "use_as_clause" { + ( + node.child_by_field_name("path")?, + Some(node.child_by_field_name("alias")?.utf8_text(src).ok()?), + ) + } else { + (node, None) + }; + let path = join_use_path(prefix, &canonical_use_path(path, src)?)?; + let binding = alias.or_else(|| path.rsplit("::").next())?; + if matches!(binding, "_" | "self" | "super" | "crate") { + bindings.anonymous = true; + } else { + bindings.leaves.push(UseLeaf { + binding: binding.to_owned(), + canonical_path: Some(path), + }); + } + } + } + Some(()) +} + +fn canonical_use_path(node: TsNode<'_>, src: &[u8]) -> Option { + match node.kind() { + "identifier" | "crate" | "self" | "super" => Some(node.utf8_text(src).ok()?.to_owned()), + "scoped_identifier" => { + let name = canonical_use_path(node.child_by_field_name("name")?, src)?; + let path = match node.child_by_field_name("path") { + Some(path) => canonical_use_path(path, src)?, + None => String::new(), + }; + Some(format!("{path}::{name}")) + } + _ => None, + } +} + +fn join_use_path(prefix: Option<&str>, path: &str) -> Option { + match (prefix, path) { + (None, path) => Some(path.to_owned()), + (Some(prefix), "self") => Some(prefix.to_owned()), + (Some(_), path) if path.starts_with("::") => None, + (Some("::"), path) => Some(format!("::{path}")), + (Some(prefix), path) => Some(format!("{prefix}::{path}")), + } +} + +/// Unverified names are only useful for dependency hints when the grammar is +/// unavailable. They never authorize insertion, deduplication or removal. +fn fallback_use_bindings(body: &str) -> Option<(bool, Vec)> { let body = body.trim(); - let glob = body.contains('*'); + let mut has_unnamed_dependencies = body.contains('*'); let leaves: Vec = if let Some(open) = body.find('{') { let inner = body[open + 1..].trim_end().trim_end_matches('}'); inner .split(',') - .filter_map(|item| leaf_binding(item.trim())) - .map(|binding| UseLeaf { binding }) + .filter_map(|item| fallback_leaf_binding(item.trim())) + .filter(|binding| { + has_unnamed_dependencies |= binding == "_"; + binding != "_" + }) + .map(|binding| UseLeaf { + binding, + canonical_path: None, + }) .collect() } else { - leaf_binding(body).map_or_default(|binding| vec![UseLeaf { binding }]) + fallback_leaf_binding(body) + .filter(|binding| { + has_unnamed_dependencies |= binding == "_"; + binding != "_" + }) + .map_or_default(|binding| { + vec![UseLeaf { + binding, + canonical_path: None, + }] + }) }; - if leaves.is_empty() && !glob { + if leaves.is_empty() && !has_unnamed_dependencies { return None; } - Some((glob, leaves)) + Some((has_unnamed_dependencies, leaves)) } /// The in-code binding for a single `use` path segment (`a::b::C` -> `C`, /// `a::C as D` -> `D`). Returns `None` for globs and empty items. -fn leaf_binding(item: &str) -> Option { +fn fallback_leaf_binding(item: &str) -> Option { let item = item.trim(); if item.is_empty() || item == "*" || item.ends_with("::*") { return None; @@ -269,12 +418,35 @@ mod tests { let stmts = parse_use_statements(src); assert_eq!(stmts.len(), 4); assert_eq!(stmts[0].leaves[0].binding, "HashMap"); - assert!(!stmts[0].glob); + assert!(!stmts[0].has_unnamed_dependencies); assert_eq!(stmts[1].leaves[0].binding, "C"); assert_eq!(stmts[2].leaves.len(), 2); assert_eq!(stmts[2].leaves[0].binding, "Y"); assert_eq!(stmts[2].leaves[1].binding, "Z"); - assert!(stmts[3].glob); + assert!(stmts[3].has_unnamed_dependencies); + } + + #[test] + fn use_bindings_preserve_path_identity_and_unnamed_dependencies() { + let imports = parse_use_statements( + "use ::std::{fmt::{self as\n Formatting, Debug as _}, collections::HashMap, io::*};", + ); + assert_eq!(imports.len(), 1); + assert!(imports[0].has_unnamed_dependencies); + assert_eq!( + imports[0] + .leaves + .iter() + .map(|leaf| (leaf.binding.as_str(), leaf.canonical_path.as_deref())) + .collect::>(), + [ + ("Formatting", Some("::std::fmt")), + ("HashMap", Some("::std::collections::HashMap")), + ] + ); + let fallback = parse_use_statements_linescan("use crate::model::Widget as Alias;"); + assert_eq!(fallback.len(), 1); + assert!(fallback[0].leaves[0].canonical_path.is_none()); } #[test] diff --git a/crates/tracedecay/src/daemon/hook_v2_replay_consumer.rs b/crates/tracedecay/src/daemon/hook_v2_replay_consumer.rs index 88d16ff07a..e5dd4ba6bf 100644 --- a/crates/tracedecay/src/daemon/hook_v2_replay_consumer.rs +++ b/crates/tracedecay/src/daemon/hook_v2_replay_consumer.rs @@ -73,6 +73,44 @@ fn spool_root_absent(root: &Path) -> Result { /// The cause a pending-work redrive left its producer work owed, or `None` /// when the redrive admitted it. +/// How many redrive attempts one pending-work envelope gets before the +/// daemon stops retrying it for this process lifetime. The envelope stays +/// in the durable ledger; only the in-process retry loop gives up. +const PENDING_WORK_REDRIVE_CAP: u32 = 16; +/// First redrive backoff (microseconds); doubles per attempt. +const PENDING_WORK_REDRIVE_BASE_MICROS: i64 = 30 * 1000 * 1000; +/// Maximum redrive backoff (microseconds). +const PENDING_WORK_REDRIVE_MAX_MICROS: i64 = 60 * 60 * 1000 * 1000; + +#[derive(Default)] +struct PendingWorkRedriveGate { + /// Keyed by the envelope's globally unique `event_id`. + state: std::collections::HashMap<[u8; 16], PendingWorkRedriveState>, +} + +#[derive(Default)] +struct PendingWorkRedriveState { + attempts: u32, + next_eligible_micros: i64, + terminal: bool, +} + +static PENDING_WORK_REDRIVE_GATE: std::sync::OnceLock< + std::sync::Mutex, +> = std::sync::OnceLock::new(); + +fn pending_work_redrive_gate() -> &'static std::sync::Mutex { + PENDING_WORK_REDRIVE_GATE + .get_or_init(|| std::sync::Mutex::new(PendingWorkRedriveGate::default())) +} + +fn pending_work_redrive_backoff(attempts: u32) -> i64 { + let shift = attempts.saturating_sub(1).min(12); + PENDING_WORK_REDRIVE_BASE_MICROS + .saturating_mul(1_i64 << shift) + .min(PENDING_WORK_REDRIVE_MAX_MICROS) +} + fn unresolved_pending_work(outcome: &HookV2AdmissionOutcomeV1) -> Option<&'static str> { match outcome { HookV2AdmissionOutcomeV1::Admitted { .. } @@ -292,8 +330,25 @@ async fn redrive_pending_work( if project_id.is_some_and(|project_id| envelope.project_id != project_id) { continue; } + // Per-envelope backoff and terminal cap: an envelope whose admission + // is permanently blocked stays in the durable ledger, but the daemon + // must not retry and warn for it on every sweep forever. + let event_key = envelope.event_id; + { + let gate = pending_work_redrive_gate() + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner); + if let Some(state) = gate.state.get(&event_key) { + if state.terminal { + continue; + } + if state.next_eligible_micros > now.0 { + continue; + } + } + } // Owed work the daemon cannot admit now stays in the ledger and - // is redriven by the next sweep. + // is redriven by the next sweep, under the gate's backoff. let outcome = admit_replayed_envelope_with_authoritative_session( envelope, None, @@ -316,6 +371,36 @@ async fn redrive_pending_work( if let Some(cause) = unresolved_pending_work(&outcome) { owed += 1; owed_cause.get_or_insert(cause); + let mut gate = pending_work_redrive_gate() + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner); + let state = gate.state.entry(event_key).or_default(); + state.attempts = state.attempts.saturating_add(1); + if state.attempts >= PENDING_WORK_REDRIVE_CAP { + if !state.terminal { + state.terminal = true; + let event_hex: String = event_key + .iter() + .map(|byte| format!("{byte:02x}")) + .take(16) + .collect(); + tracing::warn!( + host = host.hook_key(), + event_id = %event_hex, + attempts = state.attempts, + cause, + "pending producer work stayed owed past its redrive cap; quarantined in-process until restart" + ); + } + } else { + state.next_eligible_micros = + now.0.saturating_add(pending_work_redrive_backoff(state.attempts)); + } + } else { + let mut gate = pending_work_redrive_gate() + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner); + gate.state.remove(&event_key); } } if let Some(cause) = owed_cause { @@ -645,6 +730,18 @@ async fn stop_replay_consumer( mod tests { use super::*; + #[test] + fn pending_work_redrive_backoff_doubles_then_caps() { + assert_eq!(pending_work_redrive_backoff(1), 30 * 1000 * 1000); + assert_eq!(pending_work_redrive_backoff(2), 60 * 1000 * 1000); + assert_eq!(pending_work_redrive_backoff(5), 480 * 1000 * 1000); + assert_eq!( + pending_work_redrive_backoff(40), + PENDING_WORK_REDRIVE_MAX_MICROS, + "the backoff must cap at the maximum" + ); + } + #[test] fn only_an_admitted_redrive_settles_pending_work() { let duplicate = HookV2AdmissionOutcomeV1::ExactDuplicate { diff --git a/crates/tracedecay/tests/daemon_suite/sealed_generation_crash_test.rs b/crates/tracedecay/tests/daemon_suite/sealed_generation_crash_test.rs index 60b6302b7b..be15308ded 100644 --- a/crates/tracedecay/tests/daemon_suite/sealed_generation_crash_test.rs +++ b/crates/tracedecay/tests/daemon_suite/sealed_generation_crash_test.rs @@ -4,20 +4,24 @@ //! temporary name, flushed once, and only then named; the manifest and the //! active pointer follow. A kill after the pointer is durable must restart on //! the exact sealed bytes. A kill before it must leave the prior generation -//! published and no partial generation or temporary behind once the restarted -//! daemon rebuilds. +//! published, then rebuild and collect the abandoned publication through the +//! restarted daemon's scheduled maintenance. use std::collections::BTreeMap; use std::fmt::Write as _; use std::fs; use std::path::{Path, PathBuf}; -use std::time::Instant; +use std::time::{Duration, Instant}; use serde_json::json; use sha2::{Digest, Sha256}; use tracedecay_code_index_retention::code_index_generations::{ + CODE_INDEX_PREPARATION_DIRECTORY_PREFIX_V1, CodeGenerationStoreLockV1, code_generation_segments_root, code_text_artifacts_root, scoped_code_index_store_root, + try_acquire_code_generation_store_read_lock, }; +use tracedecay_configuration::RetentionConfig; +use tracedecay_maintenance::tick::MaintenanceCadence; use crate::code_index_journey::{ RECEIPT_TIMEOUT, commit_all, exact_identity, git, initialize_tracedecay, @@ -26,8 +30,11 @@ use crate::code_index_journey::{ use crate::common::{IsolatedHome, daemon_socket_path, spawn_tracedecay_daemon_with}; use tracedecay_runtime_core::path_safety::canonical_existing_identity; -const PUBLICATION_TEMPORARY_PREFIXES: [&str; 2] = - [".segment-publication.", ".evidence-pack-publication."]; +const PUBLICATION_TEMPORARY_PREFIXES: [&str; 3] = [ + ".segment-publication.", + ".evidence-pack-publication.", + CODE_INDEX_PREPARATION_DIRECTORY_PREFIX_V1, +]; fn scope_root(home: &Path, project: &Path) -> PathBuf { let layout = @@ -89,10 +96,47 @@ fn publication_temporaries(scope: &Path) -> Vec { .collect() } -fn segments_entry_count(scope: &Path) -> usize { - fs::read_dir(code_generation_segments_root(scope)) - .expect("segments directory") - .count() +fn hold_publication_commit(scope: &Path) -> CodeGenerationStoreLockV1 { + let deadline = Instant::now() + RECEIPT_TIMEOUT; + loop { + if let Some(lease) = try_acquire_code_generation_store_read_lock(scope) + .expect("read lease on the published generation") + { + return lease; + } + assert!( + Instant::now() < deadline, + "the published generation stayed busy" + ); + std::thread::sleep(std::time::Duration::from_millis(1)); + } +} + +fn has_staged_file_segment(scope: &Path) -> bool { + for entry in fs::read_dir(code_generation_segments_root(scope)).expect("segments directory") { + let entry = entry.expect("segments entry"); + if !entry + .file_name() + .to_string_lossy() + .starts_with(CODE_INDEX_PREPARATION_DIRECTORY_PREFIX_V1) + { + continue; + } + let staged = match fs::read_dir(entry.path()) { + Ok(staged) => staged, + // A source update can retire an earlier preparation before its + // successor starts. Observe the successor on the next probe. + Err(error) if error.kind() == std::io::ErrorKind::NotFound => continue, + Err(error) => panic!("read generation preparation: {error}"), + }; + if staged + .map(|entry| entry.expect("staged segment entry")) + .any(|entry| entry.file_name().to_string_lossy().starts_with("segment-")) + { + return true; + } + } + false } fn write_batch(project: &Path, files: u32, symbols: u32) { @@ -229,11 +273,17 @@ async fn sigkill_during_the_seal_keeps_the_prior_generation_published() { ) .await; let scope = scope_root(environment.home(), &project); + // The real reader lease permits segment preparation but excludes the + // final publication transaction. Keep it through SIGKILL so even a fast + // writer cannot advance the pointer between observation and the kill. + let publication_hold = hold_publication_commit(&scope); let prior_pointer = active_pointer(&scope); let prior_family = sealed_family(&scope); - let prior_entries = segments_entry_count(&scope); - write_batch(&project, 128, 16); + // The reader lease fixes the kill point; a large batch is unnecessary + // and can spread abandoned-file collection across several maintenance + // ticks. Keep this multi-file publication within one bounded sweep. + write_batch(&project, 16, 16); let batch_revision = commit_all(&project, "install the batch the killed seal was writing"); let receipt = tool( &socket, @@ -243,10 +293,10 @@ async fn sigkill_during_the_seal_keeps_the_prior_generation_published() { ) .await; assert_eq!(receipt["status"], "queued", "refresh receipt: {receipt}"); - // The seal's first segment write is the first new entry beside the prior - // generation's segments; kill the daemon while that seal is in flight. + // Segments now accumulate inside one preparation directory. Top-level + // entry counts only advance when commit names the complete batch. let deadline = Instant::now() + RECEIPT_TIMEOUT; - while segments_entry_count(&scope) < prior_entries + 2 { + while !has_staged_file_segment(&scope) { assert!( Instant::now() < deadline, "the refresh never started sealing its segments" @@ -254,6 +304,7 @@ async fn sigkill_during_the_seal_keeps_the_prior_generation_published() { std::thread::sleep(std::time::Duration::from_millis(1)); } let killed = daemon.kill_and_wait().expect("SIGKILL the sealing daemon"); + drop(publication_hold); assert!( !killed.success(), "SIGKILL must not look like a graceful exit" @@ -271,6 +322,11 @@ async fn sigkill_during_the_seal_keeps_the_prior_generation_published() { "the kill damaged the prior generation's durable file {path}" ); } + let abandoned_temporaries = publication_temporaries(&scope); + assert!( + !abandoned_temporaries.is_empty(), + "the interrupted seal must leave publication work for recovery" + ); daemon = spawn_tracedecay_daemon_with(environment.home(), |_| {}); let rebuilt = wait_for_terminal_generation( @@ -281,13 +337,30 @@ async fn sigkill_during_the_seal_keeps_the_prior_generation_published() { "refs/heads/main", Some(&batch_revision), Some(&prior.generation_id), - "crash_probe_0127_015", - Some("src/batch/file_0127.rs"), + "crash_probe_0015_015", + Some("src/batch/file_0015.rs"), ) .await; assert_ne!(rebuilt.generation_id, prior.generation_id); + // Rebuilding does not run retention: its next admitted tick is one retry + // delay away (a minute under the default policy). Start the unchanged + // completion budget after that scheduled delay. Observe only the killed + // seal's names, since a live successor may legitimately prepare work. + let cadence = MaintenanceCadence::new(Duration::from_hours( + RetentionConfig::default().interval_hours.max(1), + )); + let deadline = Instant::now() + cadence.retry_delay() + RECEIPT_TIMEOUT; + let pending_temporaries = || { + publication_temporaries(&scope) + .into_iter() + .filter(|name| abandoned_temporaries.contains(name)) + .collect::>() + }; + while !pending_temporaries().is_empty() && Instant::now() < deadline { + std::thread::sleep(std::time::Duration::from_millis(10)); + } assert_eq!( - publication_temporaries(&scope), + pending_temporaries(), Vec::::new(), "the restarted daemon must collect the killed seal's temporaries" ); diff --git a/crates/tracedecay/tests/hooks_lsp_suite/intent_pass_journey_test.rs b/crates/tracedecay/tests/hooks_lsp_suite/intent_pass_journey_test.rs index 6fc34da9e4..d1d0588f23 100644 --- a/crates/tracedecay/tests/hooks_lsp_suite/intent_pass_journey_test.rs +++ b/crates/tracedecay/tests/hooks_lsp_suite/intent_pass_journey_test.rs @@ -643,10 +643,21 @@ fn claude_stop_delivers_the_intent_suggestion_the_daemon_judged_at_the_tool_boun |(emitted, suppressed)| emitted == 1 && suppressed >= 1, ); let after_mount = intent_outcomes(&log, ENABLED_SESSION)[before + 1..].to_vec(); + // Retained stop attempts may truthfully finish unavailable before their + // replay succeeds. The retry loop above already requires an explicit + // retryable receipt for every repeated stop; the settled pass must still + // suppress the delivered suggestion. + assert_eq!( + after_mount.last().map(String::as_str), + Some("suppressed"), + "the settled stop intent pass must suppress its delivered suggestion: {after_mount:?}" + ); assert!( - !after_mount.is_empty() && after_mount.iter().all(|outcome| outcome == "suppressed"), - "the stop boundary's own intent pass withholds the suggestion it just delivered: \ - {after_mount:?}" + after_mount.iter().all(|outcome| { + outcome == "suppressed" || (outcome == "unavailable" && stop_outputs.len() > 1) + }), + "only a stop with verified retryable admission may recover from unavailable before \ + suppressing the delivered suggestion: {after_mount:?}" ); assert_eq!( hint_counts(home, &project, YES_INTENT).0, diff --git a/crates/tracedecay/tests/runtime_acceptance_suite/advisory_runtime_acceptance.rs b/crates/tracedecay/tests/runtime_acceptance_suite/advisory_runtime_acceptance.rs index 9b492ece73..f78b63bd72 100644 --- a/crates/tracedecay/tests/runtime_acceptance_suite/advisory_runtime_acceptance.rs +++ b/crates/tracedecay/tests/runtime_acceptance_suite/advisory_runtime_acceptance.rs @@ -97,9 +97,7 @@ use tracedecay_domain::feedback::{ FeedbackCycleRuntimeSnapshotV1, FeedbackDiagnosticBaselineIdentityV1, FeedbackDiagnosticBaselineV1, FeedbackDiagnosticProducerV1, FeedbackDiagnosticV1, FeedbackEvaluationInputV1, FeedbackFindingLifecycleV1, FeedbackImpactStateV1, FeedbackImpactV1, - FeedbackTargetV1, FeedbackTriggerV1, ProximityBranchWorktreeIncompatibilityV1, - ProximityCoverageV1, ProximityRelationStrengthV1, ProximityRiskInputsV1, - ProximityWarningClassV1, + FeedbackTargetV1, FeedbackTriggerV1, ProximityCoverageV1, ProximityWarningClassV1, }; #[cfg(feature = "test-transport")] use tracedecay_domain::{ @@ -997,7 +995,7 @@ async fn packaged_host_ingest_delivers_a_registered_advisory_cycle() { event["model"] = json!("cursor-fixture"); event["file_path"] = json!(project.join("src/lib.rs")); event["edits"] = json!([{"old_string": "", "new_string": "pub fn shared_edit() {}"}]); - event["session_id"] = json!("session-advisory-proximity"); + event["session_id"] = json!("session-cursor-advisory-proximity"); event["cursor_version"] = json!("fixture"); event["workspace_roots"] = json!([project.clone()]); event["user_email"] = json!("redacted@example.invalid"); @@ -1109,7 +1107,10 @@ async fn packaged_host_ingest_delivers_a_registered_advisory_cycle() { "../../../../tests/fixtures/provider_normalization/codex/session_meta.input.json" )) .unwrap(); - codex_meta["payload"]["id"] = json!("session-advisory-proximity"); + // The two hosts own distinct sessions. Reusing the Cursor session ID + // makes canonical Git evidence reject the conflicting provider lineage. + let codex_session = "session-codex-advisory-proximity"; + codex_meta["payload"]["id"] = json!(codex_session); codex_meta["payload"]["cwd"] = json!(project.clone()); let codex_message: Value = serde_json::from_str(include_str!( "../../../../tests/fixtures/provider_normalization/codex/agent_message.input.json" @@ -1125,7 +1126,7 @@ async fn packaged_host_ingest_delivers_a_registered_advisory_cycle() { "../../../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json" )) .unwrap(); - stop["session_id"] = json!("session-advisory-proximity"); + stop["session_id"] = json!(codex_session); stop["turn_id"] = json!("turn-advisory-proximity-stop"); stop["cwd"] = json!(project.clone()); stop["model"] = json!("codex-fixture"); @@ -1941,18 +1942,9 @@ async fn one_saved_edit_cycle_returns_all_four_advisory_pillars_together() { symbol: Some(ci_symbol.symbol.clone()), }, relation_paths: Vec::new(), - risk_inputs: ProximityRiskInputsV1 { - overlap_size: 1, - blast_radius_size: 2, - relation_strength: ProximityRelationStrengthV1::Direct, - branch_worktree_incompatibility: - ProximityBranchWorktreeIncompatibilityV1::Compatible, - freshness_decay_basis_points: 0, - }, // Same file as the saved edit: the shipped owner classifies that as - // the immediate tier, so inclusion never depends on the threshold. + // an exact overlap, so inclusion never depends on the threshold. warning_class: ProximityWarningClassV1::SameFile, - raw_risk_basis_points: 9_000, observed_at: UtcMicros(now.0.saturating_sub(1_000_000)), expires_at: UtcMicros(now.0.saturating_add(600_000_000)), coverage: ProximityCoverageV1::Complete, diff --git a/dashboard/codegen/schemas/dashboard-contracts.schema.json b/dashboard/codegen/schemas/dashboard-contracts.schema.json index e9f215c020..cfeb5054db 100644 --- a/dashboard/codegen/schemas/dashboard-contracts.schema.json +++ b/dashboard/codegen/schemas/dashboard-contracts.schema.json @@ -22611,8 +22611,7 @@ "neighborhood", "shared_caller", "shared_dependency", - "shared_test", - "incompatible_branch_worktree" + "shared_test" ], "type": "string" }, diff --git a/dashboard/src/contracts/decoders.ts b/dashboard/src/contracts/decoders.ts index af2eb17957..6f4d32dd14 100644 --- a/dashboard/src/contracts/decoders.ts +++ b/dashboard/src/contracts/decoders.ts @@ -8063,7 +8063,7 @@ export const ProximityAddressV1Schema: z.ZodObject<{ export const ProximityCoverageV1Schema: z.ZodEnum<{ "complete": "complete"; "denied": "denied"; "partial": "partial"; "private": "private"; "stale": "stale"; "unavailable": "unavailable" }> = z.enum(["complete", "denied", "partial", "private", "stale", "unavailable"]); -export const ProximityWarningClassV1Schema: z.ZodEnum<{ "incompatible_branch_worktree": "incompatible_branch_worktree"; "neighborhood": "neighborhood"; "overlapping_range": "overlapping_range"; "same_crate": "same_crate"; "same_file": "same_file"; "same_package": "same_package"; "same_symbol": "same_symbol"; "shared_caller": "shared_caller"; "shared_dependency": "shared_dependency"; "shared_test": "shared_test" }> = z.enum(["incompatible_branch_worktree", "neighborhood", "overlapping_range", "same_crate", "same_file", "same_package", "same_symbol", "shared_caller", "shared_dependency", "shared_test"]); +export const ProximityWarningClassV1Schema: z.ZodEnum<{ "neighborhood": "neighborhood"; "overlapping_range": "overlapping_range"; "same_crate": "same_crate"; "same_file": "same_file"; "same_package": "same_package"; "same_symbol": "same_symbol"; "shared_caller": "shared_caller"; "shared_dependency": "shared_dependency"; "shared_test": "shared_test" }> = z.enum(["neighborhood", "overlapping_range", "same_crate", "same_file", "same_package", "same_symbol", "shared_caller", "shared_dependency", "shared_test"]); export const PublicCodeProjectSchema: z.ZodObject<{ canonical_root: z.ZodType; diff --git a/dashboard/src/contracts/types.ts b/dashboard/src/contracts/types.ts index 881f5d57aa..b91f5ba716 100644 --- a/dashboard/src/contracts/types.ts +++ b/dashboard/src/contracts/types.ts @@ -4482,7 +4482,7 @@ export type ProximityAddressV1 = { export type ProximityCoverageV1 = "complete" | "denied" | "partial" | "private" | "stale" | "unavailable"; -export type ProximityWarningClassV1 = "incompatible_branch_worktree" | "neighborhood" | "overlapping_range" | "same_crate" | "same_file" | "same_package" | "same_symbol" | "shared_caller" | "shared_dependency" | "shared_test"; +export type ProximityWarningClassV1 = "neighborhood" | "overlapping_range" | "same_crate" | "same_file" | "same_package" | "same_symbol" | "shared_caller" | "shared_dependency" | "shared_test"; export type PublicCodeProject = { canonical_root: string; diff --git a/docs/plans/CODE-GENERATION-RESIDENT-SIZE-DESIGN.md b/docs/plans/CODE-GENERATION-RESIDENT-SIZE-DESIGN.md new file mode 100644 index 0000000000..8337279c8c --- /dev/null +++ b/docs/plans/CODE-GENERATION-RESIDENT-SIZE-DESIGN.md @@ -0,0 +1,204 @@ +# Code generation resident size design + +Status: proposed. No sealed-format revision is required. The sealed +generation format stays at `SEALED_GENERATION_FORMAT_REVISION_V1` 21. + +## The cost is in the decoded form, not the sealed bytes + +A cold build of this repository (6.1k files, 108 MB of source, 219k symbols, +458,883 chunks) holds a decoded `CodeIndexPublishedGenerationV1` whose +`retained_bytes` read 3.24 GB of a 4.11 GB process footprint. A 25.7k-file +repository read 4.32 GB of 5.49 GB. Each value is a lower bound because +`resident_bytes.rs` counts string and vector lengths, not allocator headers. + +| Part | Bytes | +| --- | ---: | +| Chunk records: text, exact terms, subtokens, and per-chunk identity and revision strings | 1.15 GB | +| Per-file records: clone bodies, schema evidence, and identities | 1.08 GB | +| Projection request and receipts: every chunk listed as added, with digests | 0.49 GB | +| Symbol records | 0.18 GB | +| Edges (684k) | 0.16 GB | +| Unresolved calls | 0.11 GB | +| Imports | 0.04 GB | + +The three largest rows look like candidates for sealed codec changes. +They are not. The sealed codec already writes each one compactly, and the +decoder expands each one back to its full domain shape: + +- **Per-chunk revisions and identities.** A file segment + (`PersistedFileChunksRefV2` in `sealed_codec.rs`) writes the generation + and file occurrence once per file and replaces both with markers + (`$tracedecay:g`, `$tracedecay:f`) before compression. It hoists the + language descriptor, chunker, sanitizer, and sensitivity revisions into + `chunk_defaults`. It omits a chunk id that the chunk-id recipe derives, + and it omits a content digest that the stored text determines. It stores + the source text the chunks cover once per file, and rows keep only spans. + In memory, every `CodeSearchChunkV1` owns its own `String` for six of + these values: `anchor.generation_id`, `anchor.file_occurrence_id`, + `language_descriptor_revision`, `chunker_revision`, `sanitizer_revision`, + and `sensitivity.policy_revision`. The domain newtypes from + `validated_string_newtype!` wrap `String`, so a clone is a new heap + allocation. +- **Projection request and receipts.** `projection_rows.rs` writes the + request's added chunks as `(file key, first position, count)` runs. It + writes only the receipt decisions that differ from what the request + implies. In memory, the request's `added_or_changed` holds one + `ChangedCodeChunkV1` per chunk. Each row repeats the chunk id and content + digest that the chunk record already owns. Receipt rows are no longer held. + `ProjectionPublicationHandoffV1` replays them from the request one row at a + time, so the remaining projection cost is the request rows. +- **Per-file records.** `clone_rows.rs` interns each file's syntax kinds and + token texts and writes token streams as integer codes. It omits payload + digests and the occurrence fields that the file authority fixes. In + memory, each `CodeIndexCloneBodyV1` holds expanded token streams, its + digests, and a `CloneBodyOccurrenceV1` that repeats project, repository, + generation, and path. Each file page also keeps `document.chunk_ids`, + which repeats the id of every chunk the page already holds. + +Shrinking the sealed bytes would not move the 3.24 GB. The work is in the +decoded representation. + +## Cold construction no longer holds the decoded generation + +The table above describes builds that kept the whole decoded generation +until publication. Cold construction now writes file segments to the store +preparation as each extraction window completes. It charges what it retains +to `ProcessResidentMemoryV1` under the `code_index.construction.v1` +component, through `ResidentMemoryOperationV1::reserve_process_shared`. A +refused build parks until its witnessed reconstruction demand fits, so a +concurrent second cold pass waits instead of stacking past the limit. +Serving uses the published generation's decode cache and recorded admission +demand. + +The same isolated cold pass on the release daemon now measures as follows. +Each value is one run. `footprint` reports the physical footprint peak, and +`tracedecay status --json` reports `memory.resident_bytes` and +`memory.reserved_bytes`. + +| Repository | Physical footprint peak | Peak occupancy | Peak construction charge | +| --- | ---: | ---: | ---: | +| This repository (6.1k files) | 1.58 GB | 1.58 GB | 0.92 GB | +| `t3code` (29k files) | 2.45 GB | 2.53 GB | 0.96 GB | + +During construction, occupancy stays below the reservations. The peak in +both runs comes after publication, while the interactive graph catalog +warms. `PendingInteractiveCatalogWarmV1::run` takes no reservation, so +occupancy reached 2.53 GB on `t3code` while 268 MB was reserved. The catalog +then stays resident as the 833 MB `graph_catalog` owner. That warm is a +separate admission gap and is outside this design. + +A decoded generation retains its full `retained_bytes`. When a decode peak +measurement exists, admission reserves the larger of +`decode_peak_growth_bytes` and `retained_bytes` under +`code-index-generation-decode-v1`. Without a peak measurement, admission uses +the retained bytes. A first active-generation decode with no recorded demand +currently takes no reservation. The `decoded_generation` owner reports +retained residency while the decode is held. The proposals below target both +retained residency and transient decode demand. They do not change these +admission rules or close the first-unmeasured-decode gap. + +## Proposed decoded encoding + +Apply the changes in this order. Measure after each one, and stop when the +remaining size no longer justifies the next change. + +1. **Share per-generation identity and revision strings.** Change the + identity and revision newtypes that a generation repeats per record to + wrap `Arc`. These are `CodeGenerationId`, `FileOccurrenceId`, + `LanguageDescriptorRevision`, `ChunkerRevision`, `SanitizerRevision`, and + `PolicyRevisionId`. The decoder and the builder intern each distinct value + once per generation and clone the `Arc` into every record. Each newtype + serializes through `as_str()`, so wire bytes and canonical digests do not + change. Explicit string serialization requires no additional serde feature + changes. The per-chunk cost of the six values drops from six + heap allocations to six reference-count increments. Hoisting the fields + out of `CodeSearchChunkV1` would save the 16-byte pointers too, but it + changes a domain contract that every chunk consumer reads. Do that only if + measurement after interning shows the pointers matter. +2. **Keep the projection request in its sealed shape.** Hold the request's + added chunks in memory as the same `(file key, first position, count)` + runs that `projection_rows.rs` writes. Keep explicit rows only for changed + and deleted chunks. Resolve each run against the file's chunk roster when + the projector, the digest, or receipt replay iterates the rows. Compute + the request digest by serializing the resolved rows in the same order. + `ProjectionPublicationHandoffV1::receipt_rows` already serializes receipt + rows this way without collecting them, so the digest stays + byte-identical. A cold build adds every chunk, so its + request shrinks to one run per file. +3. **Derive the document chunk roster.** Drop `document.chunk_ids` from the + decoded file page and derive the roster from the page's chunk records in + their existing file-row order. The document roster must match those rows + positionally. The chunker orders rows by source span and grain, with chunk + ID only as a tie-breaker. The separate projection roster uses chunk-id + order. The sealed segment already omits the document roster. +4. **Keep clone token streams interned.** Hold each file's interned string + table and integer token codes in memory, as `clone_rows.rs` writes them. + Rebuild the occurrence from the file authority when a caller asks for it. + The readers of `conservative_tokens` and `rename_tokens` in `clones.rs` + take a `CloneTokenStreamV1`, so they must read codes through the file's + table. It is the largest change of the four. Measure the share + of the 1.08 GB that clone bodies hold before you start it. + +The issue measurement does not split the 1.15 GB and 1.08 GB rows by +field. Before any change lands, measure the split with the method in +[Measure the win](#measure-the-win). Then order the work by the bytes each +change removes. + +## Keep shipped generations readable + +Beta builds have shipped, so live profiles hold sealed generations at +revision 21. All four changes alter only the decoded representation. Each +change must keep the sealed bytes identical for the same input. Then a +shipped generation decodes into the new representation, and a new build +writes the same segment and manifest digests as an old build. Segment reuse +across the upgrade keeps working, so the format revision stays at 21 and +there is no migration. + +Each change must include a test that seals one fixture and asserts the +segment and manifest digests equal those of the unchanged codec. The test +fails if the in-memory change leaks into the wire form. + +If a later change must alter the sealed bytes, bump +`SEALED_GENERATION_FORMAT_REVISION_V1` and rebuild from source. Do not write +a migration. The restore path already refuses an older revision with +`SupersededSealedGenerationRevision`, and the scheduler then rebuilds the +generation from the worktree. A sealed generation is a cache that the source +tree derives. A migration would need a reader for every shipped revision, +and `sealed_codec.rs` deliberately keeps no reader for older revisions. The +cost of a rebuild is one cold pass per worktree. Construction admission +bounds that pass, so concurrent rebuilds after an upgrade wait instead of +exceeding the limit. + +## Measure the win + +Use the task-supplied checkout and the release daemon in an isolated temporary +profile. Do not create a clone or another project-data copy. The earlier +figures are historical measurements, not instructions to preserve that setup. + +1. Build the release CLI with + `bazel build --config=release //crates/tracedecay-cli:tracedecay`. +2. Start the daemon with `TRACEDECAY_DATA_DIR` and `HOME` inside the temporary + profile, then run `tracedecay init `. +3. While the cold pass runs, sample `tracedecay status --json `. + Record `memory.resident_bytes`, `memory.reserved_bytes`, and + `memory.reservations`. +4. Run a query that decodes the generation, then record the + `decoded_generation` bytes in `memory.owners`. That value is the + generation's `retained_bytes`. Record the measured decode peak separately + and compare admission against the larger demand. +5. Record the on-disk size of the project's `code-index-v1/` store. The size + must not change. A change in size means a decoded change reached the + sealed bytes. + +Stop and join the isolated daemon before removing its temporary profile. +Do not read or reset the operator's active profile. + +For the per-part split, sum the `resident_bytes.rs` helpers per part: +`chunk_bytes` with each identity and revision string summed separately, +`file_bytes` with clone bodies, schema evidence, and `document.chunk_ids` +summed separately, and the projection request rows. Emit the sums as fields +of one `tracing` event at seal time. A trace event is the operator log +surface, so the event can stay after the work lands. + +Report the served generation's bytes and the peak `resident_bytes` before +and after each change, with the median of three cold passes per side. diff --git a/plugin/chatgpt-extension/embedded/server.mjs b/plugin/chatgpt-extension/embedded/server.mjs index 6fbed37167..330135effa 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 lG.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=>aM.parse(e)):[aM.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=>aY.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=>lp(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=>aY.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))lp(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))lp(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;lp(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((aA.safeParse(e).success||aW.safeParse(e).success)&&(r=e.id),void 0===r){let t;if(aA.safeParse(e).success||aW.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(aA.safeParse(e).success||aW.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 u0=Symbol("swallowsErrorsAfterClose");var u2=class{_readBuffer;_started=!1;_closed=!1;constructor(e=N.stdin,t=N.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new lB({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[u0]&&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[u0]=!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)})}},u4=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}};let u6=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"]),u3=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,u9=e=>9===e||10===e||13===e||32===e,u5=e=>{if(!u9(e.charCodeAt(0))&&!u9(e.charCodeAt(e.length-1)))return e;let t=0,r=e.length;for(;tt&&u9(e.charCodeAt(r-1));)r--;return e.slice(t,r)},u8=/[\0\r\n]/,u7=globalThis.Headers,me=(e,t=u7)=>{let r=new t;for(let t=0;t{e.call(t,r,i,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(mt.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(mt.prototype,u7.prototype);let mr=e=>globalThis.Headers===u7?new mt(e):me(e.rawHeaders,globalThis.Headers),mi=/^\/[!#$&-;=?-\[\]_a-z~]*$/,mo=/\/\.\.?(?:[/?#]|$)/,mn=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,ma=global.Request;var ms=class extends ma{constructor(e,t){if("object"==typeof e&&mg in e){let r=void 0!==t&&"body"in t&&null!=t.body;if(e[mq]&&!r)throw TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[mg]()}void 0!==t?.body?.getReader&&(t.duplex??="half"),super(e,t)}};let md=Symbol("wrapBodyStream"),mc=new Set(["latin1","binary","hex","base64","base64url"]),ml=Symbol("bodyBufferedBeforeDisconnect"),mp=Symbol("bodyBufferedLengthBeforeDisconnect"),mu=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),mm=e=>{let t;return!(e instanceof z)&&!!e.complete&&!!e.readableAborted&&"function"==typeof e.read&&(null===(t=e.readableEncoding)||mc.has(t))},mf=e=>{e.readableDidRead||!mm(e)||(e[mp]??=e.readableLength)},mh=(e,t)=>{let r;if(e.readableDidRead&&!t||!mm(e))return;if(void 0!==e[ml])return e[ml];let i=e.errored;if(i&&"ECONNRESET"!==i.code)r=i;else if(void 0!==e[mp]&&e.readableLength!==e[mp])r=mj();else{let i=t??[],o=e.read();null!==o&&i.push(mu(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=mj())}}return e[ml]=r,r},my=(e,t)=>{t instanceof Error?e.error(t):(t.length>0&&e.enqueue(t),e.close())},mg=Symbol("getRequestCache"),m_=Symbol("requestCache"),mv=Symbol("incomingKey"),mb=Symbol("urlKey"),m$=Symbol("methodKey"),mS=Symbol("headersKey"),mk=Symbol("abortControllerKey"),mw=Symbol("getAbortController"),mP=Symbol("abortRequest"),mV=Symbol("bodyBuffer"),mR=Symbol("bodyReadPromise"),mq=Symbol("bodyConsumedDirectly"),mI=Symbol("bodyLockReader"),mx=Symbol("abortReason"),mj=()=>TypeError("Body is unusable"),mC=new TextDecoder,mT=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,mO=(e,t,r)=>{if(e[mq])return Promise.reject(mj());let i=e.method;if("GET"===i||"HEAD"===i)return e[mg]()[t]();let o=(e=>{if(!mT.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[m_]&&"TRACE"!==i)return e[m_][t]();let n=(e=>{if(e[mq])return Promise.reject(mj());e[mq]=!0})(e);if(n)return n;let a=mE(e);if(a){let t=Promise.resolve(r(a,e));return e[mV]=void 0,t}return mW(e).then(t=>{let i=r(t,e);return e[mV]=void 0,i})},mE=e=>{let t=e[mv];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},mA=(e,t)=>{if(t.errored)return t.errored;let r=e[mx];return void 0!==r?r instanceof Error?r:Error(String(r)):Error("Client connection prematurely closed.")},mW=e=>{if(e[mV])return Promise.resolve(e[mV]);if(e[mR])return e[mR];let t=e[mv];if(t.readableDidRead)return Promise.reject(mj());let r=mh(t);if(void 0!==r)return r instanceof Error?Promise.reject(r):(e[mV]=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!!mm(t)&&(!s||"ECONNRESET"===s.code)&&(a(()=>{let a=mh(t,o);a instanceof Error?i(a):void 0===a?i(n??mA(e,t)):(e[mV]=a,r(a))}),!0)},d=e=>{o.push(mu(e,t.readableEncoding))},c=()=>{a(()=>{let t=1===o.length?o[0]:Buffer.concat(o);e[mV]=t,r(t)})},l=e=>{s(e)||a(()=>{i(e)})},p=()=>{t.readableEnded?c():s()||a(()=>{i(mA(e,t))})},u=()=>{t.off("data",d),t.off("end",c),t.off("error",l),t.off("close",p),e[mR]=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[mR]=i,i},mM={get method(){return this[m$]},get url(){return this[mb]},get headers(){return this[mS]||=mr(this[mv])},[mP](e){void 0===this[mx]&&(this[mx]=e);let t=this[mk];t&&!t.signal.aborted&&t.abort(e)},[mw](){return this[mk]||=new AbortController,void 0===this[mx]||this[mk].signal.aborted||this[mk].abort(this[mx]),this[mk]},[mg](){let e=this[mw]();if(this[m_])return this[m_];let t=this.method;if(this[mq]&&"GET"!==t&&"HEAD"!==t){this[mV]=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 ms(this[mb],r);return"TRACE"===t&&Object.defineProperty(i,"method",{get:()=>"TRACE"}),this[m_]=i}return this[m_]=((e,t,r,i,o)=>{let n={method:e,headers:r,signal:o.signal};if("TRACE"===e){n.method="GET";let e=new ms(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[md]){let e;n.body=new ReadableStream({async pull(t){try{if(!e){let e=mh(i);if(void 0!==e)return void my(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=mh(i);void 0!==e?n.body=new ReadableStream({start(t){my(t,e)}}):n.body=L.toWeb(i)}return new ms(t,n)})(this.method,this[mb],this.headers,this[mv],e)},get body(){if(!this[mq])return this[mg]().body;let e=this[mg]();return!this[mI]&&e.body&&(this[mI]=e.body.getReader()),e.body},get bodyUsed(){return!!this[mq]||!!this[m_]&&this[m_].bodyUsed}};Object.defineProperty(mM,"signal",{get(){return this[mw]().signal}}),["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(mM,e,{get(){return this[mg]()[e]}})}),["clone","formData"].forEach(e=>{Object.defineProperty(mM,e,{value:function(){if(this[mq]){if("clone"===e)throw mj();return Promise.reject(mj())}return this[mg]()[e]()}})}),Object.defineProperty(mM,"text",{value:function(){return mO(this,"text",e=>mC.decode(e))}}),Object.defineProperty(mM,"arrayBuffer",{value:function(){return mO(this,"arrayBuffer",e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}}),Object.defineProperty(mM,"blob",{value:function(){return mO(this,"blob",(e,t)=>{let r=(t[mS]||=mr(t[mv])).get("content-type")||"";return new Response(e,r?{headers:{"content-type":r}}:void 0).blob()})}}),Object.defineProperty(mM,"json",{value:function(){return this[mq]?Promise.reject(mj()):this.text().then(JSON.parse)}}),Object.defineProperty(mM,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[m_]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mM,ms.prototype);let mN="text/plain; charset=UTF-8",mz=Symbol("responseCache"),mD=Symbol("getResponseCache"),mF=Symbol("cache"),mL=global.Response;var mU=class e{#c;#l;[mD](){let e=this[mF],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[mF],this[mz]||=new mL(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 mL){let t=r[mz];if(t){this.#l=t,this[mD]();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[mF]=[r?.status||200,t??null,i||r?.headers])}get headers(){let e=this[mF];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(null===e[1]?void 0:{"content-type":mN}))),e[2]):this[mD]().headers}get status(){return this[mF]?.[0]??this[mD]().status}get ok(){let e=this.status;return e>=200&&e<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(mU.prototype,e,{get(){return this[mD]()[e]}})}),["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(mU.prototype,e,{value:function(){return this[mD]()[e]()}})}),Object.defineProperty(mU.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[mz]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mU,mL),Object.setPrototypeOf(mU.prototype,mL.prototype);let mH=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,mG=new Set([301,302,303,307,308]);function mB(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 mK(e,t){if(e.locked)throw TypeError("ReadableStream is locked.");if(!t.destroyed)return mB(e.getReader(),t)}Object.defineProperty(mU,"redirect",{value:function(e,t=302){if(!mG.has(t))throw RangeError("Invalid status code");return new mU(null,{status:t,headers:{location:e instanceof URL?e.href:mH.test(e)?e:new URL(e).href}})},writable:!0,configurable:!0}),Object.defineProperty(mU,"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 mU(i,{status:t?.status??200,statusText:t?.statusText,headers:r})},writable:!0,configurable:!0});let mJ=(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},mZ=Symbol("outgoingEnded"),mQ=Symbol("incomingDraining"),mX=e=>{if(e.destroyed||e[mQ])return;if(e[mQ]=!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()},mY=e=>new Response(null,{status:e instanceof Error&&("TimeoutError"===e.name||"TimeoutError"===e.constructor.name)?504:500}),m1=(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))},m0=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},m2=(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),m4=(e,t,r)=>{m2(e,t,r)?e.writeHead(t,{"Content-Type":mN}):e.writeHead(t,{"Content-Type":mN,"Content-Length":r})},m6=async(e,t)=>{let[r,i,o]=e[mF];if(!o){null===i?(t.writeHead(r),t.end()):"string"==typeof i?(m4(t,r,Buffer.byteLength(i)),t.end(i)):i instanceof Uint8Array?(m4(t,r,i.byteLength),t.end(i)):i instanceof Blob?(m4(t,r,i.size),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(r,{"Content-Type":mN}),m0(t),await mK(i,t)?.catch(e=>m1(e,t))),t[mZ]?.();return}let n=!1,a=!1,s=!0;if(o instanceof Headers)n=o.has("content-length"),o=mJ(o,null===i?void 0:mN);else if(Array.isArray(o)){let e=new Headers(o);n=e.has("content-length"),o=mJ(e,null===i?void 0:mN)}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&&m2(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())):(m0(t),await mK(i,t)?.catch(e=>m1(e,t))),t[mZ]?.()},m3=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return!1!==t.overrideGlobalObjects&&global.Request!==ms&&(Object.defineProperty(global,"Request",{value:ms}),Object.defineProperty(global,"Response",{value:mU})),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?(mf(i),e[mP](i.errored.toString())):(!o.writableFinished||i instanceof z&&i.aborted)&&(mf(i),e[mP]("Client connection prematurely closed.")),t&&!i.readableEnded&&setTimeout(()=>{i.readableEnded||setTimeout(()=>{mX(i)})})}))}};try{let d;if(a=((e,t)=>{let r,i=Object.create(mM);i[mv]=e,i[m$]=(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 u4("Absolute URL for :path is not allowed in HTTP/2");try{i[mb]=new URL(o).href}catch(e){throw new u4("Invalid absolute URL",{cause:e})}return i}let n=(e instanceof z?e.authority:e.headers.host)||t;if(!n)throw new u4("Missing host header");if(e instanceof z){if("http"!==(r=e.scheme)&&"https"!==r)throw new u4("Unsupported scheme")}else r=e.socket&&e.socket.encrypted?"https":"http";try{i[mb]=((e,t,r)=>{let i=`${e}://${t}${r}`;if(mn.test(t)){if(0===r.length)return i+"/";if(47!==r.charCodeAt(0))throw new u4("Invalid URL");return!mi.test(r)||mo.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 u4("Invalid host header");return e.href}})(r,n,o)}catch(e){if(e instanceof u4)throw e;throw new u4("Invalid URL",{cause:e})}return i})(i,t.hostname),(s=r&&"GET"!==i.method&&"HEAD"!==i.method)&&(i[md]=!0,i instanceof z&&(o[mZ]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),o.destroy()})})})),d=n=e(a,{incoming:i,outgoing:o}),"function"!=typeof d.then&&(e=>{if(!(mF in e))return!1;let t=e[mF][1];return null===t||"string"==typeof t||t instanceof Uint8Array})(n))return s&&!i.readableEnded&&o.once("finish",()=>{i.readableEnded||mX(i)}),m6(n,o);c()}catch(e){if(n)return m1(e,o);if(t.errorHandler){if(c(),!(n=await t.errorHandler(a||e instanceof u4?e:new u4(e.message,{cause:e}))))return}else n=a?mY(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(mY);if(mF in e)return m6(e,t);let i=mJ(e.headers,null===e.body?void 0:mN);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&&m0(t),await mB(o,t,r))}else i["x-hono-already-sent"]||(t.writeHead(e.status,i),t.end());t[mZ]?.()})(n,o,t)}catch(e){return m1(e,o)}}};globalThis.CloseEvent??Event,globalThis.ErrorEvent??Event,Symbol("CONNECTION_SYMBOL_KEY"),Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");var m9=class{_webStandardTransport;_requestListener;_requestContext=new WeakMap;constructor(e={}){this._webStandardTransport=new u1(e),this._requestListener=m3(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 m3(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 m5(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 m8=o7().min(1),m7=nz({pid:nP().int().nonnegative(),process_run_id:o7(),started_at_unix_secs:nP().int(),epoch:nP().int().nonnegative(),version:o7(),endpoint:nE(),http_application_endpoint:m8.nullable().optional(),auth_token:o7().min(1),profile_root:o7().min(1)});function fe(e){let t=e.http_application_endpoint;return null==t?null:`http://${t}`}function ft(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 fr(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical schema: ${t} must be an object`);return e}function fi(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 fo(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an object`);return e}function fn(e,t){if("string"!=typeof e)throw TypeError(`malformed canonical envelope: ${t} must be a string`);return e}function fa(e,t){if("number"!=typeof e||!Number.isFinite(e))throw TypeError(`malformed canonical envelope: ${t} must be a finite number`);return e}function fs(e,t){if(!Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an array`);return e}function fd(e,t){let r=fa(e,t);if(!Number.isSafeInteger(r))throw TypeError(`malformed canonical envelope: ${t} must be a safe integer`);return r}function fc(e,t){let r=fd(e,t);if(r<0)throw TypeError(`malformed canonical envelope: ${t} must be non-negative`);return r}let fl=new TextEncoder;function fp(e,t,r){let i=fn(e,t);if(0===i.length||i.trim()!==i||fl.encode(i).byteLength>r||/\p{Cc}/u.test(i))throw TypeError(`malformed canonical envelope: ${t} is not a bounded identifier`);return i}function fu(e,t,r,i,o,n,a,s,d){let c=fo(e,"success envelope");if(fn(c.binding_id,"binding_id")!==t)throw TypeError("malformed canonical envelope: binding mismatch");let l=fo(c.contract,"contract");if(fn(l.schema_id,"contract.schema_id")!==r||fa(l.schema_revision,"contract.schema_revision")!==i)throw TypeError("malformed canonical envelope: result contract mismatch");fn(c.request_id,"request_id"),fo(c.scope,"scope");let p=fo(c.outcome,"outcome"),u=fn(p.outcome,"outcome.outcome");return{...c,outcome:{...p,outcome:u,value:function(e,t,r,i,o,n,a){let s=fo(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=fo(e,"outcome.value.execution");if(fa(i.started_at,"execution.started_at"),fa(i.ended_at,"execution.ended_at"),!("effective_deadline"in i)||!("cancellation"in i))throw TypeError("malformed canonical envelope: receipt fields are required");let o=fo(i.budget,"execution.budget");fa(o.units_consumed,"budget.units_consumed"),fa(o.bytes_consumed,"budget.bytes_consumed"),fa(o.elapsed_micros,"budget.elapsed_micros");let n=fn(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=fo(r,"operation.cancellation"),t=fn(e.mode,"operation.cancellation.mode"),o=fo(i.cancellation,"execution.cancellation"),a=fn(o.stage,"execution.cancellation.stage");if(fd(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(!fs(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)fo(s.temporal,"temporal"),fo(s.authority,"authority"),fs(s.evidence_authorities,"evidence_authorities"),fo(s.coverage,"coverage"),fs(s.omissions,"omissions"),fs(s.scores,"scores"),fs(s.contributions,"contributions"),function(e){let t=fo(e,"outcome.value.page");if(fp(t.sort_contract_id,"page.sort_contract_id",192),1>fc(t.sort_revision,"page.sort_revision"))throw TypeError("malformed canonical envelope: page sort_revision must be positive");let r=null===t.total?null:fc(t.total,"page.total"),i=fc(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=fo(e,"page.cursor"),r=fn(t.kind,"page.cursor.kind");if("opaque"===r)fp(t.cursor,"page.cursor.cursor",4096);else throw TypeError(`malformed canonical envelope: unsupported page cursor kind ${r}`)}(t.cursor),null!==t.expires_at&&fd(t.expires_at,"page.expires_at")}(s.page);else if("preview"===e)fn(s.preview_id,"preview_id"),fn(s.preview_digest,"preview_digest"),fn(s.effect_class,"effect_class"),fo(s.authority,"authority"),fn(s.expected_state,"expected_state");else if("effect"===e)fn(s.effect_id,"effect_id"),fn(s.effect_class,"effect_class"),fn(s.idempotency_key,"idempotency_key"),fo(s.authority,"authority"),fn(s.expected_state,"expected_state"),fn(s.reconciliation,"reconciliation"),fo(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 fm(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ff(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function fh(e){return"number"==typeof e&&Number.isSafeInteger(e)}function fy(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&fl.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}async function fg(e){let t=await crypto.subtle.digest("SHA-256",fl.encode(ft(e)));return`sha256:${Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}`}function f_(e){return fm(e)&&"string"==typeof e.code&&"string"==typeof e.message}let fv={description:"Strongly typed algorithm-tagged integrity digest: `AccessPolicyDigest`.",type:"string"},fb={description:"Strongly typed canonical identity: `AccessRuleId`.",type:"string"},f$={description:"Strongly typed canonical identity: `ActorId`.",type:"string"},fS={description:"Strongly typed canonical identity: `AgentInstanceId`.",type:"string"},fk={enum:["memory_curator","session_reflector","skill_writer","combined_review","user_job"],type:"string"},fw={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"},fP={enum:["off","local_only","aggregate_share"],type:"string"},fV={oneOf:[{const:"project",description:"Analytics events of the resolved project.",type:"string"},{const:"all",description:"Analytics events of every registered project.",type:"string"}]},fR={description:"Strongly typed canonical identity: `AnalyzerEnvironmentVariable`.",type:"string"},fq={description:"Strongly typed canonical identity: `AnalyzerExecutableId`.",type:"string"},fI={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"}]},fx={description:"Strongly typed canonical identity: `AnalyzerLanguageId`.",type:"string"},fj={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"},fC={enum:["non_sensitive","sensitive","restricted"],type:"string"},fT={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"},fO={enum:["restart_on_configuration_change","manual_restart_only"],type:"string"},fE={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"},fA={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"}]},fW={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"}]},fM={description:"Strongly typed canonical identity: `AttemptId`.",type:"string"},fN={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"}]},fz={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"},fD={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"},fF={description:"A terminal automatic-fact receipt state.",enum:["applied","quarantined"],type:"string"},fL={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"}]},fU={enum:["disabled","codex_app_server"],type:"string"},fH={enum:["standalone","delegated_host"],type:"string"},fG={description:"The settled status every successful read in this family reports.",enum:["ok"],type:"string"},fB={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"}]},fK={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"},fJ={description:"Automation run reads answer from the active project's ledger only.",enum:["active_project"],type:"string"},fZ={enum:["queued","running","succeeded","failed","skipped"],type:"string"},fQ={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"},fX={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"},fY={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"]},stale_lock_secs:{format:"uint64",minimum:0,type:["integer","null"]}},required:["enabled"],type:"object"},f1={enum:["manual_cli","manual_mcp","dashboard","application","scheduler","host_receipt"],type:"string"},f0={description:"Strongly typed canonical identity: `BrainId`.",type:"string"},f2={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"}]},f4={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"}]},f6={enum:["hyphen","underscore","slash"],type:"string"},f3={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"},f9={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"},f5={description:"Strongly typed canonical identity: `BranchStackId`.",type:"string"},f8={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"},f7={description:"Strongly typed canonical identity: `BranchStackRevisionId`.",type:"string"},he={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"},ht={description:"Authoritative source that declared the exact stack topology.",enum:["explicit_declaration","accepted_task_branch_topology"],type:"string"},hr={enum:["no_branches","unbranched","independent_branches","local_stack"],type:"string"},hi={additionalProperties:!1,properties:{allowed:{items:{$ref:"#/$defs/BranchTopologyKindV1"},type:"array",uniqueItems:!0}},required:["allowed"],type:"object"},ho={description:"Strongly typed canonical identity: `CalibrationProfileId`.",type:"string"},hn={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"},ha={additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},stage:{$ref:"#/$defs/CancellationStage"}},required:["stage","observed_at"],type:"object"},hs={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"},hd={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"},hc={description:"A validated full native Git ref name, such as `refs/heads/main`.",type:"string"},hl={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"},hp={description:"Strongly typed canonical identity: `CapabilityId`.",type:"string"},hu={description:"Strongly typed canonical identity: `CatalogGenerationId`.",type:"string"},hm={description:"Strongly typed canonical identity: `ChangePlanId`.",type:"string"},hf={additionalProperties:!1,properties:{from_inclusive:{format:"int64",type:["integer","null"]},through_inclusive:{format:"int64",type:["integer","null"]}},type:"object"},hh={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"},hy={enum:["kind","language","path"],type:"string"},hg={description:"Strongly typed canonical identity: `CodeGenerationId`.",type:"string"},h_={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"}]},hv={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"},hb={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"},h$={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"},hS={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"},hk={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"}]},hw={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"},hP={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"}]},hV={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"},hR={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"},hq={description:"Strongly typed canonical identity: `CodeSearchChunkId`.",type:"string"},hI={description:"Strongly typed canonical identity: `CommitId`.",type:"string"},hx={enum:["promote","reject","insufficient_evidence"],type:"string"},hj={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"}]},hC={description:"Strongly typed canonical identity: `ComponentRevision`.",type:"string"},hT={description:"Strongly typed canonical identity: `ComponentVersion`.",type:"string"},hO={enum:["config_summary"],type:"string"},hE={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"},hA={description:"Strongly typed canonical identity: `ConfigurationIdempotencyKey`.",type:"string"},hW={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"}]},hM={description:"Strongly typed canonical identity: `ConfigurationReceiptId`.",type:"string"},hN={description:"Strongly typed canonical identity: `ConfigurationRevisionId`.",type:"string"},hz={description:"Strongly typed canonical identity: `ConfigurationSnapshotId`.",type:"string"},hD={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"}]},hF={description:"Strongly typed algorithm-tagged integrity digest: `ContentDigest`.",type:"string"},hL={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"}]},hU={enum:["explore","plan"],type:"string"},hH={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"},hG={enum:["retrieval","diagnostic","coordination","verification"],type:"string"},hB={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"},hK={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"},hJ={enum:["deterministic","configured_model"],type:"string"},hZ={enum:["active","paused","disabled"],type:"string"},hQ={enum:["codex_app_server"],type:"string"},hX={enum:["attempted","delayed","displayed","expanded","explicitly_accepted","explicitly_rejected","dismissed","expired_unseen","corrected","unknown"],type:"string"},hY={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"},h1={enum:["immediate","next_boundary","idle_window","on_request","suppressed"],type:"string"},h0={enum:["complete","partial","stale","cancelled","unavailable"],type:"string"},h2={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"},h4={enum:["explicitly_accepted","explicitly_rejected","dismissed","corrected"],type:"string"},h6={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"},h3={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"},h9={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"},h5={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"},h8={enum:["disabled","codex_app_server","unsupported","decision_engine"],type:"string"},h7={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"}]},ye={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"},yt={additionalProperties:!1,properties:{feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackV1"},{type:"null"}]},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"},suggestion:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"}},required:["suggestion","receipt"],type:"object"},yr={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"}]},yi={enum:["deterministic","configured_model"],type:"string"},yo={enum:["active","paused","disabled"],type:"string"},yn={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"},ya={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"},ys={enum:["stored","duplicate","superseded"],type:"string"},yd={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"},yc={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"}]},yl={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"},yp={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"},yu={description:"Which side of a file dependency the coupling report counts.",enum:["fan_in","fan_out"],type:"string"},ym={description:"Completeness is explicit; unknown never renders as clean.",enum:["complete","partial","unknown"],type:"string"},yf={additionalProperties:!1,properties:{completeness:{$ref:"#/$defs/CoverageCompleteness"},domain:{$ref:"#/$defs/EvidenceDomain"}},required:["domain","completeness"],type:"object"},yh={enum:["known","partial","stale","unknown","sampled","capped"],type:"string"},yy={description:"Strongly typed canonical identity: `CredentialReferenceId`.",type:"string"},yg={enum:["disabled","manual_receipt_only","fast_forward_only","merge_commit","cherry_pick_exact_commits"],type:"string"},y_={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"},yv={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"}]},yb={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"},y$={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"},yS={description:"Diagnostic severity. Source severity is preserved exactly; TraceDecay\nnever raises severity because several producers agree.",enum:["error","warning","information","hint"],type:"string"},yk={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"},yw={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"}]},yP={description:"Shape of the design-structure-matrix report.",enum:["stats","clusters","matrix"],type:"string"},yV={enum:["prevented","committed","unknown","not_applicable"],type:"string"},yR={enum:["exact_duplicate","superseded_overlap","repeated_investigation","duplicate_effect","not_duplicate","censored","unknown"],type:"string"},yq={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"}]},yI={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"},yx={description:"Durable effect receipt terminal state.",enum:["completed","cancelled","timed_out","failed","partial","effect_unknown"],type:"string"},yj={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"},yC={description:"Requested evidence domain for bounded coverage and omissions.",enum:["symbol","source","graph","test","temporal","anchor","operational","diagnostic"],type:"string"},yT={description:"Evidence role used by dedupe/diversity caps. Independent corroboration\nand contradictions are preserved.",enum:["primary","corroboration","contradiction","context"],type:"string"},yO={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"},yE={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"},yA={description:"Strongly typed canonical identity: `FactAssertionId`.",type:"string"},yW={enum:["general","user_pref","project","tool","decision","code_area"],type:"string"},yM={enum:["committed","idempotent_replay"],type:"string"},yN={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"}]},yz={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"},yD={description:"Strongly typed canonical identity: `FactEventId`.",type:"string"},yF={enum:["helpful","unhelpful"],type:"string"},yL={description:"Strongly typed canonical identity: `FactId`.",type:"string"},yU={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"}]},yH={description:"Payload states that structurally cannot expose an available fact payload.",enum:["redacted","quarantined","retention_expired","deleted","unavailable","ambiguous"],type:"string"},yG={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"}]},yB={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"}]},yK={enum:["conflict","unavailable","budget_exhausted","deadline_exceeded"],type:"string"},yJ={additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},scores:{$ref:"#/$defs/FactSearchScoresV1"},why:{type:["string","null"]}},required:["fact","scores"],type:"object"},yZ={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"},yQ={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"},yX={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"},yY={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"},y1={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"},y0={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"}]},y2={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"}]},y4={description:"Strongly typed canonical identity: `FeedbackCycleId`.",type:"string"},y6={enum:["clean","duplicate_noop","blocked","incomplete_coverage","stale_replan_required","budget_exceeded","cancelled","user_stop","daemon_unavailable"],type:"string"},y3={enum:["new","pre_existing","unknown"],type:"string"},y9={description:"Closed producer vocabulary for standard diagnostic projection.",enum:["code_diagnostic","git_hub_review","ci_localization","proximity"],type:"string"},y5={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"},y8={enum:["durable","session_only"],type:"string"},y7={description:"Strongly typed canonical identity: `FeedbackFindingId`.",type:"string"},ge={enum:["active","superseded","resolved","cleared"],type:"string"},gt={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"},gr={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"},gi={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"},go={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"},gn={description:"Strongly typed canonical identity: `FeedbackResultId`.",type:"string"},ga={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"},gs={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"},gd={description:"Strongly typed canonical identity: `FileOccurrenceId`.",type:"string"},gc={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"}]},gl={description:"Deterministic fixed-point score in millionths. No floating point crosses\nthis boundary.",format:"uint64",minimum:0,type:"integer"},gp={description:"Compatibility state of one source/projection pair.",enum:["current","stale","incompatible","missing","unknown"],type:"string"},gu={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",default:"production_other",description:"Strongest source role across the fused occurrences. Absent historical\ncandidates deserialize as a non-definition hit."},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","logical_evidence_id","occurrences","exact_class","utility_micros","contributions","freshness","decisions"],type:"object"},gm={description:"Metric whose distribution the Gini report measures.",enum:["complexity","lines","fan_in","fan_out","members"],type:"string"},gf={description:"Unit the Gini report aggregates its metric over.",enum:["file","symbol"],type:"string"},gh={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"}]},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={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"},g_={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"},gv={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"}]},gb={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"},g$={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"}]},gS={enum:["disabled","probe_private_preview"],type:"string"},gk={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"},gw={description:"Strongly typed canonical identity: `GitIndexPreviewId`.",type:"string"},gP={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"},gV={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"},gR={description:"In-progress native Git operation state, read from repository metadata.",enum:["none","merge","rebase","cherry_pick","revert","bisect","sequencer","unknown"],type:"string"},gq={description:"Whether a bounded page holds every answer or stopped at its limit.",enum:["complete","partial"],type:"string"},gI={enum:["complete"],type:"string"},gx={enum:["partial"],type:"string"},gj={enum:["unavailable"],type:"string"},gC={enum:["result_limit"],type:"string"},gT={additionalProperties:!1,properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},worktree:{type:["string","null"]}},type:"object"},gO={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"},gE={enum:["git"],type:"string"},gA={additionalProperties:!1,properties:{kind:{$ref:"#/$defs/GitToolErrorKindV1"},message:{type:"string"},operation:{$ref:"#/$defs/GitToolOperationV1"}},required:["kind","operation","message"],type:"object"},gW={additionalProperties:!1,description:"Git itself refused the refs, worktree status, or history the tool reads.",properties:{error:{$ref:"#/$defs/GitToolErrorV1"}},required:["error"],type:"object"},gM={description:"The git step that refused the read.",enum:["diff","status","log"],type:"string"},gN={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"},gz={enum:["forbid_force_and_rebase"],type:"string"},gD={description:"Strongly typed canonical identity: `HostInstanceId`.",type:"string"},gF={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"},gL={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"},gU={enum:["available","retained_but_unavailable","redacted","deleted","retention_expired","unauthorized","locked","unverifiable"],type:"string"},gH={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"},gG={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"},gB={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"},gK={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"}]},gJ={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"},gZ={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"}]},gQ={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"},gX={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"},gY={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"},g1={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"},g0={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"}]},g2={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"}]},g4={enum:["inline","external","canonical_occurrence"],type:"string"},g6={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"}]},g3={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"},g9={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"},g5={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"},g8={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"}]},g7={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"},_e={description:"Strongly typed algorithm-tagged integrity digest: `LocatorDigest`.",type:"string"},_t={description:"Strongly typed canonical identity: `LogicalCopyClusterId`.",type:"string"},_r={description:"Strongly typed canonical identity: `LogicalEvidenceId`.",type:"string"},_i={enum:["global","project"],type:"string"},_o={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"},_n={properties:{actor:{type:"string"},run_id:{type:["string","null"]},source:{$ref:"#/$defs/ManagedSkillSource"}},required:["source","actor"],type:"object"},_a={enum:["automation_run","user","import"],type:"string"},_s={enum:["active","disabled","archived"],type:"string"},_d={description:"Strongly typed algorithm-tagged integrity digest: `ManifestDigest`.",type:"string"},_c={description:"The only Git histories this product operation can create.",enum:["fast_forward","two_parent_merge","cherry_pick_exact_commits"],type:"string"},_l={enum:["project","user"],type:"string"},_p={enum:["all","parents_only","subagents_only"],type:"string"},_u={enum:["all","direct_user","tool_result"],type:"string"},_m={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"},_f={properties:{descriptor_revision:{type:"string"},eligible_population:{type:"string"}},required:["descriptor_revision","eligible_population"],type:"object"},_h={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"},_y={enum:["measurement","association","calibrated_prediction"],type:"string"},_g={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"},__={enum:["observability_envelope","feedback_observations","provider_usage_observation","savings_ledger"],type:"string"},_v={properties:{baseline_watermark:{type:["string","null"]},delta:{format:"double",type:["number","null"]},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"}},required:["horizon"],type:"object"},_b={properties:{lower:{format:"double",type:["number","null"]},reason:{type:["string","null"]},upper:{format:"double",type:["number","null"]}},type:"object"},_$={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"},_S={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"},_k={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"},_w={description:"Strongly typed canonical identity: `NativeIntegrationApprovalId`.",type:"string"},_P={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"},_V={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"}]},_R={description:"Strongly typed canonical identity: `NativeIntegrationPreviewId`.",type:"string"},_q={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"},_I={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"}]},_x={description:"The only truthful terminal outcomes after recovery.",enum:["committed","aborted_no_change","rolled_back","needs_inspection"],type:"string"},_j={description:"Strongly typed canonical identity: `NativeIntegrationTransactionId`.",type:"string"},_C={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"},_T={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"}]},_O={additionalProperties:!1,properties:{body:{format:"uint64",minimum:0,type:"integer"},full_file:{format:"uint64",minimum:0,type:"integer"}},required:["body","full_file"],type:"object"},_E={properties:{since_micros:{format:"int64",type:"integer"},until_micros:{format:"int64",type:"integer"}},required:["since_micros","until_micros"],type:"object"},_A={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"},_W={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"},_M={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"},_N={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"},_z={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"},_D={description:"Terminal state after an operation has been admitted.",enum:["completed","cancelled","timed_out","failed","unavailable","partial","effect_unknown"],type:"string"},_F={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"},_L={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"},_U={description:"Whether the served code generation is known current at serve time.",enum:["fresh","possibly_stale"],type:"string"},_H={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"},_G={enum:["complete"],type:"string"},_B={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"},_K={enum:["full","partial"],type:"string"},_J={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"},_Z={additionalProperties:!1,properties:{language:{type:["string","null"]},provider:{type:["string","null"]},reason:{type:"string"}},required:["reason"],type:"object"},_Q={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"},_X={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"},_Y={enum:["unavailable"],type:"string"},_1={description:"Strongly typed canonical identity: `ProjectId`.",type:"string"},_0={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"},_2={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"},_4={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"},_6={description:"Strongly typed canonical identity: `ProjectionGenerationId`.",type:"string"},_3={description:"Strongly typed canonical identity: `ProposalId`.",type:"string"},_9={enum:["reject","require_human_approval_and_independent_review"],type:"string"},_5={additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/ProtectedRefDispositionV1"},selector:{$ref:"#/$defs/ProtectedRefSelectorV1"}},required:["selector","disposition"],type:"object"},_8={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"}]},_7={description:"Strongly typed canonical identity: `ProvenanceId`.",type:"string"},ve={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"},vt={description:"Strongly typed canonical identity: `ProviderId`.",type:"string"},vr={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"},vi={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"},vo={enum:["owner_receipt","locally_measured","estimated","unknown"],type:"string"},vn={description:"Strongly typed canonical identity: `QueryCollectionId`.",type:"string"},va={description:"Which endpoint of each counted edge the rank report ranks.",enum:["incoming","outgoing"],type:"string"},vs={description:"Relationship the rank report counts.",enum:["implements","extends","calls","uses","contains","annotates","type_of","returns","receives"],type:"string"},vd={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"},vc={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"},vl={description:"Strongly typed canonical identity: `RefId`.",type:"string"},vp={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"},vu={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"},vm={description:"Closed error class for a rejected surface argument.",enum:["missing","invalid_shape","out_of_bounds","unsupported","unauthorized","stale","unknown"],type:"string"},vf={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"},vh={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"},vy={description:"Transport that rejected a surface argument. Unknown preserves missing\nattribution instead of inventing cli/mcp/http.",enum:["cli","mcp","http","unknown"],type:"string"},vg={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"}]},vv={enum:["successful_terminal"],type:"string"},vb={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"},v$={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"},vS={description:"Bounded output projection chosen by a concrete use case.",enum:["summary","evidence","references_only"],type:"string"},vk={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"},vw={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"},vP={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)."},vV={description:"Strongly typed canonical identity: `RetrievalAnchorId`.",type:"string"},vR={description:"Stable semantic ordering; adapters may not replace it with transport order.",enum:["relevance","source_position","temporal_descending","stable_identity"],type:"string"},vq={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"},vI={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"}]},vx={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"},vj={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"},vC={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"}]},vT={enum:["no_review","independent_review","standard_pull_requests","git_hub_stacked_pull_requests"],type:"string"},vO={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"},vE={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"},vA={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"},vW={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"},vM={enum:["allow","deny"],type:"string"},vN={description:"Strongly typed canonical identity: `RunId`.",type:"string"},vz={additionalProperties:!1,properties:{degraded_row:{type:["string","null"]},progress:{anyOf:[{$ref:"#/$defs/SchemaConvergenceProgressV1"},{type:"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"},vD={oneOf:[{additionalProperties:!1,properties:{done:{format:"uint64",minimum:0,type:"integer"},remaining:{format:"uint64",minimum:0,type:"integer"},unit:{const:"rows",type:"string"}},required:["unit","done","remaining"],type:"object"},{additionalProperties:!1,properties:{done:{format:"uint64",minimum:0,type:"integer"},remaining:{format:"uint64",minimum:0,type:"integer"},unit:{const:"pages",type:"string"}},required:["unit","done","remaining"],type:"object"}]},vF={enum:["registered_schema"],type:"string"},vL={enum:["pending_schema_migration","released_shape_convergence_in_progress","degraded","completed"],type:"string"},vU={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"},vH={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"},vG={enum:["read","source_bind","source_rebind","source_unbind","access_rule_upsert","access_rule_remove","replace_topology_policy","rollback"],type:"string"},vB={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"}]},vK={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"}]},vJ={description:"Typed explanation for a root that returned usable but incomplete data.",enum:["incomplete","stale","budget_exceeded","root_denied","root_unavailable"],type:"string"},vZ={description:"Stable identity of one authorized scope-set record.",type:"string"},vQ={description:"Monotonic optimistic-concurrency revision of one scope set.",format:"uint64",minimum:1,type:"integer"},vX={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"},vY={description:"Typed explanation for a root that could not return usable data.",enum:["authority_unavailable","root_missing","store_unavailable"],type:"string"},v1={description:"Strongly typed canonical identity: `ScoreDomainId`.",type:"string"},v0={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"},v2={additionalProperties:!1,properties:{knowledge:{$ref:"#/$defs/ClosedUtcIntervalV1"},valid:{$ref:"#/$defs/ValidCoverageIntervalV1"}},required:["knowledge","valid"],type:"object"},v4={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"}]},v6={additionalProperties:!1,properties:{mode:{$ref:"#/$defs/TemporalModeV1"}},required:["mode"],type:"object"},v3={enum:["fresh","stale","partial","locked","redacted","retention_withheld","unavailable"],type:"string"},v9={description:"Strongly typed canonical identity: `SessionId`.",type:"string"},v5={description:"Strongly typed canonical identity: `SessionOrThreadId`.",type:"string"},v8={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"},v7={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"},be={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"},bt={enum:["complete","failed","cancelled"],type:"string"},br={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"},bi={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"},bo={description:"Typed configuration key. Keys are lowercase, dotted product identifiers;\nuntyped host/adapter keys are not representable.",type:"string"},bn={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"},ba={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"},bs={enum:["conservative_exact","rename_normalized_exact"],type:"string"},bd={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"},bc={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"},bl={enum:["cursor","codex","claude","agents","opencode","kimi","kiro","hermes"],type:"string"},bp={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"},bu={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"},bm={description:"Strongly typed canonical identity: `SourceBindingId`.",type:"string"},bf={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"},bh={description:"Strongly typed canonical identity: `SourceInstanceKey`.",type:"string"},by={enum:["claude","codex","cursor","git_hub","hermes","kiro"],type:"string"},bg={description:"Strongly typed canonical identity: `SourceNamespace`.",type:"string"},b_={description:"Strongly typed canonical identity: `SourceOccurrenceId`.",type:"string"},bv={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"},bb={description:"Strongly typed canonical identity: `SourceStoreId`.",type:"string"},b$={description:"Strongly typed canonical identity: `StackDeliveryWatermarkId`.",type:"string"},bS={description:"Strongly typed canonical identity: `StackNodeId`.",type:"string"},bk={description:"Strongly typed canonical identity: `StackSignalId`.",type:"string"},bw={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"},bP={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"},bV={description:"Strongly typed canonical identity: `SymbolOccurrenceId`.",type:"string"},bR={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"},bq={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"},bI={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"},bx={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"},bj={description:"Strongly typed canonical identity: `TaskId`.",type:"string"},bC={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"},bT={additionalProperties:!1,properties:{anchor:{type:"string"},summary:{type:"string"}},required:["anchor","summary"],type:"object"},bO={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"}]},bE={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"}]},bA={additionalProperties:!1,properties:{anchor:{type:"string"},rank:{format:"uint32",minimum:0,type:"integer"},reason:{$ref:"#/$defs/HydrationStateResultV1"}},required:["rank","anchor","reason"],type:"object"},bW={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"},bM={description:"Strongly typed canonical identity: `ThreadId`.",type:"string"},bN={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"},bz={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"},bD={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"},bF={enum:["reject","require_explicit_human_approval","require_human_approval_and_independent_review"],type:"string"},bL={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"},bU={enum:["critical_only","lifecycle","verbose"],type:"string"},bH={description:"Risky construct the pattern scan looks for.",enum:["unwrap","expect","panic","todo","unimplemented","unsafe_block"],type:"string"},bG={description:"Stable, canonical catalog identity for `UseCaseId`.",type:"string"},bB={description:"Strongly typed canonical identity: `UserProfileId`.",type:"string"},bK={description:"UTC timestamp represented as microseconds from the Unix epoch.",format:"int64",type:"integer"},bJ={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"}]},bZ={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"},bQ={additionalProperties:!1,properties:{criterion_id:{type:"string"},description:{type:"string"},evidence_required:{type:"boolean"}},required:["criterion_id","description","evidence_required"],type:"object"},bX={enum:["never","on_request"],type:"string"},bY={description:"Strongly typed canonical identity: `WorkArtifactId`.",type:"string"},b1={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"},b0={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"},b2={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"},b4={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"}]},b6={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"},b3={additionalProperties:!1,properties:{completed:{format:"uint64",minimum:0,type:"integer"},total:{format:"uint64",minimum:0,type:"integer"}},required:["completed","total"],type:"object"},b9={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"},b5={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"}]},b8={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"},b7={enum:["leased","running","cancellation_requested","cancellation_acknowledged","cancellation_escalated","recovery_required","succeeded","failed","timed_out","cancelled"],type:"string"},$e={enum:["stdout","stderr"],type:"string"},$t={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"},$r={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"},$i={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"},$o={additionalProperties:!1,properties:{acknowledged_at:{$ref:"#/$defs/UtcMicros"},request:{$ref:"#/$defs/WorkCancellationRequestV1"}},required:["request","acknowledged_at"],type:"object"},$n={additionalProperties:!1,properties:{acknowledgement:{$ref:"#/$defs/WorkCancellationAcknowledgementV1"},escalated_at:{$ref:"#/$defs/UtcMicros"}},required:["acknowledgement","escalated_at"],type:"object"},$a={description:"Strongly typed canonical identity: `WorkCancellationRequestId`.",type:"string"},$s={additionalProperties:!1,properties:{request_id:{$ref:"#/$defs/WorkCancellationRequestId"},requested_at:{$ref:"#/$defs/UtcMicros"}},required:["request_id","requested_at"],type:"object"},$d={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"}]},$c={description:"Strongly typed canonical identity: `WorkCommandId`.",type:"string"},$l={description:"Where a configured route places task content.",enum:["local","tenant","external"],type:"string"},$p={additionalProperties:!1,properties:{topology_generation:{$ref:"#/$defs/WorkTopologyGenerationRefV1"},work_generation:{$ref:"#/$defs/ProjectionGenerationId"}},required:["work_generation","topology_generation"],type:"object"},$u={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"},$m={description:"Effect semantics admitted for one provider attempt.",enum:["observational","intercepted","compound_non_repeatable"],type:"string"},$f={description:"Declared effort class of a configured route.",enum:["minimal","standard","extended"],type:"string"},$h={enum:["deny","allowlisted"],type:"string"},$y={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"}]},$g={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"},$_={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"},$v={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"},$b={additionalProperties:!1,properties:{artifact_digest:{$ref:"#/$defs/ManifestDigest"},executable_id:{type:"string"}},required:["executable_id","artifact_digest"],type:"object"},$$={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"},$S={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"},$k={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"},$w={enum:["language","framework","architecture","testing","operations","security","domain"],type:"string"},$P={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"},$V={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"}]},$R={format:"uint64",minimum:0,title:"WorkFenceEpochV1",type:"integer"},$q={enum:["read_only","workspace_write"],type:"string"},$I={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"}]},$x={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"},$j={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"},$C={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"},$T={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"},$O={additionalProperties:!1,properties:{initiative_id:{type:"string"},milestone_id:{type:"string"},plan_id:{type:"string"}},required:["initiative_id","plan_id","milestone_id"],type:"object"},$E={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},title:{type:"string"}},required:["id","title","created_at"],type:"object"},$A={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"},$W={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"},$M={description:"A job task key: `[a-z0-9-]`, 1 to 48 bytes. Identities derive from it.",type:"string"},$N={additionalProperties:!1,properties:{epoch:{$ref:"#/$defs/WorkFenceEpochV1"},lease_id:{$ref:"#/$defs/WorkLeaseId"}},required:["lease_id","epoch"],type:"object"},$z={description:"Strongly typed canonical identity: `WorkLeaseId`.",type:"string"},$D={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"},$F={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"},$L={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"},$U={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"},$H={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"},$G={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"},$B={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"},$K={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"},$J={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"},$Z={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"}]},$Q={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"},$X={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"}]},$Y={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"},$1={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"}]},$0={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"},$2={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"},$4={additionalProperties:!1,properties:{event:{$ref:"#/$defs/WorkProductEventV1"},replayed:{type:"boolean"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["event","verified_graph_version","replayed"],type:"object"},$6={additionalProperties:!1,properties:{brain_id:{$ref:"#/$defs/BrainId"},profile_id:{$ref:"#/$defs/UserProfileId"}},required:["brain_id","profile_id"],type:"object"},$3={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"}]},$9={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"},$5={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"}]},$8={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},$7={enum:["accepted","rejected","superseded"],type:"string"},Se={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"},St={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"},Sr={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"}]},Si={description:"Provider protocol selected by the pinned Work configuration snapshot.",enum:["claude_code_cli","codex_app_server","codex_cli"],type:"string"},So={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"},Sn={enum:["claude_stream_json","codex_app_server_json_rpc","codex_exec_json"],type:"string"},Sa={description:"Strongly typed canonical identity: `WorkProviderRouteId`.",type:"string"},Ss={additionalProperties:!1,properties:{provider_id:{$ref:"#/$defs/ProviderId"},route_id:{$ref:"#/$defs/WorkProviderRouteId"}},required:["provider_id","route_id"],type:"object"},Sd={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"}]},Sc={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},Sl={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"},Sp={enum:["lease_lost","provider_unavailable","process_lost","failure_observed"],type:"string"},Su={enum:["runtime_failure","restart_recovery_required"],type:"string"},Sm={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"},Sf={enum:["runtime"],type:"string"},Sh={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"},Sy={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"}]},Sg={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"},S_={description:"A monotonically versioned control authority.",format:"uint64",minimum:0,title:"WorkRunControlAuthorityV1",type:"integer"},Sv={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"},Sb={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"},S$={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"},SS={enum:["required"],type:"string"},Sk={enum:["ordinal","heuristic","calibrated_range"],type:"string"},Sw={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"},SP={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"},SV={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"},SR={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"}]},Sq={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"},SI={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"}]},Sx={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"},Sj={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"},SC={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"}]},ST={description:"Strongly typed algorithm-tagged integrity digest: `WorkTopologyGenerationRefV1`.",type:"string"},SO={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"},SE={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"},SA={description:"Strongly typed canonical identity: `WorkflowDefinitionId`.",type:"string"},SW={additionalProperties:!1,properties:{max_width:{format:"uint32",minimum:0,type:"integer"}},required:["max_width"],type:"object"},SM={description:"Strongly typed canonical identity: `WorkflowOperationRef`.",type:"string"},SN={description:"Strongly typed canonical identity: `WorkflowOutputName`.",type:"string"},Sz={additionalProperties:!1,properties:{output_name:{$ref:"#/$defs/WorkflowOutputName"},producer_step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["producer_step_id","output_name"],type:"object"},SD={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"},SF={description:"Strongly typed canonical identity: `WorkflowStepId`.",type:"string"},SL={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"},SU={enum:["require_clean","allow_untracked_only_for_preflight","read_only_preflight_only"],type:"string"},SH={description:"Strongly typed canonical identity: `WorktreeId`.",type:"string"},SG={description:"Monotonic epoch of the worktree inventory frozen into a stack revision.",format:"uint64",minimum:0,type:"integer"},SB={description:"Strongly typed canonical identity: `WorktreeInventorySnapshotId`.",type:"string"},SK={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"}]},SJ={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"},SZ={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"},SQ=[{$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:_D,ProjectRegistryEntry:_0,ProjectRegistrySummary:_2,ProjectRepoGroup:_4,PublicCodeProject:vi,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:bK},$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:fF,AutomationReconcileScope:fB},$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:fF,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:fB,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:yW,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:{compatibility_field:{type:"string"},distance:{type:"string"},recommended_proximity:{items:{type:"string"},type:"array"},strategy:{type:"string"}},required:["strategy","distance","recommended_proximity","compatibility_field"],type:"object"},CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:{affected_tests:{items:{type:"string"},type:"array"},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","affected_tests","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:fS,CodeGenerationId:hg,CommitId:hI,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,FeedbackImpactStateV1:gi,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:fV,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:fw,AnalyticsModeV1:fP,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:fV,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:hx,CostsReadModelV1:yp,CoverageStateV1:yh,LatencyDistributionReadModelV1:gB,MetricCalibrationV1:_m,MetricCohortV1:_f,MetricCoverageV1:_h,MetricEvidenceClassV1:_y,MetricProvenanceV1:_g,MetricSourceV1:__,MetricTemporalV1:_v,MetricUncertaintyV1:_b,MetricValueV1:_$,ObservabilityHorizonV1:_E,ObservatoryReadModelV1:_W,PerformanceComparisonReadModelV1:_L,ProviderLatencyReadModelV1:vr,RejectedArgumentAnalyticsV1:vu,RejectedArgumentErrorClassV1:vm,RejectedArgumentGroupV1:vf,RejectedArgumentNameV1:vh,RejectedArgumentSurfaceV1:vy},$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:_d,NativeIntegrationApprovalId:_w,NativeIntegrationPreviewId:_R,NativeIntegrationTransactionId:_j},$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:f$,BranchStackEdgeV1:f9,BranchStackId:f5,BranchStackNodeV1:f8,BranchStackRevisionId:f7,BranchStackRevisionV1:he,BranchStackSourceV1:ht,CapabilityId:hp,CodeGenerationId:hg,CommitId:hI,ContentDigest:hF,GitOidV1:gV,GitOperationStateV1:gR,ManifestDigest:_d,MechanicalIntegrationModeV1:_c,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:_w,NativeIntegrationDirectionV1:_P,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:_V,NativeIntegrationPreviewId:_R,NativeIntegrationSealedStackSnapshotV1:_q,NativeIntegrationSelectionBindingV1:_I,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:_x,NativeIntegrationTransactionId:_j,NativeIntegrationUnavailabilityV1:_C,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:_T,ProjectId:_1,RefId:vl,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,SourceSpan:bv,StackNodeId:bS,UtcMicros:bK,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:SH,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:SG,WorktreeInventorySnapshotId:SB,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:_d,NativeIntegrationPreviewId:_R},$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:f$,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:ha,CancellationStage:hs,ComponentVersion:hT,Deadline:yb,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:yq,EffectReceipt:yI,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:yx,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:_d,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:_N,OperationReceipt:_z,OperationTermination:_D,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:_1,ReconciliationState:{description:"Reconciliation state retained after an admitted effect.",enum:["pending","reconciled","failed"],type:"string"},RefId:vl,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:vg,ResolvedScope:v$,RetrievalAnchorId:vV,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:bG,UtcMicros:bK,WorktreeId:SH},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:fG,AutomationRunArtifact:fK},$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:fk,AutomationReadStatusV1:fG,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","null"]},trigger:{$ref:"#/$defs/AutomationTrigger"}},required:["run_id","task","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:fJ,AutomationRunStatus:fZ,AutomationTrigger:f1},$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:fk,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:fG,AutomationRunArtifact:fK,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","null"]},trigger:{$ref:"#/$defs/AutomationTrigger"},validation_report:!0},required:["schema_version","run_id","trigger","task","backend","status","accepted_count","rejected_count","started_at","completed_at"],type:"object"},AutomationRunScopeV1:fJ,AutomationRunStatus:fZ,AutomationTrigger:f1,SessionRetrievalBudgetStageV1:br},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitReadCompleteV1:gI,GitReadPartialV1:gx,GitReadUnavailableV1:gj,GitResultLimitV1:gC,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitPageStatusV1:gq,GitReadUnavailableV1:gj,GitReferenceLimitV1:{enum:["reference_limit"],type:"string"},PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:ho,CandidateContribution:hd,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComponentRevision:hC,EvidenceRole:yT,ExactClass:yO,FileOccurrenceId:gd,FixedPointScore:gl,FreshnessCompatibilityV1:gp,FusedCandidate:gu,GitPageStatusV1:gq,GitReadUnavailableV1:gj,GitResultLimitV1:gC,LogicalCopyClusterId:_t,LogicalEvidenceId:_r,OccurrenceProvenance:_M,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:vd,RankingDecisionKind:vc,RepositoryId:vg,RetrievalAnchorId:vV,RetrievalSourceRoleV1:vI,RetrieverKind:vj,ScoreDomainId:v1,SessionOrThreadId:v5,SourceFreshness:bf,SourceInstanceKey:bh,SourceNamespace:bg,SourceOccurrenceId:b_,UtcMicros:bK},$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:_Q},$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:_j},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitComparedSymbolV1:gy,GitReadCompleteV1:gI,GitReadPartialV1:gx,GitReadUnavailableV1:gj,GitToolErrorKindV1:gE,GitToolErrorV1:gA,GitToolFailureV1:gW,GitToolOperationV1:gM,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,SymbolChangesCompleteV1:{additionalProperties:!1,properties:{status:{$ref:"#/$defs/GitReadCompleteV1"}},required:["status"],type:"object"},SymbolChangesUnavailableV1:bw},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,SymbolPrimitiveRecord:bR,SymbolRelationRecord: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/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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,PrimitiveSupportGap:_Z,SymbolPrimitiveRecord:bR,SymbolRelationRecord:bq,UtcMicros:bK},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,SymbolPrimitiveRecord:bR},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ExactTechnicalTermKindV1:yE,ResultProjection:vS,RetrievalOrder:vR},$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:hg,CodeOccurrenceRecord:hV,CodeSearchChunkId:hq,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:yE,FileOccurrenceId:gd,SourceSpan:bv,SymbolOccurrenceId:bV},$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:hn,CodeFacetDimension:hy,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hy,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:hg},$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:hn,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:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,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:_Z,SymbolPrimitiveRecord:bR,UtcMicros:bK},$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:hn,CodeGenerationId:hg,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:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,CodeOccurrenceRecord:hV,CodeSearchChunkId:hq,FileOccurrenceId:gd,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:bv,SymbolOccurrenceId:bV},$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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,PrimitiveSupportGap:_Z,SymbolPrimitiveRecord:bR,UtcMicros:bK},$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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,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:bK},$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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,PrimitiveSupportGap:_Z,SymbolPrimitiveRecord:bR,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:bK},$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, only analyze staged changes (default: false = all uncommitted\nchanges).",type:["boolean","null"]}},title:"CommitContextSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},recent_commits:{items:{type:"string"},type:"array"},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:{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:{file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line"],type:"object"},ConfigSummaryKindV1:hO,ConfigSummaryV1:hE,GitFileRoleV1:{description:"A changed file's semantic role.",enum:["config","docs","source","test"],type:"string"},GitToolErrorKindV1:gE,GitToolErrorV1:gA,GitToolFailureV1:gW,GitToolOperationV1:gM,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComplexityAnalysisV1:hj,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:f$,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:hA,ConfigurationReceiptId:hM,ConfigurationRevisionId:hN,ManifestDigest:_d,UtcMicros:bK},$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:fb,ActorId:f$,AnalyzerEnvironmentVariable:fR,AnalyzerExecutableId:fq,AnalyzerExecutableReferenceV1:fI,AnalyzerLanguageId:fx,AnalyzerLanguageSelectionV1:fj,AnalyzerPrivacyClassV1:fC,AnalyzerResourceLimitsV1:fT,AnalyzerRestartPolicyV1:fO,AnalyzerSettingsV1:fE,AnalyzerStructuredValueV1:fA,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,AutomationBackendV1:fU,AutomationHostModeV1:fH,AutomationSettingsV1:fQ,AutomationTaskSetV1:fX,AutomationTaskSettingsV1:fY,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CodeIndexWorkerSelectionV1:hP,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:hA,ConfigurationLayerIdV1:hW,ConfigurationRevisionId:hN,ConfigurationValueV1:hD,ContextScoutConfigurationLimitsV1:hK,ContextScoutConfigurationModeV1:hJ,ContextScoutConfigurationStateV1:hZ,ContextScoutConfiguredModelPathV1:hQ,ContextScoutIntentKindV1:h3,ContextScoutIntentSettingsV1:h9,ContextScoutSettingsV1:ya,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DecisionEngineSettingsV1:y$,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,IntentQuestionSettingsV1:gH,IntentWindowSettingsV1:gG,LcmSummarizerExecutableV1:g6,LcmSummarizerExecutablesV1:g3,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,QueryCollectionId:vn,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SettingKey:bo,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkApprovalPolicy:bX,WorkContentLocationClassV1:$l,WorkEffortClassV1:$f,WorkEgressPolicy:$h,WorkExecutableBindingV1:$_,WorkExecutableCapabilityV1:$v,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExpertiseCategoryV1:$w,WorkExpertiseConsentV1:$P,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkOrdinalBandV1:$F,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteCandidateV1:Sh,WorkRouteExecutionProfileV1:Sg,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fv,ConfigurationReceiptId:hM,ConfigurationRevisionId:hN,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:hz,ManifestDigest:_d,UtcMicros:bK},$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:bo},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{key:{$ref:"#/$defs/SettingKey"}},required:["key"],title:"ConfigurationGetRequestV1",type:"object"},{$defs:{AccessRuleId:fb,ActorId:f$,AnalyzerEnvironmentVariable:fR,AnalyzerExecutableId:fq,AnalyzerExecutableReferenceV1:fI,AnalyzerLanguageId:fx,AnalyzerLanguageSelectionV1:fj,AnalyzerPrivacyClassV1:fC,AnalyzerResourceLimitsV1:fT,AnalyzerRestartPolicyV1:fO,AnalyzerSettingsV1:fE,AnalyzerStructuredValueV1:fA,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,AutomationBackendV1:fU,AutomationHostModeV1:fH,AutomationSettingsV1:fQ,AutomationTaskSetV1:fX,AutomationTaskSettingsV1:fY,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CandidateDispositionV1:{enum:["winning","overridden","rejected","defaulted"],type:"string"},CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CodeIndexWorkerSelectionV1:hP,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:hW,ConfigurationRevisionId:hN,ConfigurationSettingActionV1:{enum:["set","unset"],type:"string"},ConfigurationSettingFindingV1:{description:"A stored value the running release keeps but does not apply. The value\nstays readable so `legal_actions` on the same key can replace it.",oneOf:[{additionalProperties:!1,description:"An `index.exclude.v1` / `index.include.v1` pattern that does not\ncompile. An earlier release stored it unchecked; indexing runs\nwithout it.",properties:{kind:{const:"invalid_index_path_pattern",type:"string"},legal_actions:{items:{$ref:"#/$defs/ConfigurationSettingActionV1"},type:"array"},message:{type:"string"},pattern:{type:"string"}},required:["kind","pattern","message","legal_actions"],type:"object"}]},ConfigurationSnapshotId:hz,ConfigurationValueV1:hD,ContextScoutConfigurationLimitsV1:hK,ContextScoutConfigurationModeV1:hJ,ContextScoutConfigurationStateV1:hZ,ContextScoutConfiguredModelPathV1:hQ,ContextScoutIntentKindV1:h3,ContextScoutIntentSettingsV1:h9,ContextScoutSettingsV1:ya,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DecisionEngineSettingsV1:y$,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,IntentQuestionSettingsV1:gH,IntentWindowSettingsV1:gG,LcmSummarizerExecutableV1:g6,LcmSummarizerExecutablesV1:g3,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,QueryCollectionId:vn,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SettingKey:bo,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkApprovalPolicy:bX,WorkContentLocationClassV1:$l,WorkEffortClassV1:$f,WorkEgressPolicy:$h,WorkExecutableBindingV1:$_,WorkExecutableCapabilityV1:$v,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExpertiseCategoryV1:$w,WorkExpertiseConsentV1:$P,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkOrdinalBandV1:$F,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteCandidateV1:Sh,WorkRouteExecutionProfileV1:Sg,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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"},findings:{description:"Parts of the stored value this release does not apply. Empty when the\neffective value applies in full.",items:{$ref:"#/$defs/ConfigurationSettingFindingV1"},type:"array"},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","findings"],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:bo,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:hN},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/ComponentConfigurationState"},title:"Array_of_ComponentConfigurationState",type:"array"},{$defs:{ChangePlanId:hm,ConfigurationIdempotencyKey:hA,ConfigurationRevisionId:hN,ManifestDigest:_d},$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:fb,ActorId:f$,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,ConfigurationRevisionId:hN,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,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:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fv,ActorId:f$,ChangePlanId:hm,ConfigurationRevisionId:hN,ManifestDigest:_d,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:vG,SettingKey:bo,UtcMicros:bK},$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:hN,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:fb,ActorId:f$,AnalyzerEnvironmentVariable:fR,AnalyzerExecutableId:fq,AnalyzerExecutableReferenceV1:fI,AnalyzerLanguageId:fx,AnalyzerLanguageSelectionV1:fj,AnalyzerPrivacyClassV1:fC,AnalyzerResourceLimitsV1:fT,AnalyzerRestartPolicyV1:fO,AnalyzerSettingsV1:fE,AnalyzerStructuredValueV1:fA,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,AutomationBackendV1:fU,AutomationHostModeV1:fH,AutomationSettingsV1:fQ,AutomationTaskSetV1:fX,AutomationTaskSettingsV1:fY,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CodeIndexWorkerSelectionV1:hP,ConfigurationIdempotencyKey:hA,ConfigurationLayerIdV1:hW,ConfigurationRevisionId:hN,ConfigurationValueV1:hD,ContextScoutConfigurationLimitsV1:hK,ContextScoutConfigurationModeV1:hJ,ContextScoutConfigurationStateV1:hZ,ContextScoutConfiguredModelPathV1:hQ,ContextScoutIntentKindV1:h3,ContextScoutIntentSettingsV1:h9,ContextScoutSettingsV1:ya,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DecisionEngineSettingsV1:y$,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,IntentQuestionSettingsV1:gH,IntentWindowSettingsV1:gG,LcmSummarizerExecutableV1:g6,LcmSummarizerExecutablesV1:g3,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,QueryCollectionId:vn,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SettingKey:bo,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkApprovalPolicy:bX,WorkContentLocationClassV1:$l,WorkEffortClassV1:$f,WorkEgressPolicy:$h,WorkExecutableBindingV1:$_,WorkExecutableCapabilityV1:$v,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExpertiseCategoryV1:$w,WorkExpertiseConsentV1:$P,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkOrdinalBandV1:$F,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteCandidateV1:Sh,WorkRouteExecutionProfileV1:Sg,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:hA,ConfigurationLayerIdV1:hW,ConfigurationRevisionId:hN,ProjectId:_1,QueryCollectionId:vn,SettingKey:bo,UserProfileId:bB},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ConstructorsNotFoundV1"},{$ref:"#/$defs/ConstructorsReportV1"}],title:"ConstructorsResultV1"},{$defs:{ContextModeV1:hU},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:hL,ContextModeV1:hU,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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LexicalAnchorDropReasonV1:g8,LexicalAnchorDropV1:g7,LocatorDigest:_e,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveLaneCompleteV1:_G,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:_K,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:_J,PrimitiveSymbolLocationV1:_Q,PrimitiveUnavailableEvidenceV1:_X,PrimitiveUnavailableStatusV1:_Y,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,TokenBudgetCutV1:bN,TokenBudgetSectionV1:bz,UtcMicros:bK},$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:hH},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"}},required:["address"],title:"ContextScoutExactAddressRequestV1",type:"object"},{$defs:{ContextScoutLimitsV1:h5,ContextScoutModelOutcomeV1:h7},$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:hH,ContextScoutWorkV1:yl},$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:ys},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{outcome:{$ref:"#/$defs/ContextScoutStoreOutcomeV1"}},required:["outcome"],title:"ContextScoutMutationResultV1",type:"object"},{$defs:{ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutRuntimeModeV1:yi,ContextScoutServiceStateV1:yo},$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:hH,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:hg,ContextScoutAddressV1:hH,ContextScoutCategoryV1:hG,ContextScoutClaimHandleV1:hB,ContextScoutDeliveryWindowV1:h1,ContextScoutEvidenceAvailabilityV1:h0,ContextScoutEvidenceProjectionV1:h2,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRouteV1:yr,ContextScoutSessionWindowV1:yn,ContextScoutSuggestionProjectionV1:yd,ContextScoutWorkV1:yl,ManifestDigest:_d,RetrievalAnchorId:vV,UtcMicros:bK},$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:hH,ContextScoutClaimHandleV1:hB,ContextScoutDeliveryOutcomeV1:hX,ContextScoutWorkV1:yl,UtcMicros:bK},$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:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutStoreOutcomeV1:ys,UtcMicros:bK},$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:hH},$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:hg,ContextScoutAddressV1:hH,ContextScoutCategoryV1:hG,ContextScoutDeliveryOutcomeV1:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutDeliveryWindowV1:h1,ContextScoutEvidenceAvailabilityV1:h0,ContextScoutEvidenceProjectionV1:h2,ContextScoutFeedbackKindV1:h4,ContextScoutFeedbackV1:h6,ContextScoutLimitsV1:h5,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRecentDeliveryV1:yt,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:yr,ContextScoutRuntimeModeV1:yi,ContextScoutServiceStateV1:yo,ContextScoutSessionWindowV1:yn,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:yd,ContextScoutSuppressionV1:yc,ContextScoutWorkV1:yl,ManifestDigest:_d,RetrievalAnchorId:vV,UtcMicros:bK},$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:hH,ContextScoutDeliveryOutcomeV1:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutFeedbackKindV1:h4,ContextScoutFeedbackV1:h6,UtcMicros:bK},$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:hA,ConfigurationRevisionId:hN,ContextScoutAddressV1:hH},$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:hg,ContextScoutAddressV1:hH,ContextScoutCategoryV1:hG,ContextScoutDeliveryOutcomeV1:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutDeliveryWindowV1:h1,ContextScoutEvidenceAvailabilityV1:h0,ContextScoutEvidenceProjectionV1:h2,ContextScoutFeedbackKindV1:h4,ContextScoutFeedbackV1:h6,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRecentDeliveryV1:yt,ContextScoutRouteV1:yr,ContextScoutSessionWindowV1:yn,ContextScoutSuggestionProjectionV1:yd,ContextScoutWorkV1:yl,ManifestDigest:_d,RetrievalAnchorId:vV,UtcMicros:bK},$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:hX,ContextScoutFeedbackKindV1:h4,ContextScoutLimitsV1:h5,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRouteV1:yr,ContextScoutRuntimeModeV1:yi,ContextScoutServiceStateV1:yo,ContextScoutSuppressionV1:yc},$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:yu},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,CouplingDirectionV1:yu,CouplingEntryV1:{additionalProperties:!1,properties:{coupled_files:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"}},required:["file","coupled_files"],type:"object"},PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hg,CommitId:hI,ComponentVersion:hT,ContentDigest:hF,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:yS,FileOccurrenceId:gd,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:_d,ProviderId:vt,RefId:vl,RepositoryId:vg,RetrievalAnchorId:vV,SanitizationReceiptId:{description:"Strongly typed canonical identity: `SanitizationReceiptId`.",type:"string"},SourceSpan:bv,SymbolOccurrenceId:bV,UtcMicros:bK,WorktreeId:SH},$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:"List of changed file paths.",items:{type:"string"},type:"array"}},required:["files"],title:"DiffContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hh,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitContextSymbolV1:gg,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:_S,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:bN,TokenBudgetSectionV1:bz},$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."},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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:yP},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:yP,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:yD,FactFeedbackActionV1:yF,FactId:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactFeedbackActionV1:yF,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:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,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:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,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:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:_d,RunId:vN},$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:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactFeedbackActionV1:yF,FactFeedbackDetailsAvailabilityV1:{enum:["available","redacted","unknown"],type:"string"},FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,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:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yD,FactId:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,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:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yD,FactId:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,ProjectId:_1},$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:yW,FactEventId:yD,FactId:yL,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:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:fS,CodeGenerationId:hg,CommitId:hI,DiagnosticSeverityV1:yS,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:y1,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:y0,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,FeedbackCycleTerminationV1:y6,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackDurabilityV1:y8,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingV1:gr,FeedbackImpactStateV1:gi,FeedbackImpactV1:go,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:fS,CodeGenerationId:hg,CommitId:hI,DiagnosticSeverityV1:yS,FeedbackAdvisoryProviderStateV1:y1,FeedbackBaselineStateV1:y0,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,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:y6,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackDurabilityV1:y8,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingV1:gr,FeedbackImpactStateV1:gi,FeedbackImpactV1:go,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:hI,DiagnosticSeverityV1:yS,FeedbackCycleId:y4,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingReadV1:gt,FeedbackFindingV1:gr,FeedbackResultId:gn,FeedbackScopeV1:ga,FileOccurrenceId:gd,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:hI,DiagnosticSeverityV1:yS,FeedbackCycleId:y4,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingReadV1:gt,FeedbackFindingV1:gr,FeedbackResultId:gn,FeedbackScopeV1:ga,FileOccurrenceId:gd,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{finding:{$ref:"#/$defs/FeedbackFindingReadV1"}},required:["finding"],title:"FeedbackGetResultV1",type:"object"},{$defs:{AgentInstanceId:fS,CodeGenerationId:hg,CommitId:hI,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,FeedbackImpactStateV1:gi,FeedbackImpactV1:go,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:hI,DiagnosticSeverityV1:yS,FeedbackCycleId:y4,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingReadV1:gt,FeedbackFindingV1:gr,FeedbackResultId:gn,FeedbackScopeV1:ga,FileOccurrenceId:gd,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:bK},$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:fS,CodeGenerationId:hg,CommitId:hI,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:ga,FileOccurrenceId:gd,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProjectId:_1,ProviderId:vt,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","incompatible_branch_worktree"],type:"string"},RefId:vl,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,UtcMicros:bK,WorktreeId:SH},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:gc},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexOmittedSourceV1:h$,CodeIndexOmittedSourcesV1:hS,CodeIndexSourceOmissionReasonV1:hk,CodeIndexStalenessStateV1:hw,FilesLayoutV1:gc,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:gm,GiniScopeV1:gf},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GiniMetricV1:gm,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:gf,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:gw,ManifestDigest:_d},$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:gw,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:gP,GitOidV1:gV,ManifestDigest:_d,UtcMicros:bK},$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:gh,GitChangeKindV1:{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"},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:g_,GitDegradationV1:gv,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:gb,GitHeadStateV1:g$,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:gk,GitIndexPreviewId:gw,GitOidV1:gV,GitOperationStateV1:gR,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:gF,HunkRefV1:gL,ManifestDigest:_d,RepositoryId:vg,UtcMicros:bK,WorktreeId:SH},$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:gV,GitSurfaceDiffScopeV1:gO},$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:gO},$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:gw,GitIndexTransactionOperationV1:gP,ManifestDigest:_d},$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:gh,GitCoverageV1:g_,GitDegradationV1:gv,GitFileModeV1:gb,GitHeadStateV1:g$,GitIndexEntryExpectationV1:gk,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:gw,GitIndexTransactionOperationV1:gP,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:gV,GitOperationStateV1:gR,HunkDirectionV1:gF,HunkRefV1:gL,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,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:bK,WorktreeId:SH},$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:b$,StackSignalId:bk},$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:f7,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:gV,ManifestDigest:_d,MechanicalIntegrationModeV1:_c,NativeIntegrationDirectionV1:_P,NativeIntegrationPreviewDispositionV1:_V,NativeIntegrationPreviewId:_R,NativeIntegrationTerminalOutcomeV1:_x,NativeIntegrationTransactionId:_j,NativeIntegrationUnavailabilityV1:_C,RefId:vl,StackDeliveryWatermarkId:b$,StackSignalId:bk,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:bK},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,CoverageCompleteness:ym,CoverageDomainState:yf,EvidenceCoverage:yj,EvidenceDomain:yC,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:_F,ResultProjection:vS,RetrievalOrder:vR,RetrievalRequestMeta:vq,TemporalModeV1:bE,UtcMicros:bK},$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:_d,UtcMicros:bK},$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:fG,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:hH,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveNotFoundV1:_B,PrimitiveSearchFreshnessV1:_J,PrimitiveSymbolLocationV1:_Q},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hf,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:gU,LcmContentRangeV1:gJ,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:g0,LcmSourceRefV1:g2,LcmStorageKindV1:g4,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:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalFreshnessV1:bO,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:gK,LcmConvergenceStateV1:gZ,LcmConvergenceV1:gQ,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:gX,LcmDoctorProjectionV1:gY,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx},$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:hf,HydrationStateResultV1:gU,LcmContentRangeV1:gJ,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:g1,LcmRetrievalOutcomeV1:g0,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:g2,LcmStorageKindV1:g4,LcmSummaryNodeV1:g9,LcmTemporalFieldsV1:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalFreshnessV1:bO,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:hf,HydrationStateResultV1:gU,LcmContentRangeV1:gJ,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:g1,LcmSourceRefV1:g2,LcmStorageKindV1:g4,LcmSummaryNodeV1:g9,LcmTemporalFieldsV1:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:_p,MessageTypeFilterV1:_u,RetainedTimeFilterV1:vP,TemporalModeV1:bE,UtcMicros:bK},$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"]},since:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"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"}]},until:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},worktree:{type:["string","null"]}},required:["query"],title:"LcmGrepRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hf,HydrationStateResultV1:gU,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:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:bE,UtcMicros:bK},$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:hf,HydrationStateResultV1:gU,LcmContentRangeV1:gJ,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:g4,LcmTemporalFieldsV1:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:gK,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:gZ,LcmConvergenceV1:gQ,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:gX,LcmDoctorProjectionV1:gY,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:vw,RetrievalWorkerStatusV1:vx},$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:_l,ProjectId:_1},$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:yN,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:_1},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{memory:{$ref:"#/$defs/MemoryStatusV1"}},required:["memory"],title:"MemoryStatusResultV1",type:"object"},{$defs:{MessageRelationshipScopeV1:_p,MessageTypeFilterV1:_u,ProjectId:_1,RetainedTimeFilterV1:vP},$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:hf,GitScopeV1:gT,HydrationStateResultV1:gU,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:vk,RetainedNextActionV1:{additionalProperties:!1,properties:{action:{type:"string"},kind:{type:"string"},reason:{type:"string"},tool:{type:"string"}},required:["kind","tool","action","reason"],type:"object"},RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,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:bi,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:bC,TemporalExplanationV1:bT,TemporalFreshnessV1:bO,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:bE,TemporalOmissionV1:bA,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:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:bR},$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:_j},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComplexityAnalysisV1:hj,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:_O,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveNotFoundV1:_B,PrimitiveSearchFreshnessV1:_J,PrimitiveSymbolLocationV1:_Q},$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:fw,AnalyticsModeV1:fP,ComparisonDispositionV1:hx,CostsReadModelV1:yp,CoverageStateV1:yh,LatencyDistributionReadModelV1:gB,MetricCalibrationV1:_m,MetricCohortV1:_f,MetricCoverageV1:_h,MetricEvidenceClassV1:_y,MetricProvenanceV1:_g,MetricSourceV1:__,MetricTemporalV1:_v,MetricUncertaintyV1:_b,MetricValueV1:_$,ObservabilityHorizonV1:_E,ObservatoryReadModelV1:_W,PerformanceComparisonReadModelV1:_L,ProviderLatencyReadModelV1:vr,RejectedArgumentAnalyticsV1:vu,RejectedArgumentErrorClassV1:vm,RejectedArgumentGroupV1:vf,RejectedArgumentNameV1:vh,RejectedArgumentSurfaceV1:vy},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{base_ref:{description:"Base branch or ref to compare against (default: detected repository\ndefault 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:"Cap the symbol, test, and module sections at about this many tokens.",format:"uint32",minimum:0,type:["integer","null"]},cursor:{description:"Authenticated continuation cursor returned by a previous page.",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 this page (default: 200, clamped to 1-500).",format:"uint32",minimum:0,type:["integer","null"]}},title:"PrContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hh,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ConfigSummaryKindV1:hO,ConfigSummaryV1:hE,GitCommitSubjectV1:{additionalProperties:!1,properties:{hash:{type:"string"},subject:{type:"string"}},required:["hash","subject"],type:"object"},GitComparedSymbolV1:gy,GitContextSymbolV1:gg,GitFileChangeStatusV1:{enum:["added","deleted","modified"],type:"string"},GitFileChangeV1:{additionalProperties:!1,properties:{path:{type:"string"},status:{$ref:"#/$defs/GitFileChangeStatusV1"}},required:["path","status"],type:"object"},GitReadCompleteV1:gI,GitReadPartialV1:gx,GitReadUnavailableV1:gj,GitToolErrorKindV1:gE,GitToolErrorV1:gA,GitToolFailureV1:gW,GitToolOperationV1:gM,MissingCoChangePartnerV1:_S,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"},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"},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"},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"},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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,PrimitiveUnavailableEvidenceV1:_X,PrimitiveUnavailableStatusV1:_Y,SymbolChangesUnavailableV1:bw,TokenBudgetCutV1:bN,TokenBudgetSectionV1:bz},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/PrContextCompleteV1"},{$ref:"#/$defs/PrContextSymbolsUnavailableV1"},{$ref:"#/$defs/PrContextGraphPendingV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"PrContextResultV1"},{$defs:{BranchStackEdgeV1:f9,BranchStackId:f5,BranchStackNodeV1:f8,BranchStackRevisionId:f7,BranchStackRevisionV1:he,BranchStackSourceV1:ht,CommitId:hI,ManifestDigest:_d,MechanicalIntegrationModeV1:_c,NativeIntegrationDirectionV1:_P,NativeIntegrationSealedStackSnapshotV1:_q,NativeIntegrationSelectionBindingV1:_I,ProjectId:_1,RefId:vl,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,StackNodeId:bS,WorktreeId:SH,WorktreeInventoryEpoch:SG,WorktreeInventorySnapshotId:SB},$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:vi},$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:_0,ProjectRegistrySummary:_2,ProjectRepoGroup:_4,PublicCodeProject:vi},$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:_F},$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:bR},$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:va,RankEdgeKindV1:vs},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,RankDirectionV1:va,RankEdgeKindV1:vs,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:hI,ProjectId:_1,ProviderId:vt,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:vg,SimilarMatchClassV1:bs},$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:hg,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ManifestDigest:_d,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,ProjectId:_1,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:vg,SimilarFamilyV1:ba,SimilarMatchClassV1:bs,SimilarOccurrenceV1:bd,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:f0,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:yw,ProjectionGenerationId:_6,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:bK},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveNotFoundV1:_B,PrimitiveSearchFreshnessV1:_J,PrimitiveSymbolLocationV1:_Q,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:_d,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:ha,CancellationStage:hs,Deadline:yb,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:_N,OperationReceipt:_z,OperationTermination:_D,UtcMicros:bK},$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:yw,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 legacy\n`core_doctor` checks (graph quick-check, temporal/migration health,\nconfiguration compatibility drift, 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:"pending_schema_migration",description:"A store whose historical schema convergence has not completed: the\nmigrations whose cost scales with store size are still pending, still\nrunning, or stopped on a failure. The daemon serves while they run, so\nthis is the surface that says which store is still migrating 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:vz,SchemaConvergenceProgressV1:vD,SchemaConvergenceStageV1:vF,SchemaConvergenceStateV1:vL,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:bK},$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:fW,CalibrationProfileId:ho,CandidateContribution:hd,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComponentRevision:hC,ContextLexicalAnchorV1:hL,DaemonServiceUnitObservationV1:yv,DiagnosticsSearchedTsconfigV1:yk,EvidenceRole:yT,ExactClass:yO,FileOccurrenceId:gd,FixedPointScore:gl,FreshnessCompatibilityV1:gp,FusedCandidate:gu,LexicalAnchorDropReasonV1:g8,LexicalAnchorDropV1:g7,LogicalCopyClusterId:_t,LogicalEvidenceId:_r,OccurrenceProvenance:_M,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveLaneCompleteV1:_G,PrimitiveRecallV1:_K,PrimitiveSearchFreshnessV1:_J,PrimitiveUnavailableEvidenceV1:_X,PrimitiveUnavailableStatusV1:_Y,RankingDecision:vd,RankingDecisionKind:vc,RepositoryId:vg,RetrievalAnchorId:vV,RetrievalSourceRoleV1:vI,RetrieverKind:vj,ScoreDomainId:v1,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:v5,SourceFreshness:bf,SourceInstanceKey:bh,SourceNamespace:bg,SourceOccurrenceId:b_,UtcMicros:bK},$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:_F,ResultProjection:vS,RetrievalOrder:vR,RetrievalRequestMeta:vq,SessionId:v9,TemporalModeV1:bE,UtcMicros:bK},$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:vV},$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:bE,UtcMicros:bK},$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:hf,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionRefreshFrontierResultV1:v8,SessionRefreshProgressV1:v7,SessionRefreshReceiptV1:be,SessionRefreshTerminalStateResultV1:bt,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalModeV1:bE,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:hf,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionRefreshFrontierResultV1:v8,SessionRefreshProgressV1:v7,SessionRefreshReceiptV1:be,SessionRefreshTerminalStateResultV1:bt,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalModeV1:bE,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:hf,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionRefreshFrontierResultV1:v8,SessionRefreshProgressV1:v7,SessionRefreshReceiptV1:be,SessionRefreshTerminalStateResultV1:bt,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalModeV1:bE,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:vP,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:vw,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:_O,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:_1,RepositoryId:vg,SimilarMatchClassV1:bs,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:bv,SymbolOccurrenceId:bV},$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:hg,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ManifestDigest:_d,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,ProjectId:_1,RepositoryId:vg,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:ba,SimilarMatchClassV1:bs,SimilarOccurrenceV1:bd,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:_s},$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:fG,ManagedSkillMaterializationScope:_i,ManagedSkillMetadata:_o,ManagedSkillProvenance:_n,ManagedSkillSource:_a,ManagedSkillState:_s,SkillImprovementRecommendation:bc,SkillInstallTarget:bl,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:bp,SkillUsageRecord:bu},$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:fG,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:_i,ManagedSkillMetadata:_o,ManagedSkillProvenance:_n,ManagedSkillSource:_a,ManagedSkillState:_s,ManagedSupportFile:{properties:{bytes:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},path:{type:"string"}},required:["path","bytes"],type:"object"},SkillImprovementRecommendation:bc,SkillInstallTarget:bl,SkillStaleRecommendation:bp,SkillSupportFileSummaryV1:{additionalProperties:!1,properties:{byte_len:{format:"uint",minimum:0,type:"integer"},path:{type:"string"}},required:["path","byte_len"],type:"object"},SkillUsageRecord:bu},$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:_d,UseCaseId:bG},$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:gd,PageRequest:_F,ResultProjection:vS,RetrievalOrder:vR,RetrievalRequestMeta:vq,SourceSpan:bv,TemporalModeV1:bE,UtcMicros:bK},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,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"],title:"SourceLinesRequest",type:"object"},{$defs:{RetrievalAnchorId:vV,SourceReference:{additionalProperties:!1,properties:{anchor:{$ref:"#/$defs/RetrievalAnchorId"},span:{$ref:"#/$defs/SourceSpan"}},required:["anchor","span"],type:"object"},SourceSpan:bv},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{body:{type:["string","null"]},file:{type:["string","null"]},references:{items:{$ref:"#/$defs/SourceReference"},type:"array"}},required:["references"],title:"SourceLinesResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],title:"SourceOutlinePrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bR},$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:f9,BranchStackId:f5,BranchStackNodeV1:f8,BranchStackRevisionId:f7,CommitId:hI,ManifestDigest:_d,NativeIntegrationDirectionV1:_P,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:_1,RefId:vl,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,StackNodeId:bS,WorktreeId:SH,WorktreeInventoryEpoch:SG,WorktreeInventorySnapshotId:SB},$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:hv,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:hb,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:h$,CodeIndexOmittedSourcesV1:hS,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:hk,CodeIndexStalenessStateV1:hw,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:{default:!1,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","coverage"],type:"object"},LcmConvergenceStateV1:gZ,LcmConvergenceV1:gQ,LcmDoctorProjectionStateV1:gX,LcmDoctorProjectionV1:gY,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:vx,SchemaConvergenceFindingV1:vz,SchemaConvergenceProgressV1:vD,SchemaConvergenceStageV1:vF,SchemaConvergenceStateV1:vL,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 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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:ha,CancellationStage:hs,CodeGenerationId:hg,CommitId:hI,Deadline:yb,OperationBudgetUsage:_N,OperationReceipt:_z,OperationTermination:_D,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:bK},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComplexityAnalysisV1:hj,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:bH},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,CoverageCompleteness:ym,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:bH,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:gT,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,UtcMicros:bK,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:f$,TaskId:bj},$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:_d,TaskId:bj,UtcMicros:bK},$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:y7,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:_d,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:bj,UtcMicros:bK},$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:y7,HandoffOpenReceiptV1:gN,InvestigationHandoffSurfaceV1:{additionalProperties:!1,properties:{finding_id:{$ref:"#/$defs/FeedbackFindingId"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"}},required:["finding_id","owner_version_digest"],type:"object"},ManifestDigest:_d,UtcMicros:bK},$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:gN,ManifestDigest:_d,TaskHandoffSurfaceV1:{additionalProperties:!1,properties:{task_id:{$ref:"#/$defs/TaskId"},version:{format:"uint64",minimum:0,type:"integer"}},required:["task_id","version"],type:"object"},TaskId:bj,UtcMicros:bK},$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:_d,MultiRootContinuationV1:_k,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:vE,RootScopeOutcomeV1_for_Nullable_RootGenerationV1:vA,RootScopeOutcomeV1_for_Nullable_string:vW,ScopeOutcome_for_Nullable_RootGenerationV1:vB,ScopeOutcome_for_Nullable_string:vK,ScopePartialReasonV1:vJ,ScopeSetId:vZ,ScopeSetRevision:vQ,ScopeUnavailableReasonV1:vY},$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:_d,MultiRootContinuationV1:_k,RootGenerationV1:vE,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:vA,RootScopeOutcomeV1_for_Nullable_string:vW,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:vB,ScopeOutcome_for_Nullable_string:vK,ScopePartialReasonV1:vJ,ScopeSetId:vZ,ScopeSetRevision:vQ,ScopeUnavailableReasonV1:vY},$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:_1,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:vZ,ScopeSetRevision:vQ},$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:f$,AuthorizedRoot:fz,AuthorizedScopeSet:fD,BrainId:f0,ManifestDigest:_d,MultiRootScopeSetCasStatusV1:{enum:["applied","conflict"],type:"string"},ProjectId:_1,RefId:vl,RegisteredRootLocatorV1:vp,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,SharedProfileStoreLocatorV1:bn,UserProfileId:bB,WorktreeId:SH},$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:vZ},$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:f$,AuthorizedRoot:fz,AuthorizedScopeSet:fD,BrainId:f0,ManifestDigest:_d,ProjectId:_1,RefId:vl,RegisteredRootLocatorV1:vp,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,SharedProfileStoreLocatorV1:bn,UserProfileId:bB,WorktreeId:SH},$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:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkCommandId:$c,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:f$,AttemptId:fM,BrainId:f0,CatalogGenerationId:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkGraphChangeV1:$I,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductEventPayloadV1:$X,WorkProductEventV1:$Y,WorkProductGraphV1:$0,WorkProductProfileScopeV1:$6,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:fM,CoverageStateV1:yh,DuplicateEffectOutcomeV1:yV,DuplicateEffortKindV1:yR,ProjectionGenerationId:_6,QuantityEvidenceClassV1:vo,RunId:vN,TaskId:bj,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkDuplicateAdjudicationEvidenceV1:$p,WorkDuplicateAdjudicationQuantitiesV1:$u,WorkTopologyGenerationRefV1:ST},$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:f$,AttemptId:fM,CoverageStateV1:yh,DuplicateEffectOutcomeV1:yV,DuplicateEffortKindV1:yR,ManifestDigest:_d,ProjectionGenerationId:_6,QuantityEvidenceClassV1:vo,RunId:vN,TaskId:bj,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkCommandId:$c,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:$p,WorkDuplicateAdjudicationQuantitiesV1:$u,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:ST},$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:fM,RunId:vN,TaskId:bj,WorkAttemptIdentityV1:b2,WorkCommandId:$c},$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:fM,CoverageStateV1:yh,LeakOwnerClassV1:{enum:["work","workflow","git","delivery","unknown"],type:"string"},ManifestDigest:_d,RunId:vN,TaskId:bj,UtcMicros:bK,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:b2,WorkCommandId:$c,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:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RetrievalAnchorId:vV,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkCommandId:$c,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,AutomaticWorktreeGcV1:fL,BrainId:f0,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CatalogGenerationId:hu,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,RetrievalAnchorId:vV,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkGraphChangeV1:$I,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductEventPayloadV1:$X,WorkProductEventV1:$Y,WorkProductGraphV1:$0,WorkProductMutationReceiptV1:$4,WorkProductProfileScopeV1:$6,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementKindV1:$H,WorkPlacementTargetV1:$B},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,WorkPlacementStateV1:$G,WorkPlacementTargetV1:$B},$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:hI,RefId:vl,WorkEffectStateV1:$m,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:$M,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:$H,WorkPlacementTargetV1:$B,WorkflowOutputName:SN},$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:f$,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:fW,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:fM,AutomaticWorktreeGcV1:fL,BrainId:f0,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CancellationStage:hs,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CatalogGenerationId:hu,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CoverageCompleteness:ym,CoverageDomainState:yf,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DaemonServiceUnitObservationV1:yv,DiagnosticsSearchedTsconfigV1:yk,EffectClass:yq,EffectReceipt:yI,EffectTermination:yx,EvidenceCoverage:yj,EvidenceDomain:yC,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,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:_e,ManifestDigest:_d,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:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,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:v$,RetrievalAnchorId:vV,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:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,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:v0,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UseCaseId:bG,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkCommandId:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkGraphChangeV1:$I,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,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:$M,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:$N,WorkLeaseId:$z,WorkMilestoneV1:$D,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,WorkPlacementStateV1:$G,WorkPlacementTargetV1:$B,WorkPlacementV1:$K,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductEventPayloadV1:$X,WorkProductEventV1:$Y,WorkProductGraphV1:$0,WorkProductMutationReceiptV1:$4,WorkProductProfileScopeV1:$6,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRestartReasonV1:Sp,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,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:SV,WorkSynthesisRefusalV1:SR,WorkSynthesisSourceEnvelopeV1:Sq,WorkSynthesisSourceOutcomeV1:SI,WorkSynthesisSourceSetV1:Sx,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowSynthesisDraft:SL,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,RunId:vN,TaskId:bj},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,RunId:vN,TaskId:bj,UtcMicros:bK,WorkCancellationRequestId:$a},$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:_d,ProjectId:_1,RepositoryId:vg,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,ManifestDigest:_d,ProposalId:_3,ProviderId:vt,RetrievalAnchorId:vV,RunId:vN,TaskEvidenceLinkV1:bI,TaskId:bj,UtcMicros:bK,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:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkItemInputV1:$A,WorkItemV1:$W,WorkProductRelationV1:$3,WorkProposalComparisonEffectV1:{oneOf:[{const:"advisory_only",description:"Comparison is evidence only. There is no apply edge from this result.",type:"string"}]},WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:f$,AttemptId:fM,CatalogGenerationId:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy},$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:b6},$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:fM,ManifestDigest:_d,RunId:vN,TaskId:bj,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptStateV1:b7,WorkEffectStateV1:$m,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:_d,ProjectId:_1,RepositoryId:vg,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkExpertiseCategoryV1:$w,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProposalId:_3,ProviderId:vt,RetrievalAnchorId:vV,RunId:vN,SessionId:v9,TaskEvidenceLinkV1:bI,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptEvidenceRecordV1:b0,WorkAttemptIdentityV1:b2,WorkAttemptProviderOutcomeV1:b5,WorkAttemptReceiptV1:b8,WorkAttemptStreamChannelV1:$e,WorkAttemptStreamSummaryV1:$t,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:$w,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:$T,WorkHierarchyV1:$O,WorkItemInputV1:$A,WorkItemV1:$W,WorkProviderAvailabilityV1:Sr,WorkProviderBackendV1:Si,WorkProviderFallbackRecordV1:So,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy},$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:_d,ProjectId:_1,ProposalId:_3,RepositoryId:vg,TaskId:bj,UtcMicros:bK,WorkEvidenceFrontierV1:$g,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductSelectionScopeV1:$5},$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:hN,ManifestDigest:_d,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:_3,ProviderId:vt,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,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:$g,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:$F,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:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,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:Sy,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:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,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:b6},$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:fM,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProviderId:vt,RunId:vN,SessionId:v9,TaskId:bj,UtcMicros:bK,WorkArtifactId:bY,WorkArtifactRefV1:b1,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:b0,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:b2,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptProviderOutcomeV1:b5,WorkAttemptStreamChannelV1:$e,WorkAttemptStreamSummaryV1:$t,WorkAttemptTopologyBindingV1:$r,WorkProviderAvailabilityV1:Sr,WorkProviderBackendV1:Si,WorkProviderFallbackRecordV1:So,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptTopologyBindingV1:$r,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:f$,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:fM,CatalogGenerationId:hu,ConfigurationRevisionId:hN,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:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RecordWorkHandoffRequestV1:{additionalProperties:!1,properties:{handoff:{$ref:"#/$defs/WorkHandoffV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","handoff","mutation"],type:"object"},RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductGraphV1:$0,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:vN,TaskId:bj,UtcMicros:bK,WorkRunControlReasonV1:Sv},$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:fM,RunId:vN,TaskId:bj,UtcMicros:bK,WorkRunControlAuthorityV1:S_,WorkRunControlReasonV1:Sv,WorkRunControlStateV1:Sb,WorkRunDeadlineCheckpointV1:S$},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementKindV1:$H,WorkPlacementTargetV1:$B},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,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:$B},$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:vN,TaskId:bj},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,WorkPlacementStateV1:$G,WorkPlacementTargetV1:$B,WorkPlacementV1:$K},$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:fM,CoverageStateV1:yh,DuplicateEffectOutcomeV1:yV,DuplicateEffortKindV1:yR,QuantityEvidenceClassV1:vo,RunId:vN,TaskId:bj,WorkAttemptIdentityV1:b2,WorkDuplicateAdjudicationQuantitiesV1:$u},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,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:$Q,WorkProductSelectionScopeV1:$5,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:vN,TaskId:bj,UtcMicros:bK},$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:bK},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:vN,TaskId:bj,UtcMicros:bK,WorkRunControlReasonV1:Sv},$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:fM,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProjectId:_1,ProviderId:vt,RepositoryId:vg,RunId:vN,SessionId:v9,TaskId:bj,TemporalModeV1:bE,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAttemptIdentityV1:b2,WorkEvidenceContinuationV1:$y,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:$Z,WorkProductSelectionScopeV1:$5,WorkTaskSessionContinuationV1:Sj},$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:f$,AttemptId:fM,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProposalId:_3,ProviderId:vt,RetrievalAnchorId:vV,RunId:vN,SessionId:v9,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:br,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:bI,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,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:bY,WorkArtifactRefV1:b1,WorkAttemptEvidenceRecordV1:b0,WorkAttemptIdentityV1:b2,WorkAttemptProviderOutcomeV1:b5,WorkAttemptReceiptV1:b8,WorkAttemptStreamChannelV1:$e,WorkAttemptStreamSummaryV1:$t,WorkEvidenceContinuationV1:$y,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:$T,WorkHierarchyV1:$O,WorkItemInputV1:$A,WorkItemV1:$W,WorkProductRelationV1:$3,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderAvailabilityV1:Sr,WorkProviderBackendV1:Si,WorkProviderFallbackRecordV1:So,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTaskSessionContinuationV1:Sj,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:fM,RunId:vN,TaskId:bj,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkRetryCauseV1:Su,WorkRetryFailureSelectorV1:Sm,WorkRetrySourceV1:Sf},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,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:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,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:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkCommandId:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkRetryCauseV1:Su,WorkRetryFailureSelectorV1:Sm,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:Sf,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,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:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkCommandId:$c,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:vN,TaskId:bj},$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:fM,RunId:vN,TaskId:bj,UtcMicros:bK,WorkRunControlAuthorityV1:S_,WorkRunControlReasonV1:Sv,WorkRunControlStateV1:Sb,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:S$},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,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:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkAttemptIdentityV1:b2,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkSynthesisEvidenceGroupV1:SV,WorkSynthesisRefusalV1:SR,WorkSynthesisSourceEnvelopeV1:Sq,WorkSynthesisSourceOutcomeV1:SI,WorkSynthesisSourceSetV1:Sx,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowSynthesisDraft:SL,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:b6},$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:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,TaskId:bj,TopologyGatePolicyV1:bL,UtcMicros:bK,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptTopologyBindingV1:$r,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,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:$G,WorkPlacementTargetV1:$B,WorkPlacementV1:$K,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:SU,WorktreePlacementModeV1:SK},$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:_E},$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:yh,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:_m,MetricCohortV1:_f,MetricCoverageV1:_h,MetricEvidenceClassV1:_y,MetricProvenanceV1:_g,MetricSourceV1:__,MetricTemporalV1:_v,MetricUncertaintyV1:_b,MetricValueV1:_$,ObservabilityHorizonV1:_E},$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:_1,RepositoryId:vg,UtcMicros:bK,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:$Z,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,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:f0,ManifestDigest:_d,ProjectId:_1,ProjectionGenerationId:_6,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,TaskEvidenceLinkV1:bI,TaskId:bj,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,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:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,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:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductGraphV1:$0,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:$5,WorkProjectionSequenceV1:{format:"uint64",minimum:0,title:"WorkProjectionSequenceV1",type:"integer"},WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,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:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,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:SA},$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:bK,WorkflowDefinitionId:SA,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:vN,WorkCommandId:$c},$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:f$,AttemptId:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,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:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTopologyPolicyV1:SO,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,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:SM,WorkflowOutputArtifact:{additionalProperties:!1,properties:{artifact:{$ref:"#/$defs/WorkArtifactRefV1"},attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["attempt_identity","artifact"],type:"object"},WorkflowOutputName:SN,WorkflowOutputReference:Sz,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:SD,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:SF,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:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:SA},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/WorkflowDefinition"},title:"Array_of_WorkflowDefinition",type:"array"},{$defs:{WorkflowDefinitionId:SA},$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:SA,WorkflowStepId:SF},$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:SA},$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:_d,ProjectId:_1,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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:vN},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,WorkHandoffAttemptFrontierV1:$x,WorkHandoffFrontierV1:$j,WorkHandoffLineageV1:$C,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,WorkHandoffAttemptFrontierV1:$x,WorkHandoffFrontierV1:$j,WorkHandoffLineageV1:$C,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:f$,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,WorkHandoffAttemptFrontierV1:$x,WorkHandoffFrontierV1:$j,WorkHandoffLineageV1:$C,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:vN,WorkCommandId:$c},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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:SA},$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:vN,WorkCommandId:$c},$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:SA},$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:f$,AttemptId:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTopologyPolicyV1:SO,WorkflowDefinitionId:SA,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:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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=fr(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=fr(r,t)[i]}return fr(r,t)}(i,s.$ref),i,o,n),n.delete(s.$ref);return}if("const"in s&&(a=s.const,ft(t)!==ft(a)))throw TypeError(`${o} does not match the canonical constant`);if(Array.isArray(s.enum)&&!s.enum.some(e=>ft(t)===ft(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&&!fi(t,d))throw TypeError(`${o} must be ${d}`);if(Array.isArray(d)&&!d.some(e=>"string"==typeof e&&fi(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=ft(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?{}:fr(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 SX(e){let t=SQ[e];if(void 0===t)throw TypeError(`generated canonical schema ${e} is missing`);return t}let SY=[{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:SX(0),decodeResult:SX(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:SX(2),decodeResult:SX(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:SX(4),decodeResult:SX(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:SX(6),decodeResult:SX(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:SX(8),decodeResult:SX(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:SX(10),decodeResult:SX(11),decodeSuccess:e=>fu(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",SX(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:SX(12),decodeResult:SX(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:SX(14),decodeResult:SX(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:SX(16),decodeResult:SX(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:SX(17),decodeResult:SX(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:SX(19),decodeResult:SX(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:SX(21),decodeResult:SX(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:SX(23),decodeResult:SX(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:SX(25),decodeResult:SX(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:SX(27),decodeResult:SX(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:SX(29),decodeResult:SX(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:SX(31),decodeResult:SX(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:SX(33),decodeResult:SX(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:SX(35),decodeResult:SX(36),decodeSuccess:e=>fu(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",SX(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:SX(37),decodeResult:SX(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:SX(38),decodeResult:SX(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:SX(40),decodeResult:SX(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:SX(42),decodeResult:SX(43),decodeSuccess:e=>fu(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",SX(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:SX(44),decodeResult:SX(45),decodeSuccess:e=>fu(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",SX(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:SX(46),decodeResult:SX(47),decodeSuccess:e=>fu(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",SX(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:SX(48),decodeResult:SX(49),decodeSuccess:e=>fu(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",SX(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:SX(50),decodeResult:SX(51),decodeSuccess:e=>fu(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",SX(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:SX(52),decodeResult:SX(53),decodeSuccess:e=>fu(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",SX(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:SX(54),decodeResult:SX(55),decodeSuccess:e=>fu(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",SX(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:SX(46),decodeResult:SX(43),decodeSuccess:e=>fu(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",SX(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:SX(56),decodeResult:SX(57),decodeSuccess:e=>fu(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",SX(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:SX(58),decodeResult:SX(57),decodeSuccess:e=>fu(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",SX(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:SX(59),decodeResult:SX(60),decodeSuccess:e=>fu(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",SX(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:SX(46),decodeResult:SX(47),decodeSuccess:e=>fu(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",SX(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:SX(61),decodeResult:SX(62),decodeSuccess:e=>fu(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",SX(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:SX(63),decodeResult:SX(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:SX(65),decodeResult:SX(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:SX(67),decodeResult:SX(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:SX(69),decodeResult:SX(70),decodeSuccess:e=>fu(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",SX(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:SX(71),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(73),decodeResult:SX(74),decodeSuccess:e=>fu(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",SX(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:SX(75),decodeResult:SX(76),decodeSuccess:e=>fu(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",SX(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:SX(77),decodeResult:SX(78),decodeSuccess:e=>fu(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",SX(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:SX(79),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(80),decodeResult:SX(81),decodeSuccess:e=>fu(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",SX(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:SX(79),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(82),decodeResult:SX(81),decodeSuccess:e=>fu(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",SX(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:SX(83),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(84),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(85),decodeResult:SX(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:SX(87),decodeResult:SX(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:SX(89),decodeResult:SX(90),decodeSuccess:e=>fu(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",SX(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:SX(91),decodeResult:SX(92),decodeSuccess:e=>fu(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",SX(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:SX(89),decodeResult:SX(93),decodeSuccess:e=>fu(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",SX(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:SX(94),decodeResult:SX(95),decodeSuccess:e=>fu(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",SX(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:SX(96),decodeResult:SX(97),decodeSuccess:e=>fu(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",SX(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:SX(98),decodeResult:SX(99),decodeSuccess:e=>fu(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",SX(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:SX(100),decodeResult:SX(92),decodeSuccess:e=>fu(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",SX(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:SX(101),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(98),decodeResult:SX(102),decodeSuccess:e=>fu(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",SX(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:SX(101),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(89),decodeResult:SX(103),decodeSuccess:e=>fu(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",SX(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:SX(104),decodeResult:SX(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:SX(106),decodeResult:SX(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:SX(108),decodeResult:SX(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:SX(110),decodeResult:SX(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:SX(112),decodeResult:SX(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:SX(114),decodeResult:SX(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:SX(116),decodeResult:SX(117),decodeSuccess:e=>fu(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",SX(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:SX(118),decodeResult:SX(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:SX(120),decodeResult:SX(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:SX(122),decodeResult:SX(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:SX(124),decodeResult:SX(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:SX(126),decodeResult:SX(127),decodeSuccess:e=>fu(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",SX(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:SX(128),decodeResult:SX(129),decodeSuccess:e=>fu(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",SX(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:SX(130),decodeResult:SX(131),decodeSuccess:e=>fu(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",SX(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:SX(132),decodeResult:SX(133),decodeSuccess:e=>fu(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",SX(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:SX(134),decodeResult:SX(135),decodeSuccess:e=>fu(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",SX(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:SX(136),decodeResult:SX(137),decodeSuccess:e=>fu(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",SX(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:SX(138),decodeResult:SX(139),decodeSuccess:e=>fu(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",SX(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:SX(140),decodeResult:SX(141),decodeSuccess:e=>fu(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",SX(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:SX(142),decodeResult:SX(143),decodeSuccess:e=>fu(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",SX(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:SX(144),decodeResult:SX(145),decodeSuccess:e=>fu(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",SX(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:SX(146),decodeResult:SX(147),decodeSuccess:e=>fu(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",SX(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:SX(148),decodeResult:SX(149),decodeSuccess:e=>fu(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",SX(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:SX(150),decodeResult:SX(151),decodeSuccess:e=>fu(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",SX(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:SX(152),decodeResult:SX(153),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(154),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(155),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(156),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(157),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(158),decodeSuccess:e=>fu(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",SX(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:SX(159),decodeResult:SX(160),decodeSuccess:e=>fu(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",SX(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:SX(161),decodeResult:SX(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:SX(163),decodeResult:SX(164),decodeSuccess:e=>fu(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",SX(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:SX(165),decodeResult:SX(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:SX(167),decodeResult:SX(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:SX(169),decodeResult:SX(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:SX(171),decodeResult:SX(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:SX(173),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(175),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(176),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(177),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(178),decodeResult:SX(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:SX(180),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(181),decodeResult:SX(182),decodeSuccess:e=>fu(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",SX(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:SX(183),decodeResult:SX(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:SX(185),decodeResult:SX(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:SX(187),decodeResult:SX(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:SX(189),decodeResult:SX(190),decodeSuccess:e=>fu(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",SX(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:SX(191),decodeResult:SX(192),decodeSuccess:e=>fu(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",SX(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:SX(193),decodeResult:SX(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:SX(195),decodeResult:SX(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:SX(197),decodeResult:SX(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:SX(199),decodeResult:SX(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:SX(201),decodeResult:SX(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:SX(203),decodeResult:SX(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:SX(204),decodeResult:SX(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:SX(205),decodeResult:SX(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:SX(207),decodeResult:SX(208),decodeSuccess:e=>fu(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",SX(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:SX(209),decodeResult:SX(210),decodeSuccess:e=>fu(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",SX(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:SX(211),decodeResult:SX(212),decodeSuccess:e=>fu(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",SX(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:SX(213),decodeResult:SX(214),decodeSuccess:e=>fu(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",SX(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:SX(215),decodeResult:SX(216),decodeSuccess:e=>fu(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",SX(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:SX(217),decodeResult:SX(218),decodeSuccess:e=>fu(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",SX(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:SX(219),decodeResult:SX(220),decodeSuccess:e=>fu(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",SX(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:SX(221),decodeResult:SX(222),decodeSuccess:e=>fu(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",SX(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:SX(223),decodeResult:SX(224),decodeSuccess:e=>fu(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",SX(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:SX(225),decodeResult:SX(226),decodeSuccess:e=>fu(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",SX(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:SX(227),decodeResult:SX(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:SX(228),decodeResult:SX(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:SX(229),decodeResult:SX(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:SX(230),decodeResult:SX(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:SX(232),decodeResult:SX(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:SX(234),decodeResult:SX(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:SX(236),decodeResult:SX(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:SX(238),decodeResult:SX(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:SX(240),decodeResult:SX(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:SX(241),decodeResult:SX(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:SX(243),decodeResult:SX(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:SX(245),decodeResult:SX(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:SX(246),decodeResult:SX(247),decodeSuccess:e=>fu(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",SX(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:SX(248),decodeResult:SX(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:SX(250),decodeResult:SX(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:SX(252),decodeResult:SX(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:SX(254),decodeResult:SX(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:SX(256),decodeResult:SX(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:SX(258),decodeResult:SX(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:SX(259),decodeResult:SX(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:SX(260),decodeResult:SX(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:SX(262),decodeResult:SX(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:SX(264),decodeResult:SX(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:SX(266),decodeResult:SX(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:SX(268),decodeResult:SX(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:SX(270),decodeResult:SX(271),decodeSuccess:e=>fu(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",SX(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:SX(270),decodeResult:SX(272),decodeSuccess:e=>fu(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",SX(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:SX(270),decodeResult:SX(273),decodeSuccess:e=>fu(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",SX(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:SX(274),decodeResult:SX(275),decodeSuccess:e=>fu(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",SX(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:SX(112),decodeResult:SX(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:SX(277),decodeResult:SX(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:SX(279),decodeResult:SX(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:SX(281),decodeResult:SX(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:SX(283),decodeResult:SX(284),decodeSuccess:e=>fu(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",SX(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:SX(285),decodeResult:SX(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:SX(286),decodeResult:SX(287),decodeSuccess:e=>fu(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",SX(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:SX(288),decodeResult:SX(289),decodeSuccess:e=>fu(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",SX(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:SX(290),decodeResult:SX(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:SX(291),decodeResult:SX(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:SX(293),decodeResult:SX(294),decodeSuccess:e=>fu(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",SX(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:SX(295),decodeResult:SX(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:SX(296),decodeResult:SX(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:SX(298),decodeResult:SX(299),decodeSuccess:e=>fu(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",SX(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:SX(300),decodeResult:SX(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:SX(302),decodeResult:SX(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:SX(304),decodeResult:SX(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:SX(306),decodeResult:SX(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:SX(308),decodeResult:SX(309),decodeSuccess:e=>fu(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",SX(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:SX(310),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(311),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(312),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(313),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(314),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(315),decodeResult:SX(316),decodeSuccess:e=>fu(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",SX(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:SX(317),decodeResult:SX(318),decodeSuccess:e=>fu(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",SX(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:SX(319),decodeResult:SX(320),decodeSuccess:e=>fu(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",SX(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:SX(321),decodeResult:SX(322),decodeSuccess:e=>fu(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",SX(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:SX(323),decodeResult:SX(324),decodeSuccess:e=>fu(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",SX(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:SX(325),decodeResult:SX(326),decodeSuccess:e=>fu(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",SX(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:SX(327),decodeResult:SX(328),decodeSuccess:e=>fu(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",SX(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:SX(329),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(331),decodeResult:SX(332),decodeSuccess:e=>fu(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",SX(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:SX(333),decodeResult:SX(334),decodeSuccess:e=>fu(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",SX(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:SX(335),decodeResult:SX(336),decodeSuccess:e=>fu(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",SX(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:SX(337),decodeResult:SX(338),decodeSuccess:e=>fu(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",SX(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:SX(339),decodeResult:SX(340),decodeSuccess:e=>fu(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",SX(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:SX(341),decodeResult:SX(342),decodeSuccess:e=>fu(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",SX(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:SX(343),decodeResult:SX(342),decodeSuccess:e=>fu(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",SX(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:SX(344),decodeResult:SX(345),decodeSuccess:e=>fu(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",SX(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:SX(346),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(347),decodeResult:SX(348),decodeSuccess:e=>fu(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",SX(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:SX(349),decodeResult:SX(350),decodeSuccess:e=>fu(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",SX(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:SX(351),decodeResult:SX(352),decodeSuccess:e=>fu(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",SX(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:SX(353),decodeResult:SX(354),decodeSuccess:e=>fu(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",SX(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:SX(347),decodeResult:SX(355),decodeSuccess:e=>fu(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",SX(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:SX(356),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(357),decodeResult:SX(358),decodeSuccess:e=>fu(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",SX(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:SX(359),decodeResult:SX(360),decodeSuccess:e=>fu(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",SX(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:SX(361),decodeResult:SX(362),decodeSuccess:e=>fu(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",SX(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:SX(363),decodeResult:SX(331),decodeSuccess:e=>fu(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",SX(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:SX(364),decodeResult:SX(356),decodeSuccess:e=>fu(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",SX(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:SX(365),decodeResult:SX(338),decodeSuccess:e=>fu(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",SX(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:SX(366),decodeResult:SX(367),decodeSuccess:e=>fu(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",SX(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:SX(368),decodeResult:SX(358),decodeSuccess:e=>fu(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",SX(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:SX(369),decodeResult:SX(370),decodeSuccess:e=>fu(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",SX(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:SX(371),decodeResult:SX(372),decodeSuccess:e=>fu(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",SX(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:SX(373),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(374),decodeResult:SX(375),decodeSuccess:e=>fu(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",SX(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:SX(376),decodeResult:SX(342),decodeSuccess:e=>fu(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",SX(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:SX(377),decodeResult:SX(378),decodeSuccess:e=>fu(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",SX(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:SX(379),decodeResult:SX(380),decodeSuccess:e=>fu(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",SX(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:SX(381),decodeResult:SX(382),decodeSuccess:e=>fu(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",SX(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:SX(383),decodeResult:SX(384),decodeSuccess:e=>fu(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",SX(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:SX(385),decodeResult:SX(386),decodeSuccess:e=>fu(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",SX(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:SX(387),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(389),decodeResult:SX(390),decodeSuccess:e=>fu(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",SX(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:SX(391),decodeResult:SX(392),decodeSuccess:e=>fu(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",SX(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:SX(393),decodeResult:SX(394),decodeSuccess:e=>fu(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",SX(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:SX(395),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(396),decodeResult:SX(397),decodeSuccess:e=>fu(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",SX(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:SX(398),decodeResult:SX(399),decodeSuccess:e=>fu(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",SX(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:SX(400),decodeResult:SX(390),decodeSuccess:e=>fu(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",SX(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:SX(401),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(402),decodeResult:SX(394),decodeSuccess:e=>fu(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",SX(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:SX(403),decodeResult:SX(386),decodeSuccess:e=>fu(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",SX(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:SX(404),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(405),decodeResult:SX(386),decodeSuccess:e=>fu(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",SX(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:SX(406),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(407),decodeResult:SX(408),decodeSuccess:e=>fu(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",SX(408))}],S1=new TextEncoder;class S0 extends Error{cause;constructor(e,t){super(e),this.name=new.target.name,this.cause=t}}class S2 extends S0{constructor(e){super("the caller aborted the request",e)}}class S4 extends S0{}class S6 extends S0{status;constructor(e){super(401===e?"the daemon rejected HTTP authentication":"the daemon rejected the HTTP origin"),this.status=e}}class S3 extends Error{status;payload;constructor(e,t={}){super(e),this.name=new.target.name,this.status=t.status,this.payload=t.payload}}class S9 extends S3{}class S5 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 S8 extends S5{}class S7 extends S5{}class ke extends S5{}class kt extends S5{}class kr extends S5{}class ki extends S5{}class ko extends S5{}class kn extends S5{}class ka extends S5{}class ks extends S5{}class kd extends S5{}let kc=new Set(["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"]),kl=new TextEncoder;function kp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ku(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function km(e){return"number"==typeof e&&Number.isSafeInteger(e)}function kf(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&kl.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}function kh(e,t){let r=e.headers.get("content-type");return null!==r&&r.split(";",1)[0]?.trim().toLowerCase()===t}function ky(e){return!!kp(e)&&!!km(e.started_at)&&!!km(e.ended_at)&&!(e.ended_at{let o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e),n=()=>{clearTimeout(o),i(new S2(t?.reason))};t?.addEventListener("abort",n,{once:!0})})}async function*kb(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=kl.encode(p).byteLength,m=[],f=0,h=!1,y=()=>new S9("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 S9("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=kl.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 S4("operation stream ended with an incomplete SSE event")}catch(e){if(e instanceof S3||e instanceof S0)throw e;throw new S4("operation stream transport was interrupted",e)}finally{i.releaseLock()}}class k${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 S3("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 SY)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 S3("page size must be an integer between 1 and 1000");if(t?.cursor!==void 0&&!kf(t.cursor,4096))throw new S3("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(!kf(e,512))throw new S3("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 S2(r.reason);throw new S4(`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 S2(i.reason);if(401===e.status||403===e.status)throw new S6(e.status);if(!kh(e,"application/json"))throw new S9("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 S2(i.reason);if(void 0!==o){let e=new TextDecoder;for(;;){let{done:t,value:r}=await o.read();if(i?.aborted)throw new S2(i.reason);if(t)break;n+=e.decode(r,{stream:!0})}n+=e.decode()}a=!0}catch(e){if(i?.aborted)throw new S2(i.reason);throw new S4("transport failure reading the daemon response body",e)}let s=kg(n,e.status);if(kp(s)&&"problem"===s.kind){var c;let i=s.value;if(!function(e){var t,r,i;if(!fm(e)||void 0!==e.binding_id&&"string"!=typeof e.binding_id||!(fm(t=e.contract)&&fy(t.schema_id,512)&&ff(t.schema_revision)&&t.schema_revision>0)||!fy(e.request_id,512)||!fm(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||f_(o.diagnostic))&&"detail"in o&&(null===o.detail||function(e){if(!fm(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 ff(e.requested)&&ff(e.committed)&&ff(e.active);case"stale_precondition":return"string"==typeof e.field&&ff(e.requested)&&ff(e.current);case"lock_deadline":return"string"==typeof e.resource&&ff(e.deadline_ms);case"diagnostics_unsupported":return(null===e.file||"string"==typeof e.file)&&Array.isArray(e.searched)&&e.searched.every(e=>fm(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 ff(e.retry_after_millis);case"reset_required":return"string"==typeof e.authority&&(null===e.found_version||fh(e.found_version))&&(null===e.required_version||fh(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||ff(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&&fy(o.trace_id,512)&&Array.isArray(o.details)&&o.details.every(f_)&&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,fm(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 S9("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 S9("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 S8(e,t);case"unavailable":return new S7(e,t);case"unsupported":return new ke(e,t);case"stale":return new kt(e,t);case"conflict":return new kr(e,t);case"partial_effect":return new ki(e,t);case"reset_required":return new ko(e,t);case"saturated":return new kn(e,t);case"cancelled":return new ka(e,t);case"timed_out":return new ks(e,t);case"invalid_request":return new kd(e,t);default:return new S5(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 S3(`${e.operation} does not accept HTTP transport options`);if(void 0===this.mcp)throw new S0(`${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 S2(r.signal.reason??t);throw new S0(`MCP tool ${e.transport.toolName} failed`,t)}try{return e.decodeResult(t)}catch(r){throw new S9(`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 S3(`${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&&S1.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 S3(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(!kp(m)||"success"!==m.kind)throw new S9("the daemon returned an unknown HTTP envelope",{status:u.status,payload:m});if(!u.ok)throw new S9("the daemon returned success with a failing HTTP status",{status:u.status,payload:m});try{let t=e.decodeSuccess(m.value);if(!(kp(t)&&kp(t.outcome)&&kp(t.outcome.value)&&"payload"in t.outcome.value&&ky(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(!fm(e)||!fm(t)||!fm(t.outcome))return!1;let r=t.outcome,i=fm(r.value)?r.value.payload:void 0;if("effect"!==r.outcome||!fm(i)||!fy(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!!ff(o)&&!(o<1)&&!(o>1e3)&&!!ff(n)&&!(n>1e6)&&!!await async function(e){return!!fm(e)&&"project_id,reference,repository_id,scope_digest,worktree_id"===Object.keys(e).sort().join(",")&&!!fy(e.project_id,512)&&!!fy(e.repository_id,512)&&!!fy(e.worktree_id,512)&&(null===e.reference||!!fy(e.reference,512))&&e.scope_digest===await fg(["tracedecay.application.scope.v1",e.project_id,e.repository_id,e.worktree_id,e.reference])}(t.scope)&&i.request_digest===await fg(["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 S9(`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(!ku(e))throw new S3(`${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 S3(`${t} must be unsigned decimal`);if(r<0n||r>0xffffffffffffffffn)throw new S3(`${t} exceeds the canonical u64 range`);return r.toString()}(t.resume.nextSequence,"resume nextSequence");if(void 0!==r&&!kf(r,4096))throw new S3("resumeToken is not a canonical stream resume token");let o=t.maxReconnects??0;if(!Number.isSafeInteger(o)||o<0)throw new S3("maxReconnects must be a non-negative integer");let n=0,a=void 0===i||"0"===i?void 0:(BigInt(i)-1n).toString(),s=0;for(;;){let d;if(t.signal?.aborted)throw new S2(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 S4))throw e;n+=1,await kv(s,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 S9("the daemon did not open an SSE stream",{status:d.status});if(!kh(d,"text/event-stream"))throw new S9("the daemon opened an operation stream with an invalid media type",{status:d.status});try{for await(let t of kb(d.body)){void 0!==t.retryDelayMs&&(s=t.retryDelayMs);let o=function(e,t,r){let i=kg(e.data,t);if(!kp(i)||"string"!=typeof i.event||i.event!==e.event||!kp(i.data))throw new S9("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||!kp(e)||!ku(e.next_sequence)||!ku(e.retained_from_sequence)||null!==e.resume_token&&"string"!=typeof e.resume_token)throw new S9("the daemon returned a malformed SSE open frontier",{status:t,payload:i});return{event:{...i,event:o,data:n},frontier:{nextSequence:String(e.next_sequence),..."string"==typeof e.resume_token?{resumeToken:e.resume_token}:{}}}}if(!ku(n.sequence)||null===e.id)throw new S9("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 S9("the SSE event ID does not match its canonical sequence",{status:t,payload:i});if("item"===o&&!("item"in n))throw new S9("the SSE item payload is missing",{status:t,payload:i});if("progress"===o&&(!ku(n.completed)||null!==n.total&&!ku(n.total)))throw new S9("the SSE progress payload is malformed",{status:t,payload:i});if("resume_gap"===o){let e=n.gap;if(!kp(e)||!ku(e.first_missing_sequence)||!ku(e.last_missing_sequence)||e.first_missing_sequence!==n.sequence||e.first_missing_sequence>e.last_missing_sequence||!kp(e.frontier)||!ku(e.frontier.next_sequence)||!ku(e.frontier.retained_from_sequence)||null!==e.frontier.resume_token&&"string"!=typeof e.frontier.resume_token)throw new S9("the SSE resume gap is malformed",{status:t,payload:i})}if(kc.has(o)){let e=n.terminal;if(!kp(e)||!ky(e.receipt))throw new S9("the SSE terminal event is malformed",{status:t,payload:i});if(e.termination!==o||e.receipt.termination!==o)throw new S9("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:{nextSequence:(BigInt(e.last_missing_sequence)+1n).toString(),..."string"==typeof t.resume_token?{resumeToken:t.resume_token}:{}}}}return{event:s,sequence:a}}(t,d.status,e);if(void 0!==o.frontier&&(i=o.frontier.nextSequence,r=o.frontier.resumeToken),void 0!==o.sequence){if(void 0!==a&&BigInt(o.sequence)<=BigInt(a))continue;let e=void 0===a?void 0:k_(a);if(void 0!==e&&o.sequence!==e)throw new S9("the daemon returned a non-contiguous SSE sequence",{status:d.status,payload:o.event});a=o.lastSequence??o.sequence,i=k_(a)}if(yield{event:t.event,id:o.sequence??null,data:o.event},kc.has(t.event))return}}catch(e){if(l=!0,e instanceof S3)throw e;if(t.signal?.aborted)throw new S2(t.signal.reason??e);if(n>=o){if(e instanceof S4)throw e;throw new S4(`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 S4("failed to close operation stream transport",e)}}if(n>=o)throw new S4(`operation stream ended before a terminal event after ${n} reconnects`);if(void 0===i||void 0===r)throw new S4("operation stream ended before exposing a resumable frontier");n+=1,await kv(s,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(!kp(i))throw new S9("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 S9("the daemon returned a malformed cancellation response",{status:r.status,payload:i});return{...i,status:o}}}function kS(e){let t=SY.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 kk=kS("project_list"),kw=kS("project_context");class kP{#u;constructor(e){this.#u=e}projectList(e,t){return this.#m(kk,e,t)}projectContext(e,t){return this.#m(kw,e,t)}async #m(e,t,r){let i,o=e.transport.toolName,n=e.decodeRequest(t);try{i=await this.#u(o,n,r)}catch(e){if(r?.aborted)throw new S2(r.reason??e);throw new S0(`MCP tool ${o} failed`,e)}try{return e.decodeResult(i)}catch(t){throw new S9(`MCP tool ${o} returned an invalid ${e.operation} result`,{payload:{response:i,cause:t}})}}}var kV=Object.create,kR=Object.defineProperty,kq=Object.getOwnPropertyDescriptor,kI=Object.getOwnPropertyNames,kx=Object.getPrototypeOf,kj=Object.prototype.hasOwnProperty,kC=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let kT=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),kO=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),kE=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),kA=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),kW=Symbol.for("mcp.sdk.errorBrands");function kM(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,kW,{value:r,enumerable:!1,configurable:!0})}function kN(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,kW)){let r=t[kW];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 kN(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 kN(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",kM(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 kz=((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 kD=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return kN(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 kN(this,e)}constructor(e,t,r,i){super(t,i),this.code=e,this.data=r,this.name="SdkError",kM(this,new.target)}},kF=class extends kD{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 kL="2026-07-28",kU=[kL];function kH(e){return e.filter(e=>!(e>=kL))}function kG(e){return e.filter(e=>e>=kL)}function kB(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 kK=["task","inputRequests","requestState"];function kJ(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||kK.some(t=>t in e)?e:{...e,content:[]}}function kZ(){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=aa(()=>nL([o7(),nP(),nI(),nj(),nJ(o7(),e),nM(e)])),t=nJ(o7(),e),r=nL([o7(),nP().int()]),i=o7(),o=nz({ttl:nP().optional()}),n=nz({taskId:o7()}),c=(s=nz({_meta:(a=nD({progressToken:r.optional(),"io.modelcontextprotocol/related-task":n.optional()})).optional()})).extend({task:o.optional()}),l=nz({method:o7(),params:s.loose().optional()}),p=nz({_meta:a.optional()}),u=nz({method:o7(),params:p.loose().optional()}),m=nD({_meta:a.optional()}),f=nL([o7(),nP().int()]),h=m.strict(),y=p.extend({requestId:f.optional(),reason:o7().optional()}),g=u.extend({method:nY("notifications/cancelled"),params:y}),_=nz({src:o7(),mimeType:o7().optional(),sizes:nM(o7()).optional(),theme:nQ(["light","dark"]).optional()}),v=nz({icons:nM(_).optional()}),$=(b=nz({name:o7(),title:o7().optional()})).extend({...b.shape,...v.shape,version:o7(),websiteUrl:o7().optional(),description:o7().optional()}),S=nB(nz({applyDefaults:nI().optional()}),t),k=ad(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nB(nz({form:S.optional(),url:t.optional()}),t.optional())),w=nD({list:t.optional(),cancel:t.optional(),requests:nD({sampling:nD({createMessage:t.optional()}).optional(),elicitation:nD({create:t.optional()}).optional()}).optional()}),P=nD({list:t.optional(),cancel:t.optional(),requests:nD({tools:nD({call:t.optional()}).optional()}).optional()}),V=nz({experimental:nJ(o7(),t).optional(),sampling:nz({context:t.optional(),tools:t.optional()}).optional(),elicitation:k.optional(),roots:nz({listChanged:nI().optional()}).optional(),tasks:w.optional(),extensions:nJ(o7(),t).optional()}),R=s.extend({protocolVersion:o7(),capabilities:V,clientInfo:$}),q=l.extend({method:nY("initialize"),params:R}),I=nz({experimental:nJ(o7(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nz({listChanged:nI().optional()}).optional(),resources:nz({subscribe:nI().optional(),listChanged:nI().optional()}).optional(),tools:nz({listChanged:nI().optional()}).optional(),tasks:P.optional(),extensions:nJ(o7(),t).optional()}),x=m.extend({protocolVersion:o7(),capabilities:I,serverInfo:$,instructions:o7().optional()}),j=u.extend({method:nY("notifications/initialized"),params:p.optional()}),C=l.extend({method:nY("ping"),params:s.optional()}),T=nz({progress:nP(),total:n4(nP()),message:n4(o7())}),O=nz({...p.shape,...T.shape,progressToken:r}),E=u.extend({method:nY("notifications/progress"),params:O}),A=s.extend({cursor:i.optional()}),W=l.extend({params:A.optional()}),M=m.extend({nextCursor:i.optional()}),z=(N=nz({uri:o7(),mimeType:n4(o7()),_meta:nJ(o7(),nE()).optional()})).extend({text:o7()}),D=o7().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),F=N.extend({blob:D}),U=nz({audience:nM(L=nQ(["user","assistant"])).optional(),priority:nP().min(0).max(1).optional(),lastModified:ac({offset:!0}).optional()}),H=nz({...b.shape,...v.shape,uri:o7(),description:n4(o7()),mimeType:n4(o7()),size:n4(nP()),annotations:U.optional(),_meta:n4(nD({}))}),G=nz({...b.shape,...v.shape,uriTemplate:o7(),description:n4(o7()),mimeType:n4(o7()),annotations:U.optional(),_meta:n4(nD({}))}),B=W.extend({method:nY("resources/list")}),K=M.extend({resources:nM(H)}),J=W.extend({method:nY("resources/templates/list")}),Z=M.extend({resourceTemplates:nM(G)}),Q=s.extend({uri:o7()}),X=l.extend({method:nY("resources/read"),params:Q}),Y=m.extend({contents:nM(nL([z,F]))}),ee=u.extend({method:nY("notifications/resources/list_changed"),params:p.optional()}),et=l.extend({method:nY("resources/subscribe"),params:Q}),er=l.extend({method:nY("resources/unsubscribe"),params:Q}),ei=p.extend({uri:o7()}),eo=u.extend({method:nY("notifications/resources/updated"),params:ei}),en=nz({name:o7(),description:n4(o7()),required:n4(nI())}),ea=nz({...b.shape,...v.shape,description:n4(o7()),arguments:n4(nM(en)),_meta:n4(nD({}))}),es=W.extend({method:nY("prompts/list")}),ed=M.extend({prompts:nM(ea)}),ec=s.extend({name:o7(),arguments:nJ(o7(),o7()).optional()}),el=l.extend({method:nY("prompts/get"),params:ec}),ep=nz({type:nY("text"),text:o7(),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),eu=nz({type:nY("image"),data:D,mimeType:o7(),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),em=nz({type:nY("audio"),data:D,mimeType:o7(),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),ef=nz({type:nY("tool_use"),name:o7(),id:o7(),input:nJ(o7(),nE()),_meta:nJ(o7(),nE()).optional()}),eh=nz({type:nY("resource"),resource:nL([z,F]),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),e_=nz({role:L,content:eg=nL([ep,eu,em,ey=H.extend({type:nY("resource_link")}),eh])}),ev=m.extend({description:o7().optional(),messages:nM(e_)}),eb=u.extend({method:nY("notifications/prompts/list_changed"),params:p.optional()}),e$=nz({title:o7().optional(),readOnlyHint:nI().optional(),destructiveHint:nI().optional(),idempotentHint:nI().optional(),openWorldHint:nI().optional()}),eS=nz({taskSupport:nQ(["required","optional","forbidden"]).optional()}),ek=nz({...b.shape,...v.shape,description:o7().optional(),inputSchema:nz({type:nY("object"),properties:nJ(o7(),e).optional(),required:nM(o7()).optional()}).catchall(nE()),outputSchema:nz({type:nY("object"),properties:nJ(o7(),e).optional(),required:nM(o7()).optional()}).catchall(nE()).optional(),annotations:e$.optional(),execution:eS.optional(),_meta:nJ(o7(),nE()).optional()}),ew=W.extend({method:nY("tools/list")}),eP=M.extend({tools:nM(ek)}),eV=m.extend({content:nM(eg),structuredContent:nJ(o7(),nE()).optional(),isError:nI().optional()}),eR=c.extend({name:o7(),arguments:nJ(o7(),nE()).optional()}),eq=l.extend({method:nY("tools/call"),params:eR}),eI=u.extend({method:nY("notifications/tools/list_changed"),params:p.optional()}),ex=nQ(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=s.extend({level:ex}),eC=l.extend({method:nY("logging/setLevel"),params:ej}),eT=p.extend({level:ex,logger:o7().optional(),data:nE()}),eO=u.extend({method:nY("notifications/message"),params:eT}),eE=nz({name:o7().optional()}),eA=nz({hints:nM(eE).optional(),costPriority:nP().min(0).max(1).optional(),speedPriority:nP().min(0).max(1).optional(),intelligencePriority:nP().min(0).max(1).optional()}),eW=nz({mode:nQ(["auto","required","none"]).optional()}),eM=nz({type:nY("tool_result"),toolUseId:o7().describe("The unique identifier for the corresponding tool call."),content:nM(eg),structuredContent:nz({}).loose().optional(),isError:nI().optional(),_meta:nJ(o7(),nE()).optional()}),eN=nH("type",[ep,eu,em]),eD=nz({role:L,content:nL([ez=nH("type",[ep,eu,em,ef,eM]),nM(ez)]),_meta:nJ(o7(),nE()).optional()}),eF=c.extend({messages:nM(eD),modelPreferences:eA.optional(),systemPrompt:o7().optional(),includeContext:nQ(["none","thisServer","allServers"]).optional(),temperature:nP().optional(),maxTokens:nP().int(),stopSequences:nM(o7()).optional(),metadata:t.optional(),tools:nM(ek).optional(),toolChoice:eW.optional()}),eL=l.extend({method:nY("sampling/createMessage"),params:eF}),eU=m.extend({model:o7(),stopReason:n4(nQ(["endTurn","stopSequence","maxTokens"]).or(o7())),role:L,content:eN}),eH=m.extend({model:o7(),stopReason:n4(nQ(["endTurn","stopSequence","maxTokens","toolUse"]).or(o7())),role:L,content:nL([ez,nM(ez)])}),eG=nz({type:nY("boolean"),title:o7().optional(),description:o7().optional(),default:nI().optional()}),eB=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),minLength:nP().optional(),maxLength:nP().optional(),format:nQ(["email","uri","date","date-time"]).optional(),default:o7().optional()}),eK=nz({type:nQ(["number","integer"]),title:o7().optional(),description:o7().optional(),minimum:nP().optional(),maximum:nP().optional(),default:nP().optional()}),eJ=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),default:o7().optional()}),eZ=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),oneOf:nM(nz({const:o7(),title:o7()})),default:o7().optional()}),eQ=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),enumNames:nM(o7()).optional(),default:o7().optional()}),eX=nL([eJ,eZ]),eY=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({type:nY("string"),enum:nM(o7())}),default:nM(o7()).optional()}),e0=nL([eY,e1=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({anyOf:nM(nz({const:o7(),title:o7()}))}),default:nM(o7()).optional()})]),e2=nL([eQ,eX,e0]),e4=nL([e2,eG,eB,eK]),e6=c.extend({mode:nY("form").optional(),message:o7(),requestedSchema:nz({type:nY("object"),properties:nJ(o7(),e4),required:nM(o7()).optional()}).catchall(nE())}),e9=nL([e6,e3=c.extend({mode:nY("url"),message:o7(),elicitationId:o7(),url:o7().url()})]),e5=l.extend({method:nY("elicitation/create"),params:e9}),e8=p.extend({elicitationId:o7()}),e7=u.extend({method:nY("notifications/elicitation/complete"),params:e8}),te=m.extend({action:nQ(["accept","decline","cancel"]),content:ad(e=>null===e?void 0:e,nJ(o7(),nL([o7(),nP(),nI(),nM(o7())])).optional())}),tt=nz({type:nY("ref/resource"),uri:o7()}),tr=nz({type:nY("ref/prompt"),name:o7()}),ti=s.extend({ref:nL([tr,tt]),argument:nz({name:o7(),value:o7()}),context:nz({arguments:nJ(o7(),o7()).optional()}).optional()}),to=l.extend({method:nY("completion/complete"),params:ti}),tn=m.extend({completion:nD({values:nM(o7()).max(100),total:n4(nP().int()),hasMore:n4(nI())})}),ta=nz({uri:o7().startsWith("file://"),name:o7().optional(),_meta:nJ(o7(),nE()).optional()}),ts=l.extend({method:nY("roots/list"),params:s.optional()}),td=m.extend({roots:nM(ta)}),tc=u.extend({method:nY("notifications/roots/list_changed"),params:p.optional()}),tl=nD({ttl:nP().optional(),pollInterval:nP().optional()}),tp=nQ(["working","input_required","completed","failed","cancelled"]),tu=nz({taskId:o7(),status:tp,ttl:nL([nP(),nj()]),createdAt:o7(),lastUpdatedAt:o7(),pollInterval:n4(nP()),statusMessage:n4(o7())}),tm=m.extend({task:tu}),tf=p.merge(tu),th=u.extend({method:nY("notifications/tasks/status"),params:tf}),ty=l.extend({method:nY("tasks/get"),params:s.extend({taskId:o7()})}),tg=m.merge(tu),t_=l.extend({method:nY("tasks/result"),params:s.extend({taskId:o7()})}),tv=m.loose(),tb=W.extend({method:nY("tasks/list")}),t$=M.extend({tasks:nM(tu)}),tS=l.extend({method:nY("tasks/cancel"),params:s.extend({taskId:o7()})}),{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:nL([C,q,to,eC,el,es,B,J,X,et,er,eq,ew,ty,t_,tb,tS]),ClientNotificationSchema:nL([g,E,j,tc,th]),ClientResultSchema:nL([h,eU,eH,te,td,tg,t$,tm]),ServerRequestSchema:nL([C,eL,e5,ts,ty,t_,tb,tS]),ServerNotificationSchema:nL([g,E,eO,eo,ee,eI,eb,th,e7]),ServerResultSchema:nL([h,x,tn,ev,ed,K,Z,Y,eV,eP,tg,t$,tm]),CallToolResultWireSchema:nE().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of kK)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(kJ).pipe(eV)})}function kQ(e){return"object"!==e.type}let kX=new Set(["const","enum","default","examples"]),kY=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function k1(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let k0={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},k2={"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},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,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function k6(){if(c)return c;let e=kZ();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 k3(e){return Object.prototype.hasOwnProperty.call(k0,e)}function k9(e){return Object.prototype.hasOwnProperty.call(k2,e)}function k5(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function k8(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(k0),Object.keys(k2);let k7={ok:!1,reason:"not-in-era"};function we(e){return k5(e)&&k5(e.outputSchema)&&kQ(e.outputSchema)}let wt={era:"2025-11-25",hasRequestMethod:k3,hasNotificationMethod:k9,validateRequest:(e,t)=>k8(k3(e)?k6().requestSchemas[e]:void 0,t),validateResult:(e,t)=>k8(Object.prototype.hasOwnProperty.call(k4,e)?k6().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>k8(k9(e)?k6().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>k7,validateInputResponse:()=>k7,samplingResultVariant:(e,t)=>{let r=kZ();return k8(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=kB(e),i=r.structuredContent;if(void 0===i)return r;let o="object"!=typeof i||null===i||Array.isArray(i),n=void 0!==t&&kQ(t);return o||n?{...r,structuredContent:{result:i}}:r},decodeResult(e,t){if(k5(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=>we(e))?{...t,tools:r.map(e=>we(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(k1(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let i="string"==typeof(t=e.$schema)&&kO.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&&k1(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:kX.has(a)?r[a]=s:kY.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 wr(){return l??=function(){let e=aa(()=>nL([o7(),nP(),nI(),nj(),nJ(o7(),e),nM(e)])),t=nJ(o7(),e),r=nL([o7(),nP().int()]),i=o7(),o=nL([o7(),nP().int()]),n=nQ(["user","assistant"]),a=nQ(["debug","info","notice","warning","error","critical","alert","emergency"]),s=o7().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),d=nz({ttl:nP().optional()}),c=nz({taskId:o7()}),l=nD({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),p=nz({_meta:l.optional()}),u=p.extend({task:d.optional()}),m=nz({_meta:l.optional()}),f=nz({method:o7(),params:m.loose().optional()}),h=nz({src:o7(),mimeType:o7().optional(),sizes:nM(o7()).optional(),theme:nQ(["light","dark"]).optional()}),y=nz({icons:nM(h).optional()}),g=nz({name:o7(),title:o7().optional()}),_=g.extend({...g.shape,...y.shape,version:o7(),websiteUrl:o7().optional(),description:o7().optional()}),v=nB(nz({applyDefaults:nI().optional()}),t),b=ad(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nB(nz({form:v.optional(),url:t.optional()}),t.optional())),$=nD({list:t.optional(),cancel:t.optional(),requests:nD({sampling:nD({createMessage:t.optional()}).optional(),elicitation:nD({create:t.optional()}).optional()}).optional()}),S=nD({list:t.optional(),cancel:t.optional(),requests:nD({tools:nD({call:t.optional()}).optional()}).optional()}),k=nz({experimental:nJ(o7(),t).optional(),sampling:nz({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:nz({listChanged:nI().optional()}).optional(),tasks:$.optional(),extensions:nJ(o7(),t).optional()}),w=nz({experimental:nJ(o7(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nz({listChanged:nI().optional()}).optional(),resources:nz({subscribe:nI().optional(),listChanged:nI().optional()}).optional(),tools:nz({listChanged:nI().optional()}).optional(),tasks:S.optional(),extensions:nJ(o7(),t).optional()}),P=nz({progress:nP(),total:n4(nP()),message:n4(o7())}),V=nz({...m.shape,...P.shape,progressToken:r}),R=f.extend({method:nY("notifications/progress"),params:V}),q=m.extend({level:a,logger:o7().optional(),data:nE()}),I=f.extend({method:nY("notifications/message"),params:q}),x=nz({uri:o7(),mimeType:n4(o7()),_meta:nJ(o7(),nE()).optional()}),j=x.extend({text:o7()}),C=x.extend({blob:s}),T=nz({audience:nM(n).optional(),priority:nP().min(0).max(1).optional(),lastModified:ac({offset:!0}).optional()}),O=nz({...g.shape,...y.shape,uri:o7(),description:n4(o7()),mimeType:n4(o7()),size:n4(nP()),annotations:T.optional(),_meta:n4(nD({}))}),E=nz({...g.shape,...y.shape,uriTemplate:o7(),description:n4(o7()),mimeType:n4(o7()),annotations:T.optional(),_meta:n4(nD({}))}),A=f.extend({method:nY("notifications/resources/list_changed"),params:m.optional()}),W=m.extend({uri:o7()}),M=f.extend({method:nY("notifications/resources/updated"),params:W}),N=nz({name:o7(),description:n4(o7()),required:n4(nI())}),z=nz({...g.shape,...y.shape,description:n4(o7()),arguments:n4(nM(N)),_meta:n4(nD({}))}),D=f.extend({method:nY("notifications/prompts/list_changed"),params:m.optional()}),F=nz({type:nY("text"),text:o7(),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),L=nz({type:nY("image"),data:s,mimeType:o7(),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),U=nz({type:nY("audio"),data:s,mimeType:o7(),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),H=nz({type:nY("tool_use"),name:o7(),id:o7(),input:nJ(o7(),nE()),_meta:nJ(o7(),nE()).optional()}),G=nz({type:nY("resource"),resource:nL([j,C]),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),B=O.extend({type:nY("resource_link")}),K=nL([F,L,U,B,G]),J=nz({role:n,content:K}),Z=nz({title:o7().optional(),readOnlyHint:nI().optional(),destructiveHint:nI().optional(),idempotentHint:nI().optional(),openWorldHint:nI().optional()}),Q=f.extend({method:nY("notifications/tools/list_changed"),params:m.optional()}),X=nz({name:o7().optional()}),Y=nz({hints:nM(X).optional(),costPriority:nP().min(0).max(1).optional(),speedPriority:nP().min(0).max(1).optional(),intelligencePriority:nP().min(0).max(1).optional()}),ee=nz({mode:nQ(["auto","required","none"]).optional()}),et=nz({type:nY("boolean"),title:o7().optional(),description:o7().optional(),default:nI().optional()}),er=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),minLength:nP().optional(),maxLength:nP().optional(),format:nQ(["email","uri","date","date-time"]).optional(),default:o7().optional()}),ei=nz({type:nQ(["number","integer"]),title:o7().optional(),description:o7().optional(),minimum:nP().optional(),maximum:nP().optional(),default:nP().optional()}),eo=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),default:o7().optional()}),en=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),oneOf:nM(nz({const:o7(),title:o7()})),default:o7().optional()}),ea=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),enumNames:nM(o7()).optional(),default:o7().optional()}),es=nL([eo,en]),ed=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({type:nY("string"),enum:nM(o7())}),default:nM(o7()).optional()}),ec=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({anyOf:nM(nz({const:o7(),title:o7()}))}),default:nM(o7()).optional()}),el=nL([ed,ec]),ep=nL([ea,es,el]),eu=nL([ep,et,er,ei]),em=u.extend({mode:nY("form").optional(),message:o7(),requestedSchema:nz({type:nY("object"),properties:nJ(o7(),eu),required:nM(o7()).optional()}).catchall(nE())}),ef=nz({type:nY("ref/resource"),uri:o7()}),eh=nz({type:nY("ref/prompt"),name:o7()}),ey=nz({uri:o7().startsWith("file://"),name:o7().optional(),_meta:nJ(o7(),nE()).optional()}),eg=k.shape,e_=nz({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),ev=w.shape,eb=nz({experimental:ev.experimental,logging:ev.logging,completions:ev.completions,prompts:ev.prompts,resources:ev.resources,tools:ev.tools,extensions:ev.extensions}),e$=nD({progressToken:r.optional(),[au]:o7(),[am]:_.optional(),[ah]:e_,[ag]:a.optional()}),eS=nz({...g.shape,...y.shape,description:o7().optional(),inputSchema:nD({$schema:o7().optional(),type:nY("object")}),outputSchema:nD({$schema:o7().optional()}).optional(),annotations:Z.optional(),_meta:nJ(o7(),nE()).optional()}),ek=nz({type:nY("tool_result"),toolUseId:o7(),content:nM(K),structuredContent:nE().optional(),isError:nI().optional(),_meta:nJ(o7(),nE()).optional()}),ew=nL([F,L,U,H,ek]),eP=nz({role:n,content:nL([ew,nM(ew)]),_meta:nJ(o7(),nE()).optional()}),eV=o7(),eR=nD({[af]:_.optional().catch(void 0)}),eq=eR.optional();function eI(e){return nD({_meta:eq,resultType:eV.default("complete"),...e})}let ex=eI({}),ej=eI({nextCursor:i.optional()}),eC=eI({content:nM(K),structuredContent:nE().optional(),isError:nI().optional()}),eT=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),tools:nM(eS),nextCursor:i.optional()}),eO=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),prompts:nM(z),nextCursor:i.optional()}),eE=eI({description:o7().optional(),messages:nM(J)}),eA=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resources:nM(O),nextCursor:i.optional()}),eW=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resourceTemplates:nM(E),nextCursor:i.optional()}),eM=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),contents:nM(nL([j,C]))}),eN=eI({completion:nz({values:nM(o7()).max(100),total:nP().int().optional(),hasMore:nI().optional()}).loose()}),ez=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"])}),eD=eI({ttlMs:nP().int().min(0).catch(0),cacheScope:nQ(["public","private"]).catch("private"),supportedVersions:nM(o7()),capabilities:eb,instructions:o7().optional()}),eF=nz({messages:nM(eP),modelPreferences:Y.optional(),systemPrompt:o7().optional(),includeContext:nQ(["none","thisServer","allServers"]).optional(),temperature:nP().optional(),maxTokens:nP().int(),stopSequences:nM(o7()).optional(),metadata:t.optional(),tools:nM(eS).optional(),toolChoice:ee.optional()}),eL=nz({method:nY("sampling/createMessage"),params:eF}),eU=nz({method:nY("roots/list"),params:nz({_meta:nJ(o7(),nE()).optional()}).optional()}),eH=nz({...eP.shape,model:o7(),stopReason:o7().optional()}),eG=nz({roots:nM(ey)}),eB=nz({action:nQ(["accept","decline","cancel"]),content:nJ(o7(),nL([o7(),nP(),nI(),nM(o7())])).optional()}),eK=nz({mode:nY("url"),message:o7(),url:o7().url()}),eJ=nL([em,eK]),eZ=nz({method:nY("elicitation/create"),params:eJ}),eQ=nL([eL,eU,eZ]),eX=nL([eH,eG,eB]),eY=nJ(o7(),eQ),e1=nJ(o7(),eX),e0=eI({inputRequests:eY.optional(),requestState:o7().optional()}),e2={inputResponses:e1.optional(),requestState:o7().optional()},e4=nz({_meta:e$,...e2}),e6=nD({progressToken:r.optional()});function e3(e,t){return nz({method:nY(e),params:nz({_meta:e$,...t})})}function e9(e,t){return nz({method:nY(e),params:nz({_meta:e6.optional(),...t}).optional()})}let e5={name:o7(),arguments:nJ(o7(),nE()).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:o7(),arguments:nJ(o7(),o7()).optional(),...e2}),ti=e3("resources/list",e8),to=e3("resources/templates/list",e8),tn=e3("resources/read",{uri:o7(),...e2}),ta={ref:nL([eh,ef]),argument:nz({name:o7(),value:o7()}),context:nz({arguments:nJ(o7(),o7()).optional()}).optional()},ts=e3("completion/complete",ta),td=e3("server/discover",{}),tc=nz({toolsListChanged:nI().optional(),promptsListChanged:nI().optional(),resourcesListChanged:nI().optional(),resourceSubscriptions:nM(o7()).optional()}),tl={notifications:tc},tp=e3("subscriptions/listen",tl),tu=eR.extend({"io.modelcontextprotocol/subscriptionId":o}),tm=nD({_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:o7(),arguments:nJ(o7(),o7()).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:o7()}),"completion/complete":e9("completion/complete",ta),"server/discover":e9("server/discover",{}),"subscriptions/listen":e9("subscriptions/listen",tl)};function th(e){return nD({_meta:eq,...e})}let ty={"tools/call":th({content:nM(K),structuredContent:nE().optional(),isError:nI().optional()}),"tools/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),tools:nM(eS),nextCursor:i.optional()}),"prompts/get":th({description:o7().optional(),messages:nM(J)}),"prompts/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),prompts:nM(z),nextCursor:i.optional()}),"resources/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resources:nM(O),nextCursor:i.optional()}),"resources/templates/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resourceTemplates:nM(E),nextCursor:i.optional()}),"resources/read":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),contents:nM(nL([j,C]))}),"completion/complete":th({completion:nz({values:nM(o7()).max(100),total:nP().int().optional(),hasMore:nI().optional()}).loose()}),"server/discover":th({ttlMs:nP().int().min(0).catch(0),cacheScope:nQ(["public","private"]).catch("private"),supportedVersions:nM(o7()),capabilities:eb,instructions:o7().optional()}),"subscriptions/listen":th({})},tg=nD({"io.modelcontextprotocol/subscriptionId":o.optional()}),t_=nz({method:nY("notifications/subscriptions/acknowledged"),params:nz({_meta:tg.optional(),notifications:tc})}),tv=nz({_meta:tg.optional(),requestId:o,reason:o7().optional()}),tb=nz({method:nY("notifications/cancelled"),params:tv}),t$=e=>nz({jsonrpc:nY("2.0"),id:nL([o7(),nP().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$(nL([eC,e0])),ListToolsResultResponseSchema:t$(eT),ListPromptsResultResponseSchema:t$(eO),GetPromptResultResponseSchema:t$(nL([eE,e0])),ListResourcesResultResponseSchema:t$(eA),ListResourceTemplatesResultResponseSchema:t$(eW),ReadResourceResultResponseSchema:t$(nL([eM,e0])),CompleteResultResponseSchema:t$(eN),DiscoverResultResponseSchema:t$(eD),SubscriptionsListenResultResponseSchema:t$(tm)}}()}let wi=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],wo=Symbol("modelcontextprotocol.resultCacheHintFallback");function wn(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function wa(e){return"public"===e||"private"===e}let ws=((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 wd=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return kN(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 kN(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",kM(this,new.target)}static fromError(t,r,i){return t===ws.UrlElicitationRequired&&i&&i.elicitations?new wl(i.elicitations,r):t===ws.UnsupportedProtocolVersion&&i&&Array.isArray(i.supported)&&"string"==typeof i.requested?new wp({supported:i.supported,requested:i.requested},r):(t===ws.InvalidParams||t===ws.ResourceNotFound)&&"string"==typeof i?.uri&&(t===ws.ResourceNotFound||1===Object.keys(i).length)?new wc(i.uri,r):t===ws.MissingRequiredClientCapability&&i&&null!==i.requiredCapabilities&&"object"==typeof i.requiredCapabilities&&!Array.isArray(i.requiredCapabilities)?new wu({requiredCapabilities:i.requiredCapabilities},r):new e(t,r,i)}},wc=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(ws.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},wl=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(ws.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},wp=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(ws.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},wu=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(ws.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let wm=["tools/call","prompts/get","resources/read"],wf=["elicitation/create","sampling/createMessage","roots/list"];function wh(){if(p)return p;let e=wr();return p={request:{"elicitation/create":nz({method:nY("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":nz({method:nY("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":nz({method:nY("roots/list"),params:nD({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function wy(e){return wf.includes(e)}function wg(e){return wy(e)?wh().request[e]:void 0}let w_={"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},wv={"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 wb(e){return Object.prototype.hasOwnProperty.call(w_,e)}function w$(e){return Object.prototype.hasOwnProperty.call(wv,e)}function wS(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function wk(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(w_),Object.keys(wv);let ww={ok:!1,reason:"not-in-era"},wP=[au,ah],wV={era:"2026-07-28",hasRequestMethod:wb,hasNotificationMethod:w$,hasInputRequestMethod:e=>void 0!==wg(e),validateRequest:(e,t)=>wk(wb(e)?wr().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>wk(Object.prototype.hasOwnProperty.call(w_,e)?wr().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>wk(w$(e)?wr().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>wk(wg(e),t),validateInputResponse:(e,t)=>wk(wy(e)?wh().response[e]:void 0,t),samplingResultVariant:()=>ww,outboundEnvelope:e=>({[au]:e.protocolVersion,[am]:e.clientInfo,[ah]:e.clientCapabilities,...void 0!==e.logLevel&&{[ag]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of wP)r in e||t.push({key:r,problem:"missing"});let r=wr().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=>kB(e),inputRequestSchema:wg,decodeResult(e,t){if(!wS(t))return{kind:"invalid",error:new kD(kz.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new kD(kz.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 kD(kz.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,i=wS(r)?r:{},o=t.requestState,n=void 0===t._meta?void 0:wr().ResultMetaSchema.safeParse(t._meta),a=n?.success?n.data:void 0;return 0===Object.keys(i).length&&"string"!=typeof o?{kind:"invalid",error:new kD(kz.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 kD(kz.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let i=function(){if(u)return u;let e=wr();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 kD(kz.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:{[af]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[af]?e:{...e,_meta:{...r,[af]:t}}})(function(e,t){var r,i;let o=t[wo];if("complete"!==t.resultType||!wi.includes(e)){let e;return void 0===o?t:(e={...t},delete e[wo],e)}let n=wn(t.ttlMs)?t.ttlMs:void 0!==(r=o)&&wn(r.ttlMs)?r.ttlMs:0,a=wa(t.cacheScope)?t.cacheScope:void 0!==(i=o)&&wa(i.cacheScope)?i.cacheScope:"private",s={...t,ttlMs:n,cacheScope:a};return delete s[wo],s}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||wm.includes(e))return t;throw new wd(ws.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=>wS(e)&&"execution"in e)&&(o().tools=n.map(e=>{if(!wS(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let a=t.capabilities;if(wS(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=wr().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("; ")}`}},wR="2026-07-28";function wq(e){return void 0!==e&&e>=kL?wV:wt}function wI(e){return void 0!==e.revision?wq(e.revision).era:"modern"===e.era?wV.era:wt.era}function wx(e){return wT.some(t=>t.hasRequestMethod(e))}function wj(e){return wT.some(t=>t.hasNotificationMethod(e))}function wC(e){return"tasks/get"===e||"tasks/cancel"===e}let wT=[wt,wV];var wO=(e=>{let t={};for(var r in e)kR(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>ss,AudioContentSchema:()=>sW,BaseMetadataSchema:()=>aH,BaseRequestParamsSchema:()=>aV,BlobResourceContentsSchema:()=>sn,BooleanSchemaSchema:()=>dc,CallToolRequestParamsSchema:()=>sX,CallToolRequestSchema:()=>sY,CallToolResultSchema:()=>sZ,CancelTaskRequestSchema:()=>dJ,CancelTaskResultSchema:()=>dZ,CancelledNotificationParamsSchema:()=>aD,CancelledNotificationSchema:()=>aF,ClientCapabilitiesSchema:()=>aQ,ClientNotificationSchema:()=>dX,ClientRequestSchema:()=>dQ,ClientResultSchema:()=>dY,ClientTasksCapabilitySchema:()=>aJ,CompatibilityCallToolResultSchema:()=>sQ,CompleteRequestParamsSchema:()=>dx,CompleteRequestSchema:()=>dj,CompleteResultSchema:()=>dC,ContentBlockSchema:()=>sD,CreateMessageRequestParamsSchema:()=>dn,CreateMessageRequestSchema:()=>da,CreateMessageResultSchema:()=>ds,CreateMessageResultWithToolsSchema:()=>dd,CreateTaskResultSchema:()=>dz,CursorSchema:()=>aS,DiscoverRequestSchema:()=>a4,DiscoverResultSchema:()=>a6,ElicitRequestFormParamsSchema:()=>d$,ElicitRequestParamsSchema:()=>dk,ElicitRequestSchema:()=>dw,ElicitRequestURLParamsSchema:()=>dS,ElicitResultSchema:()=>dR,ElicitationCompleteNotificationParamsSchema:()=>dP,ElicitationCompleteNotificationSchema:()=>dV,EmbeddedResourceSchema:()=>sN,EmptyResultSchema:()=>az,EnumSchemaSchema:()=>dv,GetPromptRequestParamsSchema:()=>sT,GetPromptRequestSchema:()=>sO,GetPromptResultSchema:()=>sL,GetTaskPayloadRequestSchema:()=>dH,GetTaskPayloadResultSchema:()=>dG,GetTaskRequestSchema:()=>dL,GetTaskResultSchema:()=>dU,IconSchema:()=>aL,IconsSchema:()=>aU,ImageContentSchema:()=>sA,ImplementationSchema:()=>aG,InitializeRequestParamsSchema:()=>aX,InitializeRequestSchema:()=>aY,InitializeResultSchema:()=>a0,InitializedNotificationSchema:()=>a2,JSONArraySchema:()=>ab,JSONObjectSchema:()=>av,JSONRPCErrorResponseSchema:()=>aW,JSONRPCMessageSchema:()=>aM,JSONRPCNotificationSchema:()=>aE,JSONRPCRequestSchema:()=>aO,JSONRPCResponseSchema:()=>aN,JSONRPCResultResponseSchema:()=>aA,JSONValueSchema:()=>a_,LegacyTitledEnumSchemaSchema:()=>df,ListChangedOptionsBaseSchema:()=>s0,ListPromptsRequestSchema:()=>sj,ListPromptsResultSchema:()=>sC,ListResourceTemplatesRequestSchema:()=>su,ListResourceTemplatesResultSchema:()=>sm,ListResourcesRequestSchema:()=>sl,ListResourcesResultSchema:()=>sp,ListRootsRequestSchema:()=>dO,ListRootsResultSchema:()=>dE,ListTasksRequestSchema:()=>dB,ListTasksResultSchema:()=>dK,ListToolsRequestSchema:()=>sK,ListToolsResultSchema:()=>sJ,LoggingLevelSchema:()=>s2,LoggingMessageNotificationParamsSchema:()=>s3,LoggingMessageNotificationSchema:()=>s9,ModelHintSchema:()=>s5,ModelPreferencesSchema:()=>s8,MultiSelectEnumSchemaSchema:()=>d_,NotificationSchema:()=>ax,NotificationsParamsSchema:()=>aI,NumberSchemaSchema:()=>dp,PaginatedRequestParamsSchema:()=>a7,PaginatedRequestSchema:()=>se,PaginatedResultSchema:()=>st,PingRequestSchema:()=>a3,PrimitiveSchemaDefinitionSchema:()=>db,ProgressNotificationParamsSchema:()=>a5,ProgressNotificationSchema:()=>a8,ProgressSchema:()=>a9,ProgressTokenSchema:()=>a$,PromptArgumentSchema:()=>sI,PromptListChangedNotificationSchema:()=>sU,PromptMessageSchema:()=>sF,PromptReferenceSchema:()=>dI,PromptSchema:()=>sx,ReadResourceRequestParamsSchema:()=>sf,ReadResourceRequestSchema:()=>sh,ReadResourceResultSchema:()=>sy,RelatedTaskMetadataSchema:()=>aw,RequestIdSchema:()=>aT,RequestMetaSchema:()=>aP,RequestSchema:()=>aq,ResourceContentsSchema:()=>sr,ResourceLinkSchema:()=>sz,ResourceListChangedNotificationSchema:()=>sg,ResourceRequestParamsSchema:()=>sf,ResourceSchema:()=>sd,ResourceTemplateReferenceSchema:()=>dq,ResourceTemplateSchema:()=>sc,ResourceUpdatedNotificationParamsSchema:()=>sR,ResourceUpdatedNotificationSchema:()=>sq,ResultMetaObjectSchema:()=>aj,ResultSchema:()=>aC,RoleSchema:()=>sa,RootSchema:()=>dT,RootsListChangedNotificationSchema:()=>dA,SamplingContentSchema:()=>dt,SamplingMessageContentBlockSchema:()=>dr,SamplingMessageSchema:()=>di,ServerCapabilitiesSchema:()=>a1,ServerNotificationSchema:()=>d0,ServerRequestSchema:()=>d1,ServerResultSchema:()=>d2,ServerTasksCapabilitySchema:()=>aZ,SetLevelRequestParamsSchema:()=>s4,SetLevelRequestSchema:()=>s6,SingleSelectEnumSchemaSchema:()=>dh,StringSchemaSchema:()=>dl,SubscribeRequestParamsSchema:()=>sf,SubscribeRequestSchema:()=>s_,SubscriptionFilterSchema:()=>sb,SubscriptionsAcknowledgedNotificationParamsSchema:()=>sk,SubscriptionsAcknowledgedNotificationSchema:()=>sw,SubscriptionsListenRequestParamsSchema:()=>s$,SubscriptionsListenRequestSchema:()=>sS,SubscriptionsListenResultMetaSchema:()=>sP,SubscriptionsListenResultSchema:()=>sV,TaskAugmentedRequestParamsSchema:()=>aR,TaskCreationParamsSchema:()=>dW,TaskMetadataSchema:()=>ak,TaskSchema:()=>dN,TaskStatusNotificationParamsSchema:()=>dD,TaskStatusNotificationSchema:()=>dF,TaskStatusSchema:()=>dM,TextContentSchema:()=>sE,TextResourceContentsSchema:()=>si,TitledMultiSelectEnumSchemaSchema:()=>dg,TitledSingleSelectEnumSchemaSchema:()=>dm,ToolAnnotationsSchema:()=>sH,ToolChoiceSchema:()=>s7,ToolExecutionSchema:()=>sG,ToolListChangedNotificationSchema:()=>s1,ToolResultContentSchema:()=>de,ToolSchema:()=>sB,ToolUseContentSchema:()=>sM,UnsubscribeRequestParamsSchema:()=>sf,UnsubscribeRequestSchema:()=>sv,UntitledMultiSelectEnumSchemaSchema:()=>dy,UntitledSingleSelectEnumSchemaSchema:()=>du});let wE=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,wA="x-mcp-header",wW=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,wM=new Set(["string","integer","boolean"]);function wN(e){let t,r=[],i=new Map,o=(e,n,a)=>{if(null===e||"object"!=typeof e)return;if(wA in e){if(!a||0===n.length)return`${wF(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[wA];if("string"!=typeof o||0===o.length)return`${wF(n)}: x-mcp-header MUST be a non-empty string`;if(!wW.test(o))return`${wF(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||!wM.has(s)){let e=`${wF(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 wz){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&wD.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 wz=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],wD=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function wF(e){return 0===e.length?"":e.join(".")}let wL="=?base64?";function wU(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function wH(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}ws.InvalidRequest,ws.UnsupportedProtocolVersion,ws.InvalidParams,ws.MethodNotFound,ws.InvalidParams,ws.MissingRequiredClientCapability,ws.ParseError,ws.InvalidRequest,ws.MethodNotFound,ws.UnsupportedProtocolVersion,ws.MissingRequiredClientCapability;let wG=!1,wB="draft-2020-12",wK=/^#\/(\$defs|definitions)\/([^/~%]+)$/;async function wJ(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 wZ=/\\\.\\d\{(\d+)\}/;function wQ(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let wX=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function wY(e){return wX.has(e)||e.startsWith("x-")}let w1=new Set(["$schema",...Object.keys(d$.shape.requestedSchema.shape)]),w0={string:wU([dl,du,dm,df]),number:wU([dp]),integer:wU([dp]),boolean:wU([dc]),array:wU([dy,dg])},w2=new Set(dl.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(!wH(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&&wQ(n)?r[o]=Object.fromEntries(Object.entries(n).map(([e,r])=>[e,function(e,t,r,i){if(!wQ(e))return e;let o="string"==typeof e.type&&Object.hasOwn(w0,e.type)?w0[e.type]:void 0;if(void 0===o)return e;let n={};for(let[s,d]of Object.entries(e))if(o.has(s)||wY(s))n[s]=d;else if("pattern"===s&&"string"===e.type&&"string"==typeof e.format)if(w2.has(e.format)){var a;"string"==typeof d&&(a=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[iw(nn,void 0)];break;case"uri":r=[iP(nd,void 0)];break;case"date":r=[iR(nr,void 0)];break;case"date-time":let i,o;i=wZ.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=>ac({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=ox(e,{target:wB,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)])):w1.has(o)?r[o]=n:wY(o)||i.push(o);if(i.length>0)throw new wd(ws.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:wB});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().");wG||(wG=!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=ox(e,{target:wB,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&&wK.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 wd(ws.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),o=(t=d$.shape.requestedSchema,oJ(t,i));if(!o.success)throw new wd(ws.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!wQ(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!oJ(db,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}]`)):wQ(t)&&wQ(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):wY(t)?[]:[n]}):[]}(i,o.data);if(n.length>0)throw new wd(ws.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 wd(ws.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 wd?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 w4={},w6={};function w3(e,t){let r=e.slice(0,-6);w4[r]=t,w6[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"])w3(e,wO[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:ct,OAuthClientInformationFullSchema:ca,OAuthClientInformationSchema:cn,OAuthClientMetadataSchema:co,OAuthClientRegistrationErrorSchema:cs,OAuthErrorResponseSchema:cr,OAuthMetadataSchema:d5,OAuthProtectedResourceMetadataSchema:d9,OAuthTokenRevocationRequestSchema:cd,OAuthTokensSchema:ce,OpenIdProviderDiscoveryMetadataSchema:d7,OpenIdProviderMetadataSchema:d8}))w3(e,t);Object.freeze(w4);let w9=Object.freeze(w6),w5=[au,am,ah,ag],w8=["inputResponses","requestState"];function w7(e,t){let r=e.params;if(!Pi(r))return{message:e,lifted:{}};let i=r._meta,o=Pi(i)?w5.filter(e=>e in i):[],n="request"===t?w8.filter(e=>e in r):[];if(0===o.length&&0===n.length)return{message:e,lifted:{}};let a={},s={...r};if(o.length>0&&Pi(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 Pe(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 Pt=(ee=void 0,()=>ee);var Pr=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??ap,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 kD(kz.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 kD(kz.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),aA.safeParse(e).success||aW.safeParse(e).success)this._onresponse(e);else if(aO.safeParse(e).success)this._onrequest(e,t);else aE.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 kD(kz.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}=w7(e,"notification"),i=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=wI(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(wj(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}=w7(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=wI(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(ws.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(wx(i.method)&&!n.hasRequestMethod(i.method)&&!(wC(i.method)&&this._customSchemaRequestMethods.has(i.method)))return void s(ws.MethodNotFound,"Method not found");let d=this._requestHandlers.get(i.method)??this.fallbackRequestHandler;if(void 0===d)return void s(ws.MethodNotFound,"Method not found");let c=n.checkInboundEnvelope(o);if(void 0!==c)return void s(ws.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(!Po(e))return{accepted:t,droppedKeys:r};for(let[i,o]of Object.entries(e)){if(!Po(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?Pt:(r=o.requestState,()=>r),signal:u.signal,send:(e,t,r)=>{let i=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(i,e.method),wH(t))return p(e,t,r);let o=Pe(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(ws.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:ws.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(aA.safeParse(e).success?e:wd.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(wH(t))return wC(e.method)||this._assertOutboundRequestInEra(i,e.method),this._requestWithSchemaViaCodec(i,e,t,r);this._assertOutboundRequestInEra(i,e.method);let o=Pe(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 wq(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 wq(void 0);case"server/discover":return wq(wR);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(wx(t)&&!e.hasRequestMethod(t))throw new kD(kz.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 kD?e:new kD(kz.RequestTimeout,String(e))}let f=e.era===wR&&!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 kD?e:new kD(kz.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)}))}wJ(r,n.result).then(e=>{e.success?p(e.data):u(new kD(kz.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 kD(kz.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 kD(kz.NotConnected,"Not connected");if(wj(t.method)&&!e.hasNotificationMethod(t.method))throw new kD(kz.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(!wx(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 wd(ws.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 wJ(t.params,{...i.params});if(!n.success)throw new wd(ws.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(!wj(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 wd(ws.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 wJ(t.params,{...i.params});if(!o.success)throw new wd(ws.InvalidParams,`Invalid params for notification ${e}: ${o.error}`);await r(o.data,i)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Pi(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Po(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Pn(e){throw new kD(kz.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}(kC(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 Pa=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,aM.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};let Ps=el("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"),Pd="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 Pc=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new Pa({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=Ps(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of Pd){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 kD(kz.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let Pl=new TextEncoder,Pp=new TextDecoder,Pu=new TextDecoder("utf-8",{fatal:!0});function Pm(...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 Pf(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 Ph(e){let t=Math.floor(e/0x100000000),r=new Uint8Array(8);return Pf(r,t,0),Pf(r,e%0x100000000,4),r}function Py(e){let t=new Uint8Array(4);return Pf(t,e),t}let Pg=/[^\x00-\x7f]/;function P_(e){if("string"==typeof e&&e.length>=128){if(Pg.test(e))throw TypeError("non-ASCII string encountered in encode()");return Pl.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 Pv(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 PZ(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 PQ(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 PV(`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 PX(e,t){if(t.includes("b64")){let t=e.b64;if("boolean"!=typeof t)throw new PI('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}function PY(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(!Pz(i))throw new e("JOSE Header is not a JSON object");return[i,r]}async function P1(e,t,r){let i,o,{alg:n,secret:a}=e,s="decrypt"===r||"sign"===r;if(a&&t instanceof Uint8Array)return t;if(Pz(t)){if("string"!=typeof(i=Vo(t)).kty)throw P8(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 PW(i.k);if(!Object.isFrozen(t)){let{key_ops:e}=t;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}}else{if(!P3(t))throw P8(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(P4(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=P0[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 Va(e,i)}let P0={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function P2(e){if(!P4(e))throw Error("CryptoKey instance expected")}let P4=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},P6=e=>e?.[Symbol.toStringTag]==="KeyObject",P3=e=>P4(e)||P6(e);function P9(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 P5=(e,...t)=>P9("Key must be ",e,...t);function P8(e,t,r){let i=["CryptoKey","KeyObject","JSON Web Key"];return r&&i.push("Uint8Array"),TypeError(P9(`Key for the ${e} algorithm must be `,t,...i))}let P7=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function Ve(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Vt(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 Vr(e,t,r){let i=e.algorithm;if(i.name!==t.name)throw P7(t.name);if(t.hash&&i.hash?.name!==t.hash)throw P7(t.hash,"algorithm.hash");if(t.namedCurve&&i.namedCurve!==t.namedCurve)throw P7(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&i.length!==t.length)throw P7(t.length,"algorithm.length");Ve(e,r)}function Vi(e){return{__proto__:null,...e}}function Vo(e){let t=Vi(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 Vn(e){if(void 0!==e&&"boolean"!=typeof e)throw TypeError('"extractable" option must be a boolean');return e}async function Va(e,t,r){if(!e.kty.includes(t.kty))throw new PV('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 Vs(e,t,r,i=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,i,[r])),Vr(e,t,r),e}let Vd=e=>crypto.getRandomValues(new Uint8Array(e.cekBits>>3));function Vc(e,t){let r=e.byteLength<<3;if(r!==t)throw new Pq(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}function Vl(e,t){if(t.length<<3!==e.ivBits)throw new Pq("Invalid Initialization Vector length")}async function Vp(e,t,r){if(!(t instanceof Uint8Array))throw TypeError(P5(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 Vu(e,t,r){return new Uint8Array((await crypto.subtle.sign("HMAC",e,t)).slice(0,r>>3))}async function Vm(e,t,r,i,o){if(!P4(r)&&!(r instanceof Uint8Array))throw TypeError(P5(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(i?Vl(e,i):i=crypto.getRandomValues(new Uint8Array(e.ivBits>>3)),r instanceof Uint8Array&&Vc(r,e.cekBits),e.cbc)return async function(e,t,r,i,o){let[n,a,s]=await Vp(e,r,"encrypt"),d=new Uint8Array(await crypto.subtle.encrypt({iv:i,name:"AES-CBC"},n,t)),c=Pm(o,i,d,Ph(8*o.length));return{ciphertext:d,tag:await Vu(a,c,s),iv:i}}(e,t,r,i,o);let n=await Vs(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 Vf(e,t,r,i,o,n){if(!P4(t)&&!(t instanceof Uint8Array))throw TypeError(P5(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!i)throw new Pq("JWE Initialization Vector missing");if(!o)throw new Pq("JWE Authentication Tag missing");if(!e.cbc&&16!==o.length)throw new Pq("Invalid Authentication Tag length");if(Vl(e,i),t instanceof Uint8Array&&Vc(t,e.cekBits),e.cbc)return async function(e,t,r,i,o,n){let[a,s,d]=await Vp(e,t,"decrypt"),c=Pm(n,i,r,Ph(8*n.length)),l=await Vu(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 PR}(e,t,r,i,o,n);let a=await Vs(t,e.subtle,"decrypt");try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:n,iv:i,name:"AES-GCM",tagLength:128},a,Pm(r,o)))}catch{throw new PR}}function Vh(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}let Vy=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Vg=[[],["deriveBits"]],V_=[[],[]];function Vv(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:Vy,ops:["wrapKey","unwrapKey"]}}function Vb(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 PV('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:t}},usages:Vg,ops:[void 0,"deriveBits"]}}function V$(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:V_,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function VS(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:V_,ops:["deriveBits","deriveBits"]}}let Vk=Vh({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:V_,ops:["encrypt","decrypt"]},"RSA-OAEP":Vv(1),"RSA-OAEP-256":Vv(256),"RSA-OAEP-384":Vv(384),"RSA-OAEP-512":Vv(512),"ECDH-ES":Vb("direct-key-agreement"),"ECDH-ES+A128KW":Vb("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":Vb("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":Vb("key-agreement-with-key-wrapping"),A128KW:V$(128),A192KW:V$(192),A256KW:V$(256),A128GCMKW:V$(128,!0),A192GCMKW:V$(192,!0),A256GCMKW:V$(256,!0),"PBES2-HS256+A128KW":VS(),"PBES2-HS384+A192KW":VS(),"PBES2-HS512+A256KW":VS()}),Vw=["encrypt","decrypt"];function VP(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:V_,ops:Vw,cekBits:e,ivBits:t?128:96,cbc:t}}let VV=Vh({A128GCM:VP(128),A192GCM:VP(192),A256GCM:VP(256),"A128CBC-HS256":VP(256,!0),"A192CBC-HS384":VP(384,!0),"A256CBC-HS512":VP(512,!0)});function VR(e,t){throw new PV(`Invalid or unsupported "${e}" (JWE ${t}) header value`)}function Vq(e){return("string"==typeof e?Vk[e]:void 0)??VR("alg","Algorithm")}function VI(e){return"key-wrapping"===e.mode||"key-encryption"===e.mode||"key-agreement-with-key-wrapping"===e.mode}function Vx(e){return("string"==typeof e?VV[e]:void 0)??VR("enc","Encryption Algorithm")}function Vj(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");Ve(e,t)}function VC(e,t,r){Vr(t,Vq(e).subtle,r),Vt(e,t)}async function VT(e,t,r,i){if(!(e instanceof Uint8Array)||e.length<8)throw new Pq("PBES2 Salt Input must be 8 or more octets");if(!Number.isSafeInteger(r)||1!==Math.sign(r))throw new Pq("PBES2 Count Input must be a positive integer");let o=Pm(P_(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 Vs(i,Vq(t).subtle,"deriveBits");return new Uint8Array(await crypto.subtle.deriveBits(a,s,n))}function VO(e){return Pm(Py(e.length),e)}async function VE(e,t,r,i,o=new Uint8Array,n=new Uint8Array){Vj(e),Vj(t,"deriveBits");let a=Pm(VO(P_(r)),VO(o),VO(n),Py(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 P$("sha256",Pm(Py(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 VA(e){P2(e);let t=e.algorithm.namedCurve;if("P-256"!==t&&"P-384"!==t&&"P-521"!==t&&"X25519"!==e.algorithm.name)throw new PV("ECDH with the provided key is not allowed or not supported by your javascript runtime")}function VW(e,t){let r=e[t];if(void 0!==r){if("string"!=typeof r)throw new Pq(`JOSE Header "${t}" (Agreement Party${"apu"===t?"U":"V"}Info) invalid`);return PU(r,t,Pq)}}function VM(e,t){if(void 0!==e&&void 0!==t&&e.byteLength===t.byteLength){for(let r=0;r"u")throw new PV(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function VL(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 Pq("Decompressed plaintext exceeded the configured limit")}return Pm(...o)}function VU(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 Pq("JWE Initialization Vector incorrect type");if("string"!=typeof r)throw new Pq("JWE Ciphertext missing or incorrect type");if(void 0!==n&&("string"!=typeof n||!n))throw new Pq("JWE Authentication Tag incorrect type");if(void 0!==o&&"string"!=typeof o)throw new Pq("JWE Protected Header incorrect type");if(void 0!==t&&("string"!=typeof t||!t))throw new Pq("JWE AAD incorrect type");if(void 0!==a&&!Pz(a))throw new Pq("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 VH(e){let t,r;try{let{header:i}=e;if(Pz(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 VG(e){let{encrypted_key:t,header:r}=e;if(void 0!==t&&"string"!=typeof t)throw new Pq("JWE Encrypted Key incorrect type");if(void 0!==r&&!Pz(r))throw new Pq("JWE Per-Recipient Unprotected Header incorrect type");if(void 0===e.protected&&void 0===r&&void 0===e.unprotected)throw new Pq("JOSE Header missing")}function VB(e){let t,{protected:r,ciphertext:i,iv:o,tag:n,aad:a}=e;return void 0!==r&&(t=PG(r,Pq,"JWE Protected Header is invalid")),[t,PU(i,"ciphertext",Pq),void 0!==o?PU(o,"iv",Pq):void 0,void 0!==n?PU(n,"tag",Pq):void 0,PH((r??"")+(void 0!==a?`.${a}`:""),"aad",Pq)]}function VK(e){return[e&&PJ("keyManagementAlgorithms",e.keyManagementAlgorithms),e&&PJ("contentEncryptionAlgorithms",e.contentEncryptionAlgorithms),e?.crit,e?.maxPBES2Count,e?.maxDecompressedLength]}async function VJ(e,t,r,i=VB(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(!PF(d,m,f))throw new Pq("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;PQ(Pq,PK,_,d,o),VD(o,d);let{alg:S,enc:k}=o;if("string"!=typeof S||!S)throw new Pq("missing JWE Algorithm (alg) in JWE Header");let w=Vk[S];if(""===$&&(!w||!VI(w)))throw new Pq("JWE Encrypted Key incorrect type");let P=w?.mode==="integrated-encryption";if(!P&&("string"!=typeof k||!k))throw new Pq("missing JWE Encryption Algorithm (enc) in JWE Header");if(y&&!y.has(S)||!y&&S.startsWith("PBES2"))throw new PP('"alg" (Algorithm) Header Parameter value not allowed');if(P){if(void 0!==k)throw new Pq('JWE "enc" (Encryption Algorithm) Header Parameter must not be present for integrated encryption');if(l?.byteLength)throw new Pq("JWE Initialization Vector must be empty for integrated encryption");if(p?.byteLength)throw new Pq("JWE Authentication Tag must be empty for integrated encryption")}else{if(g&&!g.has(k))throw new PP('"enc" (Encryption Algorithm) Header Parameter value not allowed');n=Vx(k)}if(void 0!==$)try{a=PU($,"encrypted_key",Pq)}catch(e){if(!w||!VI(w))throw e;a=new Uint8Array}let V=!1;"function"==typeof r&&(r=await r(d,e),V=!0);let R=w??Vq(S);VI(R)&&void 0===a&&(a=new Uint8Array);let q=await P1("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 VN(i),r;let d="direct-key-agreement"===s;switch(d?VN(i):function(e){if(void 0===e)throw new Pq("JWE Encrypted Key missing")}(i),e.subtle.name){case"ECDH":{let{epk:i}=o;if(!Pz(i)||["d","k","p","q","dp","dq","qi","oth","priv"].some(e=>Object.hasOwn(i,e)))throw new Pq('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');VA(r);let n=await Va(e,i),s=VW(o,"apu"),c=VW(o,"apv");VM(s,c);let l=await VE(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 P2(r),VC(a,r,"decrypt"),new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP",r,i));case"PBKDF2":{if("number"!=typeof o.p2c)throw new Pq('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 Pq('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof o.p2s)throw new Pq('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let e=PU(o.p2s,"p2s",Pq);r=await VT(e,a,o.p2c,r);break}case"AES-GCM":{if("string"!=typeof o.iv)throw new Pq('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof o.tag)throw new Pq('JOSE Header "tag" (Authentication Tag) missing or invalid');let e=PU(o.iv,"iv",Pq),t=PU(o.tag,"tag",Pq);if(12!==e.byteLength)throw new Pq("Invalid Initialization Vector length");if(16!==t.byteLength)throw new Pq("Invalid Authentication Tag length");return Vf(Vx(a.slice(0,-2)),r,i,e,t,new Uint8Array)}}return async function(e,t,r){let i=await Vs(t,Vq(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),VI(R)&&e instanceof Uint8Array&&e.byteLength<<3!==t.cekBits&&(e=Vd(t))}catch(r){if(r instanceof TypeError||r instanceof Pq||r instanceof PV)throw r;e=Vd(t)}s=await Vf(t,e,c,l,p,u)}if("DEF"===o.zip){let e=b??25e4;if(0===e)throw new PV('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 VF("DecompressionStream"),VL(new DecompressionStream("deflate-raw"),e,t)})(s,e).catch(e=>{throw e instanceof Pq?e:new Pq("Failed to decompress plaintext",{cause:e})})}return{plaintext:s,...d&&{protectedHeader:d},...void 0!==h&&{additionalAuthenticatedData:PU(h,"aad",Pq)},...f&&{sharedUnprotectedHeader:f},...m&&{unprotectedHeader:m},...V&&{key:q}}}async function VZ(e,t,r){if(e instanceof Uint8Array&&(e=Pp.decode(e)),"string"!=typeof e)throw new Pq("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 Pq("Invalid Compact JWE");return VJ({ciphertext:a,iv:n||void 0,protected:i,tag:s||void 0,encrypted_key:o||void 0},t,r)}async function VQ(e,t,r){return VZ(e,VK(r),t)}async function VX(e,t,r){if(!Pz(e))throw new Pq("Flattened JWE must be an object");let i=VU(e),[o,,n]=VH(e);if(!o)throw n;let a={...i,...o};return VG(a),VJ(a,VK(r),t)}async function VY(e,t,r){let i,o,n;if(!Pz(e))throw new Pq("General JWE must be an object");let a=e.recipients;if(!Array.isArray(a))throw new Pq("JWE Recipients missing or incorrect type");let s=Array.from(a);if(!s.every(Pz))throw new Pq("JWE Recipients missing or incorrect type");if(!s.length)throw new Pq("JWE Recipients has no members");try{i=VK(r),o=VU(e),n=VB(o)}catch{throw new PR}let d=s.map(e=>VH(e));if(s.length>1)for(let[,e]of d){let t=n[0]?.alg??e??o.unprotected?.alg,r="string"==typeof t?Vk[t]:void 0;if(r&&!VI(r))throw new Pq(`"${t}" alg may only have a single recipient`)}for(let[e]of d)if(e)try{let r={...o,...e};return VG(r),await VJ(r,i,t,n)}catch{}throw new PR}function V1(e,t,r){if(!PF(e,t,r))throw new Pq("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint")}function V0(e,t,r=!1){if(!e[1]&&!e[2]&&!e[3])throw new Pq("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&&PN(a,"JWE Additional Authenticated Data"),void 0!==s&&PN(s,"JWE Content Encryption Key"),void 0!==d&&PN(d,"JWE Initialization Vector"),r||void 0===i||(i=PY(Pq,i)[0],e[1]=i),void 0!==o&&(o=PY(Pq,o)[0],e[2]=o),r||void 0===n||(n=PY(Pq,n)[0],e[3]=n),void 0!==c&&!Pz(c))throw TypeError("JWE Key Management Parameters must be an object");V1(i,o,n);let p={...i,...o,...n};PZ(Pq,i),PQ(Pq,PK,l,i,p),VD(p,i);let{alg:u,enc:m}=p;if("string"!=typeof u||!u)throw new Pq('JWE "alg" (Algorithm) Header Parameter missing or invalid');let f=Vk[u];if(f?.mode==="integrated-encryption"){if(void 0!==m)throw new Pq('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 Pq('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');return[p,Vx(m),f]}async function V2(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??Vq(c.alg);"integrated-encryption"===k.mode?n=await P1(k,r,"encrypt"):[n,i,o]=await Vz(k,l,r,c,g,v),o&&(b?S=S?{...S,...o}:o:$=$?{...$,...o}:o,V1($,S,h));let w=$?PM(JSON.stringify($)):"",P=y?.byteLength?PM(y):void 0,V=P_(P?`${w}.${P}`:w),R=u;"DEF"===c.zip&&(R=await (async function(e){return VF("CompressionStream"),VL(new CompressionStream("deflate-raw"),e)})(R).catch(e=>{throw new Pq("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 Vm(l,R,n,_,V);let q={ciphertext:PM(a)};return d&&(q.iv=PM(d)),s&&(q.tag=PM(s)),i?.byteLength&&(q.encrypted_key=PM(i)),P&&(q.aad=P),$&&(q.protected=w),h&&(q.unprotected=h),S&&(q.header=S),q}async function V4(e,t,r){return V2(e,V0(e,r),t)}function V6(e){return[e.protected,e.encrypted_key,e.iv,e.ciphertext,e.tag].join(".")}class V3{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r]}setUnprotectedHeader(e){return PL(this.state[0],"setUnprotectedHeader"),this.state[0]=e,this}setKeyManagementParameters(e){return PL(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 V9{#h;#y=[];#g;#_;#v;constructor(e){this.#h=e}addRecipient(e,t){let r=new V3(this,e,t?.crit);return this.#y.push(r),r}setProtectedHeader(e){return PL(this.#g,"setProtectedHeader"),this.#g=e,this}setSharedUnprotectedHeader(e){return PL(this.#_,"setSharedUnprotectedHeader"),this.#_=e,this}setAdditionalAuthenticatedData(e){return this.#v=e,this}async encrypt(){if(!this.#y.length)throw new Pq("at least one recipient must be added");PN(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=V0(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&&!VI(f))throw new Pq(`"${u}" alg may only have a single recipient`);if(t){if(t!==m)throw new Pq('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else t=m}for(let[,e]of o)e[2]??=Vq(e[0].alg);let[n,a,s]=o[0],d=e?Vd(a[1]):void 0;n[5]=d;let{encrypted_key:c,header:l,...p}=await V2(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=Rn(e,[t]),i=Rs(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 PI("inconsistent use of JWS Unencoded Payload (RFC7797)");for(let e of d)try{let[r]=await Rl(e[0],i,t,Rd,e[1]);return r}catch{}throw new PA}let Rh=e=>Math.floor(e.getTime()/1e3),Ry={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},Rg=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,R_="check_failed";function Rv(){throw TypeError("Invalid time period format")}function Rb(e){"string"!=typeof e&&Rv();let t=Rg.exec(e);(!t||t[4]&&t[1])&&Rv();let r=Math.round(parseFloat(t[2])*Ry[t[3][0].toLowerCase()]);return Number.isFinite(r)||Rv(),"-"===t[1]||"ago"===t[4]?-r:r}function R$(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}function RS(e,t){if("string"!=typeof t)throw TypeError(`"${e}" claim must be a string`)}function Rk(e,t){return"number"==typeof e?R$(t,e):e instanceof Date?R$(t,Rh(e)):Rh(new Date)+Rb(e)}let Rw=e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`};function RP(e,t,r=!1){let i=e[t];if(!(void 0===i&&!r)){if("number"!=typeof i)throw new Pk(`"${t}" claim must be a number`,e,t,"invalid");return i}}function RV(e,t){throw new Pk(`unexpected "${t}" claim value`,e,t,R_)}function RR(e,t,r={}){let i,o,n;try{i=JSON.parse(Pu.decode(t))}catch{}if(!Pz(i))throw new Px("JWT Claims Set must be a top-level JSON object");let{typ:a}=r;if(void 0!==a&&("string"!=typeof e.typ||Rw(e.typ)!==Rw(a)))throw new Pk('unexpected "typ" JWT header value',i,"typ",R_);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 Pk(`missing required "${e}" claim`,i,e,"missing");void 0===d||(Array.isArray(d)?d:[d]).includes(i.iss)||RV(i,"iss"),void 0!==c&&i.sub!==c&&RV(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)))||RV(i,"aud");let{clockTolerance:m}=r,f=0;if("string"==typeof m)f=Rb(m);else if(void 0!==m){if("number"!=typeof m)throw TypeError("Invalid clockTolerance option type");f=m}R$("clockTolerance option",f);let{currentDate:h}=r,y=R$("currentDate option",Rh(void 0===h?new Date:h)),g=RP(i,"iat",void 0!==p),_=RP(i,"nbf");if(void 0!==_&&_>y+f)throw new Pk('"nbf" claim timestamp check failed',i,"nbf",R_);let v=RP(i,"exp");if(void 0!==v&&v<=y-f)throw new Pw('"exp" claim timestamp check failed',i,"exp",R_);if(void 0!==p){let e=y-g;if(e-f>R$("maxTokenAge option","number"==typeof p?p:Rb(p)))throw new Pw('"iat" claim timestamp check failed (too far in the past)',i,"iat",R_);if(e<-f)throw new Pk('"iat" claim timestamp check failed (it should be in the past)',i,"iat",R_)}return i}function Rq(e){return f.get(e)}function RI(e){let t=Rq(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 Pl.encode(JSON.stringify(t))}class Rx{constructor(e={}){if(!Pz(e))throw TypeError("JWT Claims Set MUST be an object");(f||=new WeakMap).set(this,structuredClone(e))}setIssuer(e){return RS("iss",e),Rq(this).iss=e,this}setSubject(e){return RS("sub",e),Rq(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),Rq(this).aud=e,this}setJti(e){return RS("jti",e),Rq(this).jti=e,this}setNotBefore(e){return Rq(this).nbf=Rk(e,"setNotBefore"),this}setExpirationTime(e){return Rq(this).exp=Rk(e,"setExpirationTime"),this}setIssuedAt(e){let t=Rq(this);return void 0===e?t.iat=Rh(new Date):"string"==typeof e?t.iat=R$("setIssuedAt",Rh(new Date)+Rb(e)):t.iat=Rk(e,"setIssuedAt"),this}}async function Rj(e,t,r){let[i,o]=await Rp(e,Ra(r),t);if(!o)throw new Px("JWTs MUST NOT use unencoded payload");let n=RR(i.protectedHeader,i.payload,r);return{...i,payload:n}}async function RC(e,t,r){let{plaintext:i,...o}=await VZ(e,VK(r),t),{protectedHeader:n}=o,a=RR(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 Pk(`replicated "${e}" claim header parameter mismatch`,a,e,"mismatch");return{payload:a,...o}}class RT{#b;constructor(e){PN(e,"plaintext"),this.#b=[e]}setContentEncryptionKey(e){return PL(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PL(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PL(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}async encrypt(e,t){return V6(await V4([...this.#b],e,t))}}class RO{#b;constructor(e){PN(e,"plaintext"),this.#b=[e]}setKeyManagementParameters(e){return PL(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setSharedUnprotectedHeader(e){return PL(this.#b[3],"setSharedUnprotectedHeader"),this.#b[3]=e,this}setUnprotectedHeader(e){return PL(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}setAdditionalAuthenticatedData(e){return this.#b[4]=e,this}setContentEncryptionKey(e){return PL(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PL(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}async encrypt(e,t){return V4([...this.#b],e,t)}}async function RE(e,t,r){let[i,o,n,a]=e,s="";if(void 0!==o){let e=PY(PI,o);o=e[0],s=PM(e[1])}if(void 0!==n&&(n=PY(PI,n)[0]),!o&&!n)throw new PI("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!PF(o,n))throw new PI("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...o,...n};PZ(PI,o);let c=PX(o,PQ(PI,PB,a,o,d));c||r?.();let{alg:l}=d;if("string"!=typeof l||!l)throw new PI('JWS "alg" (Algorithm) Header Parameter missing or invalid');let p=Ro(l),u="",m=i,f;if(c){let t=e[4];t?(u=t[0]??=PM(i),m=t[1]??=P_(u)):(u=PM(i),f=Pl.encode(`${s}.${u}`))}f??=Pm(P_(s),P_("."),m);let h=await Vs(await P1(p,t,"sign"),p.subtle,"sign");p.minRsaBits&&Vt(p.alg,h);let y={signature:PM(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 RA(e,t,r,i,o){let[n]=await RE([e,t,void 0,r],i,o);return`${n.protected}.${n.payload}.${n.signature}`}class RW{#$;#g;constructor(e){PN(e,"payload"),this.#$=e}setProtectedHeader(e){return PL(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RA(this.#$,this.#g,t?.crit,e,()=>{throw TypeError("use the flattened module for creating JWS with b64: false")})}}class RM{#b;constructor(e){PN(e,"payload"),this.#b=[e]}setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setUnprotectedHeader(e){return PL(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}async sign(e,t){let r=[...this.#b];r[3]=t?.crit;let[i]=await RE(r,e);return i}}class RN{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r?.crit]}setProtectedHeader(e){return PL(this.state[0],"setProtectedHeader"),this.state[0]=e,this}setUnprotectedHeader(e){return PL(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 Rz{#$;#S=[];constructor(e){this.#$=e}addSignature(e,t){let r=new RN(this,e,t);return this.#S.push(r),r}async sign(){let e;if(!this.#S.length)throw new PI("at least one signature must be added");PN(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 RE([this.#$,o,n,s,r],a);if(void 0===e)e=l,t.payload=d;else if(e!==l)throw new PI("inconsistent use of JWS Unencoded Payload (RFC7797)");t.signatures.push(c)}return t}}let RD=Rx;class RF extends RD{#g;setProtectedHeader(e){return PL(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RA(RI(this),this.#g,t?.crit,e,()=>{throw new Px("JWTs MUST NOT use unencoded payload")})}}let RL=Rx;class RU extends RL{#b=[void 0];#k;#w;#P;setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PL(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setContentEncryptionKey(e){return PL(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PL(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=RI(this);this.#b[1]&&(this.#k||this.#w||this.#P)&&(this.#b[1]={...this.#b[1],iss:this.#k?Rq(this).iss:void 0,sub:this.#w?Rq(this).sub:void 0,aud:this.#P?Rq(this).aud:void 0});let i=[...this.#b];return i[0]=r,V6(await V4(i,e,t))}}let RH='"alg" (Algorithm)';function RG(e='JWK "alg" (Algorithm) Parameter'){throw new PV(`Invalid or unsupported ${e} value`)}function RB(e,t){return("string"==typeof e?Ri[e]??Vk[e]:void 0)??RG(t)}let RK=async(e,t,r)=>{var i,o;let n;if(P6(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!P4(r))throw TypeError(P5(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=Pv(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 lG.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=>aM.parse(e)):[aM.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=>aY.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=>lp(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=>aY.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))lp(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))lp(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;lp(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((aA.safeParse(e).success||aW.safeParse(e).success)&&(r=e.id),void 0===r){let t;if(aA.safeParse(e).success||aW.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(aA.safeParse(e).success||aW.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 u0=Symbol("swallowsErrorsAfterClose");var u2=class{_readBuffer;_started=!1;_closed=!1;constructor(e=N.stdin,t=N.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new lB({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[u0]&&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[u0]=!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)})}},u4=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}};let u6=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"]),u3=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,u9=e=>9===e||10===e||13===e||32===e,u5=e=>{if(!u9(e.charCodeAt(0))&&!u9(e.charCodeAt(e.length-1)))return e;let t=0,r=e.length;for(;tt&&u9(e.charCodeAt(r-1));)r--;return e.slice(t,r)},u8=/[\0\r\n]/,u7=globalThis.Headers,me=(e,t=u7)=>{let r=new t;for(let t=0;t{e.call(t,r,i,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(mt.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(mt.prototype,u7.prototype);let mr=e=>globalThis.Headers===u7?new mt(e):me(e.rawHeaders,globalThis.Headers),mi=/^\/[!#$&-;=?-\[\]_a-z~]*$/,mo=/\/\.\.?(?:[/?#]|$)/,mn=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,ma=global.Request;var ms=class extends ma{constructor(e,t){if("object"==typeof e&&mg in e){let r=void 0!==t&&"body"in t&&null!=t.body;if(e[mq]&&!r)throw TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[mg]()}void 0!==t?.body?.getReader&&(t.duplex??="half"),super(e,t)}};let md=Symbol("wrapBodyStream"),mc=new Set(["latin1","binary","hex","base64","base64url"]),ml=Symbol("bodyBufferedBeforeDisconnect"),mp=Symbol("bodyBufferedLengthBeforeDisconnect"),mu=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),mm=e=>{let t;return!(e instanceof z)&&!!e.complete&&!!e.readableAborted&&"function"==typeof e.read&&(null===(t=e.readableEncoding)||mc.has(t))},mf=e=>{e.readableDidRead||!mm(e)||(e[mp]??=e.readableLength)},mh=(e,t)=>{let r;if(e.readableDidRead&&!t||!mm(e))return;if(void 0!==e[ml])return e[ml];let i=e.errored;if(i&&"ECONNRESET"!==i.code)r=i;else if(void 0!==e[mp]&&e.readableLength!==e[mp])r=mj();else{let i=t??[],o=e.read();null!==o&&i.push(mu(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=mj())}}return e[ml]=r,r},my=(e,t)=>{t instanceof Error?e.error(t):(t.length>0&&e.enqueue(t),e.close())},mg=Symbol("getRequestCache"),m_=Symbol("requestCache"),mv=Symbol("incomingKey"),mb=Symbol("urlKey"),m$=Symbol("methodKey"),mS=Symbol("headersKey"),mk=Symbol("abortControllerKey"),mw=Symbol("getAbortController"),mP=Symbol("abortRequest"),mV=Symbol("bodyBuffer"),mR=Symbol("bodyReadPromise"),mq=Symbol("bodyConsumedDirectly"),mI=Symbol("bodyLockReader"),mx=Symbol("abortReason"),mj=()=>TypeError("Body is unusable"),mC=new TextDecoder,mT=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,mO=(e,t,r)=>{if(e[mq])return Promise.reject(mj());let i=e.method;if("GET"===i||"HEAD"===i)return e[mg]()[t]();let o=(e=>{if(!mT.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[m_]&&"TRACE"!==i)return e[m_][t]();let n=(e=>{if(e[mq])return Promise.reject(mj());e[mq]=!0})(e);if(n)return n;let a=mE(e);if(a){let t=Promise.resolve(r(a,e));return e[mV]=void 0,t}return mW(e).then(t=>{let i=r(t,e);return e[mV]=void 0,i})},mE=e=>{let t=e[mv];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},mA=(e,t)=>{if(t.errored)return t.errored;let r=e[mx];return void 0!==r?r instanceof Error?r:Error(String(r)):Error("Client connection prematurely closed.")},mW=e=>{if(e[mV])return Promise.resolve(e[mV]);if(e[mR])return e[mR];let t=e[mv];if(t.readableDidRead)return Promise.reject(mj());let r=mh(t);if(void 0!==r)return r instanceof Error?Promise.reject(r):(e[mV]=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!!mm(t)&&(!s||"ECONNRESET"===s.code)&&(a(()=>{let a=mh(t,o);a instanceof Error?i(a):void 0===a?i(n??mA(e,t)):(e[mV]=a,r(a))}),!0)},d=e=>{o.push(mu(e,t.readableEncoding))},c=()=>{a(()=>{let t=1===o.length?o[0]:Buffer.concat(o);e[mV]=t,r(t)})},l=e=>{s(e)||a(()=>{i(e)})},p=()=>{t.readableEnded?c():s()||a(()=>{i(mA(e,t))})},u=()=>{t.off("data",d),t.off("end",c),t.off("error",l),t.off("close",p),e[mR]=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[mR]=i,i},mM={get method(){return this[m$]},get url(){return this[mb]},get headers(){return this[mS]||=mr(this[mv])},[mP](e){void 0===this[mx]&&(this[mx]=e);let t=this[mk];t&&!t.signal.aborted&&t.abort(e)},[mw](){return this[mk]||=new AbortController,void 0===this[mx]||this[mk].signal.aborted||this[mk].abort(this[mx]),this[mk]},[mg](){let e=this[mw]();if(this[m_])return this[m_];let t=this.method;if(this[mq]&&"GET"!==t&&"HEAD"!==t){this[mV]=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 ms(this[mb],r);return"TRACE"===t&&Object.defineProperty(i,"method",{get:()=>"TRACE"}),this[m_]=i}return this[m_]=((e,t,r,i,o)=>{let n={method:e,headers:r,signal:o.signal};if("TRACE"===e){n.method="GET";let e=new ms(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[md]){let e;n.body=new ReadableStream({async pull(t){try{if(!e){let e=mh(i);if(void 0!==e)return void my(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=mh(i);void 0!==e?n.body=new ReadableStream({start(t){my(t,e)}}):n.body=L.toWeb(i)}return new ms(t,n)})(this.method,this[mb],this.headers,this[mv],e)},get body(){if(!this[mq])return this[mg]().body;let e=this[mg]();return!this[mI]&&e.body&&(this[mI]=e.body.getReader()),e.body},get bodyUsed(){return!!this[mq]||!!this[m_]&&this[m_].bodyUsed}};Object.defineProperty(mM,"signal",{get(){return this[mw]().signal}}),["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(mM,e,{get(){return this[mg]()[e]}})}),["clone","formData"].forEach(e=>{Object.defineProperty(mM,e,{value:function(){if(this[mq]){if("clone"===e)throw mj();return Promise.reject(mj())}return this[mg]()[e]()}})}),Object.defineProperty(mM,"text",{value:function(){return mO(this,"text",e=>mC.decode(e))}}),Object.defineProperty(mM,"arrayBuffer",{value:function(){return mO(this,"arrayBuffer",e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}}),Object.defineProperty(mM,"blob",{value:function(){return mO(this,"blob",(e,t)=>{let r=(t[mS]||=mr(t[mv])).get("content-type")||"";return new Response(e,r?{headers:{"content-type":r}}:void 0).blob()})}}),Object.defineProperty(mM,"json",{value:function(){return this[mq]?Promise.reject(mj()):this.text().then(JSON.parse)}}),Object.defineProperty(mM,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[m_]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mM,ms.prototype);let mN="text/plain; charset=UTF-8",mz=Symbol("responseCache"),mD=Symbol("getResponseCache"),mF=Symbol("cache"),mL=global.Response;var mU=class e{#c;#l;[mD](){let e=this[mF],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[mF],this[mz]||=new mL(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 mL){let t=r[mz];if(t){this.#l=t,this[mD]();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[mF]=[r?.status||200,t??null,i||r?.headers])}get headers(){let e=this[mF];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(null===e[1]?void 0:{"content-type":mN}))),e[2]):this[mD]().headers}get status(){return this[mF]?.[0]??this[mD]().status}get ok(){let e=this.status;return e>=200&&e<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(mU.prototype,e,{get(){return this[mD]()[e]}})}),["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(mU.prototype,e,{value:function(){return this[mD]()[e]()}})}),Object.defineProperty(mU.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[mz]},{...t,depth:null==e?null:e-1})}`}}),Object.setPrototypeOf(mU,mL),Object.setPrototypeOf(mU.prototype,mL.prototype);let mH=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,mG=new Set([301,302,303,307,308]);function mB(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 mK(e,t){if(e.locked)throw TypeError("ReadableStream is locked.");if(!t.destroyed)return mB(e.getReader(),t)}Object.defineProperty(mU,"redirect",{value:function(e,t=302){if(!mG.has(t))throw RangeError("Invalid status code");return new mU(null,{status:t,headers:{location:e instanceof URL?e.href:mH.test(e)?e:new URL(e).href}})},writable:!0,configurable:!0}),Object.defineProperty(mU,"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 mU(i,{status:t?.status??200,statusText:t?.statusText,headers:r})},writable:!0,configurable:!0});let mJ=(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},mZ=Symbol("outgoingEnded"),mQ=Symbol("incomingDraining"),mX=e=>{if(e.destroyed||e[mQ])return;if(e[mQ]=!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()},mY=e=>new Response(null,{status:e instanceof Error&&("TimeoutError"===e.name||"TimeoutError"===e.constructor.name)?504:500}),m1=(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))},m0=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},m2=(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),m4=(e,t,r)=>{m2(e,t,r)?e.writeHead(t,{"Content-Type":mN}):e.writeHead(t,{"Content-Type":mN,"Content-Length":r})},m6=async(e,t)=>{let[r,i,o]=e[mF];if(!o){null===i?(t.writeHead(r),t.end()):"string"==typeof i?(m4(t,r,Buffer.byteLength(i)),t.end(i)):i instanceof Uint8Array?(m4(t,r,i.byteLength),t.end(i)):i instanceof Blob?(m4(t,r,i.size),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(r,{"Content-Type":mN}),m0(t),await mK(i,t)?.catch(e=>m1(e,t))),t[mZ]?.();return}let n=!1,a=!1,s=!0;if(o instanceof Headers)n=o.has("content-length"),o=mJ(o,null===i?void 0:mN);else if(Array.isArray(o)){let e=new Headers(o);n=e.has("content-length"),o=mJ(e,null===i?void 0:mN)}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&&m2(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())):(m0(t),await mK(i,t)?.catch(e=>m1(e,t))),t[mZ]?.()},m3=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return!1!==t.overrideGlobalObjects&&global.Request!==ms&&(Object.defineProperty(global,"Request",{value:ms}),Object.defineProperty(global,"Response",{value:mU})),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?(mf(i),e[mP](i.errored.toString())):(!o.writableFinished||i instanceof z&&i.aborted)&&(mf(i),e[mP]("Client connection prematurely closed.")),t&&!i.readableEnded&&setTimeout(()=>{i.readableEnded||setTimeout(()=>{mX(i)})})}))}};try{let d;if(a=((e,t)=>{let r,i=Object.create(mM);i[mv]=e,i[m$]=(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 u4("Absolute URL for :path is not allowed in HTTP/2");try{i[mb]=new URL(o).href}catch(e){throw new u4("Invalid absolute URL",{cause:e})}return i}let n=(e instanceof z?e.authority:e.headers.host)||t;if(!n)throw new u4("Missing host header");if(e instanceof z){if("http"!==(r=e.scheme)&&"https"!==r)throw new u4("Unsupported scheme")}else r=e.socket&&e.socket.encrypted?"https":"http";try{i[mb]=((e,t,r)=>{let i=`${e}://${t}${r}`;if(mn.test(t)){if(0===r.length)return i+"/";if(47!==r.charCodeAt(0))throw new u4("Invalid URL");return!mi.test(r)||mo.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 u4("Invalid host header");return e.href}})(r,n,o)}catch(e){if(e instanceof u4)throw e;throw new u4("Invalid URL",{cause:e})}return i})(i,t.hostname),(s=r&&"GET"!==i.method&&"HEAD"!==i.method)&&(i[md]=!0,i instanceof z&&(o[mZ]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),o.destroy()})})})),d=n=e(a,{incoming:i,outgoing:o}),"function"!=typeof d.then&&(e=>{if(!(mF in e))return!1;let t=e[mF][1];return null===t||"string"==typeof t||t instanceof Uint8Array})(n))return s&&!i.readableEnded&&o.once("finish",()=>{i.readableEnded||mX(i)}),m6(n,o);c()}catch(e){if(n)return m1(e,o);if(t.errorHandler){if(c(),!(n=await t.errorHandler(a||e instanceof u4?e:new u4(e.message,{cause:e}))))return}else n=a?mY(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(mY);if(mF in e)return m6(e,t);let i=mJ(e.headers,null===e.body?void 0:mN);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&&m0(t),await mB(o,t,r))}else i["x-hono-already-sent"]||(t.writeHead(e.status,i),t.end());t[mZ]?.()})(n,o,t)}catch(e){return m1(e,o)}}};globalThis.CloseEvent??Event,globalThis.ErrorEvent??Event,Symbol("CONNECTION_SYMBOL_KEY"),Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");var m9=class{_webStandardTransport;_requestListener;_requestContext=new WeakMap;constructor(e={}){this._webStandardTransport=new u1(e),this._requestListener=m3(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 m3(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 m5(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 m8=o7().min(1),m7=nz({pid:nP().int().nonnegative(),process_run_id:o7(),started_at_unix_secs:nP().int(),epoch:nP().int().nonnegative(),version:o7(),endpoint:nE(),http_application_endpoint:m8.nullable().optional(),auth_token:o7().min(1),profile_root:o7().min(1)});function fe(e){let t=e.http_application_endpoint;return null==t?null:`http://${t}`}function ft(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 fr(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical schema: ${t} must be an object`);return e}function fi(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 fo(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an object`);return e}function fn(e,t){if("string"!=typeof e)throw TypeError(`malformed canonical envelope: ${t} must be a string`);return e}function fa(e,t){if("number"!=typeof e||!Number.isFinite(e))throw TypeError(`malformed canonical envelope: ${t} must be a finite number`);return e}function fs(e,t){if(!Array.isArray(e))throw TypeError(`malformed canonical envelope: ${t} must be an array`);return e}function fd(e,t){let r=fa(e,t);if(!Number.isSafeInteger(r))throw TypeError(`malformed canonical envelope: ${t} must be a safe integer`);return r}function fc(e,t){let r=fd(e,t);if(r<0)throw TypeError(`malformed canonical envelope: ${t} must be non-negative`);return r}let fl=new TextEncoder;function fp(e,t,r){let i=fn(e,t);if(0===i.length||i.trim()!==i||fl.encode(i).byteLength>r||/\p{Cc}/u.test(i))throw TypeError(`malformed canonical envelope: ${t} is not a bounded identifier`);return i}function fu(e,t,r,i,o,n,a,s,d){let c=fo(e,"success envelope");if(fn(c.binding_id,"binding_id")!==t)throw TypeError("malformed canonical envelope: binding mismatch");let l=fo(c.contract,"contract");if(fn(l.schema_id,"contract.schema_id")!==r||fa(l.schema_revision,"contract.schema_revision")!==i)throw TypeError("malformed canonical envelope: result contract mismatch");fn(c.request_id,"request_id"),fo(c.scope,"scope");let p=fo(c.outcome,"outcome"),u=fn(p.outcome,"outcome.outcome");return{...c,outcome:{...p,outcome:u,value:function(e,t,r,i,o,n,a){let s=fo(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=fo(e,"outcome.value.execution");if(fa(i.started_at,"execution.started_at"),fa(i.ended_at,"execution.ended_at"),!("effective_deadline"in i)||!("cancellation"in i))throw TypeError("malformed canonical envelope: receipt fields are required");let o=fo(i.budget,"execution.budget");fa(o.units_consumed,"budget.units_consumed"),fa(o.bytes_consumed,"budget.bytes_consumed"),fa(o.elapsed_micros,"budget.elapsed_micros");let n=fn(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=fo(r,"operation.cancellation"),t=fn(e.mode,"operation.cancellation.mode"),o=fo(i.cancellation,"execution.cancellation"),a=fn(o.stage,"execution.cancellation.stage");if(fd(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(!fs(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)fo(s.temporal,"temporal"),fo(s.authority,"authority"),fs(s.evidence_authorities,"evidence_authorities"),fo(s.coverage,"coverage"),fs(s.omissions,"omissions"),fs(s.scores,"scores"),fs(s.contributions,"contributions"),function(e){let t=fo(e,"outcome.value.page");if(fp(t.sort_contract_id,"page.sort_contract_id",192),1>fc(t.sort_revision,"page.sort_revision"))throw TypeError("malformed canonical envelope: page sort_revision must be positive");let r=null===t.total?null:fc(t.total,"page.total"),i=fc(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=fo(e,"page.cursor"),r=fn(t.kind,"page.cursor.kind");if("opaque"===r)fp(t.cursor,"page.cursor.cursor",4096);else throw TypeError(`malformed canonical envelope: unsupported page cursor kind ${r}`)}(t.cursor),null!==t.expires_at&&fd(t.expires_at,"page.expires_at")}(s.page);else if("preview"===e)fn(s.preview_id,"preview_id"),fn(s.preview_digest,"preview_digest"),fn(s.effect_class,"effect_class"),fo(s.authority,"authority"),fn(s.expected_state,"expected_state");else if("effect"===e)fn(s.effect_id,"effect_id"),fn(s.effect_class,"effect_class"),fn(s.idempotency_key,"idempotency_key"),fo(s.authority,"authority"),fn(s.expected_state,"expected_state"),fn(s.reconciliation,"reconciliation"),fo(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 fm(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ff(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function fh(e){return"number"==typeof e&&Number.isSafeInteger(e)}function fy(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&fl.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}async function fg(e){let t=await crypto.subtle.digest("SHA-256",fl.encode(ft(e)));return`sha256:${Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}`}function f_(e){return fm(e)&&"string"==typeof e.code&&"string"==typeof e.message}let fv={description:"Strongly typed algorithm-tagged integrity digest: `AccessPolicyDigest`.",type:"string"},fb={description:"Strongly typed canonical identity: `AccessRuleId`.",type:"string"},f$={description:"Strongly typed canonical identity: `ActorId`.",type:"string"},fS={description:"Strongly typed canonical identity: `AgentInstanceId`.",type:"string"},fk={enum:["memory_curator","session_reflector","skill_writer","combined_review","user_job"],type:"string"},fw={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"},fP={enum:["off","local_only","aggregate_share"],type:"string"},fV={oneOf:[{const:"project",description:"Analytics events of the resolved project.",type:"string"},{const:"all",description:"Analytics events of every registered project.",type:"string"}]},fR={description:"Strongly typed canonical identity: `AnalyzerEnvironmentVariable`.",type:"string"},fq={description:"Strongly typed canonical identity: `AnalyzerExecutableId`.",type:"string"},fI={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"}]},fx={description:"Strongly typed canonical identity: `AnalyzerLanguageId`.",type:"string"},fj={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"},fC={enum:["non_sensitive","sensitive","restricted"],type:"string"},fT={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"},fO={enum:["restart_on_configuration_change","manual_restart_only"],type:"string"},fE={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"},fA={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"}]},fW={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"}]},fM={description:"Strongly typed canonical identity: `AttemptId`.",type:"string"},fN={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"}]},fz={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"},fD={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"},fF={description:"A terminal automatic-fact receipt state.",enum:["applied","quarantined"],type:"string"},fL={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"}]},fU={enum:["disabled","codex_app_server"],type:"string"},fH={enum:["standalone","delegated_host"],type:"string"},fG={description:"The settled status every successful read in this family reports.",enum:["ok"],type:"string"},fB={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"}]},fK={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"},fJ={description:"Automation run reads answer from the active project's ledger only.",enum:["active_project"],type:"string"},fZ={enum:["queued","running","succeeded","failed","skipped"],type:"string"},fQ={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"},fX={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"},fY={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"]},stale_lock_secs:{format:"uint64",minimum:0,type:["integer","null"]}},required:["enabled"],type:"object"},f1={enum:["manual_cli","manual_mcp","dashboard","application","scheduler","host_receipt"],type:"string"},f0={description:"Strongly typed canonical identity: `BrainId`.",type:"string"},f2={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"}]},f4={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"}]},f6={enum:["hyphen","underscore","slash"],type:"string"},f3={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"},f9={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"},f5={description:"Strongly typed canonical identity: `BranchStackId`.",type:"string"},f8={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"},f7={description:"Strongly typed canonical identity: `BranchStackRevisionId`.",type:"string"},he={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"},ht={description:"Authoritative source that declared the exact stack topology.",enum:["explicit_declaration","accepted_task_branch_topology"],type:"string"},hr={enum:["no_branches","unbranched","independent_branches","local_stack"],type:"string"},hi={additionalProperties:!1,properties:{allowed:{items:{$ref:"#/$defs/BranchTopologyKindV1"},type:"array",uniqueItems:!0}},required:["allowed"],type:"object"},ho={description:"Strongly typed canonical identity: `CalibrationProfileId`.",type:"string"},hn={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"},ha={additionalProperties:!1,properties:{observed_at:{$ref:"#/$defs/UtcMicros"},stage:{$ref:"#/$defs/CancellationStage"}},required:["stage","observed_at"],type:"object"},hs={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"},hd={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"},hc={description:"A validated full native Git ref name, such as `refs/heads/main`.",type:"string"},hl={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"},hp={description:"Strongly typed canonical identity: `CapabilityId`.",type:"string"},hu={description:"Strongly typed canonical identity: `CatalogGenerationId`.",type:"string"},hm={description:"Strongly typed canonical identity: `ChangePlanId`.",type:"string"},hf={additionalProperties:!1,properties:{from_inclusive:{format:"int64",type:["integer","null"]},through_inclusive:{format:"int64",type:["integer","null"]}},type:"object"},hh={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"},hy={enum:["kind","language","path"],type:"string"},hg={description:"Strongly typed canonical identity: `CodeGenerationId`.",type:"string"},h_={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"}]},hv={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"},hb={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"},h$={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"},hS={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"},hk={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"}]},hw={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"},hP={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"}]},hV={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"},hR={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"},hq={description:"Strongly typed canonical identity: `CodeSearchChunkId`.",type:"string"},hI={description:"Strongly typed canonical identity: `CommitId`.",type:"string"},hx={enum:["promote","reject","insufficient_evidence"],type:"string"},hj={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"}]},hC={description:"Strongly typed canonical identity: `ComponentRevision`.",type:"string"},hT={description:"Strongly typed canonical identity: `ComponentVersion`.",type:"string"},hO={enum:["config_summary"],type:"string"},hE={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"},hA={description:"Strongly typed canonical identity: `ConfigurationIdempotencyKey`.",type:"string"},hW={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"}]},hM={description:"Strongly typed canonical identity: `ConfigurationReceiptId`.",type:"string"},hN={description:"Strongly typed canonical identity: `ConfigurationRevisionId`.",type:"string"},hz={description:"Strongly typed canonical identity: `ConfigurationSnapshotId`.",type:"string"},hD={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"}]},hF={description:"Strongly typed algorithm-tagged integrity digest: `ContentDigest`.",type:"string"},hL={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"}]},hU={enum:["explore","plan"],type:"string"},hH={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"},hG={enum:["retrieval","diagnostic","coordination","verification"],type:"string"},hB={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"},hK={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"},hJ={enum:["deterministic","configured_model"],type:"string"},hZ={enum:["active","paused","disabled"],type:"string"},hQ={enum:["codex_app_server"],type:"string"},hX={enum:["attempted","delayed","displayed","expanded","explicitly_accepted","explicitly_rejected","dismissed","expired_unseen","corrected","unknown"],type:"string"},hY={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"},h1={enum:["immediate","next_boundary","idle_window","on_request","suppressed"],type:"string"},h0={enum:["complete","partial","stale","cancelled","unavailable"],type:"string"},h2={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"},h4={enum:["explicitly_accepted","explicitly_rejected","dismissed","corrected"],type:"string"},h6={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"},h3={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"},h9={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"},h5={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"},h8={enum:["disabled","codex_app_server","unsupported","decision_engine"],type:"string"},h7={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"}]},ye={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"},yt={additionalProperties:!1,properties:{feedback:{anyOf:[{$ref:"#/$defs/ContextScoutFeedbackV1"},{type:"null"}]},receipt:{$ref:"#/$defs/ContextScoutDeliveryReceiptV1"},suggestion:{$ref:"#/$defs/ContextScoutSuggestionProjectionV1"}},required:["suggestion","receipt"],type:"object"},yr={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"}]},yi={enum:["deterministic","configured_model"],type:"string"},yo={enum:["active","paused","disabled"],type:"string"},yn={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"},ya={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"},ys={enum:["stored","duplicate","superseded"],type:"string"},yd={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"},yc={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"}]},yl={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"},yp={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"},yu={description:"Which side of a file dependency the coupling report counts.",enum:["fan_in","fan_out"],type:"string"},ym={description:"Completeness is explicit; unknown never renders as clean.",enum:["complete","partial","unknown"],type:"string"},yf={additionalProperties:!1,properties:{completeness:{$ref:"#/$defs/CoverageCompleteness"},domain:{$ref:"#/$defs/EvidenceDomain"}},required:["domain","completeness"],type:"object"},yh={enum:["known","partial","stale","unknown","sampled","capped"],type:"string"},yy={description:"Strongly typed canonical identity: `CredentialReferenceId`.",type:"string"},yg={enum:["disabled","manual_receipt_only","fast_forward_only","merge_commit","cherry_pick_exact_commits"],type:"string"},y_={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"},yv={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"}]},yb={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"},y$={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"},yS={description:"Diagnostic severity. Source severity is preserved exactly; TraceDecay\nnever raises severity because several producers agree.",enum:["error","warning","information","hint"],type:"string"},yk={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"},yw={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"}]},yP={description:"Shape of the design-structure-matrix report.",enum:["stats","clusters","matrix"],type:"string"},yV={enum:["prevented","committed","unknown","not_applicable"],type:"string"},yR={enum:["exact_duplicate","superseded_overlap","repeated_investigation","duplicate_effect","not_duplicate","censored","unknown"],type:"string"},yq={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"}]},yI={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"},yx={description:"Durable effect receipt terminal state.",enum:["completed","cancelled","timed_out","failed","partial","effect_unknown"],type:"string"},yj={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"},yC={description:"Requested evidence domain for bounded coverage and omissions.",enum:["symbol","source","graph","test","temporal","anchor","operational","diagnostic"],type:"string"},yT={description:"Evidence role used by dedupe/diversity caps. Independent corroboration\nand contradictions are preserved.",enum:["primary","corroboration","contradiction","context"],type:"string"},yO={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"},yE={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"},yA={description:"Strongly typed canonical identity: `FactAssertionId`.",type:"string"},yW={enum:["general","user_pref","project","tool","decision","code_area"],type:"string"},yM={enum:["committed","idempotent_replay"],type:"string"},yN={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"}]},yz={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"},yD={description:"Strongly typed canonical identity: `FactEventId`.",type:"string"},yF={enum:["helpful","unhelpful"],type:"string"},yL={description:"Strongly typed canonical identity: `FactId`.",type:"string"},yU={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"}]},yH={description:"Payload states that structurally cannot expose an available fact payload.",enum:["redacted","quarantined","retention_expired","deleted","unavailable","ambiguous"],type:"string"},yG={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"}]},yB={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"}]},yK={enum:["conflict","unavailable","budget_exhausted","deadline_exceeded"],type:"string"},yJ={additionalProperties:!1,properties:{fact:{$ref:"#/$defs/FactV1"},scores:{$ref:"#/$defs/FactSearchScoresV1"},why:{type:["string","null"]}},required:["fact","scores"],type:"object"},yZ={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"},yQ={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"},yX={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"},yY={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"},y1={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"},y0={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"}]},y2={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"}]},y4={description:"Strongly typed canonical identity: `FeedbackCycleId`.",type:"string"},y6={enum:["clean","duplicate_noop","blocked","incomplete_coverage","stale_replan_required","budget_exceeded","cancelled","user_stop","daemon_unavailable"],type:"string"},y3={enum:["new","pre_existing","unknown"],type:"string"},y9={description:"Closed producer vocabulary for standard diagnostic projection.",enum:["code_diagnostic","git_hub_review","ci_localization","proximity"],type:"string"},y5={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"},y8={enum:["durable","session_only"],type:"string"},y7={description:"Strongly typed canonical identity: `FeedbackFindingId`.",type:"string"},ge={enum:["active","superseded","resolved","cleared"],type:"string"},gt={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"},gr={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"},gi={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"},go={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"},gn={description:"Strongly typed canonical identity: `FeedbackResultId`.",type:"string"},ga={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"},gs={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"},gd={description:"Strongly typed canonical identity: `FileOccurrenceId`.",type:"string"},gc={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"}]},gl={description:"Deterministic fixed-point score in millionths. No floating point crosses\nthis boundary.",format:"uint64",minimum:0,type:"integer"},gp={description:"Compatibility state of one source/projection pair.",enum:["current","stale","incompatible","missing","unknown"],type:"string"},gu={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",default:"production_other",description:"Strongest source role across the fused occurrences. Absent historical\ncandidates deserialize as a non-definition hit."},utility_micros:{format:"uint64",minimum:0,type:"integer"}},required:["anchor_id","logical_evidence_id","occurrences","exact_class","utility_micros","contributions","freshness","decisions"],type:"object"},gm={description:"Metric whose distribution the Gini report measures.",enum:["complexity","lines","fan_in","fan_out","members"],type:"string"},gf={description:"Unit the Gini report aggregates its metric over.",enum:["file","symbol"],type:"string"},gh={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"}]},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={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"},g_={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"},gv={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"}]},gb={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"},g$={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"}]},gS={enum:["disabled","probe_private_preview"],type:"string"},gk={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"},gw={description:"Strongly typed canonical identity: `GitIndexPreviewId`.",type:"string"},gP={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"},gV={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"},gR={description:"In-progress native Git operation state, read from repository metadata.",enum:["none","merge","rebase","cherry_pick","revert","bisect","sequencer","unknown"],type:"string"},gq={description:"Whether a bounded page holds every answer or stopped at its limit.",enum:["complete","partial"],type:"string"},gI={enum:["complete"],type:"string"},gx={enum:["partial"],type:"string"},gj={enum:["unavailable"],type:"string"},gC={enum:["result_limit"],type:"string"},gT={additionalProperties:!1,properties:{branch:{type:["string","null"]},commit:{type:["string","null"]},worktree:{type:["string","null"]}},type:"object"},gO={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"},gE={enum:["git"],type:"string"},gA={additionalProperties:!1,properties:{kind:{$ref:"#/$defs/GitToolErrorKindV1"},message:{type:"string"},operation:{$ref:"#/$defs/GitToolOperationV1"}},required:["kind","operation","message"],type:"object"},gW={additionalProperties:!1,description:"Git itself refused the refs, worktree status, or history the tool reads.",properties:{error:{$ref:"#/$defs/GitToolErrorV1"}},required:["error"],type:"object"},gM={description:"The git step that refused the read.",enum:["diff","status","log"],type:"string"},gN={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"},gz={enum:["forbid_force_and_rebase"],type:"string"},gD={description:"Strongly typed canonical identity: `HostInstanceId`.",type:"string"},gF={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"},gL={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"},gU={enum:["available","retained_but_unavailable","redacted","deleted","retention_expired","unauthorized","locked","unverifiable"],type:"string"},gH={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"},gG={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"},gB={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"},gK={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"}]},gJ={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"},gZ={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"}]},gQ={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"},gX={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"},gY={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"},g1={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"},g0={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"}]},g2={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"}]},g4={enum:["inline","external","canonical_occurrence"],type:"string"},g6={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"}]},g3={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"},g9={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"},g5={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"},g8={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"}]},g7={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"},_e={description:"Strongly typed algorithm-tagged integrity digest: `LocatorDigest`.",type:"string"},_t={description:"Strongly typed canonical identity: `LogicalCopyClusterId`.",type:"string"},_r={description:"Strongly typed canonical identity: `LogicalEvidenceId`.",type:"string"},_i={enum:["global","project"],type:"string"},_o={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"},_n={properties:{actor:{type:"string"},run_id:{type:["string","null"]},source:{$ref:"#/$defs/ManagedSkillSource"}},required:["source","actor"],type:"object"},_a={enum:["automation_run","user","import"],type:"string"},_s={enum:["active","disabled","archived"],type:"string"},_d={description:"Strongly typed algorithm-tagged integrity digest: `ManifestDigest`.",type:"string"},_c={description:"The only Git histories this product operation can create.",enum:["fast_forward","two_parent_merge","cherry_pick_exact_commits"],type:"string"},_l={enum:["project","user"],type:"string"},_p={enum:["all","parents_only","subagents_only"],type:"string"},_u={enum:["all","direct_user","tool_result"],type:"string"},_m={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"},_f={properties:{descriptor_revision:{type:"string"},eligible_population:{type:"string"}},required:["descriptor_revision","eligible_population"],type:"object"},_h={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"},_y={enum:["measurement","association","calibrated_prediction"],type:"string"},_g={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"},__={enum:["observability_envelope","feedback_observations","provider_usage_observation","savings_ledger"],type:"string"},_v={properties:{baseline_watermark:{type:["string","null"]},delta:{format:"double",type:["number","null"]},horizon:{$ref:"#/$defs/ObservabilityHorizonV1"}},required:["horizon"],type:"object"},_b={properties:{lower:{format:"double",type:["number","null"]},reason:{type:["string","null"]},upper:{format:"double",type:["number","null"]}},type:"object"},_$={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"},_S={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"},_k={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"},_w={description:"Strongly typed canonical identity: `NativeIntegrationApprovalId`.",type:"string"},_P={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"},_V={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"}]},_R={description:"Strongly typed canonical identity: `NativeIntegrationPreviewId`.",type:"string"},_q={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"},_I={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"}]},_x={description:"The only truthful terminal outcomes after recovery.",enum:["committed","aborted_no_change","rolled_back","needs_inspection"],type:"string"},_j={description:"Strongly typed canonical identity: `NativeIntegrationTransactionId`.",type:"string"},_C={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"},_T={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"}]},_O={additionalProperties:!1,properties:{body:{format:"uint64",minimum:0,type:"integer"},full_file:{format:"uint64",minimum:0,type:"integer"}},required:["body","full_file"],type:"object"},_E={properties:{since_micros:{format:"int64",type:"integer"},until_micros:{format:"int64",type:"integer"}},required:["since_micros","until_micros"],type:"object"},_A={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"},_W={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"},_M={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"},_N={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"},_z={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"},_D={description:"Terminal state after an operation has been admitted.",enum:["completed","cancelled","timed_out","failed","unavailable","partial","effect_unknown"],type:"string"},_F={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"},_L={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"},_U={description:"Whether the served code generation is known current at serve time.",enum:["fresh","possibly_stale"],type:"string"},_H={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"},_G={enum:["complete"],type:"string"},_B={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"},_K={enum:["full","partial"],type:"string"},_J={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"},_Z={additionalProperties:!1,properties:{language:{type:["string","null"]},provider:{type:["string","null"]},reason:{type:"string"}},required:["reason"],type:"object"},_Q={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"},_X={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"},_Y={enum:["unavailable"],type:"string"},_1={description:"Strongly typed canonical identity: `ProjectId`.",type:"string"},_0={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"},_2={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"},_4={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"},_6={description:"Strongly typed canonical identity: `ProjectionGenerationId`.",type:"string"},_3={description:"Strongly typed canonical identity: `ProposalId`.",type:"string"},_9={enum:["reject","require_human_approval_and_independent_review"],type:"string"},_5={additionalProperties:!1,properties:{disposition:{$ref:"#/$defs/ProtectedRefDispositionV1"},selector:{$ref:"#/$defs/ProtectedRefSelectorV1"}},required:["selector","disposition"],type:"object"},_8={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"}]},_7={description:"Strongly typed canonical identity: `ProvenanceId`.",type:"string"},ve={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"},vt={description:"Strongly typed canonical identity: `ProviderId`.",type:"string"},vr={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"},vi={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"},vo={enum:["owner_receipt","locally_measured","estimated","unknown"],type:"string"},vn={description:"Strongly typed canonical identity: `QueryCollectionId`.",type:"string"},va={description:"Which endpoint of each counted edge the rank report ranks.",enum:["incoming","outgoing"],type:"string"},vs={description:"Relationship the rank report counts.",enum:["implements","extends","calls","uses","contains","annotates","type_of","returns","receives"],type:"string"},vd={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"},vc={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"},vl={description:"Strongly typed canonical identity: `RefId`.",type:"string"},vp={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"},vu={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"},vm={description:"Closed error class for a rejected surface argument.",enum:["missing","invalid_shape","out_of_bounds","unsupported","unauthorized","stale","unknown"],type:"string"},vf={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"},vh={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"},vy={description:"Transport that rejected a surface argument. Unknown preserves missing\nattribution instead of inventing cli/mcp/http.",enum:["cli","mcp","http","unknown"],type:"string"},vg={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"}]},vv={enum:["successful_terminal"],type:"string"},vb={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"},v$={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"},vS={description:"Bounded output projection chosen by a concrete use case.",enum:["summary","evidence","references_only"],type:"string"},vk={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"},vw={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"},vP={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)."},vV={description:"Strongly typed canonical identity: `RetrievalAnchorId`.",type:"string"},vR={description:"Stable semantic ordering; adapters may not replace it with transport order.",enum:["relevance","source_position","temporal_descending","stable_identity"],type:"string"},vq={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"},vI={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"}]},vx={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"},vj={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"},vC={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"}]},vT={enum:["no_review","independent_review","standard_pull_requests","git_hub_stacked_pull_requests"],type:"string"},vO={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"},vE={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"},vA={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"},vW={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"},vM={enum:["allow","deny"],type:"string"},vN={description:"Strongly typed canonical identity: `RunId`.",type:"string"},vz={additionalProperties:!1,properties:{degraded_row:{type:["string","null"]},progress:{anyOf:[{$ref:"#/$defs/SchemaConvergenceProgressV1"},{type:"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"},vD={oneOf:[{additionalProperties:!1,properties:{done:{format:"uint64",minimum:0,type:"integer"},remaining:{format:"uint64",minimum:0,type:"integer"},unit:{const:"rows",type:"string"}},required:["unit","done","remaining"],type:"object"},{additionalProperties:!1,properties:{done:{format:"uint64",minimum:0,type:"integer"},remaining:{format:"uint64",minimum:0,type:"integer"},unit:{const:"pages",type:"string"}},required:["unit","done","remaining"],type:"object"}]},vF={enum:["registered_schema"],type:"string"},vL={enum:["pending_schema_migration","released_shape_convergence_in_progress","degraded","completed"],type:"string"},vU={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"},vH={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"},vG={enum:["read","source_bind","source_rebind","source_unbind","access_rule_upsert","access_rule_remove","replace_topology_policy","rollback"],type:"string"},vB={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"}]},vK={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"}]},vJ={description:"Typed explanation for a root that returned usable but incomplete data.",enum:["incomplete","stale","budget_exceeded","root_denied","root_unavailable"],type:"string"},vZ={description:"Stable identity of one authorized scope-set record.",type:"string"},vQ={description:"Monotonic optimistic-concurrency revision of one scope set.",format:"uint64",minimum:1,type:"integer"},vX={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"},vY={description:"Typed explanation for a root that could not return usable data.",enum:["authority_unavailable","root_missing","store_unavailable"],type:"string"},v1={description:"Strongly typed canonical identity: `ScoreDomainId`.",type:"string"},v0={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"},v2={additionalProperties:!1,properties:{knowledge:{$ref:"#/$defs/ClosedUtcIntervalV1"},valid:{$ref:"#/$defs/ValidCoverageIntervalV1"}},required:["knowledge","valid"],type:"object"},v4={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"}]},v6={additionalProperties:!1,properties:{mode:{$ref:"#/$defs/TemporalModeV1"}},required:["mode"],type:"object"},v3={enum:["fresh","stale","partial","locked","redacted","retention_withheld","unavailable"],type:"string"},v9={description:"Strongly typed canonical identity: `SessionId`.",type:"string"},v5={description:"Strongly typed canonical identity: `SessionOrThreadId`.",type:"string"},v8={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"},v7={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"},be={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"},bt={enum:["complete","failed","cancelled"],type:"string"},br={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"},bi={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"},bo={description:"Typed configuration key. Keys are lowercase, dotted product identifiers;\nuntyped host/adapter keys are not representable.",type:"string"},bn={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"},ba={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"},bs={enum:["conservative_exact","rename_normalized_exact"],type:"string"},bd={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"},bc={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"},bl={enum:["cursor","codex","claude","agents","opencode","kimi","kiro","hermes"],type:"string"},bp={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"},bu={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"},bm={description:"Strongly typed canonical identity: `SourceBindingId`.",type:"string"},bf={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"},bh={description:"Strongly typed canonical identity: `SourceInstanceKey`.",type:"string"},by={enum:["claude","codex","cursor","git_hub","hermes","kiro"],type:"string"},bg={description:"Strongly typed canonical identity: `SourceNamespace`.",type:"string"},b_={description:"Strongly typed canonical identity: `SourceOccurrenceId`.",type:"string"},bv={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"},bb={description:"Strongly typed canonical identity: `SourceStoreId`.",type:"string"},b$={description:"Strongly typed canonical identity: `StackDeliveryWatermarkId`.",type:"string"},bS={description:"Strongly typed canonical identity: `StackNodeId`.",type:"string"},bk={description:"Strongly typed canonical identity: `StackSignalId`.",type:"string"},bw={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"},bP={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"},bV={description:"Strongly typed canonical identity: `SymbolOccurrenceId`.",type:"string"},bR={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"},bq={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"},bI={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"},bx={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"},bj={description:"Strongly typed canonical identity: `TaskId`.",type:"string"},bC={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"},bT={additionalProperties:!1,properties:{anchor:{type:"string"},summary:{type:"string"}},required:["anchor","summary"],type:"object"},bO={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"}]},bE={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"}]},bA={additionalProperties:!1,properties:{anchor:{type:"string"},rank:{format:"uint32",minimum:0,type:"integer"},reason:{$ref:"#/$defs/HydrationStateResultV1"}},required:["rank","anchor","reason"],type:"object"},bW={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"},bM={description:"Strongly typed canonical identity: `ThreadId`.",type:"string"},bN={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"},bz={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"},bD={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"},bF={enum:["reject","require_explicit_human_approval","require_human_approval_and_independent_review"],type:"string"},bL={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"},bU={enum:["critical_only","lifecycle","verbose"],type:"string"},bH={description:"Risky construct the pattern scan looks for.",enum:["unwrap","expect","panic","todo","unimplemented","unsafe_block"],type:"string"},bG={description:"Stable, canonical catalog identity for `UseCaseId`.",type:"string"},bB={description:"Strongly typed canonical identity: `UserProfileId`.",type:"string"},bK={description:"UTC timestamp represented as microseconds from the Unix epoch.",format:"int64",type:"integer"},bJ={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"}]},bZ={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"},bQ={additionalProperties:!1,properties:{criterion_id:{type:"string"},description:{type:"string"},evidence_required:{type:"boolean"}},required:["criterion_id","description","evidence_required"],type:"object"},bX={enum:["never","on_request"],type:"string"},bY={description:"Strongly typed canonical identity: `WorkArtifactId`.",type:"string"},b1={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"},b0={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"},b2={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"},b4={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"}]},b6={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"},b3={additionalProperties:!1,properties:{completed:{format:"uint64",minimum:0,type:"integer"},total:{format:"uint64",minimum:0,type:"integer"}},required:["completed","total"],type:"object"},b9={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"},b5={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"}]},b8={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"},b7={enum:["leased","running","cancellation_requested","cancellation_acknowledged","cancellation_escalated","recovery_required","succeeded","failed","timed_out","cancelled"],type:"string"},$e={enum:["stdout","stderr"],type:"string"},$t={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"},$r={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"},$i={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"},$o={additionalProperties:!1,properties:{acknowledged_at:{$ref:"#/$defs/UtcMicros"},request:{$ref:"#/$defs/WorkCancellationRequestV1"}},required:["request","acknowledged_at"],type:"object"},$n={additionalProperties:!1,properties:{acknowledgement:{$ref:"#/$defs/WorkCancellationAcknowledgementV1"},escalated_at:{$ref:"#/$defs/UtcMicros"}},required:["acknowledgement","escalated_at"],type:"object"},$a={description:"Strongly typed canonical identity: `WorkCancellationRequestId`.",type:"string"},$s={additionalProperties:!1,properties:{request_id:{$ref:"#/$defs/WorkCancellationRequestId"},requested_at:{$ref:"#/$defs/UtcMicros"}},required:["request_id","requested_at"],type:"object"},$d={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"}]},$c={description:"Strongly typed canonical identity: `WorkCommandId`.",type:"string"},$l={description:"Where a configured route places task content.",enum:["local","tenant","external"],type:"string"},$p={additionalProperties:!1,properties:{topology_generation:{$ref:"#/$defs/WorkTopologyGenerationRefV1"},work_generation:{$ref:"#/$defs/ProjectionGenerationId"}},required:["work_generation","topology_generation"],type:"object"},$u={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"},$m={description:"Effect semantics admitted for one provider attempt.",enum:["observational","intercepted","compound_non_repeatable"],type:"string"},$f={description:"Declared effort class of a configured route.",enum:["minimal","standard","extended"],type:"string"},$h={enum:["deny","allowlisted"],type:"string"},$y={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"}]},$g={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"},$_={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"},$v={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"},$b={additionalProperties:!1,properties:{artifact_digest:{$ref:"#/$defs/ManifestDigest"},executable_id:{type:"string"}},required:["executable_id","artifact_digest"],type:"object"},$$={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"},$S={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"},$k={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"},$w={enum:["language","framework","architecture","testing","operations","security","domain"],type:"string"},$P={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"},$V={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"}]},$R={format:"uint64",minimum:0,title:"WorkFenceEpochV1",type:"integer"},$q={enum:["read_only","workspace_write"],type:"string"},$I={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"}]},$x={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"},$j={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"},$C={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"},$T={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"},$O={additionalProperties:!1,properties:{initiative_id:{type:"string"},milestone_id:{type:"string"},plan_id:{type:"string"}},required:["initiative_id","plan_id","milestone_id"],type:"object"},$E={additionalProperties:!1,properties:{created_at:{$ref:"#/$defs/UtcMicros"},id:{type:"string"},title:{type:"string"}},required:["id","title","created_at"],type:"object"},$A={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"},$W={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"},$M={description:"A job task key: `[a-z0-9-]`, 1 to 48 bytes. Identities derive from it.",type:"string"},$N={additionalProperties:!1,properties:{epoch:{$ref:"#/$defs/WorkFenceEpochV1"},lease_id:{$ref:"#/$defs/WorkLeaseId"}},required:["lease_id","epoch"],type:"object"},$z={description:"Strongly typed canonical identity: `WorkLeaseId`.",type:"string"},$D={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"},$F={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"},$L={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"},$U={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"},$H={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"},$G={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"},$B={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"},$K={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"},$J={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"},$Z={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"}]},$Q={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"},$X={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"}]},$Y={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"},$1={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"}]},$0={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"},$2={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"},$4={additionalProperties:!1,properties:{event:{$ref:"#/$defs/WorkProductEventV1"},replayed:{type:"boolean"},verified_graph_version:{$ref:"#/$defs/VerifiedWorkGraphVersionV1"}},required:["event","verified_graph_version","replayed"],type:"object"},$6={additionalProperties:!1,properties:{brain_id:{$ref:"#/$defs/BrainId"},profile_id:{$ref:"#/$defs/UserProfileId"}},required:["brain_id","profile_id"],type:"object"},$3={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"}]},$9={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"},$5={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"}]},$8={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},$7={enum:["accepted","rejected","superseded"],type:"string"},Se={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"},St={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"},Sr={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"}]},Si={description:"Provider protocol selected by the pinned Work configuration snapshot.",enum:["claude_code_cli","codex_app_server","codex_cli"],type:"string"},So={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"},Sn={enum:["claude_stream_json","codex_app_server_json_rpc","codex_exec_json"],type:"string"},Sa={description:"Strongly typed canonical identity: `WorkProviderRouteId`.",type:"string"},Ss={additionalProperties:!1,properties:{provider_id:{$ref:"#/$defs/ProviderId"},route_id:{$ref:"#/$defs/WorkProviderRouteId"}},required:["provider_id","route_id"],type:"object"},Sd={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"}]},Sc={additionalProperties:!1,properties:{decided_at:{$ref:"#/$defs/UtcMicros"},disposition:{$ref:"#/$defs/WorkProposalDispositionV1"},proposal:{$ref:"#/$defs/WorkRelationReplanProposalV1"}},required:["proposal","disposition","decided_at"],type:"object"},Sl={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"},Sp={enum:["lease_lost","provider_unavailable","process_lost","failure_observed"],type:"string"},Su={enum:["runtime_failure","restart_recovery_required"],type:"string"},Sm={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"},Sf={enum:["runtime"],type:"string"},Sh={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"},Sy={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"}]},Sg={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"},S_={description:"A monotonically versioned control authority.",format:"uint64",minimum:0,title:"WorkRunControlAuthorityV1",type:"integer"},Sv={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"},Sb={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"},S$={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"},SS={enum:["required"],type:"string"},Sk={enum:["ordinal","heuristic","calibrated_range"],type:"string"},Sw={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"},SP={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"},SV={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"},SR={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"}]},Sq={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"},SI={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"}]},Sx={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"},Sj={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"},SC={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"}]},ST={description:"Strongly typed algorithm-tagged integrity digest: `WorkTopologyGenerationRefV1`.",type:"string"},SO={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"},SE={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"},SA={description:"Strongly typed canonical identity: `WorkflowDefinitionId`.",type:"string"},SW={additionalProperties:!1,properties:{max_width:{format:"uint32",minimum:0,type:"integer"}},required:["max_width"],type:"object"},SM={description:"Strongly typed canonical identity: `WorkflowOperationRef`.",type:"string"},SN={description:"Strongly typed canonical identity: `WorkflowOutputName`.",type:"string"},Sz={additionalProperties:!1,properties:{output_name:{$ref:"#/$defs/WorkflowOutputName"},producer_step_id:{$ref:"#/$defs/WorkflowStepId"}},required:["producer_step_id","output_name"],type:"object"},SD={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"},SF={description:"Strongly typed canonical identity: `WorkflowStepId`.",type:"string"},SL={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"},SU={enum:["require_clean","allow_untracked_only_for_preflight","read_only_preflight_only"],type:"string"},SH={description:"Strongly typed canonical identity: `WorktreeId`.",type:"string"},SG={description:"Monotonic epoch of the worktree inventory frozen into a stack revision.",format:"uint64",minimum:0,type:"integer"},SB={description:"Strongly typed canonical identity: `WorktreeInventorySnapshotId`.",type:"string"},SK={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"}]},SJ={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"},SZ={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"},SQ=[{$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:_D,ProjectRegistryEntry:_0,ProjectRegistrySummary:_2,ProjectRepoGroup:_4,PublicCodeProject:vi,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:bK},$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:fF,AutomationReconcileScope:fB},$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:fF,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:fB,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:yW,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:{compatibility_field:{type:"string"},distance:{type:"string"},recommended_proximity:{items:{type:"string"},type:"array"},strategy:{type:"string"}},required:["strategy","distance","recommended_proximity","compatibility_field"],type:"object"},CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:{affected_tests:{items:{type:"string"},type:"array"},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","affected_tests","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:fS,CodeGenerationId:hg,CommitId:hI,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,FeedbackImpactStateV1:gi,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:fV,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:fw,AnalyticsModeV1:fP,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:fV,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:hx,CostsReadModelV1:yp,CoverageStateV1:yh,LatencyDistributionReadModelV1:gB,MetricCalibrationV1:_m,MetricCohortV1:_f,MetricCoverageV1:_h,MetricEvidenceClassV1:_y,MetricProvenanceV1:_g,MetricSourceV1:__,MetricTemporalV1:_v,MetricUncertaintyV1:_b,MetricValueV1:_$,ObservabilityHorizonV1:_E,ObservatoryReadModelV1:_W,PerformanceComparisonReadModelV1:_L,ProviderLatencyReadModelV1:vr,RejectedArgumentAnalyticsV1:vu,RejectedArgumentErrorClassV1:vm,RejectedArgumentGroupV1:vf,RejectedArgumentNameV1:vh,RejectedArgumentSurfaceV1:vy},$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:_d,NativeIntegrationApprovalId:_w,NativeIntegrationPreviewId:_R,NativeIntegrationTransactionId:_j},$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:f$,BranchStackEdgeV1:f9,BranchStackId:f5,BranchStackNodeV1:f8,BranchStackRevisionId:f7,BranchStackRevisionV1:he,BranchStackSourceV1:ht,CapabilityId:hp,CodeGenerationId:hg,CommitId:hI,ContentDigest:hF,GitOidV1:gV,GitOperationStateV1:gR,ManifestDigest:_d,MechanicalIntegrationModeV1:_c,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:_w,NativeIntegrationDirectionV1:_P,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:_V,NativeIntegrationPreviewId:_R,NativeIntegrationSealedStackSnapshotV1:_q,NativeIntegrationSelectionBindingV1:_I,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:_x,NativeIntegrationTransactionId:_j,NativeIntegrationUnavailabilityV1:_C,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:_T,ProjectId:_1,RefId:vl,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,SourceSpan:bv,StackNodeId:bS,UtcMicros:bK,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:SH,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:SG,WorktreeInventorySnapshotId:SB,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:_d,NativeIntegrationPreviewId:_R},$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:f$,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:ha,CancellationStage:hs,ComponentVersion:hT,Deadline:yb,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:yq,EffectReceipt:yI,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:yx,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:_d,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:_N,OperationReceipt:_z,OperationTermination:_D,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:_1,ReconciliationState:{description:"Reconciliation state retained after an admitted effect.",enum:["pending","reconciled","failed"],type:"string"},RefId:vl,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:vg,ResolvedScope:v$,RetrievalAnchorId:vV,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:bG,UtcMicros:bK,WorktreeId:SH},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:fG,AutomationRunArtifact:fK},$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:fk,AutomationReadStatusV1:fG,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","null"]},trigger:{$ref:"#/$defs/AutomationTrigger"}},required:["run_id","task","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:fJ,AutomationRunStatus:fZ,AutomationTrigger:f1},$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:fk,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:fG,AutomationRunArtifact:fK,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","null"]},trigger:{$ref:"#/$defs/AutomationTrigger"},validation_report:!0},required:["schema_version","run_id","trigger","task","backend","status","accepted_count","rejected_count","started_at","completed_at"],type:"object"},AutomationRunScopeV1:fJ,AutomationRunStatus:fZ,AutomationTrigger:f1,SessionRetrievalBudgetStageV1:br},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitReadCompleteV1:gI,GitReadPartialV1:gx,GitReadUnavailableV1:gj,GitResultLimitV1:gC,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitPageStatusV1:gq,GitReadUnavailableV1:gj,GitReferenceLimitV1:{enum:["reference_limit"],type:"string"},PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:ho,CandidateContribution:hd,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComponentRevision:hC,EvidenceRole:yT,ExactClass:yO,FileOccurrenceId:gd,FixedPointScore:gl,FreshnessCompatibilityV1:gp,FusedCandidate:gu,GitPageStatusV1:gq,GitReadUnavailableV1:gj,GitResultLimitV1:gC,LogicalCopyClusterId:_t,LogicalEvidenceId:_r,OccurrenceProvenance:_M,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:vd,RankingDecisionKind:vc,RepositoryId:vg,RetrievalAnchorId:vV,RetrievalSourceRoleV1:vI,RetrieverKind:vj,ScoreDomainId:v1,SessionOrThreadId:v5,SourceFreshness:bf,SourceInstanceKey:bh,SourceNamespace:bg,SourceOccurrenceId:b_,UtcMicros:bK},$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:_Q},$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:_j},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitComparedSymbolV1:gy,GitReadCompleteV1:gI,GitReadPartialV1:gx,GitReadUnavailableV1:gj,GitToolErrorKindV1:gE,GitToolErrorV1:gA,GitToolFailureV1:gW,GitToolOperationV1:gM,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,SymbolChangesCompleteV1:{additionalProperties:!1,properties:{status:{$ref:"#/$defs/GitReadCompleteV1"}},required:["status"],type:"object"},SymbolChangesUnavailableV1:bw},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,SymbolPrimitiveRecord:bR,SymbolRelationRecord: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/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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,PrimitiveSupportGap:_Z,SymbolPrimitiveRecord:bR,SymbolRelationRecord:bq,UtcMicros:bK},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,SymbolPrimitiveRecord:bR},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ExactTechnicalTermKindV1:yE,ResultProjection:vS,RetrievalOrder:vR},$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:hg,CodeOccurrenceRecord:hV,CodeSearchChunkId:hq,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:yE,FileOccurrenceId:gd,SourceSpan:bv,SymbolOccurrenceId:bV},$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:hn,CodeFacetDimension:hy,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hy,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:hg},$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:hn,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:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,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:_Z,SymbolPrimitiveRecord:bR,UtcMicros:bK},$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:hn,CodeGenerationId:hg,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:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,CodeOccurrenceRecord:hV,CodeSearchChunkId:hq,FileOccurrenceId:gd,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:bv,SymbolOccurrenceId:bV},$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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,PrimitiveSupportGap:_Z,SymbolPrimitiveRecord:bR,UtcMicros:bK},$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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hn,CodeGenerationId:hg,CodeQueryScope:hR,ResultProjection:vS,RetrievalOrder:vR},$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:hg,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:bK},$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:hn,ResultProjection:vS,RetrievalOrder:vR,SymbolGraphScope:bP},$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:hg,CodeGraphReadFreshnessV1:h_,PrimitiveSupportGap:_Z,SymbolPrimitiveRecord:bR,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:bK},$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, only analyze staged changes (default: false = all uncommitted\nchanges).",type:["boolean","null"]}},title:"CommitContextSurfaceRequestV1",type:"object"},{$defs:{CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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"},freshness:{anyOf:[{$ref:"#/$defs/PrimitiveSearchFreshnessV1"},{type:"null"}],description:"The worktree verdict a served graph read opens with."},recent_commits:{items:{type:"string"},type:"array"},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:{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:{file:{type:"string"},kind:{type:"string"},line:{format:"uint32",minimum:0,type:"integer"},name:{type:"string"}},required:["name","kind","file","line"],type:"object"},ConfigSummaryKindV1:hO,ConfigSummaryV1:hE,GitFileRoleV1:{description:"A changed file's semantic role.",enum:["config","docs","source","test"],type:"string"},GitToolErrorKindV1:gE,GitToolErrorV1:gA,GitToolFailureV1:gW,GitToolOperationV1:gM,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComplexityAnalysisV1:hj,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:f$,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:hA,ConfigurationReceiptId:hM,ConfigurationRevisionId:hN,ManifestDigest:_d,UtcMicros:bK},$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:fb,ActorId:f$,AnalyzerEnvironmentVariable:fR,AnalyzerExecutableId:fq,AnalyzerExecutableReferenceV1:fI,AnalyzerLanguageId:fx,AnalyzerLanguageSelectionV1:fj,AnalyzerPrivacyClassV1:fC,AnalyzerResourceLimitsV1:fT,AnalyzerRestartPolicyV1:fO,AnalyzerSettingsV1:fE,AnalyzerStructuredValueV1:fA,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,AutomationBackendV1:fU,AutomationHostModeV1:fH,AutomationSettingsV1:fQ,AutomationTaskSetV1:fX,AutomationTaskSettingsV1:fY,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CodeIndexWorkerSelectionV1:hP,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:hA,ConfigurationLayerIdV1:hW,ConfigurationRevisionId:hN,ConfigurationValueV1:hD,ContextScoutConfigurationLimitsV1:hK,ContextScoutConfigurationModeV1:hJ,ContextScoutConfigurationStateV1:hZ,ContextScoutConfiguredModelPathV1:hQ,ContextScoutIntentKindV1:h3,ContextScoutIntentSettingsV1:h9,ContextScoutSettingsV1:ya,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DecisionEngineSettingsV1:y$,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,IntentQuestionSettingsV1:gH,IntentWindowSettingsV1:gG,LcmSummarizerExecutableV1:g6,LcmSummarizerExecutablesV1:g3,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,QueryCollectionId:vn,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SettingKey:bo,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkApprovalPolicy:bX,WorkContentLocationClassV1:$l,WorkEffortClassV1:$f,WorkEgressPolicy:$h,WorkExecutableBindingV1:$_,WorkExecutableCapabilityV1:$v,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExpertiseCategoryV1:$w,WorkExpertiseConsentV1:$P,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkOrdinalBandV1:$F,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteCandidateV1:Sh,WorkRouteExecutionProfileV1:Sg,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fv,ConfigurationReceiptId:hM,ConfigurationRevisionId:hN,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:hz,ManifestDigest:_d,UtcMicros:bK},$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:bo},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{key:{$ref:"#/$defs/SettingKey"}},required:["key"],title:"ConfigurationGetRequestV1",type:"object"},{$defs:{AccessRuleId:fb,ActorId:f$,AnalyzerEnvironmentVariable:fR,AnalyzerExecutableId:fq,AnalyzerExecutableReferenceV1:fI,AnalyzerLanguageId:fx,AnalyzerLanguageSelectionV1:fj,AnalyzerPrivacyClassV1:fC,AnalyzerResourceLimitsV1:fT,AnalyzerRestartPolicyV1:fO,AnalyzerSettingsV1:fE,AnalyzerStructuredValueV1:fA,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,AutomationBackendV1:fU,AutomationHostModeV1:fH,AutomationSettingsV1:fQ,AutomationTaskSetV1:fX,AutomationTaskSettingsV1:fY,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CandidateDispositionV1:{enum:["winning","overridden","rejected","defaulted"],type:"string"},CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CodeIndexWorkerSelectionV1:hP,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:hW,ConfigurationRevisionId:hN,ConfigurationSettingActionV1:{enum:["set","unset"],type:"string"},ConfigurationSettingFindingV1:{description:"A stored value the running release keeps but does not apply. The value\nstays readable so `legal_actions` on the same key can replace it.",oneOf:[{additionalProperties:!1,description:"An `index.exclude.v1` / `index.include.v1` pattern that does not\ncompile. An earlier release stored it unchecked; indexing runs\nwithout it.",properties:{kind:{const:"invalid_index_path_pattern",type:"string"},legal_actions:{items:{$ref:"#/$defs/ConfigurationSettingActionV1"},type:"array"},message:{type:"string"},pattern:{type:"string"}},required:["kind","pattern","message","legal_actions"],type:"object"}]},ConfigurationSnapshotId:hz,ConfigurationValueV1:hD,ContextScoutConfigurationLimitsV1:hK,ContextScoutConfigurationModeV1:hJ,ContextScoutConfigurationStateV1:hZ,ContextScoutConfiguredModelPathV1:hQ,ContextScoutIntentKindV1:h3,ContextScoutIntentSettingsV1:h9,ContextScoutSettingsV1:ya,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DecisionEngineSettingsV1:y$,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,IntentQuestionSettingsV1:gH,IntentWindowSettingsV1:gG,LcmSummarizerExecutableV1:g6,LcmSummarizerExecutablesV1:g3,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,QueryCollectionId:vn,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SettingKey:bo,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkApprovalPolicy:bX,WorkContentLocationClassV1:$l,WorkEffortClassV1:$f,WorkEgressPolicy:$h,WorkExecutableBindingV1:$_,WorkExecutableCapabilityV1:$v,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExpertiseCategoryV1:$w,WorkExpertiseConsentV1:$P,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkOrdinalBandV1:$F,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteCandidateV1:Sh,WorkRouteExecutionProfileV1:Sg,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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"},findings:{description:"Parts of the stored value this release does not apply. Empty when the\neffective value applies in full.",items:{$ref:"#/$defs/ConfigurationSettingFindingV1"},type:"array"},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","findings"],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:bo,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:hN},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/ComponentConfigurationState"},title:"Array_of_ComponentConfigurationState",type:"array"},{$defs:{ChangePlanId:hm,ConfigurationIdempotencyKey:hA,ConfigurationRevisionId:hN,ManifestDigest:_d},$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:fb,ActorId:f$,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,ConfigurationRevisionId:hN,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,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:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fv,ActorId:f$,ChangePlanId:hm,ConfigurationRevisionId:hN,ManifestDigest:_d,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:vG,SettingKey:bo,UtcMicros:bK},$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:hN,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:fb,ActorId:f$,AnalyzerEnvironmentVariable:fR,AnalyzerExecutableId:fq,AnalyzerExecutableReferenceV1:fI,AnalyzerLanguageId:fx,AnalyzerLanguageSelectionV1:fj,AnalyzerPrivacyClassV1:fC,AnalyzerResourceLimitsV1:fT,AnalyzerRestartPolicyV1:fO,AnalyzerSettingsV1:fE,AnalyzerStructuredValueV1:fA,AuthorityRef:fN,AutomaticWorktreeGcV1:fL,AutomationBackendV1:fU,AutomationHostModeV1:fH,AutomationSettingsV1:fQ,AutomationTaskSetV1:fX,AutomationTaskSettingsV1:fY,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CodeIndexWorkerSelectionV1:hP,ConfigurationIdempotencyKey:hA,ConfigurationLayerIdV1:hW,ConfigurationRevisionId:hN,ConfigurationValueV1:hD,ContextScoutConfigurationLimitsV1:hK,ContextScoutConfigurationModeV1:hJ,ContextScoutConfigurationStateV1:hZ,ContextScoutConfiguredModelPathV1:hQ,ContextScoutIntentKindV1:h3,ContextScoutIntentSettingsV1:h9,ContextScoutSettingsV1:ya,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DecisionEngineSettingsV1:y$,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,IntentQuestionSettingsV1:gH,IntentWindowSettingsV1:gG,LcmSummarizerExecutableV1:g6,LcmSummarizerExecutablesV1:g3,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,QueryCollectionId:vn,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RuleEffect:vM,ScopeAccessRule:vU,ScopeAccessSubjectV1:vH,ScopeControlOperationV1:vG,ScopeSourceBinding:vX,SensitiveFilesystemLocatorV1:v0,SettingKey:bo,SourceBindingId:bm,SourceKindV1:by,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,WorkApprovalPolicy:bX,WorkContentLocationClassV1:$l,WorkEffortClassV1:$f,WorkEgressPolicy:$h,WorkExecutableBindingV1:$_,WorkExecutableCapabilityV1:$v,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExpertiseCategoryV1:$w,WorkExpertiseConsentV1:$P,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkOrdinalBandV1:$F,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteCandidateV1:Sh,WorkRouteExecutionProfileV1:Sg,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:hA,ConfigurationLayerIdV1:hW,ConfigurationRevisionId:hN,ProjectId:_1,QueryCollectionId:vn,SettingKey:bo,UserProfileId:bB},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/ConstructorsNotFoundV1"},{$ref:"#/$defs/ConstructorsReportV1"}],title:"ConstructorsResultV1"},{$defs:{ContextModeV1:hU},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:hL,ContextModeV1:hU,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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LexicalAnchorDropReasonV1:g8,LexicalAnchorDropV1:g7,LocatorDigest:_e,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveLaneCompleteV1:_G,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:_K,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:_J,PrimitiveSymbolLocationV1:_Q,PrimitiveUnavailableEvidenceV1:_X,PrimitiveUnavailableStatusV1:_Y,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,TokenBudgetCutV1:bN,TokenBudgetSectionV1:bz,UtcMicros:bK},$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:hH},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{address:{$ref:"#/$defs/ContextScoutAddressV1"}},required:["address"],title:"ContextScoutExactAddressRequestV1",type:"object"},{$defs:{ContextScoutLimitsV1:h5,ContextScoutModelOutcomeV1:h7},$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:hH,ContextScoutWorkV1:yl},$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:ys},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{outcome:{$ref:"#/$defs/ContextScoutStoreOutcomeV1"}},required:["outcome"],title:"ContextScoutMutationResultV1",type:"object"},{$defs:{ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutRuntimeModeV1:yi,ContextScoutServiceStateV1:yo},$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:hH,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:hg,ContextScoutAddressV1:hH,ContextScoutCategoryV1:hG,ContextScoutClaimHandleV1:hB,ContextScoutDeliveryWindowV1:h1,ContextScoutEvidenceAvailabilityV1:h0,ContextScoutEvidenceProjectionV1:h2,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRouteV1:yr,ContextScoutSessionWindowV1:yn,ContextScoutSuggestionProjectionV1:yd,ContextScoutWorkV1:yl,ManifestDigest:_d,RetrievalAnchorId:vV,UtcMicros:bK},$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:hH,ContextScoutClaimHandleV1:hB,ContextScoutDeliveryOutcomeV1:hX,ContextScoutWorkV1:yl,UtcMicros:bK},$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:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutStoreOutcomeV1:ys,UtcMicros:bK},$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:hH},$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:hg,ContextScoutAddressV1:hH,ContextScoutCategoryV1:hG,ContextScoutDeliveryOutcomeV1:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutDeliveryWindowV1:h1,ContextScoutEvidenceAvailabilityV1:h0,ContextScoutEvidenceProjectionV1:h2,ContextScoutFeedbackKindV1:h4,ContextScoutFeedbackV1:h6,ContextScoutLimitsV1:h5,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRecentDeliveryV1:yt,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:yr,ContextScoutRuntimeModeV1:yi,ContextScoutServiceStateV1:yo,ContextScoutSessionWindowV1:yn,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:yd,ContextScoutSuppressionV1:yc,ContextScoutWorkV1:yl,ManifestDigest:_d,RetrievalAnchorId:vV,UtcMicros:bK},$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:hH,ContextScoutDeliveryOutcomeV1:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutFeedbackKindV1:h4,ContextScoutFeedbackV1:h6,UtcMicros:bK},$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:hA,ConfigurationRevisionId:hN,ContextScoutAddressV1:hH},$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:hg,ContextScoutAddressV1:hH,ContextScoutCategoryV1:hG,ContextScoutDeliveryOutcomeV1:hX,ContextScoutDeliveryReceiptV1:hY,ContextScoutDeliveryWindowV1:h1,ContextScoutEvidenceAvailabilityV1:h0,ContextScoutEvidenceProjectionV1:h2,ContextScoutFeedbackKindV1:h4,ContextScoutFeedbackV1:h6,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRecentDeliveryV1:yt,ContextScoutRouteV1:yr,ContextScoutSessionWindowV1:yn,ContextScoutSuggestionProjectionV1:yd,ContextScoutWorkV1:yl,ManifestDigest:_d,RetrievalAnchorId:vV,UtcMicros:bK},$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:hX,ContextScoutFeedbackKindV1:h4,ContextScoutLimitsV1:h5,ContextScoutModelBackendV1:h8,ContextScoutModelOutcomeV1:h7,ContextScoutModelReceiptV1:ye,ContextScoutRouteV1:yr,ContextScoutRuntimeModeV1:yi,ContextScoutServiceStateV1:yo,ContextScoutSuppressionV1:yc},$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:yu},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,CouplingDirectionV1:yu,CouplingEntryV1:{additionalProperties:!1,properties:{coupled_files:{format:"uint64",minimum:0,type:"integer"},file:{type:"string"}},required:["file","coupled_files"],type:"object"},PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hg,CommitId:hI,ComponentVersion:hT,ContentDigest:hF,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:yS,FileOccurrenceId:gd,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:_d,ProviderId:vt,RefId:vl,RepositoryId:vg,RetrievalAnchorId:vV,SanitizationReceiptId:{description:"Strongly typed canonical identity: `SanitizationReceiptId`.",type:"string"},SourceSpan:bv,SymbolOccurrenceId:bV,UtcMicros:bK,WorktreeId:SH},$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:"List of changed file paths.",items:{type:"string"},type:"array"}},required:["files"],title:"DiffContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hh,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GitContextSymbolV1:gg,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:_S,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:bN,TokenBudgetSectionV1:bz},$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."},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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:yP},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:yP,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:yD,FactFeedbackActionV1:yF,FactId:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactFeedbackActionV1:yF,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:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,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:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,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:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:_d,RunId:vN},$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:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactFeedbackActionV1:yF,FactFeedbackDetailsAvailabilityV1:{enum:["available","redacted","unknown"],type:"string"},FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,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:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactSearchGraphCoverageV1:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yD,FactId:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yW,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitOwnerV1:yN,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,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:yB,FactSearchGraphDegradationV1:yK,FactSearchHitV1:yJ,FactSearchScoresV1:yZ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:yD,FactId:yL,MemoryScopeV1:_l,ProjectId:_1},$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:yA,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,ProjectId:_1},$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:yW,FactEventId:yD,FactId:yL,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:_l,ProjectId:_1},$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:yA,FactCategoryV1:yW,FactCommitDispositionV1:yM,FactCommitOwnerV1:yN,FactCommitReceiptV1:yz,FactEventId:yD,FactId:yL,FactIdentitySourceResultV1:yU,FactPayloadAccessV1:yH,FactProjectionV1:yG,FactStatusV1:yQ,FactTelemetryV1:yX,FactV1:yY,LocatorDigest:_e,ProjectId:_1,ProvenanceId:_7,RetrievalAnchorId:vV,UtcMicros:bK},$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:fS,CodeGenerationId:hg,CommitId:hI,DiagnosticSeverityV1:yS,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:y1,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:y0,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,FeedbackCycleTerminationV1:y6,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackDurabilityV1:y8,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingV1:gr,FeedbackImpactStateV1:gi,FeedbackImpactV1:go,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:fS,CodeGenerationId:hg,CommitId:hI,DiagnosticSeverityV1:yS,FeedbackAdvisoryProviderStateV1:y1,FeedbackBaselineStateV1:y0,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,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:y6,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackDurabilityV1:y8,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingV1:gr,FeedbackImpactStateV1:gi,FeedbackImpactV1:go,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:hI,DiagnosticSeverityV1:yS,FeedbackCycleId:y4,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingReadV1:gt,FeedbackFindingV1:gr,FeedbackResultId:gn,FeedbackScopeV1:ga,FileOccurrenceId:gd,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:hI,DiagnosticSeverityV1:yS,FeedbackCycleId:y4,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingReadV1:gt,FeedbackFindingV1:gr,FeedbackResultId:gn,FeedbackScopeV1:ga,FileOccurrenceId:gd,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{finding:{$ref:"#/$defs/FeedbackFindingReadV1"}},required:["finding"],title:"FeedbackGetResultV1",type:"object"},{$defs:{AgentInstanceId:fS,CodeGenerationId:hg,CommitId:hI,FeedbackContentIdentityV1:y2,FeedbackCycleId:y4,FeedbackImpactStateV1:gi,FeedbackImpactV1:go,FeedbackResultId:gn,FeedbackScopeV1:ga,FeedbackTargetV1:gs,FileOccurrenceId:gd,HostInstanceId:gD,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:hI,DiagnosticSeverityV1:yS,FeedbackCycleId:y4,FeedbackDiagnosticClassificationV1:y3,FeedbackDiagnosticProducerV1:y9,FeedbackDiagnosticProjectionV1:y5,FeedbackFindingId:y7,FeedbackFindingLifecycleV1:ge,FeedbackFindingReadV1:gt,FeedbackFindingV1:gr,FeedbackResultId:gn,FeedbackScopeV1:ga,FileOccurrenceId:gd,ProjectId:_1,ProviderEvaluationStateV1:ve,RepositoryId:vg,RetrievalAnchorId:vV,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:bK},$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:fS,CodeGenerationId:hg,CommitId:hI,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:ga,FileOccurrenceId:gd,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProjectId:_1,ProviderId:vt,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:vl,RepositoryId:vg,RetrievalAnchorId:vV,SessionId:v9,SourceSpan:bv,SymbolOccurrenceId:bV,UtcMicros:bK,WorktreeId:SH},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:gc},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexOmittedSourceV1:h$,CodeIndexOmittedSourcesV1:hS,CodeIndexSourceOmissionReasonV1:hk,CodeIndexStalenessStateV1:hw,FilesLayoutV1:gc,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:gm,GiniScopeV1:gf},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,GiniMetricV1:gm,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:gf,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:gw,ManifestDigest:_d},$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:gw,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:gP,GitOidV1:gV,ManifestDigest:_d,UtcMicros:bK},$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:gh,GitChangeKindV1:{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"},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:g_,GitDegradationV1:gv,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:gb,GitHeadStateV1:g$,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:gk,GitIndexPreviewId:gw,GitOidV1:gV,GitOperationStateV1:gR,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:gF,HunkRefV1:gL,ManifestDigest:_d,RepositoryId:vg,UtcMicros:bK,WorktreeId:SH},$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:gV,GitSurfaceDiffScopeV1:gO},$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:gO},$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:gw,GitIndexTransactionOperationV1:gP,ManifestDigest:_d},$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:gh,GitCoverageV1:g_,GitDegradationV1:gv,GitFileModeV1:gb,GitHeadStateV1:g$,GitIndexEntryExpectationV1:gk,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:gw,GitIndexTransactionOperationV1:gP,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:gV,GitOperationStateV1:gR,HunkDirectionV1:gF,HunkRefV1:gL,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,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:bK,WorktreeId:SH},$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:b$,StackSignalId:bk},$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:f7,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:gV,ManifestDigest:_d,MechanicalIntegrationModeV1:_c,NativeIntegrationDirectionV1:_P,NativeIntegrationPreviewDispositionV1:_V,NativeIntegrationPreviewId:_R,NativeIntegrationTerminalOutcomeV1:_x,NativeIntegrationTransactionId:_j,NativeIntegrationUnavailabilityV1:_C,RefId:vl,StackDeliveryWatermarkId:b$,StackSignalId:bk,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:bK},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,CoverageCompleteness:ym,CoverageDomainState:yf,EvidenceCoverage:yj,EvidenceDomain:yC,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:_F,ResultProjection:vS,RetrievalOrder:vR,RetrievalRequestMeta:vq,TemporalModeV1:bE,UtcMicros:bK},$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:_d,UtcMicros:bK},$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:fG,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:hH,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveNotFoundV1:_B,PrimitiveSearchFreshnessV1:_J,PrimitiveSymbolLocationV1:_Q},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hf,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:gU,LcmContentRangeV1:gJ,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:g0,LcmSourceRefV1:g2,LcmStorageKindV1:g4,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:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalFreshnessV1:bO,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:gK,LcmConvergenceStateV1:gZ,LcmConvergenceV1:gQ,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:gX,LcmDoctorProjectionV1:gY,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx},$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:hf,HydrationStateResultV1:gU,LcmContentRangeV1:gJ,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:g1,LcmRetrievalOutcomeV1:g0,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:g2,LcmStorageKindV1:g4,LcmSummaryNodeV1:g9,LcmTemporalFieldsV1:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalFreshnessV1:bO,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:hf,HydrationStateResultV1:gU,LcmContentRangeV1:gJ,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:g1,LcmSourceRefV1:g2,LcmStorageKindV1:g4,LcmSummaryNodeV1:g9,LcmTemporalFieldsV1:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:_p,MessageTypeFilterV1:_u,RetainedTimeFilterV1:vP,TemporalModeV1:bE,UtcMicros:bK},$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"]},since:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"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"}]},until:{anyOf:[{$ref:"#/$defs/RetainedTimeFilterV1"},{type:"null"}]},worktree:{type:["string","null"]}},required:["query"],title:"LcmGrepRequestV1",type:"object"},{$defs:{ClosedUtcIntervalV1:hf,HydrationStateResultV1:gU,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:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:bE,UtcMicros:bK},$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:hf,HydrationStateResultV1:gU,LcmContentRangeV1:gJ,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:g4,LcmTemporalFieldsV1:g5,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalExplanationV1:bT,TemporalModeV1:bE,TemporalOmissionV1:bA,TemporalWatermarksV1:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:gK,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:gZ,LcmConvergenceV1:gQ,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:gX,LcmDoctorProjectionV1:gY,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:vw,RetrievalWorkerStatusV1:vx},$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:_l,ProjectId:_1},$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:yN,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:_1},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{memory:{$ref:"#/$defs/MemoryStatusV1"}},required:["memory"],title:"MemoryStatusResultV1",type:"object"},{$defs:{MessageRelationshipScopeV1:_p,MessageTypeFilterV1:_u,ProjectId:_1,RetainedTimeFilterV1:vP},$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:hf,GitScopeV1:gT,HydrationStateResultV1:gU,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:vk,RetainedNextActionV1:{additionalProperties:!1,properties:{action:{type:"string"},kind:{type:"string"},reason:{type:"string"},tool:{type:"string"}},required:["kind","tool","action","reason"],type:"object"},RetainedOutcomeStatusV1:vw,RetrievalWorkerStatusV1:vx,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,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:bi,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:bC,TemporalExplanationV1:bT,TemporalFreshnessV1:bO,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:bE,TemporalOmissionV1:bA,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:bW,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:bR},$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:_j},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComplexityAnalysisV1:hj,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:_O,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveNotFoundV1:_B,PrimitiveSearchFreshnessV1:_J,PrimitiveSymbolLocationV1:_Q},$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:fw,AnalyticsModeV1:fP,ComparisonDispositionV1:hx,CostsReadModelV1:yp,CoverageStateV1:yh,LatencyDistributionReadModelV1:gB,MetricCalibrationV1:_m,MetricCohortV1:_f,MetricCoverageV1:_h,MetricEvidenceClassV1:_y,MetricProvenanceV1:_g,MetricSourceV1:__,MetricTemporalV1:_v,MetricUncertaintyV1:_b,MetricValueV1:_$,ObservabilityHorizonV1:_E,ObservatoryReadModelV1:_W,PerformanceComparisonReadModelV1:_L,ProviderLatencyReadModelV1:vr,RejectedArgumentAnalyticsV1:vu,RejectedArgumentErrorClassV1:vm,RejectedArgumentGroupV1:vf,RejectedArgumentNameV1:vh,RejectedArgumentSurfaceV1:vy},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J},$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"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{base_ref:{description:"Base branch or ref to compare against (default: detected repository\ndefault 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:"Cap the symbol, test, and module sections at about this many tokens.",format:"uint32",minimum:0,type:["integer","null"]},cursor:{description:"Authenticated continuation cursor returned by a previous page.",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 this page (default: 200, clamped to 1-500).",format:"uint32",minimum:0,type:["integer","null"]}},title:"PrContextSurfaceRequestV1",type:"object"},{$defs:{CoChangeUnavailableV1:hh,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ConfigSummaryKindV1:hO,ConfigSummaryV1:hE,GitCommitSubjectV1:{additionalProperties:!1,properties:{hash:{type:"string"},subject:{type:"string"}},required:["hash","subject"],type:"object"},GitComparedSymbolV1:gy,GitContextSymbolV1:gg,GitFileChangeStatusV1:{enum:["added","deleted","modified"],type:"string"},GitFileChangeV1:{additionalProperties:!1,properties:{path:{type:"string"},status:{$ref:"#/$defs/GitFileChangeStatusV1"}},required:["path","status"],type:"object"},GitReadCompleteV1:gI,GitReadPartialV1:gx,GitReadUnavailableV1:gj,GitToolErrorKindV1:gE,GitToolErrorV1:gA,GitToolFailureV1:gW,GitToolOperationV1:gM,MissingCoChangePartnerV1:_S,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"},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"},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"},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"},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:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,PrimitiveUnavailableEvidenceV1:_X,PrimitiveUnavailableStatusV1:_Y,SymbolChangesUnavailableV1:bw,TokenBudgetCutV1:bN,TokenBudgetSectionV1:bz},$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"#/$defs/PrContextCompleteV1"},{$ref:"#/$defs/PrContextSymbolsUnavailableV1"},{$ref:"#/$defs/PrContextGraphPendingV1"},{$ref:"#/$defs/GitToolFailureV1"}],title:"PrContextResultV1"},{$defs:{BranchStackEdgeV1:f9,BranchStackId:f5,BranchStackNodeV1:f8,BranchStackRevisionId:f7,BranchStackRevisionV1:he,BranchStackSourceV1:ht,CommitId:hI,ManifestDigest:_d,MechanicalIntegrationModeV1:_c,NativeIntegrationDirectionV1:_P,NativeIntegrationSealedStackSnapshotV1:_q,NativeIntegrationSelectionBindingV1:_I,ProjectId:_1,RefId:vl,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,StackNodeId:bS,WorktreeId:SH,WorktreeInventoryEpoch:SG,WorktreeInventorySnapshotId:SB},$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:vi},$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:_0,ProjectRegistrySummary:_2,ProjectRepoGroup:_4,PublicCodeProject:vi},$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:_F},$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:bR},$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:va,RankEdgeKindV1:vs},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,RankDirectionV1:va,RankEdgeKindV1:vs,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:hI,ProjectId:_1,ProviderId:vt,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:vg,SimilarMatchClassV1:bs},$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:hg,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ManifestDigest:_d,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,ProjectId:_1,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:vg,SimilarFamilyV1:ba,SimilarMatchClassV1:bs,SimilarOccurrenceV1:bd,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:f0,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:yw,ProjectionGenerationId:_6,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:bK},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveNotFoundV1:_B,PrimitiveSearchFreshnessV1:_J,PrimitiveSymbolLocationV1:_Q,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:_d,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:ha,CancellationStage:hs,Deadline:yb,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:_N,OperationReceipt:_z,OperationTermination:_D,UtcMicros:bK},$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:yw,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 legacy\n`core_doctor` checks (graph quick-check, temporal/migration health,\nconfiguration compatibility drift, 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:"pending_schema_migration",description:"A store whose historical schema convergence has not completed: the\nmigrations whose cost scales with store size are still pending, still\nrunning, or stopped on a failure. The daemon serves while they run, so\nthis is the surface that says which store is still migrating 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:vz,SchemaConvergenceProgressV1:vD,SchemaConvergenceStageV1:vF,SchemaConvergenceStateV1:vL,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:bK},$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:fW,CalibrationProfileId:ho,CandidateContribution:hd,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComponentRevision:hC,ContextLexicalAnchorV1:hL,DaemonServiceUnitObservationV1:yv,DiagnosticsSearchedTsconfigV1:yk,EvidenceRole:yT,ExactClass:yO,FileOccurrenceId:gd,FixedPointScore:gl,FreshnessCompatibilityV1:gp,FusedCandidate:gu,LexicalAnchorDropReasonV1:g8,LexicalAnchorDropV1:g7,LogicalCopyClusterId:_t,LogicalEvidenceId:_r,OccurrenceProvenance:_M,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveLaneCompleteV1:_G,PrimitiveRecallV1:_K,PrimitiveSearchFreshnessV1:_J,PrimitiveUnavailableEvidenceV1:_X,PrimitiveUnavailableStatusV1:_Y,RankingDecision:vd,RankingDecisionKind:vc,RepositoryId:vg,RetrievalAnchorId:vV,RetrievalSourceRoleV1:vI,RetrieverKind:vj,ScoreDomainId:v1,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:v5,SourceFreshness:bf,SourceInstanceKey:bh,SourceNamespace:bg,SourceOccurrenceId:b_,UtcMicros:bK},$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:_F,ResultProjection:vS,RetrievalOrder:vR,RetrievalRequestMeta:vq,SessionId:v9,TemporalModeV1:bE,UtcMicros:bK},$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:vV},$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:bE,UtcMicros:bK},$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:hf,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionRefreshFrontierResultV1:v8,SessionRefreshProgressV1:v7,SessionRefreshReceiptV1:be,SessionRefreshTerminalStateResultV1:bt,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalModeV1:bE,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:hf,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionRefreshFrontierResultV1:v8,SessionRefreshProgressV1:v7,SessionRefreshReceiptV1:be,SessionRefreshTerminalStateResultV1:bt,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalModeV1:bE,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:hf,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,SessionCoverageIntervalV1:v2,SessionCoverageReasonV1:v4,SessionCoverageRequestV1:v6,SessionCoverageStateV1:v3,SessionRefreshFrontierResultV1:v8,SessionRefreshProgressV1:v7,SessionRefreshReceiptV1:be,SessionRefreshTerminalStateResultV1:bt,SessionSourceCoverageV1:bi,TemporalCoverageV1:bC,TemporalModeV1:bE,UtcMicros:bK,ValidCoverageIntervalV1:bJ},$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:vP,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:vw,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:_O,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:_1,RepositoryId:vg,SimilarMatchClassV1:bs,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:bv,SymbolOccurrenceId:bV},$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:hg,CodeIndexBuildBlockedReasonV1:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ManifestDigest:_d,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,ProjectId:_1,RepositoryId:vg,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:ba,SimilarMatchClassV1:bs,SimilarOccurrenceV1:bd,SourceSpan:bv,SymbolOccurrenceId:bV,WorktreeId:SH},$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:_s},$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:fG,ManagedSkillMaterializationScope:_i,ManagedSkillMetadata:_o,ManagedSkillProvenance:_n,ManagedSkillSource:_a,ManagedSkillState:_s,SkillImprovementRecommendation:bc,SkillInstallTarget:bl,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:bp,SkillUsageRecord:bu},$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:fG,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:_i,ManagedSkillMetadata:_o,ManagedSkillProvenance:_n,ManagedSkillSource:_a,ManagedSkillState:_s,ManagedSupportFile:{properties:{bytes:{items:{format:"uint8",maximum:255,minimum:0,type:"integer"},type:"array"},path:{type:"string"}},required:["path","bytes"],type:"object"},SkillImprovementRecommendation:bc,SkillInstallTarget:bl,SkillStaleRecommendation:bp,SkillSupportFileSummaryV1:{additionalProperties:!1,properties:{byte_len:{format:"uint",minimum:0,type:"integer"},path:{type:"string"}},required:["path","byte_len"],type:"object"},SkillUsageRecord:bu},$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:_d,UseCaseId:bG},$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:gd,PageRequest:_F,ResultProjection:vS,RetrievalOrder:vR,RetrievalRequestMeta:vq,SourceSpan:bv,TemporalModeV1:bE,UtcMicros:bK},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,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"],title:"SourceLinesRequest",type:"object"},{$defs:{RetrievalAnchorId:vV,SourceReference:{additionalProperties:!1,properties:{anchor:{$ref:"#/$defs/RetrievalAnchorId"},span:{$ref:"#/$defs/SourceSpan"}},required:["anchor","span"],type:"object"},SourceSpan:bv},$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{body:{type:["string","null"]},file:{type:["string","null"]},references:{items:{$ref:"#/$defs/SourceReference"},type:"array"}},required:["references"],title:"SourceLinesResult",type:"object"},{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{file:{type:"string"}},required:["file"],title:"SourceOutlinePrimitiveRequest",type:"object"},{$defs:{SymbolPrimitiveRecord:bR},$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:f9,BranchStackId:f5,BranchStackNodeV1:f8,BranchStackRevisionId:f7,CommitId:hI,ManifestDigest:_d,NativeIntegrationDirectionV1:_P,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:_1,RefId:vl,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,StackNodeId:bS,WorktreeId:SH,WorktreeInventoryEpoch:SG,WorktreeInventorySnapshotId:SB},$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:hv,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:hb,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:h$,CodeIndexOmittedSourcesV1:hS,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:hk,CodeIndexStalenessStateV1:hw,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:{default:!1,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","coverage"],type:"object"},LcmConvergenceStateV1:gZ,LcmConvergenceV1:gQ,LcmDoctorProjectionStateV1:gX,LcmDoctorProjectionV1:gY,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:vx,SchemaConvergenceFindingV1:vz,SchemaConvergenceProgressV1:vD,SchemaConvergenceStageV1:vF,SchemaConvergenceStateV1:vL,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 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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:ha,CancellationStage:hs,CodeGenerationId:hg,CommitId:hI,Deadline:yb,OperationBudgetUsage:_N,OperationReceipt:_z,OperationTermination:_D,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:bK},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,ComplexityAnalysisV1:hj,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:bH},$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:hv,CodeIndexConvergenceParkedV1:hb,CodeIndexStalenessStateV1:hw,CoverageCompleteness:ym,PrimitiveFreshnessStateV1:_U,PrimitiveIndexingStateV1:_H,PrimitiveSearchFreshnessV1:_J,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:bH,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:gT,RetainedErrorV1:vk,RetainedOutcomeStatusV1:vw,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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,UtcMicros:bK,WorktreeId:SH},$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:_d,NativeWorktreeTargetV1:_T,ProjectId:_1,RepositoryId:vg,ScopeSetId:vZ,ScopeSetRevision:vQ,WorktreeId:SH},$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:f$,TaskId:bj},$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:_d,TaskId:bj,UtcMicros:bK},$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:y7,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:_d,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:bj,UtcMicros:bK},$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:y7,HandoffOpenReceiptV1:gN,InvestigationHandoffSurfaceV1:{additionalProperties:!1,properties:{finding_id:{$ref:"#/$defs/FeedbackFindingId"},owner_version_digest:{$ref:"#/$defs/ManifestDigest"}},required:["finding_id","owner_version_digest"],type:"object"},ManifestDigest:_d,UtcMicros:bK},$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:gN,ManifestDigest:_d,TaskHandoffSurfaceV1:{additionalProperties:!1,properties:{task_id:{$ref:"#/$defs/TaskId"},version:{format:"uint64",minimum:0,type:"integer"}},required:["task_id","version"],type:"object"},TaskId:bj,UtcMicros:bK},$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:_d,MultiRootContinuationV1:_k,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:vE,RootScopeOutcomeV1_for_Nullable_RootGenerationV1:vA,RootScopeOutcomeV1_for_Nullable_string:vW,ScopeOutcome_for_Nullable_RootGenerationV1:vB,ScopeOutcome_for_Nullable_string:vK,ScopePartialReasonV1:vJ,ScopeSetId:vZ,ScopeSetRevision:vQ,ScopeUnavailableReasonV1:vY},$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:_d,MultiRootContinuationV1:_k,RootGenerationV1:vE,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:vA,RootScopeOutcomeV1_for_Nullable_string:vW,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:vB,ScopeOutcome_for_Nullable_string:vK,ScopePartialReasonV1:vJ,ScopeSetId:vZ,ScopeSetRevision:vQ,ScopeUnavailableReasonV1:vY},$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:_1,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:vZ,ScopeSetRevision:vQ},$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:f$,AuthorizedRoot:fz,AuthorizedScopeSet:fD,BrainId:f0,ManifestDigest:_d,MultiRootScopeSetCasStatusV1:{enum:["applied","conflict"],type:"string"},ProjectId:_1,RefId:vl,RegisteredRootLocatorV1:vp,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,SharedProfileStoreLocatorV1:bn,UserProfileId:bB,WorktreeId:SH},$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:vZ},$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:f$,AuthorizedRoot:fz,AuthorizedScopeSet:fD,BrainId:f0,ManifestDigest:_d,ProjectId:_1,RefId:vl,RegisteredRootLocatorV1:vp,RepositoryId:vg,ResolvedScope:v$,ScopeSetId:vZ,ScopeSetRevision:vQ,SharedProfileStoreLocatorV1:bn,UserProfileId:bB,WorktreeId:SH},$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:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkCommandId:$c,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:f$,AttemptId:fM,BrainId:f0,CatalogGenerationId:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkGraphChangeV1:$I,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductEventPayloadV1:$X,WorkProductEventV1:$Y,WorkProductGraphV1:$0,WorkProductProfileScopeV1:$6,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:fM,CoverageStateV1:yh,DuplicateEffectOutcomeV1:yV,DuplicateEffortKindV1:yR,ProjectionGenerationId:_6,QuantityEvidenceClassV1:vo,RunId:vN,TaskId:bj,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkDuplicateAdjudicationEvidenceV1:$p,WorkDuplicateAdjudicationQuantitiesV1:$u,WorkTopologyGenerationRefV1:ST},$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:f$,AttemptId:fM,CoverageStateV1:yh,DuplicateEffectOutcomeV1:yV,DuplicateEffortKindV1:yR,ManifestDigest:_d,ProjectionGenerationId:_6,QuantityEvidenceClassV1:vo,RunId:vN,TaskId:bj,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkCommandId:$c,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:$p,WorkDuplicateAdjudicationQuantitiesV1:$u,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:ST},$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:fM,RunId:vN,TaskId:bj,WorkAttemptIdentityV1:b2,WorkCommandId:$c},$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:fM,CoverageStateV1:yh,LeakOwnerClassV1:{enum:["work","workflow","git","delivery","unknown"],type:"string"},ManifestDigest:_d,RunId:vN,TaskId:bj,UtcMicros:bK,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:b2,WorkCommandId:$c,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:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RetrievalAnchorId:vV,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkCommandId:$c,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,AutomaticWorktreeGcV1:fL,BrainId:f0,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CatalogGenerationId:hu,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,RetrievalAnchorId:vV,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkGraphChangeV1:$I,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductEventPayloadV1:$X,WorkProductEventV1:$Y,WorkProductGraphV1:$0,WorkProductMutationReceiptV1:$4,WorkProductProfileScopeV1:$6,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTopologyPolicyV1:SO,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementKindV1:$H,WorkPlacementTargetV1:$B},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,WorkPlacementStateV1:$G,WorkPlacementTargetV1:$B},$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:hI,RefId:vl,WorkEffectStateV1:$m,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:$M,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:$H,WorkPlacementTargetV1:$B,WorkflowOutputName:SN},$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:f$,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:fW,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:fM,AutomaticWorktreeGcV1:fL,BrainId:f0,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CancellationStage:hs,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CatalogGenerationId:hu,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CoverageCompleteness:ym,CoverageDomainState:yf,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,DaemonServiceUnitObservationV1:yv,DiagnosticsSearchedTsconfigV1:yk,EffectClass:yq,EffectReceipt:yI,EffectTermination:yx,EvidenceCoverage:yj,EvidenceDomain:yC,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,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:_e,ManifestDigest:_d,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:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,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:v$,RetrievalAnchorId:vV,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:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,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:v0,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UseCaseId:bG,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkCommandId:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkGraphChangeV1:$I,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,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:$M,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:$N,WorkLeaseId:$z,WorkMilestoneV1:$D,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,WorkPlacementStateV1:$G,WorkPlacementTargetV1:$B,WorkPlacementV1:$K,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductEventPayloadV1:$X,WorkProductEventV1:$Y,WorkProductGraphV1:$0,WorkProductMutationReceiptV1:$4,WorkProductProfileScopeV1:$6,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRestartReasonV1:Sp,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,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:SV,WorkSynthesisRefusalV1:SR,WorkSynthesisSourceEnvelopeV1:Sq,WorkSynthesisSourceOutcomeV1:SI,WorkSynthesisSourceSetV1:Sx,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowSynthesisDraft:SL,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,RunId:vN,TaskId:bj},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,RunId:vN,TaskId:bj,UtcMicros:bK,WorkCancellationRequestId:$a},$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:_d,ProjectId:_1,RepositoryId:vg,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,ManifestDigest:_d,ProposalId:_3,ProviderId:vt,RetrievalAnchorId:vV,RunId:vN,TaskEvidenceLinkV1:bI,TaskId:bj,UtcMicros:bK,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:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkItemInputV1:$A,WorkItemV1:$W,WorkProductRelationV1:$3,WorkProposalComparisonEffectV1:{oneOf:[{const:"advisory_only",description:"Comparison is evidence only. There is no apply edge from this result.",type:"string"}]},WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:f$,AttemptId:fM,CatalogGenerationId:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy},$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:b6},$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:fM,ManifestDigest:_d,RunId:vN,TaskId:bj,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptStateV1:b7,WorkEffectStateV1:$m,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:_d,ProjectId:_1,RepositoryId:vg,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkExpertiseCategoryV1:$w,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProposalId:_3,ProviderId:vt,RetrievalAnchorId:vV,RunId:vN,SessionId:v9,TaskEvidenceLinkV1:bI,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptEvidenceRecordV1:b0,WorkAttemptIdentityV1:b2,WorkAttemptProviderOutcomeV1:b5,WorkAttemptReceiptV1:b8,WorkAttemptStreamChannelV1:$e,WorkAttemptStreamSummaryV1:$t,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:$w,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:$T,WorkHierarchyV1:$O,WorkItemInputV1:$A,WorkItemV1:$W,WorkProviderAvailabilityV1:Sr,WorkProviderBackendV1:Si,WorkProviderFallbackRecordV1:So,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy},$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:_d,ProjectId:_1,ProposalId:_3,RepositoryId:vg,TaskId:bj,UtcMicros:bK,WorkEvidenceFrontierV1:$g,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductSelectionScopeV1:$5},$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:hN,ManifestDigest:_d,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:_3,ProviderId:vt,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,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:$g,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:$F,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:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,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:Sy,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:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,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:b6},$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:fM,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProviderId:vt,RunId:vN,SessionId:v9,TaskId:bj,UtcMicros:bK,WorkArtifactId:bY,WorkArtifactRefV1:b1,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:b0,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:b2,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptProviderOutcomeV1:b5,WorkAttemptStreamChannelV1:$e,WorkAttemptStreamSummaryV1:$t,WorkAttemptTopologyBindingV1:$r,WorkProviderAvailabilityV1:Sr,WorkProviderBackendV1:Si,WorkProviderFallbackRecordV1:So,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptTopologyBindingV1:$r,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:f$,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:fM,CatalogGenerationId:hu,ConfigurationRevisionId:hN,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:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RecordWorkHandoffRequestV1:{additionalProperties:!1,properties:{handoff:{$ref:"#/$defs/WorkHandoffV1"},mutation:{$ref:"#/$defs/WorkProductMutationIdentityV1"},selection:{$ref:"#/$defs/WorkProductSelectionScopeV1"}},required:["selection","handoff","mutation"],type:"object"},RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskEvidenceLinkV1:bI,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductGraphV1:$0,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:vN,TaskId:bj,UtcMicros:bK,WorkRunControlReasonV1:Sv},$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:fM,RunId:vN,TaskId:bj,UtcMicros:bK,WorkRunControlAuthorityV1:S_,WorkRunControlReasonV1:Sv,WorkRunControlStateV1:Sb,WorkRunDeadlineCheckpointV1:S$},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementKindV1:$H,WorkPlacementTargetV1:$B},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,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:$B},$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:vN,TaskId:bj},$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:vN,TaskId:bj,UtcMicros:bK,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,WorkPlacementStateV1:$G,WorkPlacementTargetV1:$B,WorkPlacementV1:$K},$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:fM,CoverageStateV1:yh,DuplicateEffectOutcomeV1:yV,DuplicateEffortKindV1:yR,QuantityEvidenceClassV1:vo,RunId:vN,TaskId:bj,WorkAttemptIdentityV1:b2,WorkDuplicateAdjudicationQuantitiesV1:$u},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,SourceStoreId:bb,TaskId:bj,UtcMicros:bK,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,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:$Q,WorkProductSelectionScopeV1:$5,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:vN,TaskId:bj,UtcMicros:bK},$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:bK},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:vN,TaskId:bj,UtcMicros:bK,WorkRunControlReasonV1:Sv},$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:fM,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProjectId:_1,ProviderId:vt,RepositoryId:vg,RunId:vN,SessionId:v9,TaskId:bj,TemporalModeV1:bE,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAttemptIdentityV1:b2,WorkEvidenceContinuationV1:$y,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:$Z,WorkProductSelectionScopeV1:$5,WorkTaskSessionContinuationV1:Sj},$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:f$,AttemptId:fM,ManifestDigest:_d,ObservationSourceIdentityV1:_A,ProposalId:_3,ProviderId:vt,RetrievalAnchorId:vV,RunId:vN,SessionId:v9,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:br,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:bI,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,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:bY,WorkArtifactRefV1:b1,WorkAttemptEvidenceRecordV1:b0,WorkAttemptIdentityV1:b2,WorkAttemptProviderOutcomeV1:b5,WorkAttemptReceiptV1:b8,WorkAttemptStreamChannelV1:$e,WorkAttemptStreamSummaryV1:$t,WorkEvidenceContinuationV1:$y,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:$T,WorkHierarchyV1:$O,WorkItemInputV1:$A,WorkItemV1:$W,WorkProductRelationV1:$3,WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderAvailabilityV1:Sr,WorkProviderBackendV1:Si,WorkProviderFallbackRecordV1:So,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTaskSessionContinuationV1:Sj,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:fM,RunId:vN,TaskId:bj,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkRetryCauseV1:Su,WorkRetryFailureSelectorV1:Sm,WorkRetrySourceV1:Sf},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,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:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,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:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkCommandId:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkRetryCauseV1:Su,WorkRetryFailureSelectorV1:Sm,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:Sf,WorkSandboxPolicy:SS,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:hu,ConfigurationRevisionId:hN,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,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:bb,TaskId:bj,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkCommandId:$c,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductEventEvidenceV1:$Q,WorkProductExpectedAuthorityV1:$1,WorkProductMutationIdentityV1:$2,WorkProductRevisionPinsV1:$9,WorkProductSelectionScopeV1:$5,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP},$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:vN,TaskId:bj},$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:fM,RunId:vN,TaskId:bj,UtcMicros:bK,WorkRunControlAuthorityV1:S_,WorkRunControlReasonV1:Sv,WorkRunControlStateV1:Sb,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:S$},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,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:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkAttemptIdentityV1:b2,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkSandboxPolicy:SS,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorktreeCleanlinessRequirementV1:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,WorkAttemptProgressV1:b3,WorkAttemptProjectionBindingV1:b9,WorkAttemptStateV1:b7,WorkAttemptV1:$i,WorkCancellationAcknowledgementV1:$o,WorkCancellationEscalationV1:$n,WorkCancellationRequestId:$a,WorkCancellationRequestV1:$s,WorkCancellationStateV1:$d,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionEnvelopeV1:$$,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRecoveryStateV1:Sd,WorkRestartReasonV1:Sp,WorkSandboxPolicy:SS,WorkSynthesisEvidenceGroupV1:SV,WorkSynthesisRefusalV1:SR,WorkSynthesisSourceEnvelopeV1:Sq,WorkSynthesisSourceOutcomeV1:SI,WorkSynthesisSourceSetV1:Sx,WorkTerminalEvidenceV1:SC,WorkTopologyPolicyV1:SO,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowSynthesisDraft:SL,WorktreeCleanlinessRequirementV1:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:b6},$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:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,TaskId:bj,TopologyGatePolicyV1:bL,UtcMicros:bK,WorkAttemptListCoverageV1:b4,WorkAttemptListCursorV1:b6,WorkAttemptTopologyBindingV1:$r,WorkPlacementBlockerV1:$L,WorkPlacementIdentityV1:$U,WorkPlacementKindV1:$H,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:$G,WorkPlacementTargetV1:$B,WorkPlacementV1:$K,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:SU,WorktreePlacementModeV1:SK},$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:_E},$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:yh,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:_m,MetricCohortV1:_f,MetricCoverageV1:_h,MetricEvidenceClassV1:_y,MetricProvenanceV1:_g,MetricSourceV1:__,MetricTemporalV1:_v,MetricUncertaintyV1:_b,MetricValueV1:_$,ObservabilityHorizonV1:_E},$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:_1,RepositoryId:vg,UtcMicros:bK,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:$Z,WorkProductSelectionScopeV1:$5},$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:f$,AttemptId:fM,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:f0,ManifestDigest:_d,ProjectId:_1,ProjectionGenerationId:_6,ProposalId:_3,ProviderId:vt,RepositoryId:vg,RetrievalAnchorId:vV,RunId:vN,TaskEvidenceLinkV1:bI,TaskId:bj,UserProfileId:bB,UtcMicros:bK,VerifiedWorkGraphVersionV1:bZ,WorkAcceptanceCriterionV1:bQ,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,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:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,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:$D,WorkPlanV1:$J,WorkProductAuthorizedRelationScopeV1:$Z,WorkProductGraphV1:$0,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:$5,WorkProjectionSequenceV1:{format:"uint64",minimum:0,title:"WorkProjectionSequenceV1",type:"integer"},WorkProposalDecisionV1:$8,WorkProposalDispositionV1:$7,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRelationReplanDecisionV1:Sc,WorkRelationReplanProposalV1:Sl,WorkRouteDecisionV1:Sy,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:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,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:SA},$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:bK,WorkflowDefinitionId:SA,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:vN,WorkCommandId:$c},$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:f$,AttemptId:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProjectId:_1,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkArtifactId:bY,WorkArtifactRefV1:b1,WorkAttemptIdentityV1:b2,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:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFilesystemPolicy:$q,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTopologyPolicyV1:SO,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,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:SM,WorkflowOutputArtifact:{additionalProperties:!1,properties:{artifact:{$ref:"#/$defs/WorkArtifactRefV1"},attempt_identity:{$ref:"#/$defs/WorkAttemptIdentityV1"}},required:["attempt_identity","artifact"],type:"object"},WorkflowOutputName:SN,WorkflowOutputReference:Sz,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:SD,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:SF,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:SU,WorktreeId:SH,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:SA},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$schema:"https://json-schema.org/draft/2020-12/schema",items:{$ref:"#/$defs/WorkflowDefinition"},title:"Array_of_WorkflowDefinition",type:"array"},{$defs:{WorkflowDefinitionId:SA},$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:SA,WorkflowStepId:SF},$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:SA},$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:_d,ProjectId:_1,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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:vN},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,WorkHandoffAttemptFrontierV1:$x,WorkHandoffFrontierV1:$j,WorkHandoffLineageV1:$C,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,WorkHandoffAttemptFrontierV1:$x,WorkHandoffFrontierV1:$j,WorkHandoffLineageV1:$C,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:f$,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:f$,AttemptId:fM,ManifestDigest:_d,ProjectId:_1,RepositoryId:vg,RunId:vN,TaskHandoffScope:bx,TaskId:bj,ThreadId:bM,UtcMicros:bK,WorkAttemptIdentityV1:b2,WorkAttemptStateV1:b7,WorkHandoffAttemptFrontierV1:$x,WorkHandoffFrontierV1:$j,WorkHandoffLineageV1:$C,WorkflowDefinitionId:SA,WorkflowStepId:SF,WorktreeId:SH},$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:vN,WorkCommandId:$c},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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:SA},$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:vN,WorkCommandId:$c},$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:SA},$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:f$,AttemptId:fM,AutomaticWorktreeGcV1:fL,BranchCollisionPolicyV1:f2,BranchNameComponentV1:f4,BranchNameSeparatorV1:f6,BranchNamingPolicyV1:f3,BranchTopologyKindV1:hr,BranchTopologyPolicyV1:hi,CanonicalGitRefNameV1:hc,CanonicalGitRefPrefix:hl,CapabilityId:hp,CommitId:hI,ConfigurationRevisionId:hN,ConfigurationSnapshotId:hz,CredentialReferenceId:yy,CrossMergeModeV1:yg,CrossMergePolicyV1:y_,GitHubStackedPullRequestPolicyV1:gS,HistoryRewritePolicyV1:gz,LocatorDigest:_e,ManifestDigest:_d,ProposalId:_3,ProtectedRefDispositionV1:_9,ProtectedRefRuleV1:_5,ProtectedRefSelectorV1:_8,ProviderId:vt,RefId:vl,RepositoryId:vg,RepositoryPlacementScopeV1:v_,RequiredCheckExpectationV1:vv,RequiredCheckV1:vb,ReviewRequirementV1:vC,ReviewTopologyKindV1:vT,ReviewTopologyPolicyV1:vO,RunId:vN,SensitiveFilesystemLocatorV1:v0,TaskId:bj,TopologyConcurrencyPolicyV1:bD,TopologyEscalationPolicyV1:bF,TopologyGatePolicyV1:bL,TopologyNotificationLevelV1:bU,UtcMicros:bK,WorkAcceptanceCriterionV1:bQ,WorkApprovalPolicy:bX,WorkAttemptIdentityV1:b2,WorkCommandId:$c,WorkEffectStateV1:$m,WorkEgressPolicy:$h,WorkExecutableReference:$b,WorkExecutionLimits:$S,WorkExecutionSnapshot:$k,WorkFallbackTopology:$V,WorkFenceEpochV1:$R,WorkFilesystemPolicy:$q,WorkHandoffV1:$T,WorkHierarchyV1:$O,WorkInitiativeV1:$E,WorkItemInputV1:$A,WorkItemV1:$W,WorkLeaseFenceV1:$N,WorkLeaseId:$z,WorkMilestoneV1:$D,WorkPlanV1:$J,WorkProposalV1:Se,WorkProposedChildV1:St,WorkProviderBackendV1:Si,WorkProviderProtocol:Sn,WorkProviderRouteId:Sa,WorkProviderRouteV1:Ss,WorkRouteDecisionV1:Sy,WorkSandboxPolicy:SS,WorkScoreKindV1:Sk,WorkShapeAssessmentV1:Sw,WorkSizingV1:SP,WorkTopologyPolicyV1:SO,WorkflowDefinitionId:SA,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:SU,WorktreePlacementModeV1:SK,WorktreeRetentionPolicyV1:SJ,WorktreeRootPolicyV1:SZ},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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:_d,ProjectId:_1,WorkflowDefinition:SE,WorkflowDefinitionId:SA,WorkflowFanOut:SW,WorkflowOperationRef:SM,WorkflowOutputName:SN,WorkflowOutputReference:Sz,WorkflowStep:SD,WorkflowStepId:SF},$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=fr(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=fr(r,t)[i]}return fr(r,t)}(i,s.$ref),i,o,n),n.delete(s.$ref);return}if("const"in s&&(a=s.const,ft(t)!==ft(a)))throw TypeError(`${o} does not match the canonical constant`);if(Array.isArray(s.enum)&&!s.enum.some(e=>ft(t)===ft(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&&!fi(t,d))throw TypeError(`${o} must be ${d}`);if(Array.isArray(d)&&!d.some(e=>"string"==typeof e&&fi(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=ft(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?{}:fr(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 SX(e){let t=SQ[e];if(void 0===t)throw TypeError(`generated canonical schema ${e} is missing`);return t}let SY=[{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:SX(0),decodeResult:SX(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:SX(2),decodeResult:SX(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:SX(4),decodeResult:SX(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:SX(6),decodeResult:SX(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:SX(8),decodeResult:SX(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:SX(10),decodeResult:SX(11),decodeSuccess:e=>fu(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",SX(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:SX(12),decodeResult:SX(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:SX(14),decodeResult:SX(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:SX(16),decodeResult:SX(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:SX(17),decodeResult:SX(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:SX(19),decodeResult:SX(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:SX(21),decodeResult:SX(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:SX(23),decodeResult:SX(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:SX(25),decodeResult:SX(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:SX(27),decodeResult:SX(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:SX(29),decodeResult:SX(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:SX(31),decodeResult:SX(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:SX(33),decodeResult:SX(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:SX(35),decodeResult:SX(36),decodeSuccess:e=>fu(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",SX(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:SX(37),decodeResult:SX(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:SX(38),decodeResult:SX(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:SX(40),decodeResult:SX(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:SX(42),decodeResult:SX(43),decodeSuccess:e=>fu(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",SX(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:SX(44),decodeResult:SX(45),decodeSuccess:e=>fu(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",SX(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:SX(46),decodeResult:SX(47),decodeSuccess:e=>fu(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",SX(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:SX(48),decodeResult:SX(49),decodeSuccess:e=>fu(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",SX(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:SX(50),decodeResult:SX(51),decodeSuccess:e=>fu(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",SX(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:SX(52),decodeResult:SX(53),decodeSuccess:e=>fu(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",SX(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:SX(54),decodeResult:SX(55),decodeSuccess:e=>fu(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",SX(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:SX(46),decodeResult:SX(43),decodeSuccess:e=>fu(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",SX(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:SX(56),decodeResult:SX(57),decodeSuccess:e=>fu(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",SX(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:SX(58),decodeResult:SX(57),decodeSuccess:e=>fu(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",SX(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:SX(59),decodeResult:SX(60),decodeSuccess:e=>fu(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",SX(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:SX(46),decodeResult:SX(47),decodeSuccess:e=>fu(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",SX(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:SX(61),decodeResult:SX(62),decodeSuccess:e=>fu(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",SX(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:SX(63),decodeResult:SX(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:SX(65),decodeResult:SX(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:SX(67),decodeResult:SX(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:SX(69),decodeResult:SX(70),decodeSuccess:e=>fu(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",SX(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:SX(71),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(73),decodeResult:SX(74),decodeSuccess:e=>fu(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",SX(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:SX(75),decodeResult:SX(76),decodeSuccess:e=>fu(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",SX(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:SX(77),decodeResult:SX(78),decodeSuccess:e=>fu(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",SX(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:SX(79),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(80),decodeResult:SX(81),decodeSuccess:e=>fu(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",SX(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:SX(79),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(82),decodeResult:SX(81),decodeSuccess:e=>fu(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",SX(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:SX(83),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(84),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(85),decodeResult:SX(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:SX(87),decodeResult:SX(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:SX(89),decodeResult:SX(90),decodeSuccess:e=>fu(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",SX(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:SX(91),decodeResult:SX(92),decodeSuccess:e=>fu(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",SX(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:SX(89),decodeResult:SX(93),decodeSuccess:e=>fu(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",SX(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:SX(94),decodeResult:SX(95),decodeSuccess:e=>fu(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",SX(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:SX(96),decodeResult:SX(97),decodeSuccess:e=>fu(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",SX(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:SX(98),decodeResult:SX(99),decodeSuccess:e=>fu(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",SX(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:SX(100),decodeResult:SX(92),decodeSuccess:e=>fu(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",SX(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:SX(101),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(98),decodeResult:SX(102),decodeSuccess:e=>fu(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",SX(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:SX(101),decodeResult:SX(72),decodeSuccess:e=>fu(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",SX(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:SX(89),decodeResult:SX(103),decodeSuccess:e=>fu(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",SX(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:SX(104),decodeResult:SX(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:SX(106),decodeResult:SX(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:SX(108),decodeResult:SX(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:SX(110),decodeResult:SX(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:SX(112),decodeResult:SX(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:SX(114),decodeResult:SX(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:SX(116),decodeResult:SX(117),decodeSuccess:e=>fu(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",SX(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:SX(118),decodeResult:SX(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:SX(120),decodeResult:SX(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:SX(122),decodeResult:SX(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:SX(124),decodeResult:SX(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:SX(126),decodeResult:SX(127),decodeSuccess:e=>fu(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",SX(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:SX(128),decodeResult:SX(129),decodeSuccess:e=>fu(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",SX(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:SX(130),decodeResult:SX(131),decodeSuccess:e=>fu(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",SX(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:SX(132),decodeResult:SX(133),decodeSuccess:e=>fu(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",SX(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:SX(134),decodeResult:SX(135),decodeSuccess:e=>fu(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",SX(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:SX(136),decodeResult:SX(137),decodeSuccess:e=>fu(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",SX(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:SX(138),decodeResult:SX(139),decodeSuccess:e=>fu(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",SX(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:SX(140),decodeResult:SX(141),decodeSuccess:e=>fu(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",SX(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:SX(142),decodeResult:SX(143),decodeSuccess:e=>fu(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",SX(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:SX(144),decodeResult:SX(145),decodeSuccess:e=>fu(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",SX(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:SX(146),decodeResult:SX(147),decodeSuccess:e=>fu(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",SX(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:SX(148),decodeResult:SX(149),decodeSuccess:e=>fu(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",SX(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:SX(150),decodeResult:SX(151),decodeSuccess:e=>fu(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",SX(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:SX(152),decodeResult:SX(153),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(154),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(155),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(156),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(157),decodeSuccess:e=>fu(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",SX(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:SX(10),decodeResult:SX(158),decodeSuccess:e=>fu(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",SX(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:SX(159),decodeResult:SX(160),decodeSuccess:e=>fu(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",SX(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:SX(161),decodeResult:SX(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:SX(163),decodeResult:SX(164),decodeSuccess:e=>fu(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",SX(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:SX(165),decodeResult:SX(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:SX(167),decodeResult:SX(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:SX(169),decodeResult:SX(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:SX(171),decodeResult:SX(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:SX(173),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(175),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(176),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(177),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(178),decodeResult:SX(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:SX(180),decodeResult:SX(174),decodeSuccess:e=>fu(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",SX(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:SX(181),decodeResult:SX(182),decodeSuccess:e=>fu(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",SX(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:SX(183),decodeResult:SX(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:SX(185),decodeResult:SX(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:SX(187),decodeResult:SX(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:SX(189),decodeResult:SX(190),decodeSuccess:e=>fu(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",SX(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:SX(191),decodeResult:SX(192),decodeSuccess:e=>fu(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",SX(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:SX(193),decodeResult:SX(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:SX(195),decodeResult:SX(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:SX(197),decodeResult:SX(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:SX(199),decodeResult:SX(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:SX(201),decodeResult:SX(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:SX(203),decodeResult:SX(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:SX(204),decodeResult:SX(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:SX(205),decodeResult:SX(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:SX(207),decodeResult:SX(208),decodeSuccess:e=>fu(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",SX(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:SX(209),decodeResult:SX(210),decodeSuccess:e=>fu(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",SX(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:SX(211),decodeResult:SX(212),decodeSuccess:e=>fu(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",SX(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:SX(213),decodeResult:SX(214),decodeSuccess:e=>fu(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",SX(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:SX(215),decodeResult:SX(216),decodeSuccess:e=>fu(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",SX(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:SX(217),decodeResult:SX(218),decodeSuccess:e=>fu(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",SX(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:SX(219),decodeResult:SX(220),decodeSuccess:e=>fu(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",SX(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:SX(221),decodeResult:SX(222),decodeSuccess:e=>fu(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",SX(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:SX(223),decodeResult:SX(224),decodeSuccess:e=>fu(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",SX(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:SX(225),decodeResult:SX(226),decodeSuccess:e=>fu(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",SX(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:SX(227),decodeResult:SX(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:SX(228),decodeResult:SX(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:SX(229),decodeResult:SX(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:SX(230),decodeResult:SX(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:SX(232),decodeResult:SX(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:SX(234),decodeResult:SX(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:SX(236),decodeResult:SX(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:SX(238),decodeResult:SX(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:SX(240),decodeResult:SX(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:SX(241),decodeResult:SX(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:SX(243),decodeResult:SX(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:SX(245),decodeResult:SX(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:SX(246),decodeResult:SX(247),decodeSuccess:e=>fu(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",SX(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:SX(248),decodeResult:SX(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:SX(250),decodeResult:SX(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:SX(252),decodeResult:SX(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:SX(254),decodeResult:SX(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:SX(256),decodeResult:SX(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:SX(258),decodeResult:SX(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:SX(259),decodeResult:SX(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:SX(260),decodeResult:SX(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:SX(262),decodeResult:SX(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:SX(264),decodeResult:SX(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:SX(266),decodeResult:SX(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:SX(268),decodeResult:SX(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:SX(270),decodeResult:SX(271),decodeSuccess:e=>fu(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",SX(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:SX(270),decodeResult:SX(272),decodeSuccess:e=>fu(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",SX(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:SX(270),decodeResult:SX(273),decodeSuccess:e=>fu(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",SX(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:SX(274),decodeResult:SX(275),decodeSuccess:e=>fu(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",SX(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:SX(112),decodeResult:SX(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:SX(277),decodeResult:SX(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:SX(279),decodeResult:SX(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:SX(281),decodeResult:SX(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:SX(283),decodeResult:SX(284),decodeSuccess:e=>fu(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",SX(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:SX(285),decodeResult:SX(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:SX(286),decodeResult:SX(287),decodeSuccess:e=>fu(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",SX(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:SX(288),decodeResult:SX(289),decodeSuccess:e=>fu(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",SX(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:SX(290),decodeResult:SX(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:SX(291),decodeResult:SX(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:SX(293),decodeResult:SX(294),decodeSuccess:e=>fu(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",SX(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:SX(295),decodeResult:SX(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:SX(296),decodeResult:SX(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:SX(298),decodeResult:SX(299),decodeSuccess:e=>fu(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",SX(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:SX(300),decodeResult:SX(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:SX(302),decodeResult:SX(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:SX(304),decodeResult:SX(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:SX(306),decodeResult:SX(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:SX(308),decodeResult:SX(309),decodeSuccess:e=>fu(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",SX(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:SX(310),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(311),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(312),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(313),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(314),decodeResult:SX(15),decodeSuccess:e=>fu(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",SX(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:SX(315),decodeResult:SX(316),decodeSuccess:e=>fu(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",SX(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:SX(317),decodeResult:SX(318),decodeSuccess:e=>fu(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",SX(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:SX(319),decodeResult:SX(320),decodeSuccess:e=>fu(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",SX(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:SX(321),decodeResult:SX(322),decodeSuccess:e=>fu(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",SX(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:SX(323),decodeResult:SX(324),decodeSuccess:e=>fu(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",SX(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:SX(325),decodeResult:SX(326),decodeSuccess:e=>fu(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",SX(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:SX(327),decodeResult:SX(328),decodeSuccess:e=>fu(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",SX(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:SX(329),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(331),decodeResult:SX(332),decodeSuccess:e=>fu(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",SX(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:SX(333),decodeResult:SX(334),decodeSuccess:e=>fu(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",SX(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:SX(335),decodeResult:SX(336),decodeSuccess:e=>fu(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",SX(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:SX(337),decodeResult:SX(338),decodeSuccess:e=>fu(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",SX(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:SX(339),decodeResult:SX(340),decodeSuccess:e=>fu(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",SX(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:SX(341),decodeResult:SX(342),decodeSuccess:e=>fu(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",SX(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:SX(343),decodeResult:SX(342),decodeSuccess:e=>fu(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",SX(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:SX(344),decodeResult:SX(345),decodeSuccess:e=>fu(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",SX(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:SX(346),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(347),decodeResult:SX(348),decodeSuccess:e=>fu(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",SX(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:SX(349),decodeResult:SX(350),decodeSuccess:e=>fu(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",SX(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:SX(351),decodeResult:SX(352),decodeSuccess:e=>fu(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",SX(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:SX(353),decodeResult:SX(354),decodeSuccess:e=>fu(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",SX(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:SX(347),decodeResult:SX(355),decodeSuccess:e=>fu(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",SX(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:SX(356),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(357),decodeResult:SX(358),decodeSuccess:e=>fu(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",SX(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:SX(359),decodeResult:SX(360),decodeSuccess:e=>fu(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",SX(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:SX(361),decodeResult:SX(362),decodeSuccess:e=>fu(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",SX(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:SX(363),decodeResult:SX(331),decodeSuccess:e=>fu(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",SX(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:SX(364),decodeResult:SX(356),decodeSuccess:e=>fu(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",SX(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:SX(365),decodeResult:SX(338),decodeSuccess:e=>fu(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",SX(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:SX(366),decodeResult:SX(367),decodeSuccess:e=>fu(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",SX(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:SX(368),decodeResult:SX(358),decodeSuccess:e=>fu(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",SX(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:SX(369),decodeResult:SX(370),decodeSuccess:e=>fu(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",SX(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:SX(371),decodeResult:SX(372),decodeSuccess:e=>fu(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",SX(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:SX(373),decodeResult:SX(330),decodeSuccess:e=>fu(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",SX(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:SX(374),decodeResult:SX(375),decodeSuccess:e=>fu(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",SX(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:SX(376),decodeResult:SX(342),decodeSuccess:e=>fu(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",SX(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:SX(377),decodeResult:SX(378),decodeSuccess:e=>fu(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",SX(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:SX(379),decodeResult:SX(380),decodeSuccess:e=>fu(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",SX(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:SX(381),decodeResult:SX(382),decodeSuccess:e=>fu(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",SX(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:SX(383),decodeResult:SX(384),decodeSuccess:e=>fu(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",SX(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:SX(385),decodeResult:SX(386),decodeSuccess:e=>fu(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",SX(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:SX(387),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(389),decodeResult:SX(390),decodeSuccess:e=>fu(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",SX(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:SX(391),decodeResult:SX(392),decodeSuccess:e=>fu(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",SX(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:SX(393),decodeResult:SX(394),decodeSuccess:e=>fu(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",SX(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:SX(395),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(396),decodeResult:SX(397),decodeSuccess:e=>fu(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",SX(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:SX(398),decodeResult:SX(399),decodeSuccess:e=>fu(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",SX(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:SX(400),decodeResult:SX(390),decodeSuccess:e=>fu(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",SX(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:SX(401),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(402),decodeResult:SX(394),decodeSuccess:e=>fu(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",SX(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:SX(403),decodeResult:SX(386),decodeSuccess:e=>fu(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",SX(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:SX(404),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(405),decodeResult:SX(386),decodeSuccess:e=>fu(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",SX(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:SX(406),decodeResult:SX(388),decodeSuccess:e=>fu(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",SX(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:SX(407),decodeResult:SX(408),decodeSuccess:e=>fu(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",SX(408))}],S1=new TextEncoder;class S0 extends Error{cause;constructor(e,t){super(e),this.name=new.target.name,this.cause=t}}class S2 extends S0{constructor(e){super("the caller aborted the request",e)}}class S4 extends S0{}class S6 extends S0{status;constructor(e){super(401===e?"the daemon rejected HTTP authentication":"the daemon rejected the HTTP origin"),this.status=e}}class S3 extends Error{status;payload;constructor(e,t={}){super(e),this.name=new.target.name,this.status=t.status,this.payload=t.payload}}class S9 extends S3{}class S5 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 S8 extends S5{}class S7 extends S5{}class ke extends S5{}class kt extends S5{}class kr extends S5{}class ki extends S5{}class ko extends S5{}class kn extends S5{}class ka extends S5{}class ks extends S5{}class kd extends S5{}let kc=new Set(["completed","cancelled","timed_out","failed","unavailable","effect_unknown","partial"]),kl=new TextEncoder;function kp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ku(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function km(e){return"number"==typeof e&&Number.isSafeInteger(e)}function kf(e,t){return"string"==typeof e&&e.length>0&&e.trim()===e&&kl.encode(e).byteLength<=t&&!/\p{Cc}/u.test(e)}function kh(e,t){let r=e.headers.get("content-type");return null!==r&&r.split(";",1)[0]?.trim().toLowerCase()===t}function ky(e){return!!kp(e)&&!!km(e.started_at)&&!!km(e.ended_at)&&!(e.ended_at{let o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e),n=()=>{clearTimeout(o),i(new S2(t?.reason))};t?.addEventListener("abort",n,{once:!0})})}async function*kb(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=kl.encode(p).byteLength,m=[],f=0,h=!1,y=()=>new S9("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 S9("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=kl.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 S4("operation stream ended with an incomplete SSE event")}catch(e){if(e instanceof S3||e instanceof S0)throw e;throw new S4("operation stream transport was interrupted",e)}finally{i.releaseLock()}}class k${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 S3("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 SY)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 S3("page size must be an integer between 1 and 1000");if(t?.cursor!==void 0&&!kf(t.cursor,4096))throw new S3("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(!kf(e,512))throw new S3("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 S2(r.reason);throw new S4(`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 S2(i.reason);if(401===e.status||403===e.status)throw new S6(e.status);if(!kh(e,"application/json"))throw new S9("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 S2(i.reason);if(void 0!==o){let e=new TextDecoder;for(;;){let{done:t,value:r}=await o.read();if(i?.aborted)throw new S2(i.reason);if(t)break;n+=e.decode(r,{stream:!0})}n+=e.decode()}a=!0}catch(e){if(i?.aborted)throw new S2(i.reason);throw new S4("transport failure reading the daemon response body",e)}let s=kg(n,e.status);if(kp(s)&&"problem"===s.kind){var c;let i=s.value;if(!function(e){var t,r,i;if(!fm(e)||void 0!==e.binding_id&&"string"!=typeof e.binding_id||!(fm(t=e.contract)&&fy(t.schema_id,512)&&ff(t.schema_revision)&&t.schema_revision>0)||!fy(e.request_id,512)||!fm(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||f_(o.diagnostic))&&"detail"in o&&(null===o.detail||function(e){if(!fm(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 ff(e.requested)&&ff(e.committed)&&ff(e.active);case"stale_precondition":return"string"==typeof e.field&&ff(e.requested)&&ff(e.current);case"lock_deadline":return"string"==typeof e.resource&&ff(e.deadline_ms);case"diagnostics_unsupported":return(null===e.file||"string"==typeof e.file)&&Array.isArray(e.searched)&&e.searched.every(e=>fm(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 ff(e.retry_after_millis);case"reset_required":return"string"==typeof e.authority&&(null===e.found_version||fh(e.found_version))&&(null===e.required_version||fh(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||ff(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&&fy(o.trace_id,512)&&Array.isArray(o.details)&&o.details.every(f_)&&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,fm(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 S9("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 S9("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 S8(e,t);case"unavailable":return new S7(e,t);case"unsupported":return new ke(e,t);case"stale":return new kt(e,t);case"conflict":return new kr(e,t);case"partial_effect":return new ki(e,t);case"reset_required":return new ko(e,t);case"saturated":return new kn(e,t);case"cancelled":return new ka(e,t);case"timed_out":return new ks(e,t);case"invalid_request":return new kd(e,t);default:return new S5(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 S3(`${e.operation} does not accept HTTP transport options`);if(void 0===this.mcp)throw new S0(`${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 S2(r.signal.reason??t);throw new S0(`MCP tool ${e.transport.toolName} failed`,t)}try{return e.decodeResult(t)}catch(r){throw new S9(`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 S3(`${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&&S1.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 S3(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(!kp(m)||"success"!==m.kind)throw new S9("the daemon returned an unknown HTTP envelope",{status:u.status,payload:m});if(!u.ok)throw new S9("the daemon returned success with a failing HTTP status",{status:u.status,payload:m});try{let t=e.decodeSuccess(m.value);if(!(kp(t)&&kp(t.outcome)&&kp(t.outcome.value)&&"payload"in t.outcome.value&&ky(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(!fm(e)||!fm(t)||!fm(t.outcome))return!1;let r=t.outcome,i=fm(r.value)?r.value.payload:void 0;if("effect"!==r.outcome||!fm(i)||!fy(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!!ff(o)&&!(o<1)&&!(o>1e3)&&!!ff(n)&&!(n>1e6)&&!!await async function(e){return!!fm(e)&&"project_id,reference,repository_id,scope_digest,worktree_id"===Object.keys(e).sort().join(",")&&!!fy(e.project_id,512)&&!!fy(e.repository_id,512)&&!!fy(e.worktree_id,512)&&(null===e.reference||!!fy(e.reference,512))&&e.scope_digest===await fg(["tracedecay.application.scope.v1",e.project_id,e.repository_id,e.worktree_id,e.reference])}(t.scope)&&i.request_digest===await fg(["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 S9(`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(!ku(e))throw new S3(`${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 S3(`${t} must be unsigned decimal`);if(r<0n||r>0xffffffffffffffffn)throw new S3(`${t} exceeds the canonical u64 range`);return r.toString()}(t.resume.nextSequence,"resume nextSequence");if(void 0!==r&&!kf(r,4096))throw new S3("resumeToken is not a canonical stream resume token");let o=t.maxReconnects??0;if(!Number.isSafeInteger(o)||o<0)throw new S3("maxReconnects must be a non-negative integer");let n=0,a=void 0===i||"0"===i?void 0:(BigInt(i)-1n).toString(),s=0;for(;;){let d;if(t.signal?.aborted)throw new S2(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 S4))throw e;n+=1,await kv(s,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 S9("the daemon did not open an SSE stream",{status:d.status});if(!kh(d,"text/event-stream"))throw new S9("the daemon opened an operation stream with an invalid media type",{status:d.status});try{for await(let t of kb(d.body)){void 0!==t.retryDelayMs&&(s=t.retryDelayMs);let o=function(e,t,r){let i=kg(e.data,t);if(!kp(i)||"string"!=typeof i.event||i.event!==e.event||!kp(i.data))throw new S9("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||!kp(e)||!ku(e.next_sequence)||!ku(e.retained_from_sequence)||null!==e.resume_token&&"string"!=typeof e.resume_token)throw new S9("the daemon returned a malformed SSE open frontier",{status:t,payload:i});return{event:{...i,event:o,data:n},frontier:{nextSequence:String(e.next_sequence),..."string"==typeof e.resume_token?{resumeToken:e.resume_token}:{}}}}if(!ku(n.sequence)||null===e.id)throw new S9("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 S9("the SSE event ID does not match its canonical sequence",{status:t,payload:i});if("item"===o&&!("item"in n))throw new S9("the SSE item payload is missing",{status:t,payload:i});if("progress"===o&&(!ku(n.completed)||null!==n.total&&!ku(n.total)))throw new S9("the SSE progress payload is malformed",{status:t,payload:i});if("resume_gap"===o){let e=n.gap;if(!kp(e)||!ku(e.first_missing_sequence)||!ku(e.last_missing_sequence)||e.first_missing_sequence!==n.sequence||e.first_missing_sequence>e.last_missing_sequence||!kp(e.frontier)||!ku(e.frontier.next_sequence)||!ku(e.frontier.retained_from_sequence)||null!==e.frontier.resume_token&&"string"!=typeof e.frontier.resume_token)throw new S9("the SSE resume gap is malformed",{status:t,payload:i})}if(kc.has(o)){let e=n.terminal;if(!kp(e)||!ky(e.receipt))throw new S9("the SSE terminal event is malformed",{status:t,payload:i});if(e.termination!==o||e.receipt.termination!==o)throw new S9("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:{nextSequence:(BigInt(e.last_missing_sequence)+1n).toString(),..."string"==typeof t.resume_token?{resumeToken:t.resume_token}:{}}}}return{event:s,sequence:a}}(t,d.status,e);if(void 0!==o.frontier&&(i=o.frontier.nextSequence,r=o.frontier.resumeToken),void 0!==o.sequence){if(void 0!==a&&BigInt(o.sequence)<=BigInt(a))continue;let e=void 0===a?void 0:k_(a);if(void 0!==e&&o.sequence!==e)throw new S9("the daemon returned a non-contiguous SSE sequence",{status:d.status,payload:o.event});a=o.lastSequence??o.sequence,i=k_(a)}if(yield{event:t.event,id:o.sequence??null,data:o.event},kc.has(t.event))return}}catch(e){if(l=!0,e instanceof S3)throw e;if(t.signal?.aborted)throw new S2(t.signal.reason??e);if(n>=o){if(e instanceof S4)throw e;throw new S4(`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 S4("failed to close operation stream transport",e)}}if(n>=o)throw new S4(`operation stream ended before a terminal event after ${n} reconnects`);if(void 0===i||void 0===r)throw new S4("operation stream ended before exposing a resumable frontier");n+=1,await kv(s,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(!kp(i))throw new S9("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 S9("the daemon returned a malformed cancellation response",{status:r.status,payload:i});return{...i,status:o}}}function kS(e){let t=SY.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 kk=kS("project_list"),kw=kS("project_context");class kP{#u;constructor(e){this.#u=e}projectList(e,t){return this.#m(kk,e,t)}projectContext(e,t){return this.#m(kw,e,t)}async #m(e,t,r){let i,o=e.transport.toolName,n=e.decodeRequest(t);try{i=await this.#u(o,n,r)}catch(e){if(r?.aborted)throw new S2(r.reason??e);throw new S0(`MCP tool ${o} failed`,e)}try{return e.decodeResult(i)}catch(t){throw new S9(`MCP tool ${o} returned an invalid ${e.operation} result`,{payload:{response:i,cause:t}})}}}var kV=Object.create,kR=Object.defineProperty,kq=Object.getOwnPropertyDescriptor,kI=Object.getOwnPropertyNames,kx=Object.getPrototypeOf,kj=Object.prototype.hasOwnProperty,kC=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let kT=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),kO=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),kE=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),kA=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),kW=Symbol.for("mcp.sdk.errorBrands");function kM(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,kW,{value:r,enumerable:!1,configurable:!0})}function kN(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,kW)){let r=t[kW];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 kN(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 kN(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",kM(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 kz=((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 kD=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return kN(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 kN(this,e)}constructor(e,t,r,i){super(t,i),this.code=e,this.data=r,this.name="SdkError",kM(this,new.target)}},kF=class extends kD{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 kL="2026-07-28",kU=[kL];function kH(e){return e.filter(e=>!(e>=kL))}function kG(e){return e.filter(e=>e>=kL)}function kB(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 kK=["task","inputRequests","requestState"];function kJ(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||kK.some(t=>t in e)?e:{...e,content:[]}}function kZ(){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=aa(()=>nL([o7(),nP(),nI(),nj(),nJ(o7(),e),nM(e)])),t=nJ(o7(),e),r=nL([o7(),nP().int()]),i=o7(),o=nz({ttl:nP().optional()}),n=nz({taskId:o7()}),c=(s=nz({_meta:(a=nD({progressToken:r.optional(),"io.modelcontextprotocol/related-task":n.optional()})).optional()})).extend({task:o.optional()}),l=nz({method:o7(),params:s.loose().optional()}),p=nz({_meta:a.optional()}),u=nz({method:o7(),params:p.loose().optional()}),m=nD({_meta:a.optional()}),f=nL([o7(),nP().int()]),h=m.strict(),y=p.extend({requestId:f.optional(),reason:o7().optional()}),g=u.extend({method:nY("notifications/cancelled"),params:y}),_=nz({src:o7(),mimeType:o7().optional(),sizes:nM(o7()).optional(),theme:nQ(["light","dark"]).optional()}),v=nz({icons:nM(_).optional()}),$=(b=nz({name:o7(),title:o7().optional()})).extend({...b.shape,...v.shape,version:o7(),websiteUrl:o7().optional(),description:o7().optional()}),S=nB(nz({applyDefaults:nI().optional()}),t),k=ad(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nB(nz({form:S.optional(),url:t.optional()}),t.optional())),w=nD({list:t.optional(),cancel:t.optional(),requests:nD({sampling:nD({createMessage:t.optional()}).optional(),elicitation:nD({create:t.optional()}).optional()}).optional()}),P=nD({list:t.optional(),cancel:t.optional(),requests:nD({tools:nD({call:t.optional()}).optional()}).optional()}),V=nz({experimental:nJ(o7(),t).optional(),sampling:nz({context:t.optional(),tools:t.optional()}).optional(),elicitation:k.optional(),roots:nz({listChanged:nI().optional()}).optional(),tasks:w.optional(),extensions:nJ(o7(),t).optional()}),R=s.extend({protocolVersion:o7(),capabilities:V,clientInfo:$}),q=l.extend({method:nY("initialize"),params:R}),I=nz({experimental:nJ(o7(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nz({listChanged:nI().optional()}).optional(),resources:nz({subscribe:nI().optional(),listChanged:nI().optional()}).optional(),tools:nz({listChanged:nI().optional()}).optional(),tasks:P.optional(),extensions:nJ(o7(),t).optional()}),x=m.extend({protocolVersion:o7(),capabilities:I,serverInfo:$,instructions:o7().optional()}),j=u.extend({method:nY("notifications/initialized"),params:p.optional()}),C=l.extend({method:nY("ping"),params:s.optional()}),T=nz({progress:nP(),total:n4(nP()),message:n4(o7())}),O=nz({...p.shape,...T.shape,progressToken:r}),E=u.extend({method:nY("notifications/progress"),params:O}),A=s.extend({cursor:i.optional()}),W=l.extend({params:A.optional()}),M=m.extend({nextCursor:i.optional()}),z=(N=nz({uri:o7(),mimeType:n4(o7()),_meta:nJ(o7(),nE()).optional()})).extend({text:o7()}),D=o7().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),F=N.extend({blob:D}),U=nz({audience:nM(L=nQ(["user","assistant"])).optional(),priority:nP().min(0).max(1).optional(),lastModified:ac({offset:!0}).optional()}),H=nz({...b.shape,...v.shape,uri:o7(),description:n4(o7()),mimeType:n4(o7()),size:n4(nP()),annotations:U.optional(),_meta:n4(nD({}))}),G=nz({...b.shape,...v.shape,uriTemplate:o7(),description:n4(o7()),mimeType:n4(o7()),annotations:U.optional(),_meta:n4(nD({}))}),B=W.extend({method:nY("resources/list")}),K=M.extend({resources:nM(H)}),J=W.extend({method:nY("resources/templates/list")}),Z=M.extend({resourceTemplates:nM(G)}),Q=s.extend({uri:o7()}),X=l.extend({method:nY("resources/read"),params:Q}),Y=m.extend({contents:nM(nL([z,F]))}),ee=u.extend({method:nY("notifications/resources/list_changed"),params:p.optional()}),et=l.extend({method:nY("resources/subscribe"),params:Q}),er=l.extend({method:nY("resources/unsubscribe"),params:Q}),ei=p.extend({uri:o7()}),eo=u.extend({method:nY("notifications/resources/updated"),params:ei}),en=nz({name:o7(),description:n4(o7()),required:n4(nI())}),ea=nz({...b.shape,...v.shape,description:n4(o7()),arguments:n4(nM(en)),_meta:n4(nD({}))}),es=W.extend({method:nY("prompts/list")}),ed=M.extend({prompts:nM(ea)}),ec=s.extend({name:o7(),arguments:nJ(o7(),o7()).optional()}),el=l.extend({method:nY("prompts/get"),params:ec}),ep=nz({type:nY("text"),text:o7(),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),eu=nz({type:nY("image"),data:D,mimeType:o7(),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),em=nz({type:nY("audio"),data:D,mimeType:o7(),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),ef=nz({type:nY("tool_use"),name:o7(),id:o7(),input:nJ(o7(),nE()),_meta:nJ(o7(),nE()).optional()}),eh=nz({type:nY("resource"),resource:nL([z,F]),annotations:U.optional(),_meta:nJ(o7(),nE()).optional()}),e_=nz({role:L,content:eg=nL([ep,eu,em,ey=H.extend({type:nY("resource_link")}),eh])}),ev=m.extend({description:o7().optional(),messages:nM(e_)}),eb=u.extend({method:nY("notifications/prompts/list_changed"),params:p.optional()}),e$=nz({title:o7().optional(),readOnlyHint:nI().optional(),destructiveHint:nI().optional(),idempotentHint:nI().optional(),openWorldHint:nI().optional()}),eS=nz({taskSupport:nQ(["required","optional","forbidden"]).optional()}),ek=nz({...b.shape,...v.shape,description:o7().optional(),inputSchema:nz({type:nY("object"),properties:nJ(o7(),e).optional(),required:nM(o7()).optional()}).catchall(nE()),outputSchema:nz({type:nY("object"),properties:nJ(o7(),e).optional(),required:nM(o7()).optional()}).catchall(nE()).optional(),annotations:e$.optional(),execution:eS.optional(),_meta:nJ(o7(),nE()).optional()}),ew=W.extend({method:nY("tools/list")}),eP=M.extend({tools:nM(ek)}),eV=m.extend({content:nM(eg),structuredContent:nJ(o7(),nE()).optional(),isError:nI().optional()}),eR=c.extend({name:o7(),arguments:nJ(o7(),nE()).optional()}),eq=l.extend({method:nY("tools/call"),params:eR}),eI=u.extend({method:nY("notifications/tools/list_changed"),params:p.optional()}),ex=nQ(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=s.extend({level:ex}),eC=l.extend({method:nY("logging/setLevel"),params:ej}),eT=p.extend({level:ex,logger:o7().optional(),data:nE()}),eO=u.extend({method:nY("notifications/message"),params:eT}),eE=nz({name:o7().optional()}),eA=nz({hints:nM(eE).optional(),costPriority:nP().min(0).max(1).optional(),speedPriority:nP().min(0).max(1).optional(),intelligencePriority:nP().min(0).max(1).optional()}),eW=nz({mode:nQ(["auto","required","none"]).optional()}),eM=nz({type:nY("tool_result"),toolUseId:o7().describe("The unique identifier for the corresponding tool call."),content:nM(eg),structuredContent:nz({}).loose().optional(),isError:nI().optional(),_meta:nJ(o7(),nE()).optional()}),eN=nH("type",[ep,eu,em]),eD=nz({role:L,content:nL([ez=nH("type",[ep,eu,em,ef,eM]),nM(ez)]),_meta:nJ(o7(),nE()).optional()}),eF=c.extend({messages:nM(eD),modelPreferences:eA.optional(),systemPrompt:o7().optional(),includeContext:nQ(["none","thisServer","allServers"]).optional(),temperature:nP().optional(),maxTokens:nP().int(),stopSequences:nM(o7()).optional(),metadata:t.optional(),tools:nM(ek).optional(),toolChoice:eW.optional()}),eL=l.extend({method:nY("sampling/createMessage"),params:eF}),eU=m.extend({model:o7(),stopReason:n4(nQ(["endTurn","stopSequence","maxTokens"]).or(o7())),role:L,content:eN}),eH=m.extend({model:o7(),stopReason:n4(nQ(["endTurn","stopSequence","maxTokens","toolUse"]).or(o7())),role:L,content:nL([ez,nM(ez)])}),eG=nz({type:nY("boolean"),title:o7().optional(),description:o7().optional(),default:nI().optional()}),eB=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),minLength:nP().optional(),maxLength:nP().optional(),format:nQ(["email","uri","date","date-time"]).optional(),default:o7().optional()}),eK=nz({type:nQ(["number","integer"]),title:o7().optional(),description:o7().optional(),minimum:nP().optional(),maximum:nP().optional(),default:nP().optional()}),eJ=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),default:o7().optional()}),eZ=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),oneOf:nM(nz({const:o7(),title:o7()})),default:o7().optional()}),eQ=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),enumNames:nM(o7()).optional(),default:o7().optional()}),eX=nL([eJ,eZ]),eY=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({type:nY("string"),enum:nM(o7())}),default:nM(o7()).optional()}),e0=nL([eY,e1=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({anyOf:nM(nz({const:o7(),title:o7()}))}),default:nM(o7()).optional()})]),e2=nL([eQ,eX,e0]),e4=nL([e2,eG,eB,eK]),e6=c.extend({mode:nY("form").optional(),message:o7(),requestedSchema:nz({type:nY("object"),properties:nJ(o7(),e4),required:nM(o7()).optional()}).catchall(nE())}),e9=nL([e6,e3=c.extend({mode:nY("url"),message:o7(),elicitationId:o7(),url:o7().url()})]),e5=l.extend({method:nY("elicitation/create"),params:e9}),e8=p.extend({elicitationId:o7()}),e7=u.extend({method:nY("notifications/elicitation/complete"),params:e8}),te=m.extend({action:nQ(["accept","decline","cancel"]),content:ad(e=>null===e?void 0:e,nJ(o7(),nL([o7(),nP(),nI(),nM(o7())])).optional())}),tt=nz({type:nY("ref/resource"),uri:o7()}),tr=nz({type:nY("ref/prompt"),name:o7()}),ti=s.extend({ref:nL([tr,tt]),argument:nz({name:o7(),value:o7()}),context:nz({arguments:nJ(o7(),o7()).optional()}).optional()}),to=l.extend({method:nY("completion/complete"),params:ti}),tn=m.extend({completion:nD({values:nM(o7()).max(100),total:n4(nP().int()),hasMore:n4(nI())})}),ta=nz({uri:o7().startsWith("file://"),name:o7().optional(),_meta:nJ(o7(),nE()).optional()}),ts=l.extend({method:nY("roots/list"),params:s.optional()}),td=m.extend({roots:nM(ta)}),tc=u.extend({method:nY("notifications/roots/list_changed"),params:p.optional()}),tl=nD({ttl:nP().optional(),pollInterval:nP().optional()}),tp=nQ(["working","input_required","completed","failed","cancelled"]),tu=nz({taskId:o7(),status:tp,ttl:nL([nP(),nj()]),createdAt:o7(),lastUpdatedAt:o7(),pollInterval:n4(nP()),statusMessage:n4(o7())}),tm=m.extend({task:tu}),tf=p.merge(tu),th=u.extend({method:nY("notifications/tasks/status"),params:tf}),ty=l.extend({method:nY("tasks/get"),params:s.extend({taskId:o7()})}),tg=m.merge(tu),t_=l.extend({method:nY("tasks/result"),params:s.extend({taskId:o7()})}),tv=m.loose(),tb=W.extend({method:nY("tasks/list")}),t$=M.extend({tasks:nM(tu)}),tS=l.extend({method:nY("tasks/cancel"),params:s.extend({taskId:o7()})}),{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:nL([C,q,to,eC,el,es,B,J,X,et,er,eq,ew,ty,t_,tb,tS]),ClientNotificationSchema:nL([g,E,j,tc,th]),ClientResultSchema:nL([h,eU,eH,te,td,tg,t$,tm]),ServerRequestSchema:nL([C,eL,e5,ts,ty,t_,tb,tS]),ServerNotificationSchema:nL([g,E,eO,eo,ee,eI,eb,th,e7]),ServerResultSchema:nL([h,x,tn,ev,ed,K,Z,Y,eV,eP,tg,t$,tm]),CallToolResultWireSchema:nE().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of kK)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(kJ).pipe(eV)})}function kQ(e){return"object"!==e.type}let kX=new Set(["const","enum","default","examples"]),kY=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function k1(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let k0={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},k2={"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},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,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function k6(){if(c)return c;let e=kZ();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 k3(e){return Object.prototype.hasOwnProperty.call(k0,e)}function k9(e){return Object.prototype.hasOwnProperty.call(k2,e)}function k5(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function k8(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(k0),Object.keys(k2);let k7={ok:!1,reason:"not-in-era"};function we(e){return k5(e)&&k5(e.outputSchema)&&kQ(e.outputSchema)}let wt={era:"2025-11-25",hasRequestMethod:k3,hasNotificationMethod:k9,validateRequest:(e,t)=>k8(k3(e)?k6().requestSchemas[e]:void 0,t),validateResult:(e,t)=>k8(Object.prototype.hasOwnProperty.call(k4,e)?k6().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>k8(k9(e)?k6().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>k7,validateInputResponse:()=>k7,samplingResultVariant:(e,t)=>{let r=kZ();return k8(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=kB(e),i=r.structuredContent;if(void 0===i)return r;let o="object"!=typeof i||null===i||Array.isArray(i),n=void 0!==t&&kQ(t);return o||n?{...r,structuredContent:{result:i}}:r},decodeResult(e,t){if(k5(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=>we(e))?{...t,tools:r.map(e=>we(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(k1(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let i="string"==typeof(t=e.$schema)&&kO.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&&k1(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:kX.has(a)?r[a]=s:kY.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 wr(){return l??=function(){let e=aa(()=>nL([o7(),nP(),nI(),nj(),nJ(o7(),e),nM(e)])),t=nJ(o7(),e),r=nL([o7(),nP().int()]),i=o7(),o=nL([o7(),nP().int()]),n=nQ(["user","assistant"]),a=nQ(["debug","info","notice","warning","error","critical","alert","emergency"]),s=o7().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),d=nz({ttl:nP().optional()}),c=nz({taskId:o7()}),l=nD({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),p=nz({_meta:l.optional()}),u=p.extend({task:d.optional()}),m=nz({_meta:l.optional()}),f=nz({method:o7(),params:m.loose().optional()}),h=nz({src:o7(),mimeType:o7().optional(),sizes:nM(o7()).optional(),theme:nQ(["light","dark"]).optional()}),y=nz({icons:nM(h).optional()}),g=nz({name:o7(),title:o7().optional()}),_=g.extend({...g.shape,...y.shape,version:o7(),websiteUrl:o7().optional(),description:o7().optional()}),v=nB(nz({applyDefaults:nI().optional()}),t),b=ad(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,nB(nz({form:v.optional(),url:t.optional()}),t.optional())),$=nD({list:t.optional(),cancel:t.optional(),requests:nD({sampling:nD({createMessage:t.optional()}).optional(),elicitation:nD({create:t.optional()}).optional()}).optional()}),S=nD({list:t.optional(),cancel:t.optional(),requests:nD({tools:nD({call:t.optional()}).optional()}).optional()}),k=nz({experimental:nJ(o7(),t).optional(),sampling:nz({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:nz({listChanged:nI().optional()}).optional(),tasks:$.optional(),extensions:nJ(o7(),t).optional()}),w=nz({experimental:nJ(o7(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:nz({listChanged:nI().optional()}).optional(),resources:nz({subscribe:nI().optional(),listChanged:nI().optional()}).optional(),tools:nz({listChanged:nI().optional()}).optional(),tasks:S.optional(),extensions:nJ(o7(),t).optional()}),P=nz({progress:nP(),total:n4(nP()),message:n4(o7())}),V=nz({...m.shape,...P.shape,progressToken:r}),R=f.extend({method:nY("notifications/progress"),params:V}),q=m.extend({level:a,logger:o7().optional(),data:nE()}),I=f.extend({method:nY("notifications/message"),params:q}),x=nz({uri:o7(),mimeType:n4(o7()),_meta:nJ(o7(),nE()).optional()}),j=x.extend({text:o7()}),C=x.extend({blob:s}),T=nz({audience:nM(n).optional(),priority:nP().min(0).max(1).optional(),lastModified:ac({offset:!0}).optional()}),O=nz({...g.shape,...y.shape,uri:o7(),description:n4(o7()),mimeType:n4(o7()),size:n4(nP()),annotations:T.optional(),_meta:n4(nD({}))}),E=nz({...g.shape,...y.shape,uriTemplate:o7(),description:n4(o7()),mimeType:n4(o7()),annotations:T.optional(),_meta:n4(nD({}))}),A=f.extend({method:nY("notifications/resources/list_changed"),params:m.optional()}),W=m.extend({uri:o7()}),M=f.extend({method:nY("notifications/resources/updated"),params:W}),N=nz({name:o7(),description:n4(o7()),required:n4(nI())}),z=nz({...g.shape,...y.shape,description:n4(o7()),arguments:n4(nM(N)),_meta:n4(nD({}))}),D=f.extend({method:nY("notifications/prompts/list_changed"),params:m.optional()}),F=nz({type:nY("text"),text:o7(),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),L=nz({type:nY("image"),data:s,mimeType:o7(),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),U=nz({type:nY("audio"),data:s,mimeType:o7(),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),H=nz({type:nY("tool_use"),name:o7(),id:o7(),input:nJ(o7(),nE()),_meta:nJ(o7(),nE()).optional()}),G=nz({type:nY("resource"),resource:nL([j,C]),annotations:T.optional(),_meta:nJ(o7(),nE()).optional()}),B=O.extend({type:nY("resource_link")}),K=nL([F,L,U,B,G]),J=nz({role:n,content:K}),Z=nz({title:o7().optional(),readOnlyHint:nI().optional(),destructiveHint:nI().optional(),idempotentHint:nI().optional(),openWorldHint:nI().optional()}),Q=f.extend({method:nY("notifications/tools/list_changed"),params:m.optional()}),X=nz({name:o7().optional()}),Y=nz({hints:nM(X).optional(),costPriority:nP().min(0).max(1).optional(),speedPriority:nP().min(0).max(1).optional(),intelligencePriority:nP().min(0).max(1).optional()}),ee=nz({mode:nQ(["auto","required","none"]).optional()}),et=nz({type:nY("boolean"),title:o7().optional(),description:o7().optional(),default:nI().optional()}),er=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),minLength:nP().optional(),maxLength:nP().optional(),format:nQ(["email","uri","date","date-time"]).optional(),default:o7().optional()}),ei=nz({type:nQ(["number","integer"]),title:o7().optional(),description:o7().optional(),minimum:nP().optional(),maximum:nP().optional(),default:nP().optional()}),eo=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),default:o7().optional()}),en=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),oneOf:nM(nz({const:o7(),title:o7()})),default:o7().optional()}),ea=nz({type:nY("string"),title:o7().optional(),description:o7().optional(),enum:nM(o7()),enumNames:nM(o7()).optional(),default:o7().optional()}),es=nL([eo,en]),ed=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({type:nY("string"),enum:nM(o7())}),default:nM(o7()).optional()}),ec=nz({type:nY("array"),title:o7().optional(),description:o7().optional(),minItems:nP().optional(),maxItems:nP().optional(),items:nz({anyOf:nM(nz({const:o7(),title:o7()}))}),default:nM(o7()).optional()}),el=nL([ed,ec]),ep=nL([ea,es,el]),eu=nL([ep,et,er,ei]),em=u.extend({mode:nY("form").optional(),message:o7(),requestedSchema:nz({type:nY("object"),properties:nJ(o7(),eu),required:nM(o7()).optional()}).catchall(nE())}),ef=nz({type:nY("ref/resource"),uri:o7()}),eh=nz({type:nY("ref/prompt"),name:o7()}),ey=nz({uri:o7().startsWith("file://"),name:o7().optional(),_meta:nJ(o7(),nE()).optional()}),eg=k.shape,e_=nz({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),ev=w.shape,eb=nz({experimental:ev.experimental,logging:ev.logging,completions:ev.completions,prompts:ev.prompts,resources:ev.resources,tools:ev.tools,extensions:ev.extensions}),e$=nD({progressToken:r.optional(),[au]:o7(),[am]:_.optional(),[ah]:e_,[ag]:a.optional()}),eS=nz({...g.shape,...y.shape,description:o7().optional(),inputSchema:nD({$schema:o7().optional(),type:nY("object")}),outputSchema:nD({$schema:o7().optional()}).optional(),annotations:Z.optional(),_meta:nJ(o7(),nE()).optional()}),ek=nz({type:nY("tool_result"),toolUseId:o7(),content:nM(K),structuredContent:nE().optional(),isError:nI().optional(),_meta:nJ(o7(),nE()).optional()}),ew=nL([F,L,U,H,ek]),eP=nz({role:n,content:nL([ew,nM(ew)]),_meta:nJ(o7(),nE()).optional()}),eV=o7(),eR=nD({[af]:_.optional().catch(void 0)}),eq=eR.optional();function eI(e){return nD({_meta:eq,resultType:eV.default("complete"),...e})}let ex=eI({}),ej=eI({nextCursor:i.optional()}),eC=eI({content:nM(K),structuredContent:nE().optional(),isError:nI().optional()}),eT=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),tools:nM(eS),nextCursor:i.optional()}),eO=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),prompts:nM(z),nextCursor:i.optional()}),eE=eI({description:o7().optional(),messages:nM(J)}),eA=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resources:nM(O),nextCursor:i.optional()}),eW=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resourceTemplates:nM(E),nextCursor:i.optional()}),eM=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),contents:nM(nL([j,C]))}),eN=eI({completion:nz({values:nM(o7()).max(100),total:nP().int().optional(),hasMore:nI().optional()}).loose()}),ez=eI({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"])}),eD=eI({ttlMs:nP().int().min(0).catch(0),cacheScope:nQ(["public","private"]).catch("private"),supportedVersions:nM(o7()),capabilities:eb,instructions:o7().optional()}),eF=nz({messages:nM(eP),modelPreferences:Y.optional(),systemPrompt:o7().optional(),includeContext:nQ(["none","thisServer","allServers"]).optional(),temperature:nP().optional(),maxTokens:nP().int(),stopSequences:nM(o7()).optional(),metadata:t.optional(),tools:nM(eS).optional(),toolChoice:ee.optional()}),eL=nz({method:nY("sampling/createMessage"),params:eF}),eU=nz({method:nY("roots/list"),params:nz({_meta:nJ(o7(),nE()).optional()}).optional()}),eH=nz({...eP.shape,model:o7(),stopReason:o7().optional()}),eG=nz({roots:nM(ey)}),eB=nz({action:nQ(["accept","decline","cancel"]),content:nJ(o7(),nL([o7(),nP(),nI(),nM(o7())])).optional()}),eK=nz({mode:nY("url"),message:o7(),url:o7().url()}),eJ=nL([em,eK]),eZ=nz({method:nY("elicitation/create"),params:eJ}),eQ=nL([eL,eU,eZ]),eX=nL([eH,eG,eB]),eY=nJ(o7(),eQ),e1=nJ(o7(),eX),e0=eI({inputRequests:eY.optional(),requestState:o7().optional()}),e2={inputResponses:e1.optional(),requestState:o7().optional()},e4=nz({_meta:e$,...e2}),e6=nD({progressToken:r.optional()});function e3(e,t){return nz({method:nY(e),params:nz({_meta:e$,...t})})}function e9(e,t){return nz({method:nY(e),params:nz({_meta:e6.optional(),...t}).optional()})}let e5={name:o7(),arguments:nJ(o7(),nE()).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:o7(),arguments:nJ(o7(),o7()).optional(),...e2}),ti=e3("resources/list",e8),to=e3("resources/templates/list",e8),tn=e3("resources/read",{uri:o7(),...e2}),ta={ref:nL([eh,ef]),argument:nz({name:o7(),value:o7()}),context:nz({arguments:nJ(o7(),o7()).optional()}).optional()},ts=e3("completion/complete",ta),td=e3("server/discover",{}),tc=nz({toolsListChanged:nI().optional(),promptsListChanged:nI().optional(),resourcesListChanged:nI().optional(),resourceSubscriptions:nM(o7()).optional()}),tl={notifications:tc},tp=e3("subscriptions/listen",tl),tu=eR.extend({"io.modelcontextprotocol/subscriptionId":o}),tm=nD({_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:o7(),arguments:nJ(o7(),o7()).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:o7()}),"completion/complete":e9("completion/complete",ta),"server/discover":e9("server/discover",{}),"subscriptions/listen":e9("subscriptions/listen",tl)};function th(e){return nD({_meta:eq,...e})}let ty={"tools/call":th({content:nM(K),structuredContent:nE().optional(),isError:nI().optional()}),"tools/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),tools:nM(eS),nextCursor:i.optional()}),"prompts/get":th({description:o7().optional(),messages:nM(J)}),"prompts/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),prompts:nM(z),nextCursor:i.optional()}),"resources/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resources:nM(O),nextCursor:i.optional()}),"resources/templates/list":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),resourceTemplates:nM(E),nextCursor:i.optional()}),"resources/read":th({ttlMs:nP().int().min(0),cacheScope:nQ(["public","private"]),contents:nM(nL([j,C]))}),"completion/complete":th({completion:nz({values:nM(o7()).max(100),total:nP().int().optional(),hasMore:nI().optional()}).loose()}),"server/discover":th({ttlMs:nP().int().min(0).catch(0),cacheScope:nQ(["public","private"]).catch("private"),supportedVersions:nM(o7()),capabilities:eb,instructions:o7().optional()}),"subscriptions/listen":th({})},tg=nD({"io.modelcontextprotocol/subscriptionId":o.optional()}),t_=nz({method:nY("notifications/subscriptions/acknowledged"),params:nz({_meta:tg.optional(),notifications:tc})}),tv=nz({_meta:tg.optional(),requestId:o,reason:o7().optional()}),tb=nz({method:nY("notifications/cancelled"),params:tv}),t$=e=>nz({jsonrpc:nY("2.0"),id:nL([o7(),nP().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$(nL([eC,e0])),ListToolsResultResponseSchema:t$(eT),ListPromptsResultResponseSchema:t$(eO),GetPromptResultResponseSchema:t$(nL([eE,e0])),ListResourcesResultResponseSchema:t$(eA),ListResourceTemplatesResultResponseSchema:t$(eW),ReadResourceResultResponseSchema:t$(nL([eM,e0])),CompleteResultResponseSchema:t$(eN),DiscoverResultResponseSchema:t$(eD),SubscriptionsListenResultResponseSchema:t$(tm)}}()}let wi=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],wo=Symbol("modelcontextprotocol.resultCacheHintFallback");function wn(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function wa(e){return"public"===e||"private"===e}let ws=((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 wd=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return kN(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 kN(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",kM(this,new.target)}static fromError(t,r,i){return t===ws.UrlElicitationRequired&&i&&i.elicitations?new wl(i.elicitations,r):t===ws.UnsupportedProtocolVersion&&i&&Array.isArray(i.supported)&&"string"==typeof i.requested?new wp({supported:i.supported,requested:i.requested},r):(t===ws.InvalidParams||t===ws.ResourceNotFound)&&"string"==typeof i?.uri&&(t===ws.ResourceNotFound||1===Object.keys(i).length)?new wc(i.uri,r):t===ws.MissingRequiredClientCapability&&i&&null!==i.requiredCapabilities&&"object"==typeof i.requiredCapabilities&&!Array.isArray(i.requiredCapabilities)?new wu({requiredCapabilities:i.requiredCapabilities},r):new e(t,r,i)}},wc=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(ws.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},wl=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(ws.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},wp=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(ws.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},wu=class extends wd{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(ws.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let wm=["tools/call","prompts/get","resources/read"],wf=["elicitation/create","sampling/createMessage","roots/list"];function wh(){if(p)return p;let e=wr();return p={request:{"elicitation/create":nz({method:nY("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":nz({method:nY("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":nz({method:nY("roots/list"),params:nD({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function wy(e){return wf.includes(e)}function wg(e){return wy(e)?wh().request[e]:void 0}let w_={"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},wv={"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 wb(e){return Object.prototype.hasOwnProperty.call(w_,e)}function w$(e){return Object.prototype.hasOwnProperty.call(wv,e)}function wS(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function wk(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(w_),Object.keys(wv);let ww={ok:!1,reason:"not-in-era"},wP=[au,ah],wV={era:"2026-07-28",hasRequestMethod:wb,hasNotificationMethod:w$,hasInputRequestMethod:e=>void 0!==wg(e),validateRequest:(e,t)=>wk(wb(e)?wr().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>wk(Object.prototype.hasOwnProperty.call(w_,e)?wr().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>wk(w$(e)?wr().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>wk(wg(e),t),validateInputResponse:(e,t)=>wk(wy(e)?wh().response[e]:void 0,t),samplingResultVariant:()=>ww,outboundEnvelope:e=>({[au]:e.protocolVersion,[am]:e.clientInfo,[ah]:e.clientCapabilities,...void 0!==e.logLevel&&{[ag]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of wP)r in e||t.push({key:r,problem:"missing"});let r=wr().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=>kB(e),inputRequestSchema:wg,decodeResult(e,t){if(!wS(t))return{kind:"invalid",error:new kD(kz.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new kD(kz.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 kD(kz.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,i=wS(r)?r:{},o=t.requestState,n=void 0===t._meta?void 0:wr().ResultMetaSchema.safeParse(t._meta),a=n?.success?n.data:void 0;return 0===Object.keys(i).length&&"string"!=typeof o?{kind:"invalid",error:new kD(kz.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 kD(kz.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let i=function(){if(u)return u;let e=wr();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 kD(kz.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:{[af]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[af]?e:{...e,_meta:{...r,[af]:t}}})(function(e,t){var r,i;let o=t[wo];if("complete"!==t.resultType||!wi.includes(e)){let e;return void 0===o?t:(e={...t},delete e[wo],e)}let n=wn(t.ttlMs)?t.ttlMs:void 0!==(r=o)&&wn(r.ttlMs)?r.ttlMs:0,a=wa(t.cacheScope)?t.cacheScope:void 0!==(i=o)&&wa(i.cacheScope)?i.cacheScope:"private",s={...t,ttlMs:n,cacheScope:a};return delete s[wo],s}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||wm.includes(e))return t;throw new wd(ws.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=>wS(e)&&"execution"in e)&&(o().tools=n.map(e=>{if(!wS(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let a=t.capabilities;if(wS(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=wr().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("; ")}`}},wR="2026-07-28";function wq(e){return void 0!==e&&e>=kL?wV:wt}function wI(e){return void 0!==e.revision?wq(e.revision).era:"modern"===e.era?wV.era:wt.era}function wx(e){return wT.some(t=>t.hasRequestMethod(e))}function wj(e){return wT.some(t=>t.hasNotificationMethod(e))}function wC(e){return"tasks/get"===e||"tasks/cancel"===e}let wT=[wt,wV];var wO=(e=>{let t={};for(var r in e)kR(t,r,{get:e[r],enumerable:!0});return t})({AnnotationsSchema:()=>ss,AudioContentSchema:()=>sW,BaseMetadataSchema:()=>aH,BaseRequestParamsSchema:()=>aV,BlobResourceContentsSchema:()=>sn,BooleanSchemaSchema:()=>dc,CallToolRequestParamsSchema:()=>sX,CallToolRequestSchema:()=>sY,CallToolResultSchema:()=>sZ,CancelTaskRequestSchema:()=>dJ,CancelTaskResultSchema:()=>dZ,CancelledNotificationParamsSchema:()=>aD,CancelledNotificationSchema:()=>aF,ClientCapabilitiesSchema:()=>aQ,ClientNotificationSchema:()=>dX,ClientRequestSchema:()=>dQ,ClientResultSchema:()=>dY,ClientTasksCapabilitySchema:()=>aJ,CompatibilityCallToolResultSchema:()=>sQ,CompleteRequestParamsSchema:()=>dx,CompleteRequestSchema:()=>dj,CompleteResultSchema:()=>dC,ContentBlockSchema:()=>sD,CreateMessageRequestParamsSchema:()=>dn,CreateMessageRequestSchema:()=>da,CreateMessageResultSchema:()=>ds,CreateMessageResultWithToolsSchema:()=>dd,CreateTaskResultSchema:()=>dz,CursorSchema:()=>aS,DiscoverRequestSchema:()=>a4,DiscoverResultSchema:()=>a6,ElicitRequestFormParamsSchema:()=>d$,ElicitRequestParamsSchema:()=>dk,ElicitRequestSchema:()=>dw,ElicitRequestURLParamsSchema:()=>dS,ElicitResultSchema:()=>dR,ElicitationCompleteNotificationParamsSchema:()=>dP,ElicitationCompleteNotificationSchema:()=>dV,EmbeddedResourceSchema:()=>sN,EmptyResultSchema:()=>az,EnumSchemaSchema:()=>dv,GetPromptRequestParamsSchema:()=>sT,GetPromptRequestSchema:()=>sO,GetPromptResultSchema:()=>sL,GetTaskPayloadRequestSchema:()=>dH,GetTaskPayloadResultSchema:()=>dG,GetTaskRequestSchema:()=>dL,GetTaskResultSchema:()=>dU,IconSchema:()=>aL,IconsSchema:()=>aU,ImageContentSchema:()=>sA,ImplementationSchema:()=>aG,InitializeRequestParamsSchema:()=>aX,InitializeRequestSchema:()=>aY,InitializeResultSchema:()=>a0,InitializedNotificationSchema:()=>a2,JSONArraySchema:()=>ab,JSONObjectSchema:()=>av,JSONRPCErrorResponseSchema:()=>aW,JSONRPCMessageSchema:()=>aM,JSONRPCNotificationSchema:()=>aE,JSONRPCRequestSchema:()=>aO,JSONRPCResponseSchema:()=>aN,JSONRPCResultResponseSchema:()=>aA,JSONValueSchema:()=>a_,LegacyTitledEnumSchemaSchema:()=>df,ListChangedOptionsBaseSchema:()=>s0,ListPromptsRequestSchema:()=>sj,ListPromptsResultSchema:()=>sC,ListResourceTemplatesRequestSchema:()=>su,ListResourceTemplatesResultSchema:()=>sm,ListResourcesRequestSchema:()=>sl,ListResourcesResultSchema:()=>sp,ListRootsRequestSchema:()=>dO,ListRootsResultSchema:()=>dE,ListTasksRequestSchema:()=>dB,ListTasksResultSchema:()=>dK,ListToolsRequestSchema:()=>sK,ListToolsResultSchema:()=>sJ,LoggingLevelSchema:()=>s2,LoggingMessageNotificationParamsSchema:()=>s3,LoggingMessageNotificationSchema:()=>s9,ModelHintSchema:()=>s5,ModelPreferencesSchema:()=>s8,MultiSelectEnumSchemaSchema:()=>d_,NotificationSchema:()=>ax,NotificationsParamsSchema:()=>aI,NumberSchemaSchema:()=>dp,PaginatedRequestParamsSchema:()=>a7,PaginatedRequestSchema:()=>se,PaginatedResultSchema:()=>st,PingRequestSchema:()=>a3,PrimitiveSchemaDefinitionSchema:()=>db,ProgressNotificationParamsSchema:()=>a5,ProgressNotificationSchema:()=>a8,ProgressSchema:()=>a9,ProgressTokenSchema:()=>a$,PromptArgumentSchema:()=>sI,PromptListChangedNotificationSchema:()=>sU,PromptMessageSchema:()=>sF,PromptReferenceSchema:()=>dI,PromptSchema:()=>sx,ReadResourceRequestParamsSchema:()=>sf,ReadResourceRequestSchema:()=>sh,ReadResourceResultSchema:()=>sy,RelatedTaskMetadataSchema:()=>aw,RequestIdSchema:()=>aT,RequestMetaSchema:()=>aP,RequestSchema:()=>aq,ResourceContentsSchema:()=>sr,ResourceLinkSchema:()=>sz,ResourceListChangedNotificationSchema:()=>sg,ResourceRequestParamsSchema:()=>sf,ResourceSchema:()=>sd,ResourceTemplateReferenceSchema:()=>dq,ResourceTemplateSchema:()=>sc,ResourceUpdatedNotificationParamsSchema:()=>sR,ResourceUpdatedNotificationSchema:()=>sq,ResultMetaObjectSchema:()=>aj,ResultSchema:()=>aC,RoleSchema:()=>sa,RootSchema:()=>dT,RootsListChangedNotificationSchema:()=>dA,SamplingContentSchema:()=>dt,SamplingMessageContentBlockSchema:()=>dr,SamplingMessageSchema:()=>di,ServerCapabilitiesSchema:()=>a1,ServerNotificationSchema:()=>d0,ServerRequestSchema:()=>d1,ServerResultSchema:()=>d2,ServerTasksCapabilitySchema:()=>aZ,SetLevelRequestParamsSchema:()=>s4,SetLevelRequestSchema:()=>s6,SingleSelectEnumSchemaSchema:()=>dh,StringSchemaSchema:()=>dl,SubscribeRequestParamsSchema:()=>sf,SubscribeRequestSchema:()=>s_,SubscriptionFilterSchema:()=>sb,SubscriptionsAcknowledgedNotificationParamsSchema:()=>sk,SubscriptionsAcknowledgedNotificationSchema:()=>sw,SubscriptionsListenRequestParamsSchema:()=>s$,SubscriptionsListenRequestSchema:()=>sS,SubscriptionsListenResultMetaSchema:()=>sP,SubscriptionsListenResultSchema:()=>sV,TaskAugmentedRequestParamsSchema:()=>aR,TaskCreationParamsSchema:()=>dW,TaskMetadataSchema:()=>ak,TaskSchema:()=>dN,TaskStatusNotificationParamsSchema:()=>dD,TaskStatusNotificationSchema:()=>dF,TaskStatusSchema:()=>dM,TextContentSchema:()=>sE,TextResourceContentsSchema:()=>si,TitledMultiSelectEnumSchemaSchema:()=>dg,TitledSingleSelectEnumSchemaSchema:()=>dm,ToolAnnotationsSchema:()=>sH,ToolChoiceSchema:()=>s7,ToolExecutionSchema:()=>sG,ToolListChangedNotificationSchema:()=>s1,ToolResultContentSchema:()=>de,ToolSchema:()=>sB,ToolUseContentSchema:()=>sM,UnsubscribeRequestParamsSchema:()=>sf,UnsubscribeRequestSchema:()=>sv,UntitledMultiSelectEnumSchemaSchema:()=>dy,UntitledSingleSelectEnumSchemaSchema:()=>du});let wE=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,wA="x-mcp-header",wW=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,wM=new Set(["string","integer","boolean"]);function wN(e){let t,r=[],i=new Map,o=(e,n,a)=>{if(null===e||"object"!=typeof e)return;if(wA in e){if(!a||0===n.length)return`${wF(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[wA];if("string"!=typeof o||0===o.length)return`${wF(n)}: x-mcp-header MUST be a non-empty string`;if(!wW.test(o))return`${wF(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||!wM.has(s)){let e=`${wF(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 wz){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&wD.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 wz=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],wD=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function wF(e){return 0===e.length?"":e.join(".")}let wL="=?base64?";function wU(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function wH(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}ws.InvalidRequest,ws.UnsupportedProtocolVersion,ws.InvalidParams,ws.MethodNotFound,ws.InvalidParams,ws.MissingRequiredClientCapability,ws.ParseError,ws.InvalidRequest,ws.MethodNotFound,ws.UnsupportedProtocolVersion,ws.MissingRequiredClientCapability;let wG=!1,wB="draft-2020-12",wK=/^#\/(\$defs|definitions)\/([^/~%]+)$/;async function wJ(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 wZ=/\\\.\\d\{(\d+)\}/;function wQ(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let wX=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function wY(e){return wX.has(e)||e.startsWith("x-")}let w1=new Set(["$schema",...Object.keys(d$.shape.requestedSchema.shape)]),w0={string:wU([dl,du,dm,df]),number:wU([dp]),integer:wU([dp]),boolean:wU([dc]),array:wU([dy,dg])},w2=new Set(dl.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(!wH(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&&wQ(n)?r[o]=Object.fromEntries(Object.entries(n).map(([e,r])=>[e,function(e,t,r,i){if(!wQ(e))return e;let o="string"==typeof e.type&&Object.hasOwn(w0,e.type)?w0[e.type]:void 0;if(void 0===o)return e;let n={};for(let[s,d]of Object.entries(e))if(o.has(s)||wY(s))n[s]=d;else if("pattern"===s&&"string"===e.type&&"string"==typeof e.format)if(w2.has(e.format)){var a;"string"==typeof d&&(a=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[iw(nn,void 0)];break;case"uri":r=[iP(nd,void 0)];break;case"date":r=[iR(nr,void 0)];break;case"date-time":let i,o;i=wZ.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=>ac({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=ox(e,{target:wB,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)])):w1.has(o)?r[o]=n:wY(o)||i.push(o);if(i.length>0)throw new wd(ws.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:wB});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().");wG||(wG=!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=ox(e,{target:wB,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&&wK.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 wd(ws.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),o=(t=d$.shape.requestedSchema,oJ(t,i));if(!o.success)throw new wd(ws.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!wQ(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!oJ(db,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}]`)):wQ(t)&&wQ(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):wY(t)?[]:[n]}):[]}(i,o.data);if(n.length>0)throw new wd(ws.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 wd(ws.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 wd?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 w4={},w6={};function w3(e,t){let r=e.slice(0,-6);w4[r]=t,w6[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"])w3(e,wO[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:ct,OAuthClientInformationFullSchema:ca,OAuthClientInformationSchema:cn,OAuthClientMetadataSchema:co,OAuthClientRegistrationErrorSchema:cs,OAuthErrorResponseSchema:cr,OAuthMetadataSchema:d5,OAuthProtectedResourceMetadataSchema:d9,OAuthTokenRevocationRequestSchema:cd,OAuthTokensSchema:ce,OpenIdProviderDiscoveryMetadataSchema:d7,OpenIdProviderMetadataSchema:d8}))w3(e,t);Object.freeze(w4);let w9=Object.freeze(w6),w5=[au,am,ah,ag],w8=["inputResponses","requestState"];function w7(e,t){let r=e.params;if(!Pi(r))return{message:e,lifted:{}};let i=r._meta,o=Pi(i)?w5.filter(e=>e in i):[],n="request"===t?w8.filter(e=>e in r):[];if(0===o.length&&0===n.length)return{message:e,lifted:{}};let a={},s={...r};if(o.length>0&&Pi(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 Pe(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 Pt=(ee=void 0,()=>ee);var Pr=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??ap,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 kD(kz.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 kD(kz.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),aA.safeParse(e).success||aW.safeParse(e).success)this._onresponse(e);else if(aO.safeParse(e).success)this._onrequest(e,t);else aE.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 kD(kz.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}=w7(e,"notification"),i=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=wI(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(wj(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}=w7(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=wI(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(ws.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(wx(i.method)&&!n.hasRequestMethod(i.method)&&!(wC(i.method)&&this._customSchemaRequestMethods.has(i.method)))return void s(ws.MethodNotFound,"Method not found");let d=this._requestHandlers.get(i.method)??this.fallbackRequestHandler;if(void 0===d)return void s(ws.MethodNotFound,"Method not found");let c=n.checkInboundEnvelope(o);if(void 0!==c)return void s(ws.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(!Po(e))return{accepted:t,droppedKeys:r};for(let[i,o]of Object.entries(e)){if(!Po(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?Pt:(r=o.requestState,()=>r),signal:u.signal,send:(e,t,r)=>{let i=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(i,e.method),wH(t))return p(e,t,r);let o=Pe(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(ws.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:ws.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(aA.safeParse(e).success?e:wd.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(wH(t))return wC(e.method)||this._assertOutboundRequestInEra(i,e.method),this._requestWithSchemaViaCodec(i,e,t,r);this._assertOutboundRequestInEra(i,e.method);let o=Pe(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 wq(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 wq(void 0);case"server/discover":return wq(wR);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(wx(t)&&!e.hasRequestMethod(t))throw new kD(kz.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 kD?e:new kD(kz.RequestTimeout,String(e))}let f=e.era===wR&&!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 kD?e:new kD(kz.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)}))}wJ(r,n.result).then(e=>{e.success?p(e.data):u(new kD(kz.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 kD(kz.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 kD(kz.NotConnected,"Not connected");if(wj(t.method)&&!e.hasNotificationMethod(t.method))throw new kD(kz.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(!wx(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 wd(ws.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 wJ(t.params,{...i.params});if(!n.success)throw new wd(ws.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(!wj(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 wd(ws.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 wJ(t.params,{...i.params});if(!o.success)throw new wd(ws.InvalidParams,`Invalid params for notification ${e}: ${o.error}`);await r(o.data,i)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Pi(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Po(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Pn(e){throw new kD(kz.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}(kC(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 Pa=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,aM.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};let Ps=el("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"),Pd="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 Pc=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new Pa({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=Ps(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of Pd){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 kD(kz.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let Pl=new TextEncoder,Pp=new TextDecoder,Pu=new TextDecoder("utf-8",{fatal:!0});function Pm(...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 Pf(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 Ph(e){let t=Math.floor(e/0x100000000),r=new Uint8Array(8);return Pf(r,t,0),Pf(r,e%0x100000000,4),r}function Py(e){let t=new Uint8Array(4);return Pf(t,e),t}let Pg=/[^\x00-\x7f]/;function P_(e){if("string"==typeof e&&e.length>=128){if(Pg.test(e))throw TypeError("non-ASCII string encountered in encode()");return Pl.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 Pv(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 PZ(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 PQ(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 PV(`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 PX(e,t){if(t.includes("b64")){let t=e.b64;if("boolean"!=typeof t)throw new PI('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}function PY(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(!Pz(i))throw new e("JOSE Header is not a JSON object");return[i,r]}async function P1(e,t,r){let i,o,{alg:n,secret:a}=e,s="decrypt"===r||"sign"===r;if(a&&t instanceof Uint8Array)return t;if(Pz(t)){if("string"!=typeof(i=Vo(t)).kty)throw P8(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 PW(i.k);if(!Object.isFrozen(t)){let{key_ops:e}=t;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}}else{if(!P3(t))throw P8(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(P4(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=P0[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 Va(e,i)}let P0={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function P2(e){if(!P4(e))throw Error("CryptoKey instance expected")}let P4=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},P6=e=>e?.[Symbol.toStringTag]==="KeyObject",P3=e=>P4(e)||P6(e);function P9(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 P5=(e,...t)=>P9("Key must be ",e,...t);function P8(e,t,r){let i=["CryptoKey","KeyObject","JSON Web Key"];return r&&i.push("Uint8Array"),TypeError(P9(`Key for the ${e} algorithm must be `,t,...i))}let P7=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function Ve(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Vt(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 Vr(e,t,r){let i=e.algorithm;if(i.name!==t.name)throw P7(t.name);if(t.hash&&i.hash?.name!==t.hash)throw P7(t.hash,"algorithm.hash");if(t.namedCurve&&i.namedCurve!==t.namedCurve)throw P7(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&i.length!==t.length)throw P7(t.length,"algorithm.length");Ve(e,r)}function Vi(e){return{__proto__:null,...e}}function Vo(e){let t=Vi(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 Vn(e){if(void 0!==e&&"boolean"!=typeof e)throw TypeError('"extractable" option must be a boolean');return e}async function Va(e,t,r){if(!e.kty.includes(t.kty))throw new PV('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 Vs(e,t,r,i=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,i,[r])),Vr(e,t,r),e}let Vd=e=>crypto.getRandomValues(new Uint8Array(e.cekBits>>3));function Vc(e,t){let r=e.byteLength<<3;if(r!==t)throw new Pq(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}function Vl(e,t){if(t.length<<3!==e.ivBits)throw new Pq("Invalid Initialization Vector length")}async function Vp(e,t,r){if(!(t instanceof Uint8Array))throw TypeError(P5(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 Vu(e,t,r){return new Uint8Array((await crypto.subtle.sign("HMAC",e,t)).slice(0,r>>3))}async function Vm(e,t,r,i,o){if(!P4(r)&&!(r instanceof Uint8Array))throw TypeError(P5(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(i?Vl(e,i):i=crypto.getRandomValues(new Uint8Array(e.ivBits>>3)),r instanceof Uint8Array&&Vc(r,e.cekBits),e.cbc)return async function(e,t,r,i,o){let[n,a,s]=await Vp(e,r,"encrypt"),d=new Uint8Array(await crypto.subtle.encrypt({iv:i,name:"AES-CBC"},n,t)),c=Pm(o,i,d,Ph(8*o.length));return{ciphertext:d,tag:await Vu(a,c,s),iv:i}}(e,t,r,i,o);let n=await Vs(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 Vf(e,t,r,i,o,n){if(!P4(t)&&!(t instanceof Uint8Array))throw TypeError(P5(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!i)throw new Pq("JWE Initialization Vector missing");if(!o)throw new Pq("JWE Authentication Tag missing");if(!e.cbc&&16!==o.length)throw new Pq("Invalid Authentication Tag length");if(Vl(e,i),t instanceof Uint8Array&&Vc(t,e.cekBits),e.cbc)return async function(e,t,r,i,o,n){let[a,s,d]=await Vp(e,t,"decrypt"),c=Pm(n,i,r,Ph(8*n.length)),l=await Vu(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 PR}(e,t,r,i,o,n);let a=await Vs(t,e.subtle,"decrypt");try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:n,iv:i,name:"AES-GCM",tagLength:128},a,Pm(r,o)))}catch{throw new PR}}function Vh(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}let Vy=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Vg=[[],["deriveBits"]],V_=[[],[]];function Vv(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:Vy,ops:["wrapKey","unwrapKey"]}}function Vb(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 PV('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:t}},usages:Vg,ops:[void 0,"deriveBits"]}}function V$(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:V_,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function VS(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:V_,ops:["deriveBits","deriveBits"]}}let Vk=Vh({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:V_,ops:["encrypt","decrypt"]},"RSA-OAEP":Vv(1),"RSA-OAEP-256":Vv(256),"RSA-OAEP-384":Vv(384),"RSA-OAEP-512":Vv(512),"ECDH-ES":Vb("direct-key-agreement"),"ECDH-ES+A128KW":Vb("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":Vb("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":Vb("key-agreement-with-key-wrapping"),A128KW:V$(128),A192KW:V$(192),A256KW:V$(256),A128GCMKW:V$(128,!0),A192GCMKW:V$(192,!0),A256GCMKW:V$(256,!0),"PBES2-HS256+A128KW":VS(),"PBES2-HS384+A192KW":VS(),"PBES2-HS512+A256KW":VS()}),Vw=["encrypt","decrypt"];function VP(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:V_,ops:Vw,cekBits:e,ivBits:t?128:96,cbc:t}}let VV=Vh({A128GCM:VP(128),A192GCM:VP(192),A256GCM:VP(256),"A128CBC-HS256":VP(256,!0),"A192CBC-HS384":VP(384,!0),"A256CBC-HS512":VP(512,!0)});function VR(e,t){throw new PV(`Invalid or unsupported "${e}" (JWE ${t}) header value`)}function Vq(e){return("string"==typeof e?Vk[e]:void 0)??VR("alg","Algorithm")}function VI(e){return"key-wrapping"===e.mode||"key-encryption"===e.mode||"key-agreement-with-key-wrapping"===e.mode}function Vx(e){return("string"==typeof e?VV[e]:void 0)??VR("enc","Encryption Algorithm")}function Vj(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");Ve(e,t)}function VC(e,t,r){Vr(t,Vq(e).subtle,r),Vt(e,t)}async function VT(e,t,r,i){if(!(e instanceof Uint8Array)||e.length<8)throw new Pq("PBES2 Salt Input must be 8 or more octets");if(!Number.isSafeInteger(r)||1!==Math.sign(r))throw new Pq("PBES2 Count Input must be a positive integer");let o=Pm(P_(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 Vs(i,Vq(t).subtle,"deriveBits");return new Uint8Array(await crypto.subtle.deriveBits(a,s,n))}function VO(e){return Pm(Py(e.length),e)}async function VE(e,t,r,i,o=new Uint8Array,n=new Uint8Array){Vj(e),Vj(t,"deriveBits");let a=Pm(VO(P_(r)),VO(o),VO(n),Py(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 P$("sha256",Pm(Py(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 VA(e){P2(e);let t=e.algorithm.namedCurve;if("P-256"!==t&&"P-384"!==t&&"P-521"!==t&&"X25519"!==e.algorithm.name)throw new PV("ECDH with the provided key is not allowed or not supported by your javascript runtime")}function VW(e,t){let r=e[t];if(void 0!==r){if("string"!=typeof r)throw new Pq(`JOSE Header "${t}" (Agreement Party${"apu"===t?"U":"V"}Info) invalid`);return PU(r,t,Pq)}}function VM(e,t){if(void 0!==e&&void 0!==t&&e.byteLength===t.byteLength){for(let r=0;r"u")throw new PV(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function VL(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 Pq("Decompressed plaintext exceeded the configured limit")}return Pm(...o)}function VU(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 Pq("JWE Initialization Vector incorrect type");if("string"!=typeof r)throw new Pq("JWE Ciphertext missing or incorrect type");if(void 0!==n&&("string"!=typeof n||!n))throw new Pq("JWE Authentication Tag incorrect type");if(void 0!==o&&"string"!=typeof o)throw new Pq("JWE Protected Header incorrect type");if(void 0!==t&&("string"!=typeof t||!t))throw new Pq("JWE AAD incorrect type");if(void 0!==a&&!Pz(a))throw new Pq("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 VH(e){let t,r;try{let{header:i}=e;if(Pz(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 VG(e){let{encrypted_key:t,header:r}=e;if(void 0!==t&&"string"!=typeof t)throw new Pq("JWE Encrypted Key incorrect type");if(void 0!==r&&!Pz(r))throw new Pq("JWE Per-Recipient Unprotected Header incorrect type");if(void 0===e.protected&&void 0===r&&void 0===e.unprotected)throw new Pq("JOSE Header missing")}function VB(e){let t,{protected:r,ciphertext:i,iv:o,tag:n,aad:a}=e;return void 0!==r&&(t=PG(r,Pq,"JWE Protected Header is invalid")),[t,PU(i,"ciphertext",Pq),void 0!==o?PU(o,"iv",Pq):void 0,void 0!==n?PU(n,"tag",Pq):void 0,PH((r??"")+(void 0!==a?`.${a}`:""),"aad",Pq)]}function VK(e){return[e&&PJ("keyManagementAlgorithms",e.keyManagementAlgorithms),e&&PJ("contentEncryptionAlgorithms",e.contentEncryptionAlgorithms),e?.crit,e?.maxPBES2Count,e?.maxDecompressedLength]}async function VJ(e,t,r,i=VB(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(!PF(d,m,f))throw new Pq("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;PQ(Pq,PK,_,d,o),VD(o,d);let{alg:S,enc:k}=o;if("string"!=typeof S||!S)throw new Pq("missing JWE Algorithm (alg) in JWE Header");let w=Vk[S];if(""===$&&(!w||!VI(w)))throw new Pq("JWE Encrypted Key incorrect type");let P=w?.mode==="integrated-encryption";if(!P&&("string"!=typeof k||!k))throw new Pq("missing JWE Encryption Algorithm (enc) in JWE Header");if(y&&!y.has(S)||!y&&S.startsWith("PBES2"))throw new PP('"alg" (Algorithm) Header Parameter value not allowed');if(P){if(void 0!==k)throw new Pq('JWE "enc" (Encryption Algorithm) Header Parameter must not be present for integrated encryption');if(l?.byteLength)throw new Pq("JWE Initialization Vector must be empty for integrated encryption");if(p?.byteLength)throw new Pq("JWE Authentication Tag must be empty for integrated encryption")}else{if(g&&!g.has(k))throw new PP('"enc" (Encryption Algorithm) Header Parameter value not allowed');n=Vx(k)}if(void 0!==$)try{a=PU($,"encrypted_key",Pq)}catch(e){if(!w||!VI(w))throw e;a=new Uint8Array}let V=!1;"function"==typeof r&&(r=await r(d,e),V=!0);let R=w??Vq(S);VI(R)&&void 0===a&&(a=new Uint8Array);let q=await P1("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 VN(i),r;let d="direct-key-agreement"===s;switch(d?VN(i):function(e){if(void 0===e)throw new Pq("JWE Encrypted Key missing")}(i),e.subtle.name){case"ECDH":{let{epk:i}=o;if(!Pz(i)||["d","k","p","q","dp","dq","qi","oth","priv"].some(e=>Object.hasOwn(i,e)))throw new Pq('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');VA(r);let n=await Va(e,i),s=VW(o,"apu"),c=VW(o,"apv");VM(s,c);let l=await VE(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 P2(r),VC(a,r,"decrypt"),new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP",r,i));case"PBKDF2":{if("number"!=typeof o.p2c)throw new Pq('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 Pq('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof o.p2s)throw new Pq('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let e=PU(o.p2s,"p2s",Pq);r=await VT(e,a,o.p2c,r);break}case"AES-GCM":{if("string"!=typeof o.iv)throw new Pq('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof o.tag)throw new Pq('JOSE Header "tag" (Authentication Tag) missing or invalid');let e=PU(o.iv,"iv",Pq),t=PU(o.tag,"tag",Pq);if(12!==e.byteLength)throw new Pq("Invalid Initialization Vector length");if(16!==t.byteLength)throw new Pq("Invalid Authentication Tag length");return Vf(Vx(a.slice(0,-2)),r,i,e,t,new Uint8Array)}}return async function(e,t,r){let i=await Vs(t,Vq(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),VI(R)&&e instanceof Uint8Array&&e.byteLength<<3!==t.cekBits&&(e=Vd(t))}catch(r){if(r instanceof TypeError||r instanceof Pq||r instanceof PV)throw r;e=Vd(t)}s=await Vf(t,e,c,l,p,u)}if("DEF"===o.zip){let e=b??25e4;if(0===e)throw new PV('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 VF("DecompressionStream"),VL(new DecompressionStream("deflate-raw"),e,t)})(s,e).catch(e=>{throw e instanceof Pq?e:new Pq("Failed to decompress plaintext",{cause:e})})}return{plaintext:s,...d&&{protectedHeader:d},...void 0!==h&&{additionalAuthenticatedData:PU(h,"aad",Pq)},...f&&{sharedUnprotectedHeader:f},...m&&{unprotectedHeader:m},...V&&{key:q}}}async function VZ(e,t,r){if(e instanceof Uint8Array&&(e=Pp.decode(e)),"string"!=typeof e)throw new Pq("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 Pq("Invalid Compact JWE");return VJ({ciphertext:a,iv:n||void 0,protected:i,tag:s||void 0,encrypted_key:o||void 0},t,r)}async function VQ(e,t,r){return VZ(e,VK(r),t)}async function VX(e,t,r){if(!Pz(e))throw new Pq("Flattened JWE must be an object");let i=VU(e),[o,,n]=VH(e);if(!o)throw n;let a={...i,...o};return VG(a),VJ(a,VK(r),t)}async function VY(e,t,r){let i,o,n;if(!Pz(e))throw new Pq("General JWE must be an object");let a=e.recipients;if(!Array.isArray(a))throw new Pq("JWE Recipients missing or incorrect type");let s=Array.from(a);if(!s.every(Pz))throw new Pq("JWE Recipients missing or incorrect type");if(!s.length)throw new Pq("JWE Recipients has no members");try{i=VK(r),o=VU(e),n=VB(o)}catch{throw new PR}let d=s.map(e=>VH(e));if(s.length>1)for(let[,e]of d){let t=n[0]?.alg??e??o.unprotected?.alg,r="string"==typeof t?Vk[t]:void 0;if(r&&!VI(r))throw new Pq(`"${t}" alg may only have a single recipient`)}for(let[e]of d)if(e)try{let r={...o,...e};return VG(r),await VJ(r,i,t,n)}catch{}throw new PR}function V1(e,t,r){if(!PF(e,t,r))throw new Pq("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint")}function V0(e,t,r=!1){if(!e[1]&&!e[2]&&!e[3])throw new Pq("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&&PN(a,"JWE Additional Authenticated Data"),void 0!==s&&PN(s,"JWE Content Encryption Key"),void 0!==d&&PN(d,"JWE Initialization Vector"),r||void 0===i||(i=PY(Pq,i)[0],e[1]=i),void 0!==o&&(o=PY(Pq,o)[0],e[2]=o),r||void 0===n||(n=PY(Pq,n)[0],e[3]=n),void 0!==c&&!Pz(c))throw TypeError("JWE Key Management Parameters must be an object");V1(i,o,n);let p={...i,...o,...n};PZ(Pq,i),PQ(Pq,PK,l,i,p),VD(p,i);let{alg:u,enc:m}=p;if("string"!=typeof u||!u)throw new Pq('JWE "alg" (Algorithm) Header Parameter missing or invalid');let f=Vk[u];if(f?.mode==="integrated-encryption"){if(void 0!==m)throw new Pq('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 Pq('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');return[p,Vx(m),f]}async function V2(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??Vq(c.alg);"integrated-encryption"===k.mode?n=await P1(k,r,"encrypt"):[n,i,o]=await Vz(k,l,r,c,g,v),o&&(b?S=S?{...S,...o}:o:$=$?{...$,...o}:o,V1($,S,h));let w=$?PM(JSON.stringify($)):"",P=y?.byteLength?PM(y):void 0,V=P_(P?`${w}.${P}`:w),R=u;"DEF"===c.zip&&(R=await (async function(e){return VF("CompressionStream"),VL(new CompressionStream("deflate-raw"),e)})(R).catch(e=>{throw new Pq("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 Vm(l,R,n,_,V);let q={ciphertext:PM(a)};return d&&(q.iv=PM(d)),s&&(q.tag=PM(s)),i?.byteLength&&(q.encrypted_key=PM(i)),P&&(q.aad=P),$&&(q.protected=w),h&&(q.unprotected=h),S&&(q.header=S),q}async function V4(e,t,r){return V2(e,V0(e,r),t)}function V6(e){return[e.protected,e.encrypted_key,e.iv,e.ciphertext,e.tag].join(".")}class V3{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r]}setUnprotectedHeader(e){return PL(this.state[0],"setUnprotectedHeader"),this.state[0]=e,this}setKeyManagementParameters(e){return PL(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 V9{#h;#y=[];#g;#_;#v;constructor(e){this.#h=e}addRecipient(e,t){let r=new V3(this,e,t?.crit);return this.#y.push(r),r}setProtectedHeader(e){return PL(this.#g,"setProtectedHeader"),this.#g=e,this}setSharedUnprotectedHeader(e){return PL(this.#_,"setSharedUnprotectedHeader"),this.#_=e,this}setAdditionalAuthenticatedData(e){return this.#v=e,this}async encrypt(){if(!this.#y.length)throw new Pq("at least one recipient must be added");PN(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=V0(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&&!VI(f))throw new Pq(`"${u}" alg may only have a single recipient`);if(t){if(t!==m)throw new Pq('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else t=m}for(let[,e]of o)e[2]??=Vq(e[0].alg);let[n,a,s]=o[0],d=e?Vd(a[1]):void 0;n[5]=d;let{encrypted_key:c,header:l,...p}=await V2(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=Rn(e,[t]),i=Rs(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 PI("inconsistent use of JWS Unencoded Payload (RFC7797)");for(let e of d)try{let[r]=await Rl(e[0],i,t,Rd,e[1]);return r}catch{}throw new PA}let Rh=e=>Math.floor(e.getTime()/1e3),Ry={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},Rg=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,R_="check_failed";function Rv(){throw TypeError("Invalid time period format")}function Rb(e){"string"!=typeof e&&Rv();let t=Rg.exec(e);(!t||t[4]&&t[1])&&Rv();let r=Math.round(parseFloat(t[2])*Ry[t[3][0].toLowerCase()]);return Number.isFinite(r)||Rv(),"-"===t[1]||"ago"===t[4]?-r:r}function R$(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}function RS(e,t){if("string"!=typeof t)throw TypeError(`"${e}" claim must be a string`)}function Rk(e,t){return"number"==typeof e?R$(t,e):e instanceof Date?R$(t,Rh(e)):Rh(new Date)+Rb(e)}let Rw=e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`};function RP(e,t,r=!1){let i=e[t];if(!(void 0===i&&!r)){if("number"!=typeof i)throw new Pk(`"${t}" claim must be a number`,e,t,"invalid");return i}}function RV(e,t){throw new Pk(`unexpected "${t}" claim value`,e,t,R_)}function RR(e,t,r={}){let i,o,n;try{i=JSON.parse(Pu.decode(t))}catch{}if(!Pz(i))throw new Px("JWT Claims Set must be a top-level JSON object");let{typ:a}=r;if(void 0!==a&&("string"!=typeof e.typ||Rw(e.typ)!==Rw(a)))throw new Pk('unexpected "typ" JWT header value',i,"typ",R_);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 Pk(`missing required "${e}" claim`,i,e,"missing");void 0===d||(Array.isArray(d)?d:[d]).includes(i.iss)||RV(i,"iss"),void 0!==c&&i.sub!==c&&RV(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)))||RV(i,"aud");let{clockTolerance:m}=r,f=0;if("string"==typeof m)f=Rb(m);else if(void 0!==m){if("number"!=typeof m)throw TypeError("Invalid clockTolerance option type");f=m}R$("clockTolerance option",f);let{currentDate:h}=r,y=R$("currentDate option",Rh(void 0===h?new Date:h)),g=RP(i,"iat",void 0!==p),_=RP(i,"nbf");if(void 0!==_&&_>y+f)throw new Pk('"nbf" claim timestamp check failed',i,"nbf",R_);let v=RP(i,"exp");if(void 0!==v&&v<=y-f)throw new Pw('"exp" claim timestamp check failed',i,"exp",R_);if(void 0!==p){let e=y-g;if(e-f>R$("maxTokenAge option","number"==typeof p?p:Rb(p)))throw new Pw('"iat" claim timestamp check failed (too far in the past)',i,"iat",R_);if(e<-f)throw new Pk('"iat" claim timestamp check failed (it should be in the past)',i,"iat",R_)}return i}function Rq(e){return f.get(e)}function RI(e){let t=Rq(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 Pl.encode(JSON.stringify(t))}class Rx{constructor(e={}){if(!Pz(e))throw TypeError("JWT Claims Set MUST be an object");(f||=new WeakMap).set(this,structuredClone(e))}setIssuer(e){return RS("iss",e),Rq(this).iss=e,this}setSubject(e){return RS("sub",e),Rq(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),Rq(this).aud=e,this}setJti(e){return RS("jti",e),Rq(this).jti=e,this}setNotBefore(e){return Rq(this).nbf=Rk(e,"setNotBefore"),this}setExpirationTime(e){return Rq(this).exp=Rk(e,"setExpirationTime"),this}setIssuedAt(e){let t=Rq(this);return void 0===e?t.iat=Rh(new Date):"string"==typeof e?t.iat=R$("setIssuedAt",Rh(new Date)+Rb(e)):t.iat=Rk(e,"setIssuedAt"),this}}async function Rj(e,t,r){let[i,o]=await Rp(e,Ra(r),t);if(!o)throw new Px("JWTs MUST NOT use unencoded payload");let n=RR(i.protectedHeader,i.payload,r);return{...i,payload:n}}async function RC(e,t,r){let{plaintext:i,...o}=await VZ(e,VK(r),t),{protectedHeader:n}=o,a=RR(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 Pk(`replicated "${e}" claim header parameter mismatch`,a,e,"mismatch");return{payload:a,...o}}class RT{#b;constructor(e){PN(e,"plaintext"),this.#b=[e]}setContentEncryptionKey(e){return PL(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PL(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PL(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}async encrypt(e,t){return V6(await V4([...this.#b],e,t))}}class RO{#b;constructor(e){PN(e,"plaintext"),this.#b=[e]}setKeyManagementParameters(e){return PL(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setSharedUnprotectedHeader(e){return PL(this.#b[3],"setSharedUnprotectedHeader"),this.#b[3]=e,this}setUnprotectedHeader(e){return PL(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}setAdditionalAuthenticatedData(e){return this.#b[4]=e,this}setContentEncryptionKey(e){return PL(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PL(this.#b[6],"setInitializationVector"),this.#b[6]=e,this}async encrypt(e,t){return V4([...this.#b],e,t)}}async function RE(e,t,r){let[i,o,n,a]=e,s="";if(void 0!==o){let e=PY(PI,o);o=e[0],s=PM(e[1])}if(void 0!==n&&(n=PY(PI,n)[0]),!o&&!n)throw new PI("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!PF(o,n))throw new PI("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...o,...n};PZ(PI,o);let c=PX(o,PQ(PI,PB,a,o,d));c||r?.();let{alg:l}=d;if("string"!=typeof l||!l)throw new PI('JWS "alg" (Algorithm) Header Parameter missing or invalid');let p=Ro(l),u="",m=i,f;if(c){let t=e[4];t?(u=t[0]??=PM(i),m=t[1]??=P_(u)):(u=PM(i),f=Pl.encode(`${s}.${u}`))}f??=Pm(P_(s),P_("."),m);let h=await Vs(await P1(p,t,"sign"),p.subtle,"sign");p.minRsaBits&&Vt(p.alg,h);let y={signature:PM(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 RA(e,t,r,i,o){let[n]=await RE([e,t,void 0,r],i,o);return`${n.protected}.${n.payload}.${n.signature}`}class RW{#$;#g;constructor(e){PN(e,"payload"),this.#$=e}setProtectedHeader(e){return PL(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RA(this.#$,this.#g,t?.crit,e,()=>{throw TypeError("use the flattened module for creating JWS with b64: false")})}}class RM{#b;constructor(e){PN(e,"payload"),this.#b=[e]}setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setUnprotectedHeader(e){return PL(this.#b[2],"setUnprotectedHeader"),this.#b[2]=e,this}async sign(e,t){let r=[...this.#b];r[3]=t?.crit;let[i]=await RE(r,e);return i}}class RN{#f;state;constructor(e,t,r){this.#f=e,this.state=[void 0,void 0,t,r?.crit]}setProtectedHeader(e){return PL(this.state[0],"setProtectedHeader"),this.state[0]=e,this}setUnprotectedHeader(e){return PL(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 Rz{#$;#S=[];constructor(e){this.#$=e}addSignature(e,t){let r=new RN(this,e,t);return this.#S.push(r),r}async sign(){let e;if(!this.#S.length)throw new PI("at least one signature must be added");PN(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 RE([this.#$,o,n,s,r],a);if(void 0===e)e=l,t.payload=d;else if(e!==l)throw new PI("inconsistent use of JWS Unencoded Payload (RFC7797)");t.signatures.push(c)}return t}}let RD=Rx;class RF extends RD{#g;setProtectedHeader(e){return PL(this.#g,"setProtectedHeader"),this.#g=e,this}async sign(e,t){return RA(RI(this),this.#g,t?.crit,e,()=>{throw new Px("JWTs MUST NOT use unencoded payload")})}}let RL=Rx;class RU extends RL{#b=[void 0];#k;#w;#P;setProtectedHeader(e){return PL(this.#b[1],"setProtectedHeader"),this.#b[1]=e,this}setKeyManagementParameters(e){return PL(this.#b[7],"setKeyManagementParameters"),this.#b[7]=e,this}setContentEncryptionKey(e){return PL(this.#b[5],"setContentEncryptionKey"),this.#b[5]=e,this}setInitializationVector(e){return PL(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=RI(this);this.#b[1]&&(this.#k||this.#w||this.#P)&&(this.#b[1]={...this.#b[1],iss:this.#k?Rq(this).iss:void 0,sub:this.#w?Rq(this).sub:void 0,aud:this.#P?Rq(this).aud:void 0});let i=[...this.#b];return i[0]=r,V6(await V4(i,e,t))}}let RH='"alg" (Algorithm)';function RG(e='JWK "alg" (Algorithm) Parameter'){throw new PV(`Invalid or unsupported ${e} value`)}function RB(e,t){return("string"==typeof e?Ri[e]??Vk[e]:void 0)??RG(t)}let RK=async(e,t,r)=>{var i,o;let n;if(P6(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!P4(r))throw TypeError(P5(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=Pv(new Uint8Array(await crypto.subtle.exportKey(t,r))),o=`${e.toUpperCase()} KEY`,n=(i.match(/.{1,64}/g)||[]).join(` `),`-----BEGIN ${o}----- ${n} -----END ${o}-----`},RJ=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r({data:e,pos:0}),RQ=e=>{let t=e.data[e.pos++];if(void 0===t)throw Error("Unexpected end of ASN.1 input");return t},RX=e=>{let t=RQ(e);if(128&t){let r=127&t,i=0;for(let t=0;t{for(;t-- >0;){e.pos++;let t=RX(e);e.pos+=t}},R1=(e,t,r)=>{if(RQ(e)!==t)throw Error(r)},R0=(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},R2=async(e,t,r,i)=>{let o,n=Vn(i?.extractable),a=RB(r,RH);a.secret&&RG(RH);let s="spki"===e;if(a.resolve)try{let r=RZ(t);(function(e,t){if(R1(e,48,`Invalid ${"spki"===t?"SPKI":"PKCS#8"} structure`),RX(e),"pkcs8"===t){R1(e,2,"Expected version field");let t=RX(e);e.pos+=t}R1(e,48,"Expected algorithm identifier"),RX(e)})(r,e),o=a.resolve({crv:(e=>{let t,r=(R1(e,6,"Expected algorithm OID"),t=RX(e),R0(e,t));if(RJ(r,[43,101,110]))return"X25519";if(!RJ(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");R1(e,6,"Expected curve OID");let i=RX(e),o=R0(e,i);if(RJ(o,[42,134,72,206,61,3,1,7]))return"P-256";if(RJ(o,[43,129,4,0,34]))return"P-384";if(RJ(o,[43,129,4,0,35]))return"P-521";throw Error("Unsupported named curve")})(r)})}catch{throw new PV("Invalid or unsupported key format")}else o=a.subtle;return crypto.subtle.importKey(e,t,o,n??s,a.usages[+!s])},R4=(e,t)=>Pb(e.replace(t,""));function R6(e){return RK("public","spki",e)}function R3(e){return RK("private","pkcs8",e)}async function R9(e){if(P6(e))if("secret"!==e.type)return e.export({format:"jwk"});else e=e.export();if(e instanceof Uint8Array)return{kty:"oct",k:PM(e)};if(!P4(e))throw TypeError(P5(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 R5=(e,t)=>{if("string"!=typeof e||!e)throw new Pj(`${t} missing or invalid`)};async function R8(e,t){let r,i;if(Pz(e)){if("string"!=typeof(r=Vi(e)).kty)throw TypeError(P5(e,"CryptoKey","KeyObject","JSON Web Key"))}else if(P3(e))r=Vi(await R9(e));else throw TypeError(P5(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":R5(r.alg,'"alg" (Algorithm) Parameter'),R5(r.pub,'"pub" (Public key) Parameter'),i={alg:r.alg,kty:r.kty,pub:r.pub};break;case"EC":R5(r.crv,'"crv" (Curve) Parameter'),R5(r.x,'"x" (X Coordinate) Parameter'),R5(r.y,'"y" (Y Coordinate) Parameter'),i={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":R5(r.crv,'"crv" (Subtype of Key Pair) Parameter'),R5(r.x,'"x" (Public Key) Parameter'),i={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":R5(r.e,'"e" (Exponent) Parameter'),R5(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 Pj('"k" (Key Value) Parameter missing or invalid');i={k:r.k,kty:r.kty};break;default:throw new PV('"kty" (Key Type) Parameter missing or unsupported')}let o=P_(JSON.stringify(i));return PM(await P$(t,o))}async function R7(e,t){t??="sha256";let r=await R8(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}async function qe(e,t){let r,i={...e,...t?.header};if(!Pz(i.jwk))throw new PI('"jwk" (JSON Web Key) Header Parameter must be a JSON object');try{r=Vo(i.jwk)}catch(e){throw new PI("Invalid Embedded JWK",{cause:e})}let o=Ro(i.alg);if(void 0!==r.use&&"sig"!==r.use)throw new PI('Invalid Embedded JWK, its "use" must be "sig" when present');if(void 0!==r.alg&&r.alg!==o.alg)throw new PI(`Invalid Embedded JWK, its "alg" must be "${o.alg}" when present`);let n=await Va(o,r,!0);if("public"!==n.type)throw new PI('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}async function qt(e,t,r){let i=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(void 0===i[o]){let e=Va(r,t,!0).then(e=>{if("public"!==e.type)throw new PC("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 qr(e){let t;try{t=structuredClone(e)}catch{}if(!PD(t))throw new PC("JSON Web Key Set malformed");let r=t.keys.map(e=>{let t=Vi(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?Ri[n]:void 0;if(!s||s.secret)throw new PV('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 PT;if(1!==l){let e=new PO;throw e[Symbol.asyncIterator]=async function*(){for(let e of d)try{yield await qt(i,e,s)}catch{}},e}return qt(i,c,s)},"jwks",{value:()=>structuredClone(t)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(h="jose/v6.2.12");let qi=Symbol(),qo=Symbol();function qn(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 PE:e});if(200!==o.status)throw new PS("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch{throw new PS("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(r,d,AbortSignal.timeout(n),c).then(t=>{let r=qr(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&&qn(p,s)||await g();try{return await y(e,t)}catch(r){if(r instanceof PT&&!qn(p,a))return await g(),y(e,t);throw r}},{coolingDown:{get:()=>qn(p,a),enumerable:!0},fresh:{get:()=>qn(p,s),enumerable:!0},reload:{value:g,enumerable:!0},reloading:{get:()=>!!u,enumerable:!0},jwks:{value:()=>y?.jwks(),enumerable:!0}})}let qd=Rx;class qc extends qd{encode(){let e=PM(JSON.stringify({alg:"none"})),t=PM(RI(this));return`${e}.${t}.`}static decode(e,t){let r,i;if("string"!=typeof e)throw new Px("Unsecured JWT must be a string");let{0:o,1:n,2:a,length:s}=e.split(".");if(3!==s||""!==a)throw new Px("Invalid Unsecured JWT");try{r=PG(o,PI,"JWS Protected Header is invalid");let e=PQ(PI,PB,void 0,r,r);i=PX(r,e)}catch(e){throw e instanceof PI?new Px("Invalid Unsecured JWT",{cause:e}):e}if("none"!==r.alg)throw new Px("Invalid Unsecured JWT");if(!i)throw new Px("JWTs MUST NOT use unencoded payload");return{payload:RR(r,PU(n,"payload",Px),t),header:r}}}async function ql(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw TypeError('"spki" must be SPKI formatted string');return R2("spki",R4(e,/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g),t,r)}async function qp(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=R4(e,/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g);i=function(e){let t=RZ(e);R1(t,48,"Invalid certificate structure");let r=RX(t);if(r<0||t.pos+r>t.data.length)throw Error("Unexpected end of ASN.1 input");R1(t,48,"Invalid tbsCertificate structure"),RX(t),160===e[t.pos]?RY(t,6):RY(t,5);let i=t.pos;R1(t,48,"Invalid SPKI structure");let o=RX(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 R2("spki",i,t,r)}async function qu(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return R2("pkcs8",R4(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),t,r)}async function qm(e,t,r){if(!Pz(e))throw TypeError("JWK must be an object");let i=Vo(e),o=Vn(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 PW(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 Va(RB(t),i,o);case"RSA":case"EC":case"OKP":return Va(RB(t),i,o);default:throw new PV('Unsupported "kty" (Key Type) Parameter value')}}function qf(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 PG(t,TypeError,r)}function qh(e){let t,r;if("string"!=typeof e)throw new Px("JWTs must use Compact JWS serialization, JWT must be a string");let{1:i,length:o}=e.split(".");if(5===o)throw new Px("Only JWTs using Compact JWS serialization can be decoded");if(3!==o)throw new Px("Invalid JWT");if(!i)throw new Px("JWTs must contain a payload");try{t=PW(i)}catch{throw new Px("Failed to base64url decode the payload")}try{r=JSON.parse(Pu.decode(t))}catch{throw new Px("Failed to parse the decoded payload as JSON")}if(!Pz(r))throw new Px("Invalid JWT Claims Set");return r}async function qy(e,t){let r,i=Vn(t?.extractable),o=RB(e,RH);if(o.secret&&RG(RH),o.resolve){let e=t?.crv??"P-256";if(!["P-256","P-384","P-521","X25519"].includes(e))throw new PV("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 PV(`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 PV("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 qg(e,t){let r,i,o,n=Vn(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:RG(RH)}return crypto.subtle.generateKey(i,n??!1,o)}let q_="WebCryptoAPI";var qv=kC(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=qv();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}),q$=kC(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=qv(),r=qb();var i=qv();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=qb();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)}}),qS=kC(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=q$(),o=qv();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}),qk=kC(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=q$();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")}}),qw=kC(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=q$(),r=qS(),i=qk();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)}}),qP=kC(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=qw(),r=q$(),i=qk(),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)}}),qV=kC(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:{}}}}),qR=kC(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}),qq=kC(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=qV(),o=qR(),n=qw(),a=q$(),s=qS();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/pnpm-lock.yaml b/pnpm-lock.yaml index 864282dc67..1e45851b69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -189,7 +189,7 @@ importers: version: 1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@tanstack/react-query': specifier: ^5.62.0 - version: 5.104.5(@types/react@19.3.0)(react@19.3.1) + version: 5.105.0(@types/react@19.3.0)(react@19.3.1) '@tanstack/react-virtual': specifier: ^3.11.0 version: 3.14.22(react-dom@19.3.1(react@19.3.1))(react@19.3.1) @@ -1508,11 +1508,11 @@ packages: '@tailwindcss/postcss@4.3.3': resolution: {integrity: sha512-JTSZZGQi1AyKirbLN3azmjVzef92tcX7h+iSqPdaeStyFpGpDlKvvpxeOE8njhbUanbRwr3z8DyzhICWnMtQeg==} - '@tanstack/query-core@5.104.5': - resolution: {integrity: sha512-Q94gI8Opd+CbdVNOdj8ZCyV8WqLYitrDq1t96Xc8WZT6lY0r5iRnJLXYDxMex7EEf2v+mXvn4FcjaBKSxXZQ9A==} + '@tanstack/query-core@5.105.0': + resolution: {integrity: sha512-7p56vRmT/z4UJ6sctGIdl5WRUQyUv53IUpUwEKi2g97zMbO7zh8ZsCLffGAvCPBR4xD72e3VXsDyLwXHhoNTMQ==} - '@tanstack/react-query@5.104.5': - resolution: {integrity: sha512-RORgFe052U+93weaNuqg7qHq7vNVNzXN/VrXqD4bbAuQCWUqOl2lV5Ui9flWk5CVvMyL/Bh27QWhzwH0aaOx9g==} + '@tanstack/react-query@5.105.0': + resolution: {integrity: sha512-y+hMuDERvgg6ay1da0V1a6ZC0ZONt7dELxSFkqRZuwm7p1TTZs0MoXrPlBRflIpRoYjvzQVYxycnLImpFLhWrw==} peerDependencies: '@types/react': ^18 || ^19 react: ^18 || ^19 @@ -3926,11 +3926,11 @@ snapshots: postcss: 8.5.30 tailwindcss: 4.3.3 - '@tanstack/query-core@5.104.5': {} + '@tanstack/query-core@5.105.0': {} - '@tanstack/react-query@5.104.5(@types/react@19.3.0)(react@19.3.1)': + '@tanstack/react-query@5.105.0(@types/react@19.3.0)(react@19.3.1)': dependencies: - '@tanstack/query-core': 5.104.5 + '@tanstack/query-core': 5.105.0 react: 19.3.1 optionalDependencies: '@types/react': 19.3.0 diff --git a/scripts/bazel/patches/rules-rust-clippy-metadata-inputs.patch b/scripts/bazel/patches/rules-rust-clippy-metadata-inputs.patch index 98924c6cc1..7be8ee1a0b 100644 --- a/scripts/bazel/patches/rules-rust-clippy-metadata-inputs.patch +++ b/scripts/bazel/patches/rules-rust-clippy-metadata-inputs.patch @@ -65,10 +65,11 @@ diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl transitive_crate_outputs = dep_info.transitive_metadata_outputs dependency_search_artifacts = None -@@ -1009,7 +1014,8 @@ +@@ -1009,8 +1014,9 @@ error_format = None, allowed_unstable_rust_features = None, link_std_dylib = False, + bin_link_flags = None, - dependency_search_artifacts = None): + dependency_search_artifacts = None, + force_depend_on_metadata = False): diff --git a/scripts/bazel/patches/rules-rust-windows-build-flags.patch b/scripts/bazel/patches/rules-rust-windows-build-flags.patch index df11b8eb37..273deb9fe4 100644 --- a/scripts/bazel/patches/rules-rust-windows-build-flags.patch +++ b/scripts/bazel/patches/rules-rust-windows-build-flags.patch @@ -1,14 +1,17 @@ diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl -@@ -1108,7 +1108,8 @@ +@@ -1108,10 +1108,11 @@ for build_env_file in build_env_files: process_wrapper_flags.add("--env-file", build_env_file) - + - process_wrapper_flags.add_all(build_flags_files, before_each = "--arg-file") + if toolchain.exec_triple.system != "windows": + process_wrapper_flags.add_all(build_flags_files, before_each = "--arg-file") - + if bin_link_flags: + process_wrapper_flags.add("--bin-arg-file", bin_link_flags) + process_wrapper_flags.add("--cargo-bin-name", getattr(attr, "cargo_bin_name", "") or ctx.label.name) + all_allowed_unstable_features = [] if getattr(ctx.attr, "unstable_rust_features_config", None): @@ -1591,6 +1592,15 @@ diff --git a/scripts/bazel/patches/rules-rust-windows-dependency-search.patch b/scripts/bazel/patches/rules-rust-windows-dependency-search.patch index d089c5cca0..5f372ce819 100644 --- a/scripts/bazel/patches/rules-rust-windows-dependency-search.patch +++ b/scripts/bazel/patches/rules-rust-windows-dependency-search.patch @@ -50,12 +50,14 @@ diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl def _will_emit_object_file(emit): for e in emit: -@@ -984,7 +1008,8 @@ +@@ -984,8 +1008,9 @@ require_explicit_unstable_features = False, error_format = None, allowed_unstable_rust_features = None, -- link_std_dylib = False): +- link_std_dylib = False, +- bin_link_flags = None): + link_std_dylib = False, ++ bin_link_flags = None, + dependency_search_artifacts = None): """Builds an Args object containing common rustc flags diff --git a/sdks/typescript/src/operations.ts b/sdks/typescript/src/operations.ts index 6d597f0c80..106a0307d6 100644 --- a/sdks/typescript/src/operations.ts +++ b/sdks/typescript/src/operations.ts @@ -781,7 +781,7 @@ export type ProviderId = string; export type ProviderLatencyReadModelV1 = { readonly first_progress: LatencyDistributionReadModelV1; readonly identity_provenance: MetricProvenanceV1; readonly identity_unavailable_reason?: string | null; readonly model?: string | null; readonly provider?: string | null; readonly queue: LatencyDistributionReadModelV1; readonly service: LatencyDistributionReadModelV1; readonly start: LatencyDistributionReadModelV1; readonly terminal: LatencyDistributionReadModelV1; readonly [key: string]: unknown }; export type ProximityAddressV1 = { readonly file: FileOccurrenceId; readonly scope: FeedbackScopeV1; readonly span?: SourceSpan | null; readonly symbol?: SymbolOccurrenceId | null }; export type ProximityCoverageV1 = "complete" | "partial" | "stale" | "unavailable" | "denied" | "private"; -export type ProximityWarningClassV1 = "same_file" | "overlapping_range" | "same_symbol" | "same_package" | "same_crate" | "neighborhood" | "shared_caller" | "shared_dependency" | "shared_test" | "incompatible_branch_worktree"; +export type ProximityWarningClassV1 = "same_file" | "overlapping_range" | "same_symbol" | "same_package" | "same_crate" | "neighborhood" | "shared_caller" | "shared_dependency" | "shared_test"; export type PublicCodeProject = { readonly canonical_root: string; readonly created_at: number; readonly default_branch?: string | null; readonly display_root: string; readonly git_common_dir?: string | null; readonly head_branch?: string | null; readonly is_active?: boolean | null; readonly label: string; readonly last_seen_at: number; readonly project_id: string; readonly project_root: string; readonly [key: string]: unknown }; export type QuantityEvidenceClassV1 = "owner_receipt" | "locally_measured" | "estimated" | "unknown"; export type QueryCollectionId = string; @@ -2564,7 +2564,7 @@ const DEFINITIONS = { ProviderLatencyReadModelV1: {"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"}, ProximityAddressV1: {"additionalProperties":false,"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","incompatible_branch_worktree"],"type":"string"}, + ProximityWarningClassV1: {"enum":["same_file","overlapping_range","same_symbol","same_package","same_crate","neighborhood","shared_caller","shared_dependency","shared_test"],"type":"string"}, PublicCodeProject: {"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"}, QuantityEvidenceClassV1: {"enum":["owner_receipt","locally_measured","estimated","unknown"],"type":"string"}, QueryCollectionId: {"description":"Strongly typed canonical identity: `QueryCollectionId`.","type":"string"}, diff --git a/server.json b/server.json index 4b342c0ac3..cc766fd2a5 100644 --- a/server.json +++ b/server.json @@ -8,6 +8,6 @@ "source": "github" }, "websiteUrl": "https://github.com/ScriptedAlchemy/tracedecay", - "version": "1.0.0-beta.92", + "version": "1.0.0-beta.93", "packages": [] } diff --git a/version.txt b/version.txt index 74c9c2b582..a6f112dc62 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0-beta.92 +1.0.0-beta.93