[FIX] Rectify: _fmt_generic Silent Truncation of Dispatch-Critical Structured Data — PART A ONLY - #3963
Merged
Trecek merged 3 commits intoJun 9, 2026
Conversation
…uncation The _fmt_generic formatter in pretty_output_hook.py silently truncates nested dict/list values at 200 chars (lines 149-152), destroying dispatch_plan visibility in dispatch_food_truck envelopes. This caused the AI orchestrator to lose visibility of dispatch groups 4-6 (9 of 22 issues) in a recent run. Promotes dispatch_food_truck to a dedicated formatter with: - DispatchEnvelopeResult TypedDict covering all response shapes (DispatchCompleted, DispatchRejected, fleet_error) - _fmt_dispatch_food_truck function with field-explicit access and full JSON rendering of nested structures - RENDERED/SUPPRESSED frozensets enforcing TypedDict coverage - New _fmt_dispatch.py module (keeps _fmt_execution.py under budget) - Re-export imports in pretty_output_hook.py for conftest access - Removal from _UNFORMATTED_TOOLS, addition to _FORMATTERS dispatch - _dispatch_food_truck_json_producer for multi-path key coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- test_dispatch_food_truck_six_group_plan_preserved: 6-group envelope must survive formatting (catches 200-char truncation regression) - test_dispatch_food_truck_error_envelope_preserves_diagnostics: error path fields must render (catches silent error path loss) - test_dispatch_food_truck_has_dedicated_formatter: coverage contract guard (dispatch_food_truck must be in _FORMATTERS, not _UNFORMATTED_TOOLS) - test_unformatted_tools_have_no_nested_response_types: structural gate preventing future tools with nested dict/list response types from entering _UNFORMATTED_TOOLS (architectural immunity) - _FORMATTER_COVERAGE_REGISTRY: add dispatch_food_truck entry with _dispatch_food_truck_json_producer covering all 4 envelope paths - Budget updates: _fmt_dispatch.py (200 lines), _fmt_execution.py (330), type: ignore count (101) to accommodate new import block Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dd ellipsis Raise nested value truncation from 200 to 2000 chars, render all fields in list-of-dicts items, and add ellipsis indicators to truncated non-string list items. Also add ellipsis to pipeline_step_post_hook tracker banner. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Trecek
force-pushed
the
dispatch-plan-silently-truncated-by-fmt-generic-200-char-lim/3956
branch
from
June 9, 2026 21:17
8947f99 to
5610140
Compare
Trecek
deleted the
dispatch-plan-silently-truncated-by-fmt-generic-200-char-lim/3956
branch
June 9, 2026 21:28
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
The
_fmt_genericformatter inpretty_output_hook.pysilently truncates nested dict/list values to 200 characters. This destroyed thedispatch_planfield indispatch_food_trucktool results, causing the AI orchestrator to lose visibility of dispatch groups 4–6 (9 of 22 issues). The root cause is an architectural gap: tools carrying structured data consumed by downstream orchestrators are classified alongside simple ack/result tools in_UNFORMATTED_TOOLS, where_fmt_genericapplies a blanket 200-char truncation with no awareness of field semantics.The existing formatter system already has a robust immunity pattern — dedicated formatters with TypedDict contracts and RENDERED/SUPPRESSED frozensets enforced by meta-tests — but this pattern is opt-in and lacks a structural gate that forces tools with complex response shapes out of the generic path.
Part A promotes
dispatch_food_truckto a dedicated formatter with full contract coverage, and adds a structural test that prevents future tools with nested dict/list response fields from entering_UNFORMATTED_TOOLSwithout explicit acknowledgment. Part B will address the broader_fmt_generictruncation policy and related tools (get_pipeline_report,wait_for_ci,get_ci_status,fetch_github_issue).Requirements
Conflict Resolution Decisions
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/remediation-20260609-112259-672124/.autoskillit/temp/rectify/rectify_fmt_generic_truncation_2026-06-09_113500.mdCloses #3956
🤖 Generated with Claude Code via AutoSkillit