fix(redteam): footnote when --attacks count diverges from summary#220
Merged
Merged
Conversation
When `airs redteam report <jobId> --attacks --severity X` returns fewer
items than the summary breakdown row for X promised, print a one-line
dimmed footnote so operators know the gap is upstream-driven (server-side
list-attacks aggregator excludes some variants) rather than a CLI bug.
Reshapes the internal `listAttacks()` return from `RedTeamAttack[]` to
`{ attacks, totalItems? }` so we can surface `pagination.total_items`.
The footnote logic lives in a pure helper `buildAttackListFootnote()`
that's unit-testable in isolation.
Closes #206
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLI footnote workaround for upstream aggregator divergence — not a server-side reconciliation.
airs redteam report <jobId> --attacks --severity Xnow prints a dimmed one-line footnote whenlist-attacksreturns fewer items than the summary severity breakdown promised for X. Example: summary says 109 CRITICAL, list returns 19 → footnote(showing 19 of 109 expected for severity CRITICAL — list-attacks endpoint excludes some variants; tracking upstream divergence at #206).getStaticReport(jobId)already runs above the--attacksbranch, soseverityBreakdownis free.service.listAttacks()fromPromise<RedTeamAttack[]>toPromise<{ attacks; totalItems? }>to surfacepagination.total_items. Only internal caller (the report command) updated.buildAttackListFootnote()exported from the renderer module — unit-testable in isolation.--severityfilter, no matching breakdown row, totalItems unknown, or counts agree.Test plan
buildAttackListFootnote(5),listAttacksnormalizer shape (5 reshape + 2 pagination), renderer footnote (1)pnpm lintcleanpnpm tsc --noEmitcleanpnpm test693 passedpnpm docs:checkcleanCloses #206