← redevops.io
Draft · thesis · redevops.io

Context Runtime

The Discovery Runtime: deciding which missions are worth running, and learning the best action per regime
v8 adds the layer above the query planner. Where v7 answered any question optimally, v8 decides which questions and missions are worth pursuing at all, and closes the loop: it selects the best action for each business regime and learns from delayed, real-world outcomes under governance. This is the proactive, self-learning layer of the Agentic OS.

This is a draft, and a thesis. v5 shipped the mission kernel, v6 the DevOps operating system, and v7 named the query planner - given an intent, choose the representation, retrieval, reasoning, verification and execution. But v7, like Mission Runtime and Context Runtime, assumed someone already knew what deserved attention. In real operations that is the hardest part. v8 names the missing layer - Discovery Runtime - and the self-learning control loop it enables. Treat forward-looking phases as intent, not guarantees; the implementation-status table separates what runs today from what is planned. The Discovery Runtime, self-learning insurance loop, execution-topology selection and efficiency primitives ship as enterprise reference implementations (Python + Go, at parity); the open core carries the runtime interfaces and the Mission/Context kernels these bind to.

Abstract

Analytics has optimized how questions are answered - better dashboards, then better retrieval, then (v7) an optimal per-workload plan. All of it waits for a person to ask. The next step is a system that continuously decides which questions are worth asking and which missions are worth running, then learns which actions actually improve outcomes. v8 states this as two claims. First, a distinct architectural layer - Discovery Runtime - sits above Mission Runtime and Context Runtime: it observes the evolving world state, detects meaningful change deterministically, forms evidence-backed hypotheses, and proposes a small number of governed missions. Second, once actions have consequences, choosing them is a contextual-bandit problem with delayed, multi-objective, policy-pruned rewards - solved offline first, then in shadow, then in a controlled live pilot. We support both with formal interfaces, two runnable reference implementations, two benchmarks, and a flagship case study: a self-learning insurance distribution control layer that discovers opportunities, removes unsafe actions, learns what works by regime, and explains every decision. Throughout, one efficiency principle holds: recompute only what changed, activate only what is relevant, and learn only from what matters - so the runtime scales with change, not with the size of the world. v8 also names the next axis - execution topology, the choice of how AI work is organized (single agent, coordinator-workers, voting, pipeline, hierarchy) - extending the planner from what it computes to how that computation is coordinated.

The execution plan

Before the dimensions, the abstraction that ties them together. Given a goal, Context Runtime does not make a scattered set of independent choices - it produces a single execution plan, the way a relational optimizer produces one query plan from a SQL statement. Mission Runtime then executes that plan under governance.

Goal
  |
  v
Execution Plan
    representation       # documents, SQL, property graph, temporal state
    retrieval            # which retrieval strategy
    reasoning            # how much reasoning effort
    model                # which model
    execution topology   # how the work is organized
    verification         # how the result is checked
  |
  v
Mission                  # governed, replayable execution

Read the rest of this paper through that lens. The claim is not "the planner chooses a retriever"; it is "the planner produces an execution plan, and every dimension named here is a column of that plan." Representation, retrieval, reasoning, model, execution topology and verification are not six separate systems - they are the fields of one plan the runtime optimizes as a whole, cost-based and learned, and hands to Mission Runtime to run. Discovery Runtime (next) is the step that decides a plan should be produced at all.

The most visible field is the first. For a real investigation - "Is ACME Corp safe to onboard?" - the runtime does not commit to one knowledge representation; it compares candidate plans (documents only, SQL only, property graph, SQL + property graph, documents + graph + temporal), scores each on how well it covers the facets the decision needs, and chooses the cheapest that clears a confidence bar - here SQL + property graph (expected confidence 0.94, estimated latency 280 ms), because sanctions live in a structured store while ownership chains, historical directors and their temporal changes live in a graph. Every rejected plan carries a reason, so an operator can click EXPLAIN and see why this representation mix. That representation comparison is the observable face of the execution plan, and it is what turns the Security & Compliance, Finance and Customer-Success blocks into three views of one runtime rather than a dozen separate applications.

1. The layer above the query planner

Context Runtime starts from intent; Mission Runtime starts from a mission:

Context Runtime   Goal -> Evidence -> Reasoning -> Answer
Mission Runtime   Goal -> Plan -> Execute -> Verify -> Learn

Both assume the goal is given. The relevant pattern in operations begins earlier - with the world changing and nobody yet asking. Discovery Runtime is the layer that turns that change into a governed decision:

Signals -> Change detection -> Correlation -> Hypothesis -> Mission proposal -> Mission Runtime

Three runtimes answer three different questions, and separating them is what makes the system legible.

Discovery RuntimeShould a mission exist?watch, detect, propose Mission RuntimeHow to execute safely?govern, verify, replay Context RuntimeWhich evidence + method?represent, retrieve, reason Outcome + delayed rewardverified, replayable evidence learn which discoveries were worth it
Discovery decides whether, Mission decides how safely, Context decides with what. The outcome of every executed mission feeds back into Discovery, so the system learns which signals and hypotheses are worth promoting per regime. Sidekick supervises the integrations; Projects is where a human reviews discoveries and approves missions.

A dashboard describes; Discovery Runtime decides what deserves attention. Its responsibility is one sentence: observe the evolving business state, identify meaningful change, and propose the missions worth executing - with evidence, confidence, expected value, urgency, a verification plan, and a policy decision about whether it may launch automatically.

2. Discovery Runtime architecture

The hard problem is not detecting a threshold crossing; it is deciding whether a detected change is important. A serious system must handle seasonality, repeated alerts, stale data, correlated symptoms, active incidents, expected post-deployment changes, low-confidence signals, false-positive cost, and competing priorities. The output is not ten thousand alerts. It is seven missions.

Signals: SQL · graph · logs · metrics · CRM · sensors Detection + baseline engine Suppress · dedup · correlate Hypothesis + evidence planner Mission-proposal scorer Policy / approval decision Mission Runtime outcome -> learning Context Runtimeselects the representations
Deterministic first: SQL, thresholds, rate-of-change, seasonal baselines, forecast residuals, freshness and graph-change detectors do the detection; suppression and correlation collapse the noise; only then does AI reasoning enter, and Context Runtime decides which representations the evidence is gathered from. The scorer ranks by decision value, and a risk-aware policy decides ignore / monitor / request-evidence / propose / auto-launch.

Deterministic first, AI where it pays

Discovery Runtime does not call a model on every metric update. Detection is handled by cheap statistical tests - threshold and rate-of-change, EWMA forecast residuals, weekday-seasonal baselines, peer-group deviation, data-freshness failures, and property-graph changes - each emitting a scored, cited Detection. Suppression applies cooldown windows, active-mission suppression and duplicate collapse; correlation groups co-moving symptoms (noisy-OR aggregation) into a single discovery. AI reasoning becomes useful only after a meaningful pattern survives, and it produces an evidence-backed hypothesis - supporting and contradicting evidence, plus a verification plan - not a free-form guess.

Delta-driven world state

The default execution model is incremental, not batch. Rather than rebuilding the complete world state on every event, the runtime processes a StateDelta - the affected entities, the artifacts it invalidates, and the derived state it touches - and recomputes only the impacted detectors, hypotheses and missions. Most events change little; recomputing everything just to notice that is the expensive mistake. Evidence, likewise, is carried forward as reusable EvidenceResidual artifacts with provenance, validity and supersession metadata, rather than re-accumulated as ever-growing context.

2.1 · Sparse capability activation

Not every detector, representation, planner, model or action candidate is relevant to a given discovery. An ActivationBudget makes relevance a first-class planning primitive: the cost model activates only the most relevant capabilities for each mission and leaves the rest dormant - the way a modern frontier model routes a token to a few experts rather than the whole network. The analogy is deliberate and the level is different: this is sparse activation of infrastructure capabilities chosen by the planner, not sparse activation of model weights.

One principle spans the stack: don't recompute everything, don't execute everything, don't learn from everything. Measure what changed (StateDelta), activate only what is relevant (ActivationBudget), and keep the learning honest (routing health) - the direction frontier model architectures are taking, expressed at the infrastructure level rather than in model weights.

3. The self-learning loop

Detection tells you something changed. Deciding what to do about it, when actions have consequences, is a different problem: a contextual bandit over a governed action space, keyed on the business regime, trained on delayed and multi-objective rewards.

The objective is not maximum alert recall or maximum action volume. It is maximum decision value - measured, delayed, and governed.

4. Flagship case study: self-learning insurance distribution

Insurance distribution is the sharpest test of the thesis, because the naive approach - a rules engine mapping each customer profile to a canned pitch - is exactly what the runtime must not be. The durable loop is instead:

discover -> contextualize -> constrain -> choose -> execute -> verify -> learn
Discoveryopportunity class Contextdecision context Eligibilityprune unsafe Banditchoose action Missiongovern + execute Delayed multi-objective rewardbind · retain · complain · cancel · cost reward trains the bandit per regime
Discovery surfaces an opportunity class (coverage gap, renewal risk, carrier mismatch, compliance change). Context Runtime assembles a versioned decision context with provenance. Deterministic eligibility removes anything prohibited before learning. The bandit chooses among only the safe actions; Mission Runtime executes under approval; the delayed multi-objective reward trains the policy for that regime.

The composite action and the safe action space

An action is not a product; it is a tuple - product x carrier x package x timing x channel x message x broker-involvement x follow-up - alongside governed low/no-ops: request more information, ask a broker to review, defer, monitor, and an explicit do nothing. Before the bandit sees anything, deterministic policy logic prunes infeasible or prohibited actions: producer licensing, customer consent, carrier appetite, underwriting eligibility, suitability and replacement rules, state regulation, approved products and messages, contact-frequency limits, fairness and anti-discrimination controls, and budget/authority. Only safe candidates reach the bandit, and templates define safe execution envelopes - they do not encode fixed routes.

Explainability

Every recommendation explains why the opportunity was surfaced, which evidence and representations were used, which actions were removed and why, why the selected action ranked above the alternatives, who approved it, what happened, and how the outcome fed learning. This is the regulator- and producer-facing audit surface, and it is a first-class output, not an afterthought.

4b. Second application: AI-native security operations

The same loop applies, unchanged, to security and compliance - evidence that the architecture is general, not insurance-specific. Traditional SecOps is reactive: a scanner emits thousands of alerts and waits for an operator to triage a dashboard. Here Discovery Runtime continuously watches posture and behaviour and surfaces only the high-value investigations, and each becomes a governed mission rather than a notification.

Continuous AI-native guardrails

The guardrail surface extends beyond endpoints to the risks that are specific to running agents and models in production: prompt injection, tool abuse, MCP permission drift, model-gateway/routing-policy violations, supply-chain provenance, cloud-posture misconfiguration, identity anomalies and data leakage. Each is monitored continuously - a stream of signals with deterministic thresholds - rather than by periodic scans, and correlation collapses many symptoms into one finding (the "seven missions, not ten thousand alerts" property).

Mission-based security and multi-representation evidence

A finding is not an alert; it is a proposed governed mission - Prompt Injection Investigation, Tool Abuse Investigation, Supply Chain Audit, Cloud Misconfiguration Review, Data-Leakage Investigation - carrying evidence, approvals, replay, verification and audit. Crucially, each investigation reuses the v7 representation planner (§The execution plan): rather than one fixed evidence source, the planner automatically combines documents, SQL, property graphs and temporal history and EXPLAINs the mix. A prompt-injection investigation combines the injection-signature corpus (documents), the tool-call log (SQL) and the agent→tool→resource call graph (property graph); a cloud-misconfiguration review combines the config baseline (SQL) with config drift over time (temporal); a data-leakage investigation combines egress logs, the PII-lineage graph and the secrets corpus. The chosen mix is the cheapest that clears the confidence bar.

Learning inside a deterministic policy boundary

Security policy stays deterministic: eligibility pruning removes any prohibited response before the bandit sees it, and a suppressed or legally-held subject can never receive a side-effecting action. Within that safe set, the contextual bandit learns only the operational shape - the response per finding class (block / warn / observe / ignore), investigation prioritisation, evidence ranking and escalation timing - from the delayed outcome (a real incident caught versus a false-positive override, a missed incident, time-to-resolution). The runtime learns how to respond; it never learns whether a control applies.

This is the through-line of the platform: the same Discovery → Execution Planner → Context Runtime → Mission Runtime → learn architecture runs Security & Compliance, Finance, Customer Success and Revenue & Intelligence - one decision system, four domains, not a dozen bespoke applications.

5. Formal interfaces

The layer is small enough to state precisely. Discovery Runtime:

Signal(source, subject, metric, value, observed_at, dimensions, confidence)
Detection(kind, subject, metric, severity, expected, observed, evidence)
Correlation(subject, detections, severity, related_subjects)
Hypothesis(claim, confidence, supporting_evidence, contradicting_evidence,
           verification_plan, representations)
MissionProposal(goal, subject, opportunity_class, suggested_template,
                expected_value, confidence, urgency, risk, score,
                decision, approval_policy, evidence)

Insurance Distribution:

DecisionProblem(subject, opportunity_class, eligible_action_space,
                reward_horizon_days, approval_policy)
DecisionContext(features, provenance, freshness, confidence, policy_labels)   # versioned
Action(kind, product, carrier, package, timing, channel, message_strategy,
       broker_involvement, follow_up)
RewardComponents(bound_value, retention, persistency, acceptance, ...  # positive
                 complaints, cancellation, compliance_violation, cost, ...)  # negative
Outcome(action_key, regime, components, reward, propensity, final)

Cross-cutting types make the efficiency and governance principles explicit across all three runtimes:

StateDelta(entities, invalidated_artifacts, derived_state)         # recompute only what changed
ActivationBudget(detectors, representations, planners, models,    # activate only what is relevant
                 action_candidates, limit)
EvidenceResidual(artifact, provenance, valid_until, confidence,   # reuse evidence, do not re-accumulate
                 superseded_by)
ModelSessionContract(reasoning_history, switch_compatibility,     # provider / session contract
                     context_limit, prefix_cache, autonomy)
ProactivityBudget(autonomous_action_limit, approval_threshold,    # Mission Runtime governs autonomy
                  clarification_policy, side_effect_limit)
ExecutionTopology(kind, workers, merge_policy)                     # how AI work is organized

6. Benchmark methodology

Two benchmarks make the claims measurable, both deterministic and replayable.

DiscoveryBench plants known anomalies among noise across many subjects, replays them through the runtime, and measures detection precision and recall, how many raw alerts collapse into discoveries, false discoveries, and explanation completeness. The reference implementation recovers every planted anomaly with zero false discoveries on the clean subjects, and every proposal carries its evidence and verification plan.

InsuranceDistributionBench runs a synthetic environment with a hidden best action per regime and measures discovery precision, policy-pruning correctness (a prohibited carrier/product never becomes eligible), fairness enforcement (a fairness-blocked account leaves only the governed floor), learned-versus-baseline reward lift, off-policy estimated value, and explanation completeness. The bandit converges to strongly-matching actions, beats the do-nothing baseline, and the SNIPS estimate favors the learned policy.

Honesty line. Both benchmarks are synthetic and prove the loop end to end - the machinery detects, prunes safely, learns, and evaluates offline - not a commercial performance claim. Historical or anonymized customer data provides the strongest evaluation and is required before any performance claim; a controlled live pilot is a later phase, deliberately gated.

7. Implementation status

v8 names a layer that is partly built. This ledger separates what runs today from what is planned.

CapabilityStatus
Discovery Runtime: signals/baselines, deterministic detectors, suppression + correlation, hypothesis planner, expected-value scoring, risk-aware promotion policy, Mission Runtime handoff, outcome learning, EXPLAINshipped (reference implementation, tested)
Insurance Distribution: decision schemas, context builder, deterministic eligibility/compliance pruning, contextual bandit, delayed multi-objective reward ledger, IPS/SNIPS off-policy evaluation, governed mission templates, EXPLAINshipped (reference implementation, tested)
DiscoveryBench + InsuranceDistributionBench (deterministic, replayable)shipped
Reuse of Mission Runtime (templates, evidence, approvals, replay) and Context Runtime (representation planner) via injectable seamsshipped
Delta-driven world state (StateDelta): incremental recompute of only the impacted detectors, hypotheses and missionsplanned
Sparse capability activation (ActivationBudget) across detectors, representations, planners, models and action candidatesplanned
Routing-health / anti-collapse metrics (selection entropy, action exposure, capability concentration, ESS, fallback frequency)planned
Selective evidence carry-forward (EvidenceResidual), provider session contracts (ModelSessionContract), and proactivity budgets (ProactivityBudget)planned
Context caching: reusable context identities and cache-aware, prefix-aware schedulingplanned
Execution topology: ExecutionTopology schema + topology-aware planner (single agent / coordinator-workers / voting / pipeline / hierarchical), cost-model + learned selection, topology benchmarks, EXPLAIN visualizationplanned
Projects Discovery view: prioritized queue of proposed missions, suppressed alerts, EXPLAIN, approve/dismiss/deferplanned
Production signal integrations (Doris/PostgreSQL, Prometheus/Grafana, CRM/ERP, property graphs, event sources); real vision arm for retail perceptionplanned
Insurance: entity resolution + golden records, delayed-reward calibration on historical data, controlled live pilot (one agency / narrow product), multi-agency scale with tenant isolation and regional regulation packsplanned

The reference implementations are pure-Python and dependency-light, run and test in-process, and reuse the Mission and Context runtimes through injectable seams rather than hard dependencies - so production wiring is a swap, not a rewrite.

8. What it is not

Discovery Runtime is frequently mistaken for tools it sits above or beside.

CategoryWhat it doesWhy Discovery Runtime is different
BI dashboardsDescribe what happened, on demandDiscovery decides what deserves attention and proposes a governed mission, unprompted
Alerting / monitoringFire on threshold violationsDiscovery suppresses, correlates, tests hypotheses, and ranks by decision value - seven missions, not ten thousand alerts
Rules enginesMap conditions to fixed actionsDiscovery learns the best action per regime from delayed outcomes; templates are safe envelopes, not fixed routes
Agent frameworks (LangGraph, CrewAI)Orchestrate a given task with toolsDiscovery decides whether a task should exist, then hands a governed, evidenced mission to the runtime that executes it
Forecasting / anomaly libsDetect statistical changeDiscovery uses them as detectors, then adds correlation, evidence, governance, and outcome learning on top

It is not a BI dashboard, a generic stream processor, an autonomous executive, a replacement for statistical forecasting, or a rule engine with a model attached. It is the layer that turns changes in world state into a small number of governed, evidence-backed mission proposals - and, where actions have consequences, learns which ones are worth taking.

9. The next axis: execution topology

The dimensions so far - representation, retrieval, reasoning, model, verification, and (v8) which mission and how much autonomy - all optimize the computation. A recent line of multi-agent research (Google DeepMind's evaluation of hundreds of agent configurations) points at a further axis: the coordination strategy matters more than the number of agents. Teams of agents win when work decomposes into independent subtasks; on tightly-coupled sequential work a single capable agent often beats a swarm, because coordination overhead and error propagation outweigh the parallelism.

That makes execution topology a first-class, measurable optimization variable. Given a mission, the planner should choose how the work is organized - a single agent, a coordinator with independent workers, a voting ensemble, a pipeline, or a hierarchy - rather than assume every task benefits from a larger swarm.

Mission -> Coordinator -> independent workers -> Merge -> Verification -> Commit

ExecutionTopology(
    kind="coordinator_workers",   # single_agent | coordinator_workers | voting | pipeline | hierarchical
    workers=4,
    merge_policy="verify_then_commit",
)

It extends the query-planner analogy cleanly. A relational optimizer chooses join order and whether to parallelize a scan; the AI query planner chooses the coordination topology. The choice is cost-based - quality, latency, cost, coordination overhead, verification cost, and historical success - and, like every other dimension, learned: the contextual bandit learns the best topology per mission class instead of hardcoding swarms. Governance stays where it belongs: workers remain independent, the coordinator integrates evidence and produces the final outcome, and Mission Runtime owns the merge, verification, approvals, replay and audit - so a parallel topology is still a governed, replayable mission, not an unaccountable swarm.

This axis is broad enough that it may anchor a future v9 in its own right. Here it is stated as the next optimization variable and an implementation direction; the schema and a topology-aware planner are the first steps.

10. Roadmap

The sequence progresses from replay to a controlled live pilot, never skipping a safety gate.

Conclusion

Business intelligence was organized around reports; agentic analytics is organized around missions. A dashboard says what happened. Context Runtime decides how to answer. Mission Runtime decides how to act. Discovery Runtime decides what is worth acting on - and, once an action has consequences, learns which one wins for each regime, from delayed and governed outcomes. That does not remove human judgment; it focuses human attention on a small number of evidence-backed decisions instead of manual monitoring. v8 is the proactive, self-learning layer that turns a runtime that can answer any question into one that decides which questions and missions are worth pursuing at all - and does so incrementally, measuring what changed, activating only what is relevant, and reusing what it already knows. That is the same efficiency direction frontier model architectures are converging on, held here as an infrastructure-level design rather than a model-architecture one, and it now spans the whole stack - Context Runtime, Mission Runtime, and Discovery Runtime.

Amendment (v10-era) — prediction/residual as a runtime mechanism, learned harness choice

These generalize v8's residual and self-learning loop.

Prediction → Observation → Residual

The existing EvidenceResidual becomes a general mechanism of three typed artifacts: Prediction (predicted_state · horizon · assumptions · model_or_rule · confidence · evidence), Observation (observed_state · observed_at · source · realized_data), and Residual (prediction_ref · observation_ref · mismatch_type · magnitude · affected_artifacts · proposed_investigation). Discovery never auto-revises: it creates a Residual, computes impact, proposes an Investigation, routes it through Mission Runtime, and produces a Finding or a null outcome. Applications span expected-vs-observed events, pipeline health vs incidents, retrieval quality vs verification failure, cost vs realized cost, and code-integration expectation vs test regression.

Learned harness choice and trajectory findings

The self-learning loop learns which harness strategy passes at what cost per context band — the pattern already implemented in merge()'s learner. And trajectory findings from the normalized event stream (multi-step sequences over RuntimeEvents) become Discovery inputs: a sequence that looks risky motivates a Residual and an Investigation, never automatic truth.

Context Runtime v8 (draft, not yet posted). Discovery Runtime and the insurance distribution application ship as pure-Python reference implementations with DiscoveryBench and InsuranceDistributionBench. redevops.io is a member of the NVIDIA Inception program.