Skip to content

Feat/report ti tabs lists#1879

Open
otavionvidia wants to merge 15 commits into
NVIDIA:feature/technique_intentfrom
otavionvidia:feat/report-ti-tabs-lists
Open

Feat/report ti tabs lists#1879
otavionvidia wants to merge 15 commits into
NVIDIA:feature/technique_intentfrom
otavionvidia:feat/report-ti-tabs-lists

Conversation

@otavionvidia

Copy link
Copy Markdown
Collaborator

What this does

Screen.Recording.2026-06-23.at.4.50.46.PM.mov

Adds a Techniques & Intents view to the HTML report (garak-report/), surfacing
garak's existing taxonomy digest data (digest.technique, digest.intent,
digest.technique_intent) that previously had no UI. This is a report/frontend-only
feature — no probe, detector, generator, or scoring behaviour changes.

Highlights:

  • New "Techniques & Intents" tab alongside Modules.
  • Executive "Pairing severity" summary: a single stacked bar split into the five
    DEFCON levels (own colour each, worst-first) over a count-only legend, plus a
    pairings · techniques · intents caption.
  • Tabbed taxonomy lists ("By technique" / "By intent") in the Modules-tab accordion
    style: each entry shows a worst-first horizontal bar chart of its cross-axis pairings,
    with an inline detail panel (pass/fail evals, pooled leaves, grouped/prettified
    detectors).
  • Notable pairings callout: surfaces genuine interaction effects (pairings that fail
    far worse than the technique or intent does on its own); silent for separable matrices.
  • Filter / sort / detail-level controls (DEFCON filter, sort, grouped vs all-leaves)
    reusing the shared ReportFilterBar.
  • "Module Security Status" rename of the global status card so its unit (modules) is
    explicit and distinct from the new pairing-level summary (both use the DC-3 threshold).
  • Supporting infra: DEFCON constants/labels, a useSeverityColor helper, a
    useTaxonomyCellChartOptions chart-options hook, and techniqueIntentRollup /
    taxonomyLabels utilities — all with unit tests.

No tracked bug, so no issue number.

Unique branch

Submitted from feat/report-ti-tabs-lists (fork) → main upstream. No other open PR
introduces the technique×intent report UI.

AI assistance

AI assistance was used; the submitter reviewed every changed line.

Verification

