Skip to content

core: length limit and truncated flag (TASKS 1.6) - #23

Merged
hightemp merged 3 commits into
mainfrom
core/length-limit
Oct 23, 2026
Merged

hightemp merged 3 commits into
mainfrom
core/length-limit

Conversation

@hightemp

Copy link
Copy Markdown
Owner

TASKS 1.6 (FR-1.4). Design note: PRD section 13, "1.6".

  • ig_limit_len(len, max_len, &truncated): min(len, max_len), max_len = 0 means no limit.
  • ig_result_t.truncated, reset by every detector together with the fingerprint.
  • ig_detector_run(d, s, len, max_len, res): runs a registry detector on the prefix and records truncated; the single entry point for inspect() (5.3) and the pipeline (phase 4).
  • The pipeline will apply the limit to the raw value before normalization, which never grows a value, so normalization cost is bounded too. The limit_exceeded event and blocking policy come in 4.6.
  • Tests: tests/unit/test_limit.c (7 cases).

Local: unit (gcc, clang ASan/UBSan, CentOS 7), clang-tidy, clang-format, cppcheck, phpt on 7.0 NTS and 8.5 ZTS, license check.

🤖 Generated with Claude Code

hightemp and others added 3 commits October 23, 2026 11:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ig_limit_len() caps the inspected length (0 = no limit), ig_result_t gains
truncated, and ig_detector_run() runs a detector on the prefix and records
the flag. Detectors reset truncated on a reused result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hightemp
hightemp merged commit 7f37d2b into main Oct 23, 2026
38 checks passed
@hightemp
hightemp deleted the core/length-limit branch October 23, 2026 09:02
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