Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
c6b682f
feat: add itmux observability file fanout
NeuralEmpowerment Jul 7, 2026
0e8e7ca
docs: add modular observability ADR
NeuralEmpowerment Jul 7, 2026
d6ad705
experiments: hypothesis for observability claude hook file fanout
NeuralEmpowerment Jul 7, 2026
e08005b
experiments: hypothesis for observability codex token cost surface
NeuralEmpowerment Jul 7, 2026
678dd76
experiments: hypothesis for langfuse otel ingestion smoke
NeuralEmpowerment Jul 7, 2026
f259b31
experiments: hypothesis for observability langfuse otel export
NeuralEmpowerment Jul 7, 2026
644c1bc
experiments: run observability claude hook file fanout (inconclusive)
NeuralEmpowerment Jul 7, 2026
3b5b7d0
experiments: run observability codex token cost surface (go)
NeuralEmpowerment Jul 7, 2026
fbaa5ad
experiments: run langfuse otel ingestion smoke (no-go)
NeuralEmpowerment Jul 7, 2026
ef7fb63
experiments: run observability langfuse otel export (no-go)
NeuralEmpowerment Jul 7, 2026
aa62845
docs: sync observability design with experiment results
NeuralEmpowerment Jul 7, 2026
cb6e971
experiments: track langfuse smoke preflight response
NeuralEmpowerment Jul 7, 2026
968599e
feat: add codex exec observability observer
NeuralEmpowerment Jul 7, 2026
da63eee
feat: wire codex exec observer command
NeuralEmpowerment Jul 7, 2026
837170f
experiments: hypothesis for observability codex exec observer wiring
NeuralEmpowerment Jul 7, 2026
c675f18
experiments: run observability codex exec observer wiring (go)
NeuralEmpowerment Jul 7, 2026
a6c2b2d
experiments: hypothesis for observability claude credential health
NeuralEmpowerment Jul 7, 2026
ce3a28f
experiments: classify claude credential health blocker
NeuralEmpowerment Jul 7, 2026
7764245
fix: pass claude oauth token into docker workspace
NeuralEmpowerment Jul 7, 2026
a141543
experiments: hypothesis for claude env token passthrough
NeuralEmpowerment Jul 7, 2026
3c19bfe
experiments: run claude env token passthrough
NeuralEmpowerment Jul 7, 2026
037e614
experiments: hypothesis for claude hook fanout after auth
NeuralEmpowerment Jul 7, 2026
4715cf7
experiments: run claude hook fanout after auth
NeuralEmpowerment Jul 7, 2026
48e7a89
experiments: hypothesis for baked claude hook runtime
NeuralEmpowerment Jul 7, 2026
6cce1c5
experiments: run baked claude hook runtime
NeuralEmpowerment Jul 7, 2026
b637464
feat: collect claude hook events through sink
NeuralEmpowerment Jul 7, 2026
f5b801e
experiments: hypothesis for claude hook sink capture
NeuralEmpowerment Jul 7, 2026
48e72dd
experiments: run claude hook sink capture
NeuralEmpowerment Jul 7, 2026
59bfb8a
feat: bake observability runtime into itmux image
NeuralEmpowerment Jul 7, 2026
129aacd
experiments: hypothesis for stock itmux hook sink
NeuralEmpowerment Jul 7, 2026
a62a7d9
experiments: run stock itmux hook sink
NeuralEmpowerment Jul 7, 2026
9f81edf
docs: align observability ADR with stock hook proof
NeuralEmpowerment Jul 7, 2026
2a5e62d
chore: clean hook sink experiment artifact
NeuralEmpowerment Jul 7, 2026
87cab47
docs: document observability hook sink
NeuralEmpowerment Jul 7, 2026
4064579
experiments: hypothesis for langfuse otlp preflight
NeuralEmpowerment Jul 7, 2026
b6f84b6
experiments: run langfuse otlp preflight
NeuralEmpowerment Jul 7, 2026
fdcbb16
feat: add langfuse otlp exporter config
NeuralEmpowerment Jul 7, 2026
e99280c
experiments: run langfuse exporter config failfast
NeuralEmpowerment Jul 7, 2026
6f01843
feat: send langfuse otlp traces
NeuralEmpowerment Jul 7, 2026
31aa706
experiments: run langfuse otlp transport mock
NeuralEmpowerment Jul 7, 2026
8dbdb2d
feat: report langfuse trace links
NeuralEmpowerment Jul 7, 2026
18b6c80
experiments: run langfuse trace link reporting
NeuralEmpowerment Jul 7, 2026
68a5410
feat: add langfuse cli setup path
NeuralEmpowerment Jul 7, 2026
9df3bad
experiments: run langfuse cli setup path
NeuralEmpowerment Jul 7, 2026
85bec33
experiments: hypothesize langfuse cli runtime failfast
NeuralEmpowerment Jul 7, 2026
0f0070f
experiments: run langfuse cli runtime failfast
NeuralEmpowerment Jul 7, 2026
45695d2
experiments: hypothesize mixed exporter isolation
NeuralEmpowerment Jul 7, 2026
cf22ab3
experiments: run mixed exporter isolation
NeuralEmpowerment Jul 7, 2026
f26895b
experiments: rerun langfuse otel export current path
NeuralEmpowerment Jul 7, 2026
3ad01b6
docs: align observability langfuse gates
NeuralEmpowerment Jul 7, 2026
98f1310
test: cover observability file link portability
NeuralEmpowerment Jul 7, 2026
83f20d3
chore: bump observability plugin for hook sink
NeuralEmpowerment Jul 7, 2026
e7555cc
docs: add langfuse observability setup guide
NeuralEmpowerment Jul 7, 2026
dfafaf9
experiments: refresh langfuse ingestion gate
NeuralEmpowerment Jul 7, 2026
33eea5e
docs: add observability completion audit
NeuralEmpowerment Jul 7, 2026
2a0a5a8
experiments: add langfuse backend smoke runner
NeuralEmpowerment Jul 7, 2026
4ca8b86
feat(itmux): add langfuse trace query cli
NeuralEmpowerment Jul 7, 2026
8ad592c
experiments: prove langfuse trace query mock path
NeuralEmpowerment Jul 7, 2026
1f70ea4
fix: harden langfuse observability path
NeuralEmpowerment Jul 7, 2026
072e9b5
test: prove langfuse local backend smoke
NeuralEmpowerment Jul 7, 2026
fda123d
feat: enrich langfuse usage telemetry
NeuralEmpowerment Jul 8, 2026
eb47257
feat: normalize claude transcript usage
NeuralEmpowerment Jul 8, 2026
7a91618
feat: export claude transcript telemetry
NeuralEmpowerment Jul 8, 2026
882cb65
fix: redact transcript telemetry exports
NeuralEmpowerment Jul 8, 2026
ae4cf35
feat: collect claude run transcript telemetry
NeuralEmpowerment Jul 8, 2026
b3eb54e
feat: prove live claude langfuse telemetry
NeuralEmpowerment Jul 8, 2026
4a68463
feat: summarize langfuse tool loops
NeuralEmpowerment Jul 8, 2026
97cf01f
feat: stream claude observed events during await
NeuralEmpowerment Jul 8, 2026
6513c9f
fix: order langfuse tool summaries by event seq
NeuralEmpowerment Jul 8, 2026
35461c1
feat: prove live codex langfuse cost telemetry
NeuralEmpowerment Jul 8, 2026
691482e
feat: classify langfuse learning-loop events
NeuralEmpowerment Jul 8, 2026
014d57c
feat: prove live claude agent tool telemetry
NeuralEmpowerment Jul 8, 2026
8a6769d
feat: add compact langfuse trace summaries
NeuralEmpowerment Jul 8, 2026
a05d05a
feat: list langfuse traces for learning loops
NeuralEmpowerment Jul 8, 2026
42bd167
feat: add langfuse feedback scores
NeuralEmpowerment Jul 8, 2026
d555688
feat: include langfuse scores in trace summaries
NeuralEmpowerment Jul 8, 2026
7c035e9
feat: add langfuse generation cost summaries
NeuralEmpowerment Jul 8, 2026
d0c60a4
feat: add codex exec mode to itmux run
NeuralEmpowerment Jul 8, 2026
1884c7d
test: cover codex run dispatch
NeuralEmpowerment Jul 8, 2026
5700ad4
feat: add langfuse mcp trace tools
NeuralEmpowerment Jul 8, 2026
f0ad264
fix: package itmux for langfuse mcp
NeuralEmpowerment Jul 8, 2026
949348a
fix: add direct langfuse mcp fallback
NeuralEmpowerment Jul 8, 2026
4426260
feat: add langfuse learning loop report
NeuralEmpowerment Jul 8, 2026
4c0c2eb
feat: add langfuse learning loop insights
NeuralEmpowerment Jul 8, 2026
85b1508
experiments: hypothesis for official-langfuse-plugin-trace-shape
NeuralEmpowerment Jul 8, 2026
a0e4451
experiments: run official-langfuse-plugin-trace-shape (go)
NeuralEmpowerment Jul 8, 2026
e8dd542
experiments: hypothesis for official-langfuse-plugin-e2e-local
NeuralEmpowerment Jul 8, 2026
c8d047b
experiments: run official-langfuse-plugin-e2e-local (go)
NeuralEmpowerment Jul 8, 2026
86122a2
docs: align langfuse setup with official plugins
NeuralEmpowerment Jul 8, 2026
2daeba4
experiments: hypothesis for single-rich-exporter-guard
NeuralEmpowerment Jul 8, 2026
0ce339a
experiments: run single-rich-exporter-guard (go)
NeuralEmpowerment Jul 8, 2026
a67f0a2
experiments: hypothesis for syntropic137-jsonl-fanout-compat
NeuralEmpowerment Jul 8, 2026
ba94c05
experiments: run syntropic137-jsonl-fanout-compat (go)
NeuralEmpowerment Jul 8, 2026
0542332
experiments: hypothesis for official-plugin-install-surface
NeuralEmpowerment Jul 8, 2026
526fceb
experiments: run official-plugin-install-surface (go)
NeuralEmpowerment Jul 8, 2026
9c7bc5a
experiments: hypothesis for official-plugin-real-session
NeuralEmpowerment Jul 8, 2026
0fb2b3a
experiments: run official-plugin-real-session (go)
NeuralEmpowerment Jul 8, 2026
f6534bf
experiments: hypothesis for langfuse--official-plugin-tool-rollups
NeuralEmpowerment Jul 8, 2026
7f6f49c
experiments: run langfuse--official-plugin-tool-rollups (go)
NeuralEmpowerment Jul 8, 2026
272ac4d
experiments: hypothesis for langfuse--runtime-noise-guard
NeuralEmpowerment Jul 8, 2026
81178da
experiments: run langfuse--runtime-noise-guard (go)
NeuralEmpowerment Jul 8, 2026
9a23d98
experiments: hypothesis for langfuse--official-plugin-discovery-report
NeuralEmpowerment Jul 8, 2026
dc823b9
experiments: run langfuse--official-plugin-discovery-report (go)
NeuralEmpowerment Jul 8, 2026
9a65b09
experiments: hypothesis for langfuse--portable-setup-doctor
NeuralEmpowerment Jul 8, 2026
7ae4d90
experiments: run langfuse--portable-setup-doctor (go)
NeuralEmpowerment Jul 8, 2026
a96100d
experiments: hypothesis for langfuse--doctor-minimal-env-portability
NeuralEmpowerment Jul 8, 2026
0db317d
experiments: run langfuse--doctor-minimal-env-portability (go)
NeuralEmpowerment Jul 8, 2026
dfadc52
experiments: hypothesis for langfuse--doctor-workspace-image
NeuralEmpowerment Jul 8, 2026
e2084b9
experiments: run langfuse--doctor-workspace-image (go)
NeuralEmpowerment Jul 8, 2026
c0f9d09
docs: update observability completion audit
NeuralEmpowerment Jul 8, 2026
2246ee6
experiments: hypothesis for langfuse codex plugin hooks doctor
NeuralEmpowerment Jul 8, 2026
07e419f
experiments: run langfuse codex plugin hooks doctor (go)
NeuralEmpowerment Jul 8, 2026
cc62d89
docs: record codex plugin hooks doctor evidence
NeuralEmpowerment Jul 8, 2026
5135119
experiments: hypothesis for langfuse codex plugin hooks remediation
NeuralEmpowerment Jul 8, 2026
8057a0b
experiments: run langfuse codex plugin hooks remediation (go)
NeuralEmpowerment Jul 8, 2026
ceb3189
docs: record codex hooks remediation evidence
NeuralEmpowerment Jul 8, 2026
52f33ff
experiments: hypothesis for langfuse codex official hooks fresh run
NeuralEmpowerment Jul 8, 2026
f02271c
experiments: run langfuse codex official hooks fresh run (inconclusive)
NeuralEmpowerment Jul 8, 2026
b16a43f
experiments: hypothesis for langfuse codex official hooks fresh run c…
NeuralEmpowerment Jul 8, 2026
5c855de
experiments: run langfuse codex official hooks fresh run corrected (n…
NeuralEmpowerment Jul 8, 2026
bcd25b7
experiments: hypothesis for langfuse codex hook trust bypass
NeuralEmpowerment Jul 8, 2026
df95bf5
docs: record official langfuse plugin decision
NeuralEmpowerment Jul 8, 2026
150b65e
feat(observability): finalize official LangFuse setup path
NeuralEmpowerment Jul 9, 2026
5a2589d
refactor(itmux): split langfuse cli module
NeuralEmpowerment Jul 10, 2026
21162ed
test(langfuse): record learning loop trace experiment
NeuralEmpowerment Jul 10, 2026
2f5d96e
fix(langfuse): make score readback robust
NeuralEmpowerment Jul 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,16 @@
"Bash(gh issue list:*)",
"Bash(gh issue create:*)"
]
},
"extraKnownMarketplaces": {
"langfuse-observability": {
"source": {
"source": "github",
"repo": "langfuse/Claude-Observability-Plugin"
}
}
},
"enabledPlugins": {
"langfuse-observability@langfuse-observability": true
}
}
512 changes: 512 additions & 0 deletions docs/adrs/038-modular-agent-observability.md

