Skip to content

Default TraceDecay tool output to markdown - #262

Merged
ScriptedAlchemy merged 5 commits into
masterfrom
explore/markdown-default-output
Jul 3, 2026
Merged

Default TraceDecay tool output to markdown#262
ScriptedAlchemy merged 5 commits into
masterfrom
explore/markdown-default-output

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • default MCP tool responses to markdown unless format: "json" is requested
  • render tracedecay_message_search with compact markdown rows instead of raw JSON blobs
  • add Claude plugin schema validation, hook replay analytics, and response-handle truncation coverage

Verification

  • cargo fmt --check
  • cargo test message_search_markdown --lib
  • cargo test message_search --test mcp_suite
  • cargo test claude_plugin --test agent_suite
  • cargo test hook_replay --test hooks_lsp_suite
  • cargo test generated_codex_plugin_skills_are_byte_copies_of_the_source_bundle --test agent_suite
  • cargo test produced_plugin_skills_meet_the_metadata_budget_and_openai_contract --test agent_suite

Claude Session Recall

  • Found via tracedecay_message_search provider claude: session d37694b3-62ad-470e-8121-932bf9491045 created explore/markdown-default-output from origin/master and recorded the message-search markdown issue.
  • Found via tracedecay_message_search provider claude: session a62b3a59-fe48-4cec-8b89-148f295c9050 pushed 84a28f8 to origin/explore/markdown-default-output.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9e97516

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

ScriptedAlchemy and others added 4 commits July 3, 2026 23:34
All MCP tool handlers now route through render::finalize, so the default
output is token-efficient markdown and format:"json" returns compact JSON
for programmatic consumers. Converted the JSON-only paths: message_search,
all lcm_* tools, fact_store/fact_feedback, skill_list/skill_view/
automation_run_artifact_view/hermes_skill_bridge (previously pretty-printed),
all edit tools, branch_list, active_project, dashboard, run_affected_tests
error paths, git error results, dsm, and tracedecay_retrieve (markdown
default returns stored content verbatim; never re-truncates).

All converted tools joined FORMAT_CAPABLE_TOOL_NAMES, so their schemas
advertise the format param and the generated Hermes bridge plugin keeps
injecting format:"json" for its machine contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- message_search default output is now a compact markdown list (provider,
  session+title, role, timestamp, score, readable snippet) instead of
  generic_md dumping raw metadata_json/source_path/transcript_path blobs
  into table cells. format:"json" still returns full structured records.
- Fix regression: lcm_preflight markdown-default truncation now threads the
  project root so an oversized payload stores a retrieval handle instead of
  clipping irreversibly (matches lcm_expand_query).
- Fix metrics: JSON truncation envelope reports reversible=handle.is_some()
  instead of hardcoded true, so failed/absent-handle truncations aren't
  miscounted as reversible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Address truncation-audit findings so every markdown-default response stays
bounded and recoverable:

- S4: tracedecay_files and tracedecay_type_hierarchy no longer clip oversized
  output irreversibly. New render::truncate_text_with_handle stores the full
  body and returns the markdown truncation envelope with an rh_ handle
  (delegates to truncated_markdown_with_handle; no duplicated logic).
- S3: lcm_expand_query_tool_json's format:"json"+needs_synthesis path could
  emit an unbounded payload when even the Minimal compaction tier overflowed.
  New bounded_lcm_expand_query_floor_text enforces a floor: stores a retrieval
  handle (surfaced as response_handle for the Hermes bridge) and keeps the
  contract keys (status, needs_synthesis, bounded answer/prompt, rebuilt
  synthesis_prompt) while zeroing unbounded arrays with *_truncated markers.
- S5: LCM preflight/expand_query compaction tiers now call
  observe_response_truncation so those truncations show up in metrics.
- Drop unused LCM_GREP_SNIPPET_CHARS (lcm_grep hits are already bounded).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ScriptedAlchemy
ScriptedAlchemy force-pushed the explore/markdown-default-output branch from ce133df to a705263 Compare July 3, 2026 23:40
@ScriptedAlchemy
ScriptedAlchemy force-pushed the explore/markdown-default-output branch from a705263 to 9e97516 Compare July 3, 2026 23:47
@ScriptedAlchemy
ScriptedAlchemy merged commit 41bb533 into master Jul 3, 2026
16 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the explore/markdown-default-output branch July 4, 2026 01:13
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