Skip to main content

Session logging engine for the ai-hats framework — session lifecycle, versioned trace/audit schema, and a surface-agnostic transcript-parser adapter.

Project description

ai-hats-observe

A standalone session-logging engine: open a session on a bare directory, append trace entries, write an incremental audit, and finalize a versioned metrics.json — with no configuration, no worktree engine, and no ai-hats.yaml.

ai-hats-observe is the observability core extracted from the ai-hats framework (ADR-0014 Phase 1, T15). It has no dependency on the ai-hats integrator: everything below runs against a plain directory. Its only runtime dependency is ai-hats-core (dependency-free filesystem primitives + the migration seam).

What it owns

  • Session lifecycleSessionManager / Session: allocate a session directory, resolve its artifact paths, list/filter past sessions.
  • Trace + audit writerlog_trace, init_audit, append_audit, finalize_audit; the enriched AuditWriter that turns a transcript into audit.md + a versioned metrics.json.
  • Versioned trace/audit schema — a schema_version on the metrics surface, with a wired (initially empty) migration seam.
  • Surface-agnostic parsing — a TranscriptParser adapter: the AuditWriter holds no provider-specific parsing; the concrete ClaudeParser (structured JSONL + trace-chrome fallback) is one implementation. A new surface (Gemini, or a future CLI) plugs in its own parser — the writer never changes.

Extending to a new surface

The parser is carried by the session's provider, not a central registry: a Provider yields its TranscriptParser, and the integrator injects it into the AuditWriter. Adding a surface means shipping a parser that satisfies the TranscriptParser protocol and a provider that names it — no edit to ai-hats-observe internals.

Dependency direction

ai-hats-observe imports only ai-hats-core and the standard library. It never imports the ai-hats integrator; ai-hats imports from here. The boundary is enforced by an AST import-lint (test_observe_boundary.py).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_hats_observe-0.2.0.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_hats_observe-0.2.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file ai_hats_observe-0.2.0.tar.gz.

File metadata

  • Download URL: ai_hats_observe-0.2.0.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_hats_observe-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9316f93c50fec4ad813948c74096e0cee0a0482ac9227cfd34ed5ad0acf9ddf1
MD5 d5dea9542f67fdeb40ba0b5f4b2a2db9
BLAKE2b-256 e415b7350c2ab41b9c6f0d403d118f2e031cdc657d09f9f92c3e9f68fe7948b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_hats_observe-0.2.0.tar.gz:

Publisher: release-packages.yml on muratovv/ai-hats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_hats_observe-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_hats_observe-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27e2a4f5b54dfc8426e68be78e4c771812fc8aab449e2f914181d8cd23bb6efd
MD5 8b80907b59122f6d4b1c9b5282108acb
BLAKE2b-256 a7c317acd6a7db75c6422370853c2788b45ecfb556fe3165e61a720a1bec824f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_hats_observe-0.2.0-py3-none-any.whl:

Publisher: release-packages.yml on muratovv/ai-hats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page