Skip to content

Add Muse Code hook tracing - #70

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

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

Conversation

@Qard

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

Copy link
Copy Markdown
Collaborator

Summary

  • Add first-class Muse Code tracing through the shared daemon translator and Braintrust-owned managed-hook setup.
  • Capture the six lifecycle/model events verified in Muse Code 1.1.1; stream export-v1 imports through the same translator and enumerate sessions with bounded asynchronous MSP requests.
  • Add invocation-local run muse: replace Braintrust's saved managed hooks only for the launched session, preserve compatible unrelated hooks, pass routing through a private context file, and start an isolated daemon before Muse so sanitized hooks never need credentials.
  • Keep ordinary Muse sessions and saved settings unchanged. Reject known duplicate Braintrust user/project hooks and incompatible strict managed-hook files instead of risking double capture or lost hooks.

Scope and limits

Live tracing covers SessionStart, UserPromptSubmit, PreLLMCall, PostLLMCall, Stop, and SessionEnd. Tool, permission, compaction, and subagent details remain unsupported until their native payloads are verified. Attach follows active sessions through repeated full exports. It keeps open spans active between polls, sends only newly observed envelopes through the shared translator, and closes on a native session end or interruption. One-shot imports of active sessions also leave spans open so later imports add native completion to the same trace. MSP view remains insufficient for model-call fidelity; polling cost grows with session size.

Managed run is gated to the verified Muse Code 1.1.1 release because its process-local managed-hook override is undocumented. Independently installed tracing plugins may still duplicate capture and should be disabled for managed runs. The embedding bt repository must update its daemon revision before these commands appear in the public CLI.

Validation

  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked
  • cargo clippy --manifest-path bt-daemon/Cargo.toml --all-features --all-targets --locked -- -D warnings
  • Two local real-Muse 1.1.1 smoke tests: verified managed routes in journaled events, preservation of unrelated managed hooks and saved settings, ordinary-session behavior afterward, and startup of the isolated daemon.
  • Import of a real Muse 1.1.1 export into an isolated debug sink, including a resumed two-turn session with model output and metrics.
  • Full-snapshot attach tests cover unchanged polls, growing sessions, native completion, stable root/turn/model IDs, and repeated-import destination deduplication, including an active-to-completed import.

@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
@Qard
Stephen Belanger (Qard) force-pushed the t3code/plan-sdk-312-implementation branch 2 times, most recently from c926f34 to 1a0c8e0 Compare September 23, 2026 19:39
@Qard
Stephen Belanger (Qard) force-pushed the t3code/plan-sdk-312-implementation branch from 1a0c8e0 to 6d624cd Compare September 24, 2026 15:47

This branch has not been deployed

No deployments
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