interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / docs / plans / tracing / DESIGN-398.md

119 lines · 10444 bytes Raw Blame History Source

Unified execution tracing (aien-sovereign-core#398): design and limits

Owner: campaign session 1ea888, 2026-10-10. Branch feat/unified-execution-tracing-398. Inventory of the identifiers this joins on: INVENTORY-398.md (same folder). Crate: crates/aien-trace (serde and serde_json only).

What a trace is, and is not

A trace is a correlation record: one event per boundary crossing of one run, each with a parent, joined by stable ids that already exist in the runtime. It is observational. It never authorizes anything (the AuthorizedEffect mint and the compose grant stay where they are), and it is never proof: proof is the compose ledger with its record marks, the effect receipts, the generation record and the independent verifier (tools/aien-verify). Every event points at proof by digest or relative path and carries no prompt, tool argument, model output, file path or memory item; the type system enforces that (the only free text is a 64 byte note with <, > and control characters removed, and the runtime writes only fixed labels and refusal names into it).

Field mapping (contracts C1 and C2 in ~/workspace/six-issues/COORDINATION.md)

Event fieldSourceNote
trace_idswarm: TraceId::derive(root_world_id, swarm_id, 0) per swarm; compose daemon: one per ComposeBridge (derived from start time and pid); when a request came through Interplane the Interplane trace_id (32 lowercase hex) is copied into ids.interplane_trace_idC1: Interplane's id is the cross-boundary join key; AIEN never re-mints it
ids.interplane_message_id, ids.interplane_request_idInterplane envelope and CapabilityRequest idsC1, bounded to 64 chars
statusone to one with the AEGIS FailureClass plus okC2: rejected also covers Interplane denied, not_found, invalid; approval_pending is terminal for the attempt and not a failure
effect_certaintyno_effect, uncertain, effect_occurredC2 EffectCertainty; uncertain is aien-mcp CallOutcome::Uncertain or a compose intent settled UNRESOLVED, and is never retried by anything that reads a trace
refs.intent_digestaien_mcp::authority::intent_digestnames the intent, never its arguments
refs.effect_receipt_digestaien_mcp::receipt_digest (canonical encoding with sorted keys, sha256)the receipt itself stays in the ledger
ids.generation_recordcompose ledger record id from write_task_generationevidence pointer
ids.decision_idcompose: the cx promotion (authorize) or the commit record id (model turn)what was decided about
ids.grant_idcompose grant record id, or the broker approval id hexauthorization pointer, not authority
ids.tool_request_idcompose effect intent record id, or the broker tool request idone effect attempt

Where events are emitted

StageSiteEvent, status
swarm launchSwarmManager::launch_swarmswarm_launched ok (root event of the swarm trace)
branch forkSwarmManager where branch worlds and sequences are createdbranch_forked ok, parent root
admission, preemptionTraceDecisionObserver (aien-runtime trace_observer.rs) on the scheduler's existing DecisionObserver tap; admitted from admission_examined verdicts AdmittedPrefill/AdmittedDecode, preempted from choice.preemptedsequence_admitted, sequence_preempted
branch finishednote_sequence_finishedsequence_finished ok
cancelcancel_swarmswarm_cancelled cancelled
broker authorityEffectLane::authorize (aien-mcp)authority_decided ok / approval_pending / rejected, note = reason label (provider_not_admitted, refused, ...)
broker effectEffectLane::execute (Finished, Rejected, Uncertain, ledger replay, in-flight duplicate)effect_executed ok+effect_occurred / rejected+no_effect / uncertain / in_flight; child of the lane's parent event (an AuthorizedEffect carries no event id)
compose model turnComposeBridge::run_task_inner after the commit record is writtenmodel_turn ok with generation_record and decision_id = commit id, note compose_commit or uncommitted; proposer error: model_turn failed, note proposer_error
compose authorityeffects::authorizeauthority_decided ok (grant_id = grant record) / rejected+no_effect (note = refusal name) / failed
compose intenteffects::open_intenttool_requested ok (tool_request_id = intent record, grant_id) / rejected (refusal name) / failed
compose ackeffects::ackeffect_executed ok+effect_occurred (DONE) / rejected+no_effect (NOT_DONE: the world check says the effect did not happen, a definite no-effect outcome, not "ran and errored") / uncertain+uncertain (UNRESOLVED) / rejected (refusal name) / failed (other error)
compose reconcileeffects::reconcile (also reconcile_at_start)result_received ok (note = caller label) or failed (reconcile_failed), one per call, tool_request_id when one intent was declared

The compose bridge's first event is the root of its trace and every later event is its child (the bridge has no per-task context today; the ids join the rows). The scheduler crate is not modified. No event is emitted from inside a kernel launch, a KV block operation or a decode step.

Exporter, cardinality, buffering, retention

Tamper statement

Editing, deleting or forging exported events changes nothing the runtime decides: execute needs an AuthorizedEffect, which only EffectLane::authorize mints; the compose daemon executes only against a grant in its ledger under a record mark; tools/aien-verify reads the ledger and receipts, not traces. A forged authority_decided ok event is just a line in a file. The provenance guard test (provenance_is_read_by_no_decision_code) still holds: the trace wrappers read the response, never the provenance fields.

Overhead (measured; numbers in the PR body)

crates/aien-runtime/tests/trace_overhead_benchmark.rs runs the same 64-branch swarm workload on the reference CPU backend with NullSink and with MemorySink and prints elapsed milliseconds (TRACE_OVERHEAD kind=... elapsed_ms=...). The PR body records release-build numbers with host, commit and load at the time. The LINEAR and BRANCH model-serving cases of the issue are not measured here: the swarm workload has no model forward pass, so the measured overhead is that of the scheduling and event path only.

Limits

Recorded from the independent review of PR #400 (2026-10-10, 0 blocking, 9 minor)

Fixed before merge: NOT_DONE is rejected + no_effect (was failed); the exporter refuses a symbolic link at the path and resets the mode to 0o600 on every flush; the compose emit sites check trace_enabled() before building ids. Kept as limits of this version: