packages feed

shikumi-trace-0.3.0.1: shikumi-trace.cabal

cabal-version: 3.4
name: shikumi-trace
version: 0.3.0.1
synopsis:
  Hierarchical tracing, observability, and deterministic replay for shikumi (EP-7)

category: AI
description:
  Hierarchical (nested) tracing and deterministic offline replay for shikumi.
  Running a program inside the @Trace@ effect produces a /tree/ of spans (program
  / module / combinator / LM-call), captured by interposing on EP-1's @LLM@
  effect — so each provider call becomes a leaf span carrying model, latency,
  tokens, cost, and the EP-6 content-addressed cache key. The tree pretty-prints
  to the terminal and serializes to a stable JSON trace file; @runLLMReplay@ then
  re-runs the same program with the network disabled, serving every call from the
  recording (and raising a precise @ReplayDivergence@ for any unrecorded call).

license: BSD-3-Clause
author: Nadeem Bitar
maintainer: nadeem@gmail.com
build-type: Simple
extra-doc-files: CHANGELOG.md

common common-options
  ghc-options:
    -Wall
    -Wcompat
    -Widentities
    -Wincomplete-uni-patterns
    -Wincomplete-record-updates
    -Wredundant-constraints
    -fhide-source-paths
    -Wmissing-export-lists
    -Wpartial-fields
    -Wmissing-deriving-strategies

  default-language: GHC2024
  default-extensions:
    DeriveAnyClass
    DuplicateRecordFields
    OverloadedLabels
    OverloadedStrings

library
  import: common-options
  hs-source-dirs: src
  exposed-modules:
    Shikumi.Trace
    Shikumi.Trace.Demo
    Shikumi.Trace.Feedback
    Shikumi.Trace.Internal.Spike
    Shikumi.Trace.Node
    Shikumi.Trace.Observation
    Shikumi.Trace.Program
    Shikumi.Trace.Replay
    Shikumi.Trace.ResponseJSON
    Shikumi.Trace.Store

  build-depends:
    aeson >=2.2 && <2.3,
    baikai >=0.7.1.0 && <0.8,
    base >=4.20 && <5,
    bytestring >=0.11 && <0.13,
    containers >=0.6 && <0.9,
    directory >=1.3 && <1.4,
    effectful >=2.6 && <2.8,
    generic-lens >=2.2 && <2.4,
    lens ^>=5.3,
    scientific >=0.3 && <0.4,
    shikumi ^>=0.4.0.0,
    shikumi-cache ^>=0.2.0.1,
    text ^>=2.1,
    time >=1.12 && <1.17,
    vector >=0.13 && <0.14,

executable shikumi-trace-demo
  import: common-options
  hs-source-dirs: app
  main-is: Main.hs
  ghc-options:
    -threaded
    -with-rtsopts=-N

  build-depends:
    base,
    shikumi-trace ^>=0.3.0.1,

test-suite shikumi-trace-test
  import: common-options
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Main.hs
  ghc-options:
    -threaded
    -with-rtsopts=-N

  other-modules:
    ObservationSpec
    TraceFixtures

  build-depends:
    QuickCheck,
    aeson,
    baikai >=0.7.1.0 && <0.8,
    base,
    bytestring,
    containers,
    effectful,
    generic-lens,
    lens ^>=5.3,
    shikumi ^>=0.4.0.0,
    shikumi-cache ^>=0.2.0.1,
    shikumi-trace ^>=0.3.0.1,
    tasty,
    tasty-hunit,
    tasty-quickcheck,
    temporary,
    text ^>=2.1,
    time,
    vector,