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.2.0.tar.gz (42.7 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.2.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for galeed-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6081c0a99c931af8c6438b609e0948f847f8966bc0cf6575df97f11c9eb9611e
MD5 029dd0cf7cc7421b79b1799a0655221b
BLAKE2b-256 51fd2668d524870da65ec654e5e27c6cf53f9f8c933cabf963b4bb5fb0b0fd1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: galeed-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acef35dd1d69899b0f8810af72cda5b692170477a1d7855302ed1a157879d529
MD5 3b7d904ce24946fedc6fbbfbf2dc02f4
BLAKE2b-256 ae61db0572d7845c40448a25705ce13cc74201c4f9e7a8fef21eb53f078443a4

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