Skip to main content

Galeed

The cross-project trace/log spine — "heap of witness" (Genesis 31:48).

Galeed is the family's shared logging capability: a structured event stream that separates process telemetry (what the system did, step by step) from the final output (the answer). It is intentionally dependency-free (pure stdlib) so any project can adopt it.

In Genesis 31, Laban and Jacob raise one memorial heap and give it two names — Galeed ("heap of witness", the record itself) and Mizpah ("watchtower", the one who watches over it). The family keeps the pair: Galeed records; Mizpah views.

What it provides

  • events — a structured event vocabulary (EventType, TraceEvent, stable ids). Self-contained and extensible.
  • recorderTracer: created once per request/operation; emits events, persists them, and exposes query helpers.
  • bus — a process-wide in-process pub/sub (TraceBus) for live streaming (e.g. SSE to a process panel or a dev-log window).
  • feedback — lightweight feedback events tied to a trace.
  • cairnemit_cairn_observation(...), a tiny bridge for events that Huldah can analyse as human-load and agent-effectiveness evidence. The module and cairn_kind key keep the Cairn name: it is the observation format, not the analyser (which was renamed in the Deborah/Huldah split).
  • llm_calls — the LLM debugging layer: one document per model call with the COMPLETE input (prompt or messages list) and COMPLETE output, a human step_name, and parent_call_id chains for recursive flows. Spine events stay lean; the heavy payloads live here. Wrap direct calls with capture_llm_call(...); Hoglah records every job automatically.
from galeed import Tracer, EventType, get_bus, record_llm_call, capture_llm_call
from galeed import emit_cairn_observation

Viewers

  • galeed trace (CLI, pip install galeed[cli]) — the clean In→Out call tree for every source: chains nested, --verbose for the technical layer, filters (--session/--trace/--source/--step/--call/--status/--since), --follow live tail, --json export (works without the extra).
  • galeed sessions / galeed events — spine summaries and raw events.
  • galeed serve (pip install galeed[web], default port 8785) — the HTTP trace API browser viewers read: Tirzah-compatible /api/trace/* shapes, /api/llm-calls, and an SSE tail. Mizpah points here by default.

Connection: --mongo-uri/--mongo-db or GALEED_MONGO_URI / GALEED_MONGO_DB (default mongodb://localhost:27017 / mnemosyne_dev).

Who emits into it

Any family project — Tirzah, Mahalath, Hoglah, Deborah, Huldah, Milcah — emits its process telemetry through Galeed. Mizpah is the viewer over what Galeed records.

When a product wants Huldah to read an event as human-facing observation evidence, emit it through the Cairn-format bridge:

emit_cairn_observation(
    tracer,
    kind="agent_output",
    message="Generated recommendation without authority citation.",
    tags=["missing_evidence"],
    human_systems=["trust calibration", "uncertainty management"],
    duration_ms=4200,
)

This stores a normal Galeed trace event with metadata.cairn_kind, tags, human_systems, duration_ms, and the standard correlation ids already carried by the tracer.

Schema discipline

Events carry a schema_version (galeed.SCHEMA_VERSION); bump it only on a backwards-incompatible change to the event shape (new event types are additive and need no bump). For cross-repo joins, populate the standard CORRELATION_KEYS (request_id, session_id, trace_id, plan_id, job_id) — galeed.correlation_ids(event) reads them back from fields + metadata so a trace can be stitched across projects.

Develop

Works the same on native Linux and WSL — stdlib-only, no platform-specific steps.

pip install -e ".[dev]"   # pytest lives in the dev extra
pytest

Hook bridges for coding agents

Galeed includes bridges so external coding agents (Codex CLI, Claude Code, Cursor) can stream their lifecycle into the family trace spine.

Install the hook command (requires the cli extra for Mongo):

pip install "galeed[cli]"

Example Codex config (~/.codex/config.toml):

[hooks]
SessionStart = ["galeed-codex-hook", "SessionStart"]
PreToolUse   = ["galeed-codex-hook", "PreToolUse"]
PostToolUse  = ["galeed-codex-hook", "PostToolUse"]
Stop         = ["galeed-codex-hook", "Stop"]

The handler reads JSON from stdin (Codex hook payload) and emits events with source="codex" (types like codex.sessionstart, codex.posttooluse, codex.tool.started, etc.). Use the same GALEED_MONGO_* env vars.

See the integration plan in the Noa docs for full context and phased rollout (Phase 0 is a minimal trace spike using a single PostToolUse hook).

Download files

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

Source Distribution

galeed-0.3.1.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

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

galeed-0.3.1-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file galeed-0.3.1.tar.gz.

File metadata

  • Download URL: galeed-0.3.1.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for galeed-0.3.1.tar.gz
Algorithm Hash digest
SHA256 75f05082476c6bdf4334fbd2bf3ceefb9f6d2b0634ad3ca52f1a058d5b31fe3a
MD5 5eaf37c9347121173ad09722b8967249
BLAKE2b-256 ecbbe070ecd4051d6077626bf120705bf702ba9553781953556c7dfbeb54a4ca

See more details on using hashes here.

File details

Details for the file galeed-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: galeed-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for galeed-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0dc613c4fe8de63f62a2f9b749c98e8e7a3dd284cbad7203180fa1690d5399c7
MD5 9bb7d8e58a04b848dc9342e1b57b382f
BLAKE2b-256 fe716da2e7fc6071f8631c5fadbd3eb3b09b2c57bdd393d382fa0f5245ee6822

See more details on using hashes here.

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