Frontend feature under garak-report/, so the JS toolchain applies (the generator-config
/ garak -t flow isn't relevant here):

  • cd garak-report && npm ci
  • Type check: npm run check (tsc --noEmit) — clean
  • Lint: npm run lint (eslint .) — clean
  • Unit tests: npm test (vitest run --coverage) — incl. techniqueIntentRollup,
    useTaxonomyCellChartOptions, SummaryStatsCard
  • Build the bundled report: npm run build (regenerates garak/analyze/ui/index.html)
  • Python suite unaffected but confirm green: python -m pytest tests/
  • Verify: open a report with technique/intent digest data → new tab renders; the
    severity bar shows one coloured slice per populated DEFCON level; lists, charts, and
    inline detail panels work; label and bar clicks both select
  • Verify: a report without technique/intent data shows the empty-state message
    and no broken tab
  • Verify: top card reads "Module Security Status"; there is no duplicate
    pairing-level status card up top
  • Document: behaviour documented via component/hook/util docstrings

No special hardware or proprietary software required.

otavionvidia and others added 7 commits June 23, 2026 17:23
Add a Technique/Intent (CAS taxonomy) view to the garak HTML report:
- Technique × Intent DEFCON-severity heatmap
- "By technique" and "By intent" breakdown charts
- Drill-down side panel with risk severity, evaluation counts, and the
  contributing detectors/probes for a selected cell or bar

Renders only when a report carries technique/intent digest sections and
degrades to a clear empty state otherwise, so it is safe ahead of the
Python-side TI digest emission. Per-attempt hit evidence is intentionally
out of scope here (it belongs to the interactive garak-ui).

Rebuilds the bundled garak/analyze/ui/index.html artifact.

Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
- recolour the risk ramp with KUI-native tokens (red → orange → gold →
  light-blue → deep-blue); avoids Tailwind/KUI palette clashes
- keep heatmap cell labels legible: fixed per-cell contrast pinned in both
  normal and emphasis states, so they never inherit the fill or flash
- drive the coordinated row/column highlight imperatively via the ECharts
  instance instead of rebuilding the option (removes the hover flicker)
- make breakdown-bar category labels click and hover exactly like their bars
- move the detail-level toggle to a panel control row mirroring the Modules
  tab's filter bar, so its global scope reads correctly
- add the rollup util, breakdown-bar options hook, and their tests (needed
  by the already-committed components)

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
Remove the technique × intent heatmap, detail drawer, and breakdown bar
chart in favour of an objective summary (critical / at-risk / clean pairing
counts) plus a conditional "notable pairings" callout for genuine
interactions. Techniques and intents now render as Modules-style tabbed
accordion lists: expand a row for a worst-first pass-rate bar chart, then
click a bar or its axis label to open the pairing detail (severity,
concrete pass/fail counts, pooled pairs, and grouped/humanised detectors)
in a side panel. Move the detail-level toggle beside the sort control,
default to the all-leaves view, and drop the redundant section header.

Co-authored-by: Claude
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
Replace the technique×intent summary cards with a single "Pairing
severity" card: one stacked bar split into the five DEFCON levels in
their own colours, over a count-only legend (the bar carries the
proportions, so per-band percentages are dropped). Counts are computed
per DEFCON level so the bands fill the full width.

Rename the global "Security Status" heading to "Module Security Status"
so its unit (modules) is explicit and distinct from the tab's
pairing-level summary.

Co-authored-by: Claude
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
Regenerate garak/analyze/ui/index.html so the shipped report bundle
matches the current technique×intent UI source (DEFCON severity bar and
Module Security Status rename included).

Co-authored-by: Claude
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
Add component tests for the technique×intent UI so the suite meets the
85% coverage gate: TaxonomyCellChart click handling (bar and axis-label),
TaxonomyAxisList + FlatTaxonomyList render paths (chart, single-child,
pooled-leaf detail, clean state, filter/sort/empty states), and the
TechniqueIntentPanel matrix vs marginal-only flows with its filter, sort,
level and tab controls.

Co-authored-by: Claude
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
The previous bundle was built with a stale local vite 6.4.1; CI builds
with yarn (vite 7.3.5 per yarn.lock) and rejects the mismatch. Rebuild
via `yarn install && yarn build` so the committed bundle matches CI
(vite 7.3.5, identical chunk hashes).

Co-authored-by: Claude
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
@otavionvidia otavionvidia force-pushed the feat/report-ti-tabs-lists branch from c1644bb to 40734f0 Compare June 24, 2026 00:23
@patriciapampanelli patriciapampanelli moved this from In Progress to In Review in garak / Context Aware Scanning Jun 24, 2026
@jmartin-tech jmartin-tech changed the base branch from main to feature/technique_intent June 24, 2026 12:46

@jmartin-tech jmartin-tech left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this was based on an in progress form of the digest entry.

Testing base on a report created using 0daa46d, the current tip of the target branch, fails to display the new tab. The latest format of the digest should contain all data needed however the current processing looks like it will need to be reworked.

A sample of the digest with faked testing data can be obtained using the following:

python -m garak -t test

Comment thread garak-report/src/pages/Report.tsx Outdated
Comment thread garak-report/src/pages/Report.tsx Outdated
Comment thread garak-report/src/pages/Report.tsx Outdated
Comment thread garak-report/src/types/ReportEntry.ts Outdated
Comment thread garak-report/src/types/ReportEntry.ts Outdated
otavionvidia and others added 3 commits June 24, 2026 09:29
Co-authored-by: Jeffrey Martin <jmartin@Op3n4M3.dev>
Signed-off-by: Otavio Padovani <opadovani@nvidia.com>
Co-authored-by: Jeffrey Martin <jmartin@Op3n4M3.dev>
Signed-off-by: Otavio Padovani <opadovani@nvidia.com>
The Techniques & Intents tab assumed a digest shape that
`_compute_technique_intent_matrix` never emits (top-level `technique`/
`intent` marginal maps, `n_evaluations`, and `detectors_used` name
arrays), so the tab failed to render on reports from the target branch.

Source the view exclusively from `technique_intent_matrix`:
- model the real cell (`score` nullable, `passed`, `total_evaluated`,
  `nones`, `n_detectors`) and the reserved per-row `_summary`;
- skip `_summary` rows and drop unevaluated (null-score / zero-eval)
  pairings so they never reach the severity bands or worst-first order;
- pool real passed/undetermined counts and surface concrete pass/fail
  stats plus a detector count in the detail panel (the digest carries no
  detector names at this granularity);
- drop the marginal-only `FlatTaxonomyList` path that had no backing data.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
…eat/report-ti-tabs-lists

Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
Act on review feedback for the Techniques & Intents tab:

- Replace the DEFCON severity bar with a plain "Coverage" summary
  (techniques, intents, pairings evaluated, overall pass rate); severity
  stays on the per-pairing badges in the lists.
- Consume the new digest naming: technique/intent cells now carry a
  human-readable `name`, and each technique a `_summary.name` and
  `description`. Labels, the technique×intent pairing rows, and a new
  per-technique description line use these instead of raw demon:* keys
  and intent codes.
- Tighten the detail stats: drop the ambiguous standalone detector box
  and spell out that counts are evaluations (one per attempt × detector),
  so the figure no longer has to be inferred.

Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
- Surface distinct prompt counts per technique×intent pairing: the
  evaluator now tracks unique attempt UUIDs per intent and the digest
  pools them across probes (max within a probe, sum across probes) so
  the figure reflects prompts rather than attempts × detectors. Carried
  through the frontend types and worst-first rollup.
- Notable-pairing clicks now re-scroll to the open detail even when the
  same pairing is clicked again, via a per-click nonce; the scroll waits
  out the accordion open animation only when one is actually running.
- Keep the single-file inlining plugin out of `vite dev` and enable
  polling watchers so HMR stops serving stale modules on macOS.

Signed-off-by: Otavio PAdovani <opadovani@nvidia.com>
Address review feedback on the technique/intent report:
- Normalize run.spec in the digest to the readable probespec (was
  rendering as an object in Setup), with a formatValue object fallback.
- Name and describe grouped intent columns from a bundled trait-typology
  snapshot instead of showing raw codes like S006; guarded by a drift
  test against garak/data/cas/trait_typology.json.
- Track distinct prompts per probe (evaluator n_attempts -> digest
  prompt_count) so the Modules view shows overall prompt counts.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is do we need to duplicate this file in the repository? A symlink or simply referencing the file already as garak/data/cas/trait_typology.json would remove the concern about drift.

Comment thread garak/evaluators/base.py
"nones": nones,
"total_evaluated": outputs_evaluated,
"total_processed": outputs_processed,
"n_attempts": len(attempt_uuids),

@jmartin-tech jmartin-tech Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this would be the right value, this entry is still for the probe/detector pair not the overall probe.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confirmed this would not be the right value, I will offer a revision that provides the correct value somewhere in the digest on a per probe across all detectors summary.

…prompt-count fallback

Address further review on the technique/intent report:
- Intent columns now show the taxonomy code alongside the name
  ("C006 - Anthropomorphise") for both grouped families and leaves, so
  the slug is unambiguous.
- Render a run.spec {include, exclude} object as one selector per line in
  the Setup view (plugin paths verbatim, filters as key:value, excludes
  prefixed with -), so reports whose digest predates spec rendering no
  longer show raw JSON / [object Object].
- Fall back to the first detector's evaluation total for the probe
  prompt-count badge when the digest carries no prompt_count, matching
  the bar-chart tooltip; freshly run reports still show the exact count.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants