Skip to content

[FIX] Rectify: _fmt_generic Silent Truncation of Dispatch-Critical Structured Data — PART A ONLY - #3963

Merged
Trecek merged 3 commits into
developfrom
dispatch-plan-silently-truncated-by-fmt-generic-200-char-lim/3956
Jun 9, 2026
Merged

[FIX] Rectify: _fmt_generic Silent Truncation of Dispatch-Critical Structured Data — PART A ONLY#3963
Trecek merged 3 commits into
developfrom
dispatch-plan-silently-truncated-by-fmt-generic-200-char-lim/3956

Conversation

@Trecek

@Trecek Trecek commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The _fmt_generic formatter in pretty_output_hook.py silently truncates nested dict/list values to 200 characters. This destroyed the dispatch_plan field in dispatch_food_truck tool 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_generic applies 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_truck to 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_TOOLS without explicit acknowledgment. Part B will address the broader _fmt_generic truncation 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.md

Closes #3956

🤖 Generated with Claude Code via AutoSkillit

Trecek and others added 3 commits June 9, 2026 14:17
…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
Trecek force-pushed the dispatch-plan-silently-truncated-by-fmt-generic-200-char-lim/3956 branch from 8947f99 to 5610140 Compare June 9, 2026 21:17
@Trecek
Trecek added this pull request to the merge queue Jun 9, 2026
Merged via the queue into develop with commit d29a299 Jun 9, 2026
3 checks passed
@Trecek
Trecek deleted the dispatch-plan-silently-truncated-by-fmt-generic-200-char-lim/3956 branch June 9, 2026 21:28
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