Large diffs are not rendered by default.

235 changes: 235 additions & 0 deletions docs/adrs/039-official-langfuse-plugins-canonical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
---
title: "ADR-039: Official LangFuse Plugins Are Canonical for Agent Traces"
status: proposed
created: 2026-07-08
updated: 2026-07-08
author: Neural
supersedes: ADR-038 partial
tags: [architecture, observability, langfuse, claude, codex]
---

# ADR-039: Official LangFuse Plugins Are Canonical for Agent Traces

## Status

**Proposed**

- Created: 2026-07-08
- Updated: 2026-07-08
- Author(s): Neural
- Partially supersedes: ADR-038's Rust OTLP-to-LangFuse fallback decision
- Related OKRs: `okrs-51p.6`, `okrs-51p.9`

## Context

ADR-038 chose a modular observability architecture with normalized local
events, exporter fanout, LangFuse support, and Syntropic137 compatibility. That
decision was directionally correct, but later experiments showed that one part
of the design caused product confusion: exporting normalized `itmux` events
directly to LangFuse through the Rust OTLP writer produced valid but weak
LangFuse traces.

The Rust OTLP traces had generic `agentic_primitives.run`, `tool_start`,
`tool_end`, `token_usage`, and `session_end` observations. They were useful as
transport smoke tests, but they did not provide the user-facing trace UX we
want for learning loops: clear turns, model calls, native tool observations,
root input/output, costs, and harness session grouping.

