Skip to content

[comp] Production Deploy#2924

Merged
Marfuen merged 7 commits into
releasefrom
main
May 27, 2026
Merged

[comp] Production Deploy#2924
Marfuen merged 7 commits into
releasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Adds family grouping for both controls and requirements to make large frameworks easier to browse. Also completes custom framework link handling, hardens sync with a transaction, and adds a batch requirements update API to reduce rate limiting during bulk edits.

  • New Features

    • Grouped views: controls and requirements now support collapsible families, search, pagination, and a family filter; auto-enable when family data exists, otherwise fall back to flat lists.
    • Framework editor: Control Family column with Manage Families dialog (rename/delete with impact preview); Requirement Family column via combobox.
    • Versioning/Review: manifests, diff, sync/rollback, export/import updated to include controlFamily and requirementFamily; update preview shows family changes.
    • UI/components/tests: FrameworkControlsGrouped, FrameworkRequirementsGrouped, FamilyFilterDropdown, shared helpers/tests; Review Update tests for family summaries.
    • Build config: transpiles @trycompai/design-system and updates Tailwind content paths.
    • DB/API: per-instance FrameworkControlFamily table; requirementFamily on requirements; manifests/builders/types updated. Prisma migrations run on deploy.
    • API: Batch update endpoint for requirements to support bulk edits from the editor and avoid rate limiting; transactional with validation.
  • Bug Fixes

    • Custom frameworks: merge framework-scoped and direct links for policies, tasks, and documents with dedup across all read paths, fixing compliance and detail/list views.
    • Write-side sync mirrors direct links into framework-scoped junctions for custom framework instances; fast no-op when an org has no custom frameworks; runs in a single transaction when no external client is provided to avoid partial state.
    • Unlink cascades (policy/task/doc): transactional cleanup of framework-scoped links for custom frameworks, guarded to avoid deleting explicitly scoped links.
    • Utilities/tests: shared dedup helpers; unit tests for controls and custom-framework sync.
    • CS-390/CS-393: default sort requirements by identifier in flat views; remove duplicate headings in the app.
    • Framework editor: ComboboxCell dropdown flips upward when near the viewport bottom to avoid overflow.

Written for commit 8ce8b3c. 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 (staging) Ready Ready Preview, Comment May 27, 2026 5:31pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app (staging) Skipped Skipped May 27, 2026 5:31pm
portal (staging) Skipped Skipped May 27, 2026 5:31pm

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 45 files

Confidence score: 5/5

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

Re-trigger cubic

* fix(controls): include direct policy/task links in custom framework view

Custom frameworks never populate FrameworkControlPolicyLink/TaskLink
junction tables, so findOneForFramework returned empty policies/tasks.
Now merges both framework-scoped and direct relationships with dedup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): scope direct-link fallback to custom frameworks only

Avoids regression for built-in frameworks where framework-scoped links
are intentionally per-framework. Also applies the same fix to
findRequirement() in frameworks service for list/detail consistency.
Extracts deduplicateById to shared util.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): write-side sync + complete read fallback for custom frameworks

Write side: syncDirectLinksToCustomFrameworks mirrors direct policy/task/
document links into framework-scoped junction tables for all custom FIs
using a control. Called from linkPolicies/linkTasks/linkDocumentTypes
(no frameworkInstanceId) and linkControlsToRequirement (custom FI).

Read side: all 4 read paths (findOneForFramework, findOne, findAll,
findRequirement) fall back to direct relationships for custom frameworks,
covering existing data without a migration.

Extracts mergeControlLinks helper to deduplicate mapping logic between
findOne and findRequirement. Collapses deduplicateById/deduplicateByFormType
into a generic deduplicateBy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* perf(controls): early exit sync when org has no custom frameworks

Avoids the requirementMap query on every direct-link operation for
orgs that don't use custom frameworks (vast majority of traffic).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): clean up framework-scoped doc links on direct unlink

When unlinking a direct ControlDocumentType, also delete the
corresponding FrameworkControlDocumentTypeLink rows for custom
framework instances. Prevents stale evidence showing up in custom
framework views after the direct link is removed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): only cascade doc-link cleanup when direct link existed

Skip framework-scoped cleanup if deleteMany removed 0 direct rows,
preventing deletion of explicitly-scoped custom framework links.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): complete custom framework link coverage

- removePolicyControl: cascade-delete framework-scoped policy links
  for custom FIs when disconnecting a policy from a control
- findAll: add custom framework fallback for policies, documents, and
  tasks so dashboard compliance scores are correct
- create: sync framework-scoped links within the creation transaction
  when the control is mapped to custom framework requirements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): guard policy cleanup and fix task dedup ordering

- removePolicyControl: check link exists before cascading framework-
  scoped cleanup, preventing deletion of explicitly-scoped links
- findAll: filter empty-controls tasks before dedup and prioritize
  direct tasks, so custom framework tasks aren't dropped by
  empty framework-scoped entries shadowing valid direct entries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(controls): wrap unlink cascades in transactions

Both removePolicyControl and unlinkDocumentType now run their
direct-link removal and framework-scoped cleanup in a single
transaction, preventing partial state on failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 7 files (changes from recent commits).

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/controls/sync-custom-framework-links.ts Outdated
Comment thread apps/api/src/frameworks/frameworks.service.ts Outdated
Adds requirementFamily field to FrameworkEditorRequirement, with full
support across the framework editor, versioning/sync/rollback, manifest
builder/diff, export/import, and the app's requirements tab.

- Framework editor: ComboboxCell column for setting requirement families
- App: FrameworkRequirementsGrouped component with expand/collapse,
  search, family filter, and URL persistence via nuqs
- Versioning: requirementFamily captured in manifests, diffed, synced
- Review: shows requirement family changes in update preview

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ewport bottom

* fix(framework-editor): flip ComboboxCell dropdown upward when near viewport bottom

Measures available space below the cell on open. If less than 260px,
the dropdown renders above the cell instead of below.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(framework-editor): default sort requirements by identifier

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(app): remove duplicate headings, default sort requirements by identifier

CS-390: Requirements now sorted by identifier with numeric-aware
comparison (AC-2 before AC-10) in the flat view.

CS-393: Removed duplicate "Requirements (N)" and "Controls (N)"
headings — the tab already shows the count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The three createMany calls (policy, task, document links) now run
inside a transaction when no external client is provided, preventing
partial sync state if one fails.

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…miting

* fix(api): add batch update endpoint for requirements to avoid rate limiting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(api): add IsNotEmpty to batch update requirement ID field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to staging – portal May 27, 2026 17:30 Inactive
@vercel vercel Bot temporarily deployed to staging – app May 27, 2026 17:30 Inactive
@Marfuen Marfuen merged commit e53e858 into release May 27, 2026
9 of 10 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.64.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

2 participants