Skip to content

Developer#27

Merged
deborahjacob-botanu merged 3 commits intomainfrom
developer
Apr 25, 2026
Merged

Developer#27
deborahjacob-botanu merged 3 commits intomainfrom
developer

Conversation

@deborahjacob-botanu
Copy link
Copy Markdown
Collaborator

Summary

Changes

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • CI / build / tooling

Testing

  • Unit tests pass (pytest)
  • Lint passes (ruff check)
  • Type check passes (mypy)

Checklist

  • My code follows the project's coding style
  • I have added SPDX headers to new files
  • I have added tests for my changes
  • I have updated documentation if needed
  • All commits are signed off (git commit -s) per the DCO

…-24 P0 #1)

Pre-change, the default install silently produced no judgeable
content: set_input_content / set_output_content / set_retrieval_content
no-op'd because their rate-gate evaluated ``random.random() < 0.0 ==
False``. The L2 evaluator judge then returned empty test cases for
every span and eval_rollups stayed ``pending`` forever. Customers
had to read the docs AND flip a config flag before the "SDK in →
eval out" loop worked.

Flipping the default to 0.10 (what the docs already recommended for
production) inverts the failure mode from silent-no-eval to loud-
content-captured-with-PII-risk. Three PII-defense layers still run
on every captured attribute:
  1. SDK in-process scrub (pii_scrub_enabled=True by default)
  2. Collector credential-regex scrub on content attribute prefixes
  3. Evaluator Presidio NER before judge calls

Changes:
- BotanuConfig.content_capture_rate default 0.0 → 0.10
- YAML loader fallback default matches (config.py:436)
- Bootstrap logs content_capture_rate at every startup; warns when
  <= 0.0 so the "why are eval rollups empty" debugging path ends
  at a startup log line, not silently-dropped helper calls.
- Tests: test_default_is_zero → test_default_is_ten_percent,
  test_env_var_invalid_ignored now expects 0.10 fallback.
- Docs: api/configuration.md table + getting-started/configuration.md
  code sample both updated.

All 150 SDK unit tests still pass.

NOTE: working-tree had one unrelated pre-existing change to
src/botanu/models/run_context.py — NOT included in this commit.

Signed-off-by: Deborah Jacob <deborah@botanu.ai>
Pre-existing working-tree change. Removes a 4-line explanatory
comment about why ``botanu.outcome.status`` is not emitted (the
customer-trust-hole note). Behavior unchanged — the SDK still
does not emit ``botanu.outcome.status``. The rationale lives in
project memory + the value-engine / cost-engine design docs.

Signed-off-by: Deborah Jacob <deborah@botanu.ai>
Resolves 10 lint findings:
- S603 subprocess call (bare noqa)
- RUF015 list-index slice -> next()
- RUF059 unused unpacked code -> _code
- RUF005 x7 results + [False] -> [*results, False]

Signed-off-by: Deborah Jacob <deborah@botanu.ai>
@deborahjacob-botanu deborahjacob-botanu merged commit 8a1c192 into main Apr 25, 2026
11 of 13 checks passed
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