The official LangFuse Claude Code and Codex plugins behaved differently. They
read the harness-native transcript/rollout and emit LangFuse-native traces:

- Claude Code traces contain a Claude turn, generation observations, tool
observations such as `Tool: Read`, usage, costs, and session grouping.
- Codex traces contain a `Codex Turn`, generation observations, tool
observations such as `exec_command`, usage, costs, and session grouping.

The evidence also showed that the SDK language shown in LangFuse identifies
the plugin implementation path:

- Official Codex plugin traces report `telemetry.sdk.language = nodejs` and
`langfuse-sdk`.
- Official Claude plugin traces report `telemetry.sdk.language = python` and
`langfuse-sdk`.

That is expected and accurate. It means the Claude plugin is exporting through
the Python LangFuse/OpenTelemetry SDK path, while the Codex plugin is exporting
through the Node.js LangFuse/OpenTelemetry SDK path.

We still need normalized local event fanout. Local JSONL is useful for
debugging, test evidence, replay, and Syntropic137. Syntropic137 still needs a
HookWatcher-compatible JSONL projection. Those are separate from rich LangFuse
trace ownership.

## Experiment Evidence

The detailed experiment folders remain the audit trail. This ADR distills the
decision-driving results:

| Evidence | Result | Decision Impact |
|---|---|---|
| Rust OTLP writer to local LangFuse | Accepted by backend, but produced generic `agentic_primitives.run`, `tool_start`, `tool_end`, and `token_usage` observations with weak input/output and tool semantics | Remove from rich-trace path; keep only historical evidence |
| Official Claude plugin real run | Trace `0e553fc833c71639acd03be9807eb616` showed native Claude generation/tool shape, usage/cost, and `telemetry.sdk.language=python` | Use official Claude plugin as canonical Claude producer |
| Official Codex plugin real run | Trace `b3d2561d7c0557c12fd427c02a16e2f3` showed native Codex turn/tool shape, usage/cost, and `telemetry.sdk.language=nodejs` | Use official Codex plugin as canonical Codex producer |
| Fresh direct Codex plugin invocation | Trace `b928a86e0c44784896a2224778c339c4` confirmed rich trace upload against the local LangFuse backend | Treat remaining Codex work as hook/config readiness, not exporter design |
| JSONL/Syntropic fanout experiments | Local `AgentRunEvent` JSONL and Syntropic137 HookWatcher-style JSONL both worked independently of LangFuse | Keep backend-independent evidence and Syntropic bridge |

