packages feed

shikumi-trace-0.2.0.0: shikumi-trace.cabal

cabal-version:   3.4
name:            shikumi-trace
version:         0.2.0.0
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.Program
    Shikumi.Trace.Replay
    Shikumi.Trace.ResponseJSON
    Shikumi.Trace.Store

  build-depends:
    , aeson
    , baikai         >=0.3      && <0.4
    , base           >=4.20     && <5
    , bytestring
    , containers
    , directory
    , effectful
    , generic-lens
    , lens           ^>=5.3
    , scientific
    , shikumi        ^>=0.3.0.0
    , shikumi-cache  ^>=0.1.2.0
    , text           ^>=2.1
    , time
    , vector

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.2.0.0

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:  TraceFixtures
  build-depends:
    , aeson
    , baikai            >=0.3      && <0.4
    , base
    , bytestring
    , containers
    , effectful
    , generic-lens
    , lens              ^>=5.3
    , QuickCheck
    , shikumi           ^>=0.3.0.0
    , shikumi-cache     ^>=0.1.2.0
    , shikumi-trace     ^>=0.2.0.0
    , tasty
    , tasty-hunit
    , tasty-quickcheck
    , temporary
    , text              ^>=2.1
    , time
    , vector