Skip to content

Simulation & twins

The cockpit’s pipeline has three stages:

  • Reconcile grounds the data.
  • Simulate tests what-if scenarios. This is the Hypothesis Lab.
  • Twins prepares the actions that act on the results.

This page covers the services behind Simulate and Twins, and the claims and reverse-logistics service.

Hypothesis Lab (HypothesisService)

RPCWhat it does
GetHypothesisVariablesScenario groups inferred from the estate, with each scenario’s simulation_state and the run-level swarm_census.
SimulateScenario / InteractiveSimulateRuns one scenario (or a stream of them) through the agentic ReAct loop. Returns SimulateScenarioResponse.
ValidateHypothesisChecks a scenario against the recognised rules and data.
SendToTwinsTurns a validated scenario into an action card in the Twins queue.
AnalyzeTelemetryAgentic analysis of an equipment time series.

Scenarios and the swarm

Scenarios are generated from the estate’s domains, synapses and rules. HypothesisScenario.origin records which one proposed each scenario: node, synapse or rule. In a full fetch, Phase 2 runs a bounded-parallel swarm with one agent per scenario. The cap is derived from the time budget rather than chosen:

  • Three agents run concurrently.
  • Each agent has a ceiling of 6 minutes.
  • The swarm’s budget is 25 minutes.
  • That gives 4 waves of 3, so at most 12 agents per run.

A scenario the cap left out is marked, not hidden. HypothesisScenarioState takes one of these values:

StateMeaning
SIMULATEDDispatched, and the agent produced a result.
FAILEDDispatched, but the agent produced no result. Causes include a guardrail block, a TOON parse failure, the per-agent ceiling, or the budget running out.
CAPPEDInferred, but never dispatched because of the cap.
NOT_IN_RUNNewer than the recorded run.
UNSPECIFIEDUnknown. This is neither a success nor a failure.

HypothesisSwarmCensus records scenarios_inferred, agents_dispatched, agents_succeeded, capped, agent_cap, the source of the roster, and computed_at.

A simulation returns:

  • Decision scenarios.
  • Impacts (metric, change percentage, risk level and horizon).
  • Evidence traces (source_node → relation → target_node).
  • Forecasts with intervals.
  • Anomalies.

The swarm’s aggregate is a union of independent answers, not a consensus.

Validation

ValidateHypothesis is a deterministic check, not a model call:

  • valid_data is true when a fetch has grounded the instance, meaning a rules or posture snapshot exists.
  • valid_logic also requires that none of the scenario’s reconciled rules is in drift, shadow, missing or conflict. Each such rule becomes a risk_flags entry.
  • rationale explains the verdict.

Digital twins (TwinsService)

RPCWhat it does
StreamTwinsInteractive twin reasoning. It takes text, audio, video frames or a document, and can ground itself in the posture snapshot and recognised rules (ground_with_knowledge, focus_domains, scenario_context). Streams thoughts, Decisions and tool calls. The query is checked by ai.SanitizePrompt first.
GetActionQueue / ExecuteActionThe action queue and the human decision. See Action cards & money.
OptimizeRouteComputes a route through the session’s Google Routes connector and returns distance, duration and polyline.
QuickAskRetrieval-based Q&A for S&OP and inventory questions.
UploadAnalyzeRoot-cause or savings analysis of an uploaded CSV, Excel or PDF file.
GenerateRoadmapA phased transformation roadmap (Digitize, Connect, Analyze, Automate) from maturity scores.
GetSavingsSummaryPipeline savings and approved savings.
SubmitFeedbackRecords feedback on a generated response to the durable record store.

Refusals are errors, not empty cards.

  • OptimizeRoute returns Unavailable when there’s no routing connector or no route, rather than a card with blank measurements. cost_savings is left empty, because the routing provider returns no cost.
  • GenerateRoadmap leaves estimated_investment_usd and expected_roi_percent at zero, which means “not estimated”. Nothing derives those figures, so the roadmap describes a plan, not a measurement.

Claims and reverse logistics (ClaimsAgentService)

TriageReturnItem is a fixed rule over the condition grade the caller states:

condition_codeDisposition
PRISTINE / ARESTOCK
DAMAGED / BREFURBISH
DEFECTIVE / CRECYCLE
EXPIRED / DLANDFILL
  • A missing return_id or condition_code, an unknown grade, or a negative value is refused with InvalidArgument. An unknown grade is never a decision to destroy stock.
  • estimated_recovery_yield_usd, refurbishment_cost_usd and routing_destination aren’t derived, because FACE holds no pricing, cost or facility data for returns. basis_note says so on every response.

ProcessReverseLogistics refuses without a record. It needs a record behind the claim, the return authorisation and the receiving log. Without one it answers FailedPrecondition rather than inventing dispositions or fraud patterns from identifiers alone.

Reverse-logistics outcomes that rest on records are produced as RETURN_DISPOSITION evidence documents. See Evidence documents.

What this does not establish

  • A simulation is a model’s reasoning over grounded context. It isn’t a measured outcome, and its confidence is the model’s own.
  • The swarm results cover only the scenarios that ran. Read the census before treating the results as covering the estate.
  • Passing validation means the rules are consistent. It doesn’t mean the scenario will happen.
  • A triage disposition follows the stated grade, not an inspection. It’s only as good as the grade the caller supplied.