Skip to content

cloudsec: bind the SLA state selector and the due_at sort - #332

Draft
maximelb wants to merge 1 commit into
masterfrom
solve/w2-sla-due-dates-w2sla01
Draft

cloudsec: bind the SLA state selector and the due_at sort#332
maximelb wants to merge 1 commit into
masterfrom
solve/w2-sla-due-dates-w2sla01

Conversation

@maximelb

@maximelb maximelb commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What was asked

Bind the new cloud-security SLA selector so the SDK and CLI stay at full parity with the
gateway's findings surface.

What was done

Adds sla (breached | due_soon | on_track | exempt | none) and the due_at sort
key to the cloudsec findings surface.

It rides the shared _finding_query_pairs / _finding_filter_options helpers, so it
reaches all four surfaces those feed — finding list, finding facets, finding causes,
and export findings — and a test asserts that explicitly. A surface that silently dropped
the selector would return the unfiltered estate while the caller believed they had asked
for the overdue slice.

The docstrings record the two things about this dimension that are not guessable from its
name:

  • The state is derived server-side at read time, and there is no built-in default SLA —
    so every finding reads none until the org writes an sla policy record. A caller
    seeing all-none is looking at an unconfigured org, not a bug.
  • --sort due_at is the one sort key that defaults to ascending (soonest due first)
    and places findings with no due date last rather than excluding them.

The three existing exhaustive-kwargs assertions gained sla=None so they keep asserting the
complete call rather than a subset.

Testing

pytest tests/unit/ tests/microbenchmarks/ --benchmark-disable (the CI invocation):
3862 passed, 5 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y3AnxeGmcGA9scrsRZFtg9

Adds `sla` (breached | due_soon | on_track | exempt | none) and the `due_at`
sort key to the cloudsec findings surface, keeping the SDK at full parity
with the gateway's findings selectors.

It rides the shared `_finding_query_pairs` / `_finding_filter_options`
helpers, so it reaches all four surfaces those feed - `finding list`,
`finding facets`, `finding causes`, and `export findings` - and a test
asserts that explicitly: a surface that silently dropped the selector would
return the unfiltered estate while the caller believed they had asked for
the overdue slice.

Docs record the two things about this dimension that are not guessable:
the state is DERIVED at read time (there is no built-in default SLA, so
every finding reads `none` until the org writes an `sla` policy), and
`--sort due_at` is the one sort key that defaults to ASCENDING and places
findings with no due date last rather than excluding them.

The three existing exhaustive-kwargs assertions gained `sla=None` so they
keep asserting the complete call rather than a subset.

Tests: 3862 passed, 5 skipped (the CI invocation: pytest tests/unit/
tests/microbenchmarks/ --benchmark-disable).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3AnxeGmcGA9scrsRZFtg9
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.

2 participants