Skip to main content

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 lifecycle — SessionManager / Session: allocate a session directory, resolve its artifact paths, list/filter past sessions.
  • Trace + audit writer — log_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.

Session privacy

New session directories are created with mode 0700. Sensitive artifacts are created and rewritten with mode 0600, including prompts, role materialization, traces, audits, metrics, transcripts, reasoning, usage, and raw PTY captures. These permissions are enforced independently of the caller's umask and apply to every provider that uses the observe session API. Existing session trees are not migrated or rewritten.

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

Metadata

Release files for ai-hats-observe 0.24.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-hats-observe 0.24.1
File Size Uploaded Provenance Actions
ai_hats_observe-0.24.1.tar.gz 144.8 kB With provenance Details for ai_hats_observe-0.24.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-hats-observe 0.24.1
File Interpreter ABI Platform Actions
ai_hats_observe-0.24.1-py3-none-any.whl Python 3 none any Details for ai_hats_observe-0.24.1-py3-none-any.whl

Total release size: 234.2 kB

Release files / ai_hats_observe-0.24.1.tar.gz

Download URL ai_hats_observe-0.24.1.tar.gz
Size 144.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8ffb37770c4dc59ffd16edcee94e45ebdfa97bcf82773b0748e61dbb43bc7902
BLAKE2b-256 checksum
How to use checksums
68cde5cf1199dc96420bcc8e0f9efbdfeda60c120ecd3354c706607ac3a27a4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / ai_hats_observe-0.24.1-py3-none-any.whl

Download URL ai_hats_observe-0.24.1-py3-none-any.whl
Size 89.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a50b47c350ea23b5483d67cc758640bc891f90b0f7a0b39bc542ee25b55d127
BLAKE2b-256 checksum
How to use checksums
04c6569efb5672f60fb2d98bfdeda1ea5147723cc64886c13fc2324dc4e5cfde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for ai-hats-observe 0.24.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_hats_observe-0.24.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page