tools.gleam extraction + record_read fix + trace scaffolding#1
Merged
Conversation
RED phase: tests for tools.gleam extraction, trace.gleam scaffolding, and record_read HEAD advancement bug. All fail because modules don't exist yet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract all tool schemas from daemon.gleam and mcp.gleam into tools.gleam — single source of truth for tool names, descriptions, and input schemas. daemon uses daemon_tools_json(), mcp uses mcp_tools_json() (ADO-only, with name-required commit). Fix record_read bug: session.act() was called but the updated session s2 was discarded (`let _ = s2`), so HEAD never advanced on @READ. Now s2 is propagated through Active state. Add trace.gleam with BEAM-native telemetry scaffolding: - Event names: [:gall, :tool, :call] and [:gall, :tool, :result] - Metadata type with tool, path, sha, session_id, duration_ms - Erlang FFI (gall_trace_ffi.erl) that calls :telemetry.execute/3 or falls back to no-op Format-only changes in gall.gleam, session.gleam, store.gleam, gall_store_test.gleam from gleam format. 40 tests pass (17 original + 23 new). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
record_readwas discarding the updated session (let _ = s2), so HEAD never advanced on reads. Fixed.[:gall, :tool, :call]/[:gall, :tool, :result]with metadata maps. Erlang FFI calls:telemetry.execute/3with graceful fallback.23 new tests (40 total). TDD arc: red then green.
Test plan
🤖 Generated with Claude Code