feat(oncop): introduce ONCOP v1 — typed cross‑operator protocol with …#101
Merged
Conversation
…URL inference Adds the Orkestra Native Cross‑Operator Protocol (ONCOP) as the unified, typed mechanism for cross‑binary observation across autoscale, status.fields, and template resolution. Key additions: - Introduce ONCOPType enum: metrics, health, cr, info, events - Add BuildONCOPURL(decl) for deterministic URL inference from CRD, selector, and source.type - Extend readCross() with ONCOP host-based resolution (Path 2), preserving informer-first and raw-endpoint fallback semantics - Add ParseCrossField and extraction helpers for cross.<crd>.<category>.<field> - Add per-source caching (cacheFor) for remote ONCOP reads - Support new `type: cr` for CR-specific detail (status/spec/children/metrics) - Unify autoscale cross-metric resolution via ONCOP metrics endpoint - Inject ONCOP responses into resolver under .cross.<as> Impact: Operators can now observe each other declaratively without hard-coded URLs. Autoscalers, status fields, and templates consume cross-operator data through a stable, typed protocol. ONCOP becomes the default cross-binary observation path across Orkestra.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces ONCOP v1, the Orkestra Native Cross‑Operator Protocol, as the unified, typed mechanism for cross‑binary observation across autoscaling, status fields, and template resolution. ONCOP replaces ad‑hoc HTTP integrations with a declarative, URL‑inferable protocol that operators can implement consistently.
This is a foundational change that standardises how Orkestra operators observe each other.
Motivation
Before this PR, cross‑operator reads relied on:
This made cross‑binary autoscaling brittle and operator composition harder than necessary.
ONCOP solves this by introducing a typed, deterministic, cache‑aware protocol for cross‑operator reads.
Design Overview
ONCOP defines five observation surfaces:
Each type maps to a deterministic URL under
/katalog/<crd>.URL inference is centralised in:
CrossCRDDeclarationCross resolution now follows a strict priority:
This ensures correctness, performance, and backward compatibility.
Implementation Details
1. ONCOPType enum
Added first‑class constants:
metricshealthcrinfoeventsWith helpers:
2. URL inference
BuildONCOPURL(decl)now constructs URLs using:decl.Source.Hostdecl.Source.Typedecl.Crddecl.Selector.Namespacedecl.Selector.NameThis eliminates all handwritten URLs.
3. readCross() integration
readCross()now includes:Responses are injected into
.cross.<as>.4. Resolver improvements
Added:
ParseCrossFieldExtractCrossCRDExtractCrossCategoryExtractCrossFieldNameExtractCrossNamespaceThese unify parsing of
cross.<crd>.<category>.<field>.5. Autoscale integration
Autoscale conditions now resolve:
via ONCOP metrics endpoint with optional caching.
6. Status fields
Status fields can now reference:
.cross.<as>.status.*.cross.<as>.children.*.cross.<as>.metrics.*.cross.<as>.health.*All powered by ONCOP.
Migration Notes
source.endpointcontinues to work unchanged.type: crshould be used for CR‑specific detail (replaces previous overloading ofinfo).Testing
cacheFor)Reviewer Checklist