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.3.0.tar.gz (37.6 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.3.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_hats_observe-0.3.0.tar.gz
  • Upload date:
  • Size: 37.6 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.3.0.tar.gz
Algorithm Hash digest
SHA256 69f71263695a9d2e7f2bcfbcec243227734e7e71184add362de64f6b1cbf4967
MD5 bb46c991ef9f2f56884fb8151d952418
BLAKE2b-256 355f9b4e154bd53711f2a819851368681c1edaccf53f5a9ac6d4d835ff3b3dff

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_hats_observe-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_hats_observe-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c3f11778bd815a46eab1d37580feef9f99daed95fadcc0418955c77cbcec804
MD5 31c32acc212207c276adccceb51645e6
BLAKE2b-256 51ed58e2fa4c441514d546551bf30cec776f231c80f3e1b33de42c68623a8b96

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_hats_observe-0.3.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