Skip to content

CS-424 [Improvement] Include a default justification at all times on the SoA#2921

Open
github-actions[bot] wants to merge 6 commits into
mainfrom
chas/soa-justification
Open

CS-424 [Improvement] Include a default justification at all times on the SoA#2921
github-actions[bot] wants to merge 6 commits into
mainfrom
chas/soa-justification

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 25, 2026

This is an automated pull request to merge chas/soa-justification into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Ensure every SoA control always has a justification by adding ISO 27001 family defaults, a generic fallback when no family matches, and showing/saving them for both Applicable and Not Applicable answers. Addresses CS-424.

  • New Features
    • API: Added INCLUSION_JUSTIFICATIONS and getInclusionJustification() with ISO 27001:2022 family mapping; when answer is missing/insufficient or YES without a reason, default to a family justification or a generic default if no family matches. Passes control closure into parsing and persists justifications for both YES and NO.
    • App: Always display the justification in table and mobile views. Allow editing the justification for both states; require text only when Not Applicable.
    • Tests: Added unit tests for getInclusionJustification() mapping.

Written for commit 4253d45. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment May 25, 2026 3:22pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped May 25, 2026 3:22pm
portal Skipped Skipped May 25, 2026 3:22pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@chasprowebdev chasprowebdev changed the title [dev] [chasprowebdev] chas/soa-justification CS-424 [Improvement] Include a default justification at all times on the SoA May 25, 2026
@linear
Copy link
Copy Markdown

linear Bot commented May 25, 2026

CS-424

@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 25, 2026

@cubic-dev-ai please review it

@chasprowebdev I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 8 files

Confidence score: 3/5

  • There is a concrete runtime risk in apps/api/src/soa/utils/soa-answer-parser.ts: calling trim without verifying the justification value is a string can throw on non-string JSON and break answer parsing for affected requests.
  • apps/api/src/soa/utils/constants.ts has a medium-impact fallback gap where many controls can still return null, so some YES/default flows may persist without a justification instead of a safe generic default.
  • Given the two medium-to-high severity issues (6–7/10) with strong confidence, this looks like some regression risk rather than a merge-blocker if those paths are uncommon.
  • Pay close attention to apps/api/src/soa/utils/soa-answer-parser.ts, apps/api/src/soa/utils/constants.ts - parser type-guarding and fallback defaults directly affect justification persistence reliability.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/soa/utils/soa-answer-parser.ts Outdated
Comment thread apps/api/src/soa/utils/constants.ts Outdated
@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 25, 2026

@cubic-dev-ai please review it

@chasprowebdev I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant