Skip to content

BCH-1346: Inherited Capabilities panel for downstream SSPs - #283

Merged
saltpy-cs merged 4 commits into
mainfrom
feat/BCH-1346
Jul 13, 2026
Merged

BCH-1346: Inherited Capabilities panel for downstream SSPs#283
saltpy-cs merged 4 commits into
mainfrom
feat/BCH-1346

Conversation

@saltpy-cs

@saltpy-cs saltpy-cs commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New "Inherited Capabilities" tab on the SSP editor, rendering each leveraged control/statement from GET /oscal/system-security-plans/:id/leveraged-controls: a non-actionable "Covered by X vN" badge, satisfaction, and outstanding responsibilities with per-responsibility posture (satisfied/not-satisfied/unknown, BCH-1339).
  • Drift handling: a warning banner for both drifted and revoked links, a "View drift risk" link when driftRiskId is present, and a Re-attest action — only for drifted (the API 400s re-attesting a revoked link; showing the button there would be a guaranteed-failing action).
  • Re-attest is gated behind ssp:update via PermissionGate, matching the API's own guard on that route exactly.
  • No catalog/profile endpoint is ever fetched — the projection response is the only data source in this view, per the ticket's "no upstream dashboards, just the guarantee" framing.

Depends on compliance-framework/api#455, which adds the id/status/driftRiskId fields this panel needs on the projection response — a real gap I found and confirmed with the user before writing any UI code (the endpoint had no way to identify a link or detect drift at all).

Caught and fixed one bug during implementation: ReAttest's response is a raw SSPLeverageLink, not the richer projection shape — merging it in place would have wiped inheritedFrom/outstandingResponsibilities/responsibilityPosture for that entry. Fixed by refetching the projection list after a successful re-attest instead of merging.

Test plan

  • vue-tsc --build clean
  • eslint clean
  • New tests: rendering (covered-by badge, satisfaction, outstanding responsibilities with posture), empty state, a dedicated no-catalog-synthesis test asserting the only fetched URL is the projection endpoint, drifted/revoked warning + drift-risk-link + re-attest round-trip, and gating on ssp:update
  • Full npm run test:unit suite green aside from one pre-existing, unrelated LoginView.spec.ts failure (localStorage env issue predating this change)
  • Manually verified in a local demo environment: triggered real drift on a subscription and confirmed the warning, drift-risk link, and re-attest round-trip all work end-to-end against the live API

Summary by CodeRabbit

  • New Features

    • Added an Inherited Capabilities tab to system security plan editors.
    • Displays inherited controls, offering details, satisfaction status, responsibilities, and drift-risk links.
    • Added permission-based re-attestation for applicable controls, with confirmation and success/error notifications.
    • Added loading and empty states for inherited capabilities.
  • Tests

    • Added coverage for rendering, permissions, drift risks, responsibilities, and re-attestation workflows.

Renders each leveraged control/statement from the projection endpoint: a
non-actionable "Covered by X vN" badge, satisfaction, and outstanding
responsibilities with per-responsibility posture (BCH-1339). Drifted links
show a warning, a link to the drift risk, and a Re-attest action (gated on
ssp:update); revoked links show the warning only, since the API only allows
re-attesting from drifted. No catalog/profile endpoint is ever fetched — the
projection response is the only data source, per the "no upstream
dashboards, just the guarantee" scope. Depends on api PR #455 for the
id/status/driftRiskId fields this panel needs.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@saltpy-cs, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fc755c73-2fef-4db9-83dd-8c0c0e22ef9c

📥 Commits

Reviewing files that changed from the base of the PR and between 6920a2c and 7bdc58d.

📒 Files selected for processing (16)
  • src/utils/get-id-from-route.ts
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesBackMatterView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesFindingsView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesImportSspView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesLocalDefinitionsView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesObservationsView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesOverviewView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesPoamItemsView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesRisksView.vue
  • src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesSystemIdView.vue
  • src/views/system-security-plans/SystemSecurityPlanControlImplementationView.vue
  • src/views/system-security-plans/SystemSecurityPlanExportOfferingsView.vue
  • src/views/system-security-plans/SystemSecurityPlanInheritedCapabilitiesView.vue
  • src/views/system-security-plans/SystemSecurityPlanLeverageView.vue
  • src/views/system-security-plans/__tests__/SystemSecurityPlanInheritedCapabilitiesView.spec.ts
  • vitest.setup.ts
📝 Walkthrough

Walkthrough

Adds an inherited-capabilities editor tab and lazy-loaded route. The new view fetches leveraged controls, displays inheritance and responsibility status, supports drift-risk links and permission-gated re-attestation, and includes comprehensive rendering and interaction tests.

Changes

Inherited capabilities

Layer / File(s) Summary
Contracts and editor navigation
src/types/ssp-leverage.ts, src/router/index.ts, src/views/system-security-plans/SystemSecurityPlanEditorView.vue
Adds leveraged-control types and wires the inherited-capabilities child route and editor tab.
Inherited capabilities view
src/views/system-security-plans/SystemSecurityPlanInheritedCapabilitiesView.vue
Fetches and renders leveraged controls, responsibilities, satisfaction, drift risks, and re-attestation actions with toast feedback.
View behavior validation
src/views/system-security-plans/__tests__/SystemSecurityPlanInheritedCapabilitiesView.spec.ts
Tests empty and populated states, status warnings, responsibility posture, re-attestation, refresh behavior, drift-risk links, and permission gating.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor as SSP editor
  participant View as Inherited capabilities view
  participant API as Data API
  participant Toasts as PrimeVue toasts
  Editor->>View: Open inherited capabilities with SSP id
  View->>API: Fetch leveraged-controls projection
  API-->>View: Return leveraged controls
  View->>View: Render statuses and responsibilities
  View->>API: Post re-attestation
  API-->>View: Return attestation result
  View->>API: Refresh projection
  View->>Toasts: Show success or error
Loading

Possibly related PRs

Poem

A bunny hops through controls bright,
Inherited badges glow just right.
Drift risks peek, attestations fly,
Toasts announce success nearby.
“More capabilities!” we cheer—
The editor’s path is crystal clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: a new Inherited Capabilities panel for downstream SSPs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@saltpy-cs

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/views/system-security-plans/__tests__/SystemSecurityPlanInheritedCapabilitiesView.spec.ts`:
- Around line 178-198: Add a failure-path test alongside the existing
re-attestation test that configures postMock to reject, invokes the confirmation
accept callback for re-attest, and flushes pending promises. Assert that
toastAddMock is called with an object containing severity: 'error', covering the
catch branch in reAttest.

In
`@src/views/system-security-plans/SystemSecurityPlanInheritedCapabilitiesView.vue`:
- Line 123: Rename or alias the imported getIdFromRoute utility to a
domain-neutral name, updating its defining export and all usages including
SystemSecurityPlanInheritedCapabilitiesView. Preserve the existing route-ID
extraction behavior while removing the misleading POAM-specific naming.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b4ebe0ec-cb44-4a27-bd8f-fd3f26886310

📥 Commits

Reviewing files that changed from the base of the PR and between f7cd10e and 6920a2c.

📒 Files selected for processing (5)
  • src/router/index.ts
  • src/types/ssp-leverage.ts
  • src/views/system-security-plans/SystemSecurityPlanEditorView.vue
  • src/views/system-security-plans/SystemSecurityPlanInheritedCapabilitiesView.vue
  • src/views/system-security-plans/__tests__/SystemSecurityPlanInheritedCapabilitiesView.spec.ts

Comment thread src/views/system-security-plans/SystemSecurityPlanInheritedCapabilitiesView.vue Outdated
…tility naming

Add a failure-path test for reAttest's catch branch, and rename the
misleadingly POAM-specific get-poam-id-from-route.ts to get-id-from-route.ts
(the exported function itself was already domain-neutral) across all 13
import sites.
…plementation

Node's own experimental global localStorage (present without a CLI flag but
non-functional, warning and resolving to undefined) was shadowing jsdom's
working shim in this Node version, breaking every test that touches
localStorage directly. Passing --localstorage-file via NODE_OPTIONS activates
Node's native implementation instead, resolving the conflict.
… CLI flag

The previous fix (NODE_OPTIONS=--localstorage-file=...) fails in CI: Node
explicitly disallows that flag via NODE_OPTIONS on the Node version CI runs
(20), even though it's silently accepted on newer local Node versions — and
regardless of version, the flag never actually reaches jsdom's per-test
sandboxed global scope anyway, since Node's native localStorage lives on the
outer process only. Replacing it with a small in-memory Storage polyfill in
vitest.setup.ts, applied whenever the host's localStorage is missing or
broken, works identically on every Node version with no CLI flags at all.
@saltpy-cs
saltpy-cs merged commit 0813f0a into main Jul 13, 2026
3 checks passed
@saltpy-cs
saltpy-cs deleted the feat/BCH-1346 branch July 13, 2026 17:00
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.

1 participant