headroom/crates
Rod Boev be51008c70
fix(toin): publish skip compression recommendations (#1782)
## Description

TOIN already learns when a tool-output slice should skip compression,
but the published recommendation artifact drops that signal. A high
full-retrieval row can therefore still publish an ordinary compressor
strategy even though TOIN marked it as skip-worthy. This change carries
`skip_compression_recommended` into `recommendations.toml`, keeps Rust
parsing backward compatible for older files, and makes skip rows publish
a skip-oriented strategy hint instead of misleading compressor guidance.

Refs #1775

## Type of Change

- [x] 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
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)

## Changes Made

- Publishes `skip_compression_recommended` in generated recommendation
rows.
- Uses retrieval-aware strategy output for rows TOIN already marked as
skip-worthy.
- Extends the Rust recommendation schema with a backward-compatible
default for older TOML files.
- Adds focused publish and schema coverage for skip and non-skip rows.

## Testing

- [x] Unit tests pass (`uv run pytest tests/test_toin_publish.py -q`)
- [x] Linting passes (`uv run ruff check headroom/cli/toin_publish.py
headroom/telemetry/toin.py tests/test_toin_publish.py`)
- [ ] Type checking passes (`uv run mypy headroom`)
- [x] New tests added for new functionality
- [ ] Manual testing performed
- [ ] I have made corresponding changes to the documentation

### Test Output

```text
uv run pytest tests/test_toin_publish.py -q: 8 passed
uv run ruff check headroom/cli/toin_publish.py headroom/telemetry/toin.py tests/test_toin_publish.py: passed
cargo fmt --all -- --check: passed
cargo check -p headroom-core: passed
cargo test -p headroom-core --lib transforms::recommendations: 6 passed
cargo clippy --workspace -- -D warnings: passed
```

## Real Behavior Proof

- Environment: Windows for Python validation through the headless
runner; Rust validation via focused local cargo commands where
available.
- Exact command / steps: `uv run pytest tests/test_toin_publish.py -q`,
`uv run ruff check headroom/cli/toin_publish.py
headroom/telemetry/toin.py tests/test_toin_publish.py`, `cargo fmt --all
-- --check`, `cargo check -p headroom-core`, `cargo test -p
headroom-core --lib transforms::recommendations`, and `cargo clippy
--workspace -- -D warnings`.
- Observed result: Skip-worthy rows carry `skip_compression_recommended
= true` and a skip strategy hint; normal rows carry `false` and preserve
their ordinary strategy.
- Not tested: Live runtime dispatcher skip behavior and full Rust
workspace tests.

## Review Readiness

- [x] I have performed a self-review
- [x] This PR is ready for human review

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] I have updated the CHANGELOG.md if applicable

## Additional Notes

This PR fixes the published recommendation artifact. Runtime dispatcher
enforcement remains a separate follow-up because it needs a dedicated
consumer proof matrix. Documentation and changelog are left unchecked
because this changes generated recommendation data and Headroom's
changelog is generated from conventional commits.
2026-07-07 23:14:54 -05:00
..
headroom-core fix(toin): publish skip compression recommendations (#1782) 2026-07-07 23:14:54 -05:00
headroom-parity feat: compression extraction — Rust knob exposure, CCR hardening, traffic audits (#818) 2026-06-16 20:21:13 -07:00
headroom-proxy fix(deps): remediate dependency CVEs and publish SBOM (#1509) 2026-06-27 15:28:12 -07:00
headroom-py fix(deps): remediate dependency CVEs and publish SBOM (#1509) 2026-06-27 15:28:12 -07:00