The Claude run evidence confirms that seeing
`telemetry.sdk.language=python` on Claude traces is accurate. It identifies the
SDK implementation used by LangFuse's official plugin, not the language of the
Claude harness itself.

## Decision

We will make official LangFuse plugins the only canonical rich trace path for
Claude Code and Codex.

We will remove Rust OTLP-to-LangFuse from the user-facing `itmux` exporter
surface. In practice:

- Do not present `--observability-langfuse` as a supported way to get rich
Claude/Codex traces.
- Remove or deprecate the `langfuse_otlp` exporter from public run specs,
generated schema, CLI flags, setup guide, and smoke scripts.
- Keep `itmux langfuse-trace`, `itmux langfuse-traces`,
`itmux langfuse-score`, and the `agentic-langfuse` MCP read/write tools.
Those are query/learning-loop tools, not exporters.
- Keep `--observability-file` as the canonical local `AgentRunEvent` JSONL
artifact.
- Keep `--observability-syntropic-file` as the Syntropic137-compatible JSONL
projection.
- Package setup around official plugins plus secret-safe environment/config
injection for MacBooks, Mac Mini/VPS hosts, and isolated Docker workspaces.

For unsupported future harnesses, we will not revive the Rust OTLP writer by
default. The preferred approach is to write a harness-native LangFuse adapter
or plugin that exports native turns/generations/tools, then keep local JSONL as
the durable side channel.

