fix(redteam): render attack subcategory display name in report#217
Merged
Conversation
The `report --attacks` renderer was reading `a.name` (lifted from a no-longer-returned `attack_name` field) and printing `undefined`. Lift `sub_category_display_name` into the normalized RedTeamAttack shape and render `subCategoryDisplayName || subCategory || '—'` instead. Closes #204
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
airs redteam report <jobId> --attackswas printingundefinedfor every attack's subcategory because the renderer reada.name(lifted from a no-longer-returnedattack_namefield).src/airs/redteam.ts:454now liftssub_category_display_nameinto thesubCategoryDisplayNamefield onRedTeamAttack.src/cli/renderer/redteam.ts:203now printssubCategoryDisplayName ?? subCategory ?? '—'— readable display name preferred, raw value fallback, em-dash if neither.—instead of literalundefined.Test plan
tests/unit/airs/redteam.spec.ts: lifts display name, undefined when omitted) and renderer (tests/unit/cli/redteam-attacks-renderer.spec.ts: display-name, raw fallback, em-dash) — all failed before implementationpnpm lintcleanpnpm tsc --noEmitcleanpnpm test682 passedpnpm docs:checkcleanCloses #204