Skip to content

Bound the finding's free text and refuse oversize tool-call arguments - #65

Merged
shipmill-romamo[bot] merged 2 commits into
mainfrom
fix/63-bound-finding-and-step-arguments
Oct 9, 2026
Merged

shipmill-romamo[bot] merged 2 commits into
mainfrom
fix/63-bound-finding-and-step-arguments

Conversation

@shipmill-romamo

@shipmill-romamo shipmill-romamo Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Bounds the last three unbounded pieces of model text in the investigation record, per D-8 as chosen on #63.

  • finding.rootCause and finding.why keep at most 8000 characters (FINDING_TEXT_LIMIT), keeping the start before a [last N characters cut] mark through the existing _head_text (as D-6). The cut happens where _finding builds the Finding, so the proposed/unrecorded decision ids are still read from the whole proposed line
  • _run_call refuses a call whose parsed arguments serialize to more than 8000 characters (STEP_ARGUMENTS_LIMIT, measured with json.dumps(arguments, ensure_ascii=False), so non-ASCII text counts in characters, not escapes). It is recorded as an invalid step with empty arguments, exactly like the non-JSON case; the tool does not run and the repeat cache is not filled. The model is told the arguments are too long and nothing ran
  • The trace's raw toolCalls[].arguments still keeps the cut start of an oversize call (_call_text unchanged)
  • Schema: maxLength: 8000 on finding.rootCause and finding.why, plus descriptions; steps[].arguments gets a description only (no schema rule can bound an object's serialized size, so code enforces it)
  • To stay under ruff's return-count limit, the non-object and oversize checks moved into a small _arguments_problem helper

Tests

  • Arguments at exactly 8000 serialized characters run and are kept whole; 8001 and 50000 are refused unrun with {} and invalid, the model is told why, and the trace keeps the marked start of the raw text. Saved records validate against the schema
  • Non-ASCII arguments are measured in characters: 7999 Cyrillic characters run, 8001 are refused
  • A repeated oversize call is refused again rather than served as repeated
  • Finding lines at 8000 are kept whole; 8001 and 50000 keep the start with the mark (Cyrillic, counted in characters); records validate
  • A decision id past 8000 characters in the proposed line is still found
  • The schema accepts an 8000-character rootCause/why and refuses 8001
  • uv run ruff check ., uv run mypy, uv run pytest (full suite, 496 passed), uv run cloudfall config validate --project config/examples all pass

Fixes #63

🤖 Generated with Claude Code

shipmill-romamo Bot and others added 2 commits October 9, 2026 20:39
finding.rootCause, finding.why and spec.steps[].arguments come from the
model's output, which can quote host output, yet the record kept all
three unbounded after #57 capped the answer and the raw arguments.

rootCause and why now keep at most 8000 characters, keeping the start
before a [last N characters cut] mark (D-8, as D-6); the proposed
decision ids are still read from the whole line. A tool call whose
parsed arguments serialize (json.dumps defaults) to more than 8000
characters is refused before it runs and recorded as an invalid step
with empty arguments, and is not remembered for the repeat cache; the
trace still keeps the cut start of its raw arguments. The schema bounds
both finding fields with maxLength 8000.

Fixes #63

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 8000-character limit on a call's parsed arguments counted each
non-ASCII character as its six-character \uXXXX escape, so a Cyrillic
argument was refused at about 1300 characters. Serialize with
ensure_ascii=False so the limit counts characters, as D-8 says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shipmill-romamo
shipmill-romamo Bot merged commit 070c781 into main Oct 9, 2026
1 check passed
@shipmill-romamo
shipmill-romamo Bot deleted the fix/63-bound-finding-and-step-arguments branch October 9, 2026 17:44
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.

Investigation record: steps[].arguments and the finding's rootCause and why are still unbounded

0 participants