## Alternatives Considered

### Alternative 1: Keep Rust OTLP as an Explicit Fallback

**Description**: Keep `langfuse_otlp`, but require a force flag or explicit
fallback mode.

**Pros**:

- Existing transport code and tests continue to pass.
- Provides a generic OpenTelemetry path for any future collector.
- Useful as a backend smoke test.

**Cons**:

- Still creates low-quality LangFuse traces when used.
- Users naturally open the noisy trace and assume LangFuse is not working.
- Requires ongoing docs, tests, flags, and support for a path we no longer want
for Claude/Codex.

**Reason for rejection**: The fallback path consumed attention and confused the
product evaluation. The official plugins already solve the rich trace problem
better.

### Alternative 2: Keep Both and Improve Rust OTLP Semantics

**Description**: Continue exporting from Rust, but map normalized events into
more LangFuse-native trace shapes.

**Pros**:

- One exporter could work across many harnesses.
- Keeps tracing inside the `itmux` run lifecycle.

**Cons**:

- Reconstructing native turns/generations/tools from normalized events repeats
work the official plugins already do from better source data.
- The Rust path lacks harness-specific transcript semantics, especially for
Claude and interactive Codex.
- More code, more tests, and more divergence from maintained LangFuse plugins.

**Reason for rejection**: For Claude/Codex, source-native plugins have better
data and lower maintenance cost.

