Files
larksuite-cli/internal/output
shanglei 463e4170a4 fix(output): scan full pretty output; block mode fails closed
Address the owner review's blocking finding on PR #1998: the 128 KiB windowed
pretty scan could be bypassed — a match straddling a window boundary (via the
default instruction_override rule's unbounded \s+) matched the full text but
neither window, so block mode still wrote it to stdout.

- Scan the complete rendered text as one string (no windows): correct regex
  semantics, and the []any window round-trip through normalize disappears.
- Add a no-truncate full-text scan path (extcs.ScanRequest.FullText, additive)
  so content past the scanner's 128 KiB per-string cap is still scanned;
  latency stays bounded by the existing 100 ms scan timeout. The structured
  API-response scan path keeps its cap.
- Block mode now FAILS CLOSED when a scan cannot complete (timeout/error/panic):
  nothing is written and a typed ContentSafetyError is returned. warn/off keep
  failing open. This intentionally changes the §0.3 content-safety red line for
  block mode; the legacy oracle golden is updated accordingly.
- Report an unknown --format before the --jq conflict (with the --format param),
  and validate the framework --format on the --print-schema path too.

Regression tests: cross-window instruction_override payload is now blocked;
full-text scan catches matches beyond the per-string cap; regex boundary
semantics preserved; block-mode fail-closed on scan timeout/error.
2026-07-23 14:34:19 +08:00
..