Skip to main content

Observability tooling for agent harness sessions, imports, and reports.

Project description

Harness Observability Layer

Minimal MVP for instrumenting an agent harness and generating observability metrics from canonical events.

Security And Privacy

HOL is a local-first analysis tool.

  • hol import, hol analyze, hol report, hol list, hol portfolio, and hol failures operate on local files.
  • HOL does not upload imported conversations, prompts, tool outputs, or reports by default.
  • HOL stores imported raw sessions and derived artifacts only in local paths you control.
  • Some metrics such as total_lines and read coverage are optional local enrichments derived from the current filesystem state.

Privacy controls available now:

  • --no-raw-copy
  • --no-resolve-files
  • --redact-sensitive

Additional review docs:

Install

pip install harness-observability-layer

This exposes the unified CLI:

hol --help

You can also invoke the package directly:

python -m harness_observability_layer --help

Development Install

For local development from this repository:

pip install -e .

For release validation and packaging tooling during development:

pip install -e .[dev]

What exists

  • canonical event model
  • append-only JSONL logger
  • observable file and shell adapters
  • minimal harness runner
  • offline analyzer
  • mocked session example
  • Codex session importer
  • Claude Code session importer
  • Codex runtime wrapper for codex exec --json

Quick start

After pip install harness-observability-layer, the most common path is to point hol at an existing local session archive:

hol import latest
hol analyze latest --format markdown

For repository-local development, the bundled example remains available:

PYTHONPATH=src .venv/bin/python examples/mock_session.py

This writes events to a per-session file like /tmp/harness_observability_layer/sess_xxxx.events.jsonl and prints a derived metrics summary.

By default the example writes runtime data to /tmp/harness_observability_layer/events.jsonl so it can run cleanly in sandboxed environments.

Import an existing Codex session

hol import session ~/.codex/archived_sessions/rollout-YYYY-MM-DDTHH-MM-SS-....jsonl

Privacy-oriented variant:

hol import session ~/.codex/archived_sessions/rollout-YYYY-MM-DDTHH-MM-SS-....jsonl --no-raw-copy --no-resolve-files

This now creates a session artifact folder inside the project:

  • hol-artifacts/sessions/<session-name>/raw.codex.jsonl
  • hol-artifacts/sessions/<session-name>/normalized.events.jsonl
  • hol-artifacts/sessions/<session-name>/summary.json
  • hol-artifacts/sessions/<session-name>/report.html
  • hol-artifacts/sessions/<session-name>/report.css

It also refreshes:

  • hol-artifacts/sessions/index.html

Import the latest archived Codex session

hol import latest

This picks the most recently modified eligible rollout-*.jsonl from ~/.codex/archived_sessions and imports it into the project. Sessions whose recorded cwd points at a different directory are skipped. Sessions without a usable cwd are still eligible as a fallback.

Import a Claude Code session

hol import claude-session ~/.claude/projects/<project>/<session>.jsonl

This imports a Claude Code JSONL session into canonical events and stores it under:

  • hol-artifacts/sessions/claude-<session-name>/raw.claude.jsonl
  • hol-artifacts/sessions/claude-<session-name>/normalized.events.jsonl
  • hol-artifacts/sessions/claude-<session-name>/summary.json
  • hol-artifacts/sessions/claude-<session-name>/report.html

To import the latest Claude session from the default archive tree:

hol import claude-latest

Like hol import latest, this filters out archived sessions whose recorded cwd clearly belongs to another directory. Sessions without a usable cwd remain eligible.

Import all archived Codex sessions

hol import all

This imports every eligible rollout-*.jsonl from ~/.codex/archived_sessions. Sessions whose recorded cwd points at a different directory are skipped. Sessions without a usable cwd are still imported.

By default:

  • existing imported session folders are skipped

To force reimport:

hol import all --reimport

Summarize and compare imported sessions

hol list --limit 5
hol analyze latest --format markdown
hol analyze compare <session-a> <session-b>
hol report markdown <session-id>
hol report markdown <session-id> --redact-sensitive

Run Codex with observability capture

From the published package, use the hol CLI for imports, summaries, comparisons, and reports. The live Codex runtime wrapper below remains a repository-local helper script:

PYTHONPATH=src .venv/bin/python scripts/run_codex_observed.py \
  "Say only OK" \
  --cwd /path/to/project

This wrapper:

  • runs codex exec --json
  • saves the raw Codex JSONL stream
  • normalizes it into canonical events
  • writes summary.json
  • writes a styled report.html
  • prints a metrics summary

By default, live runs are saved under hol-artifacts/live_runs/run_###/.

Open the HTML report

After an import or live run, open the generated report.html file from the corresponding artifact folder. The page is static and does not require a server.

To browse imported sessions, open:

  • hol-artifacts/sessions/index.html

In restricted environments, running Codex itself may still require broader filesystem or network access than the parser/importer.

The legacy scripts remain available, but the package/CLI surface is now the recommended interface.

Citation

If you use this project in research, documentation, or derivative tooling, please cite it using CITATION.cff.

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

harness_observability_layer-0.1.2.tar.gz (57.5 kB view details)

Uploaded Source

Built Distribution

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

harness_observability_layer-0.1.2-py3-none-any.whl (60.3 kB view details)

Uploaded Python 3

File details

Details for the file harness_observability_layer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for harness_observability_layer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 99c914397e980b7c5efffea13fc1ce032cf2de33d6c2b36d997286c00869fce6
MD5 325cfc61a16bfdfb04ac3b66866d1986
BLAKE2b-256 cc6e2a24d66106e00a0b6817e28f95622cad3eb16373236a4c575b0066597dde

See more details on using hashes here.

Provenance

The following attestation bundles were made for harness_observability_layer-0.1.2.tar.gz:

Publisher: release.yml on alexandrelira99/harness_observability_layer

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

File details

Details for the file harness_observability_layer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for harness_observability_layer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d8309ac3278f2df87ae12831af504deb72fb07e507530a47e49ad89f59a31194
MD5 e78832e54c0c9dabc49c11fb02cc80fd
BLAKE2b-256 62afc0d7b2a429955d3a99d9a782f0a4b617fa912fa90a9a0ad1dfdc57487520

See more details on using hashes here.

Provenance

The following attestation bundles were made for harness_observability_layer-0.1.2-py3-none-any.whl:

Publisher: release.yml on alexandrelira99/harness_observability_layer

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