### Alternative 3: Use Only Local JSONL and No LangFuse Plugins

**Description**: Keep local JSONL/Syntropic JSONL only and query those files for
learning loops.

**Pros**:

- Simple local implementation.
- No external backend required.
- Works in isolated workspaces.

**Cons**:

- Loses LangFuse dashboards, sessions, scores, cost views, and API query tools.
- Does not satisfy the `.9` backend requirement.
- Makes cross-machine learning loops harder.

**Reason for rejection**: LangFuse is the chosen primary observability backend.
JSONL is a durable side channel, not the primary trace UX.

## Consequences

### Positive Consequences

- LangFuse dashboard traces become easier to interpret because only rich
official-plugin traces are expected for Claude/Codex.
- Setup instructions become clearer: install official plugin, inject
credentials, verify with doctor, then query traces.
- Syntropic137 support stays cleanly separated through JSONL projection.
- The codebase can delete a large custom OTLP/protobuf exporter surface.

### Negative Consequences

- We lose a generic Rust OTLP smoke path unless it is replaced by a smaller
backend health check or direct LangFuse API check.
- Unsupported future harnesses need their own adapter/plugin rather than using
the Rust exporter as a default.
- Existing experiments and docs that reference `langfuse_otlp` become
historical evidence, not current implementation guidance.

### Neutral Consequences

- `itmux langfuse-*` query and score commands remain important because they are
how agents consume LangFuse for learning loops.
- `TRACE_TO_LANGFUSE=true` remains the official plugin opt-in signal.
- Claude and Codex may show different SDK languages in LangFuse because their
official plugins are implemented with different SDK runtimes.

## Implementation Notes

- Remove `ObservabilityExporter::LangFuseOtlp` and the `langfuse_otlp` schema
variant.
- Remove `--observability-langfuse`, `--observability-langfuse-force`,
`--langfuse-project-id`, and `--langfuse-label` from `itmux run`,
`itmux codex-exec`, and `itmux claude-transcript`.
- Keep `--observability-file` and `--observability-syntropic-file`.
- Remove Rust OTLP sink code from `ObservabilityFanout`; keep file and
Syntropic JSONL sinks.
- Keep shared LangFuse query helpers that are used by `itmux langfuse-trace`,
`itmux langfuse-traces`, score commands, and MCP tools.
- Replace `scripts/langfuse-local.sh smoke` with an official-plugin-oriented
check or rename the old smoke as historical/deprecated.
- Update `scripts/langfuse-observability-doctor.sh` so it checks official
plugin readiness, JSONL/Syntropic support, and MCP/query support, not Rust
OTLP noise guards.
- Update `docs/guides/langfuse-observability-setup.md` to make official plugin
setup the packaged path for MacBook, Mac Mini/VPS, and Docker workspaces.
- Mark OTLP experiments as historical in the audit docs; they explain why the
path was removed but are not current acceptance gates.

## References

- ADR-038: Modular Agent Observability
- `docs/guides/langfuse-observability-setup.md`
- `docs/plans/2026-07-07-observability-primitive-completion-audit.md`
- `experiments/2026-07-08--langfuse--official-plugin-e2e-local`
- `experiments/2026-07-08--langfuse--official-plugin-real-session`
- `experiments/2026-07-08--langfuse--official-plugin-tool-rollups`
- `experiments/2026-07-08--langfuse--official-plugin-discovery-report`
- `experiments/2026-07-08--langfuse--runtime-noise-guard`
- `experiments/2026-07-08--langfuse--codex-plugin-hooks-remediation`
- `experiments/2026-07-08--langfuse--codex-official-hooks-fresh-run-corrected`
- `experiments/2026-07-08--syntropic137--jsonl-fanout-compat`
Loading
Loading