Problem
get_recipe_section serializes the list-valued errors, warnings, and
ingredients_table sections as JSON and then applies character-offset
chunking. When a section exceeds the delivery bound, a returned content
fragment can split a JSON token or list element and cannot be parsed
independently.
This is residual class 1 from #4314, verified on develop at ac8f653a0
after PR #4330.
Current behavior
_bounded_recipe_section_response in
src/autoskillit/server/tools/tools_recipe.py accepts a string and slices it
at character offsets.
get_recipe_section passes JSON-serialized strings for errors, warnings,
and ingredients_table.
- Existing continuation tests cover reconstructed raw/YAML content, not the
parsing contract for these list-valued sections.
- Current tool and sous-chef guidance does not explicitly define
concatenate-before-parse behavior.
Required outcome
- Define one explicit, machine-consumable pagination contract for list-valued
recipe sections.
- Preserve list-element boundaries so every successful page is independently
valid JSON and retains its original element values and ordering.
- Keep every serialized tool response within the effective delivery byte bound,
including multibyte data and a single element that cannot fit on an ordinary
page.
- Return an explicit bounded failure or continuation representation for an
individually oversized element; do not silently drop it or return an invalid
fragment.
- Preserve the existing continuation metadata contract (
part, total_parts,
has_more, and next_part) and the behavior of string-valued sections.
- Document the list-page consumption contract in the public tool guidance used
by agents.
Verification
Add regression coverage for all three list-valued sections:
- Multiple pages round-trip through JSON parsing and reconstruct the original
ordered list.
- Each complete tool response respects the effective byte bound.
- Multibyte values and a single oversized element have deterministic,
lossless behavior.
- Invalid
part values fail explicitly.
- Existing string/YAML continuation behavior remains unchanged.
Provenance and boundaries
Problem
get_recipe_sectionserializes the list-valuederrors,warnings, andingredients_tablesections as JSON and then applies character-offsetchunking. When a section exceeds the delivery bound, a returned
contentfragment can split a JSON token or list element and cannot be parsed
independently.
This is residual class 1 from #4314, verified on
developatac8f653a0after PR #4330.
Current behavior
_bounded_recipe_section_responseinsrc/autoskillit/server/tools/tools_recipe.pyaccepts a string and slices itat character offsets.
get_recipe_sectionpasses JSON-serialized strings forerrors,warnings,and
ingredients_table.parsing contract for these list-valued sections.
concatenate-before-parse behavior.
Required outcome
recipe sections.
valid JSON and retains its original element values and ordering.
including multibyte data and a single element that cannot fit on an ordinary
page.
individually oversized element; do not silently drop it or return an invalid
fragment.
part,total_parts,has_more, andnext_part) and the behavior of string-valued sections.by agents.
Verification
Add regression coverage for all three list-valued sections:
ordered list.
lossless behavior.
partvalues fail explicitly.Provenance and boundaries
8c00afaa1(paginate list-typed sections by element, not JSON-string offset). Use it as design evidence, not as a wholesale cherry-pick, becausePR Rectify: Host-Attested Codex Recipe Delivery and Cumulative-Insertion Immunity #4330 changed the surrounding delivery architecture.
is out of scope for this issue.