Skip to content

[Mongoose] Add shared Execution Traces for capability runs #168

Description

@Nickel85

Goal

Add shared Execution Traces for capability runs so Mongoose can debug, evaluate, replay, and eventually optimize capability workflows without each capability inventing a private trace format.

Execution traces support the future Loop Runtime but are useful before it exists. They should capture what happened during a capability execution while preserving the local-first, secret-safe runtime model.

Roadmap Position

This extends existing observability, job logging, shared memory, and Njord finance audit/replay work. It does not replace domain audit records. Domain capabilities still decide what their decisions mean; Mongoose provides a common trace envelope for decisions, tool usage, state updates, and outcomes.

This fits the stable local runtime/observability runway better than the v0.9 shared memory milestone. v0.9 may store memory records that traces later reference, but it should not be forced to deliver the complete cross-capability trace system.

Execution Trace Scope

Capability executions should log structured trace events for:

  • selected agent and capability
  • goal/request context
  • loop definition or direct entrypoint used
  • decisions and validation results
  • tool calls and provider access, with secret redaction
  • state reads and state updates, using references where raw data is sensitive
  • prompt/template references and model/provider metadata where applicable
  • exit criteria checks
  • output contract validation
  • final outcome, errors, warnings, and user decisions

Traces should support debugging, evaluation, future optimization, prompt-context retrieval, and replay-safe summaries.

Acceptance Criteria

  • Defines a provider-neutral execution trace envelope for capability runs.
  • Supports both future Loop Runtime executions and existing direct capability executions.
  • Captures decisions, tool usage, state references, validation results, exit criteria, and outcomes.
  • Redacts secrets and avoids storing unnecessary PII.
  • Stores traces under local-first Mongoose state/logging contracts.
  • Links trace records to job ids, capability ids, memory records, and domain audit records when available.
  • Defines replay-safe summaries for future analysis and prompt context.
  • Makes trace collection inspectable through existing or planned run/job/status observability surfaces.
  • Includes tests or fixtures for deterministic, LLM-assisted, failed, and user-aborted executions.

Non-goals

  • Do not make traces an auto-approval mechanism.
  • Do not require traces to store full raw prompts, raw provider payloads, or sensitive external data.
  • Do not replace Njord finance audit records, commerce decision logs, or other domain-specific audit models.
  • Do not require the full shared Loop Runtime to exist before direct-entrypoint capabilities can emit traces.

Depends On

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: architectureRuntime architecture, contracts, boundaries, and reusable capability designarea: capability-runtimeCapability declarations, runtime contracts, provider abstraction, and execution decouplingenhancementNew feature or requestroadmap: mongooseMongoose platform/runtime roadmap track

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions