Skip to content

Add Muse Code hook tracing - #70

Draft
Stephen Belanger (Qard) wants to merge 5 commits into
mainfrom
t3code/plan-sdk-312-implementation
Draft

Add Muse Code hook tracing#70
Stephen Belanger (Qard) wants to merge 5 commits into
mainfrom
t3code/plan-sdk-312-implementation

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Register a first-class muse daemon translator for Muse Code 1.1 hook payloads.
  • Configure Muse through a Braintrust-owned managed hook file without merging user hooks.
  • Add Muse command definitions for the embedding bt CLI's enable, disable, doctor, and import surfaces.
  • Import completed local Muse sessions through export-v1 and the same production translator used by live hooks.
  • Support bt trace import muse --all by enumerating durable session IDs through Muse's read-only MSP session/list API before exporting each session.

Behavior and fidelity

bt trace import muse SESSION_ID invokes muse export --session, imports the staged export through the normal delivery pipeline, and removes the temporary export after import. The export reader uses stable session/run/request identifiers and native timestamps, restores complete committed assistant output, and preserves token metrics.

Persistent live hooks remain a low-latency transport. Export-v1 is the authoritative historical fallback when hook output is incomplete. --all does not resume sessions, obtain writer leases, or subscribe to views.

The following are deliberately not exposed yet:

  • --attach, because it needs a durable MSP subscription and cursor-following implementation.
  • bt trace run muse, because Muse currently has no safe ephemeral configuration overlay; cloning user configuration would be unsafe and could conflict with existing managed hooks.
  • Full tool and subagent reconstruction from export-v1, pending a fixture that exercises those native records.

The embedding bt repository must update its embedded daemon revision before the public CLI exposes the new Muse commands.

Validation

  • cargo fmt --manifest-path bt-daemon/Cargo.toml -- --check
  • cargo clippy --manifest-path bt-daemon/Cargo.toml --all-features --locked -- -D warnings
  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked
  • A real Muse 1.1.1 echo session imported through the standalone daemon into an isolated debug sink: session root, turn, LLM output, and token metrics were emitted.
  • A real import muse --all run enumerated and imported all three durable local Muse sessions through MSP.

The suite passed: 123 unit tests and enabled integration suites. Existing real-agent tests for Codex, Claude, OpenCode, and Pi remain ignored by their own prerequisite checks.

@Qard
Stephen Belanger (Qard) force-pushed the t3code/plan-sdk-312-implementation branch 2 times, most recently from a86284a to 345b900 Compare September 11, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant