Skip to content

Conversation

@github-actions
Copy link
Contributor

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.

* feat: task assignment for vendor and records

* refactor(auth): simplify role validation and update entity types

* refactor(task): clean and fix bug

* feat(task): add GetTaskItemStatsQueryDto for task item stats retrieval

* chore: added focus mode for task, improved logic and cleaning up

* feat(task): add task item attachment upload and activity logging

* feat: add comments to task, notifications in email and in-appm clean code

* feat: risk assesstment for vendors, fix some bugs

* refactor(notifications): clean up NovuService fetch logic and error handling

* feat(api): add INTERNAL_API_TOKEN to environment example

* feat(env): add INTERNAL_API_TOKEN to environment configuration

* chore(api): fix bugs

* fix(api): update default framework ID from iso42001 to iso27001

* fix(api): correct entity route path for risk in comment notifier

---------

Co-authored-by: Tofik Hasanov <[email protected]>
@vercel
Copy link

vercel bot commented Dec 23, 2025

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

Project Deployment Review Updated (UTC)
app (staging) Ready Ready Preview, Comment Dec 24, 2025 6:20am
portal (staging) Ready Ready Preview, Comment Dec 24, 2025 6:20am

@cursor
Copy link

cursor bot commented Dec 23, 2025

PR Summary

Adds task management and automations, plus UI and auth enhancements.

  • Introduces TaskManagementModule with endpoints for task items (CRUD, stats, pagination, filtering/sorting), attachments (new S3 pathing), audit logs, and role-guarded access; integrates email (Resend templates) and in-app notifications (Novu)
  • Implements mention and assignment notifications for comments/task items, adds NovuService, and expands email preferences with taskMentions and taskAssignments
  • Automates vendor risk assessment creation via Trigger.dev tasks using Firecrawl research; adds internal controller (guarded by InternalTokenGuard) and batch triggers; vendor create now triggers background risk-assessment task
  • Updates UI: embeds Task Items on Vendor/Risk pages, rebrands “Tasks” to “Evidence” in labels/titles, and improves vendor creation/research flow (org-scoped)
  • Auth updates: userRoles in auth context, new RoleValidator guard, and InternalTokenGuard for internal APIs; HybridAuth sets roles for JWT and null for API keys
  • Attachments: file size limit increased to 60MB and special S3 key format for task-item uploads
  • Questionnaire export: supports all formats (ZIP) in token-based flow
  • Infra/config: add NOVU keys and internal token to envs, include email package in Docker build/tsconfig/deps; add Firecrawl dependency

Written by Cursor Bugbot for commit 154ca39. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@graphite-app
Copy link

graphite-app bot commented Dec 23, 2025

Graphite Automations

"Auto-assign PRs to Author" took an action on this PR • (12/23/25)

1 reviewer was added to this PR based on Mariano Fuentes's automation.

} else {
this.logger.log(`[MENTION DEBUG] No mentions found in description`);
}
}
Copy link

Choose a reason for hiding this comment

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

Task update notifies all mentioned users repeatedly

The updateTaskItem function sends mention notifications to ALL mentioned users on every description update, rather than only newly mentioned users. The comments service correctly compares previous and current mentions using extractMentionedUserIds(existingComment.content) and filters with currentMentioned.filter((id) => !previousMentioned.has(id)). The task management service has access to existingTaskItem.description but doesn't use it for this comparison. This causes users to receive duplicate notifications every time a task description is edited, even for minor typo fixes.

Fix in Cursor Fix in Web

assigneeId: input.parsedInput.assigneeId,
organizationId: session.session.activeOrganizationId,
website: input.parsedInput.website,
organizationId: input.parsedInput.organizationId,
Copy link

Choose a reason for hiding this comment

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

Web UI vendor creation misses risk assessment task

The vendors.service.ts was updated to trigger vendor-risk-assessment-task when creating vendors (which creates a TaskItem), but the web UI's create-vendor-action.ts server action creates vendors directly in the database without triggering this task. The researchVendorAction called by the form only takes a website URL without vendor context, so it cannot create the TaskItem. This means vendors created through the web UI won't receive automatic risk assessment TaskItems, while vendors created through the API will. The existence of backfill-vendor-risk-assessment-tasks.ts confirms the intent is for all vendors to have these tasks.

Additional Locations (1)

Fix in Cursor Fix in Web

@vercel vercel bot temporarily deployed to staging – portal December 23, 2025 21:15 Inactive
@vercel vercel bot temporarily deployed to staging – app December 23, 2025 21:15 Inactive
const parentRoutePath = taskItem?.entityType === 'vendor' ? 'vendors' : 'risk';
const commentUrl = taskItem
? `${appUrl}/${organizationId}/${parentRoutePath}/${taskItem.entityId}?taskItemId=${entityId}#task-items`
: '';
Copy link

Choose a reason for hiding this comment

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

Comment mention notifications broken for legacy Task entities

The comment mention notifier only handles CommentEntityType.task comments, but assumes entityId is always a TaskItem ID. However, comments.service.ts explicitly supports both TaskItem and legacy Task entities under this type (with backward compatibility comments). When a comment is made on a legacy Task (not TaskItem), db.taskItem.findUnique returns null, causing entityName to default to "Unknown Task" and commentUrl to be an empty string. The notification email will then display a broken "View Comment" button linking to nothing and show "copy and paste this URL:" with an empty link.

Fix in Cursor Fix in Web

where: {
id: vendorId,
organizationId: session.session.activeOrganizationId,
organizationId,
Copy link

Choose a reason for hiding this comment

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

Vendor page removed organization access validation from session

The getVendor and getAssignees functions were changed from validating session.session.activeOrganizationId to accepting organizationId directly from URL params without verifying the authenticated user has access to that organization. Previously the code checked if (!session || !session.session.activeOrganizationId), ensuring the user had an active org context. Now it only checks if (!session?.user?.id) and trusts the orgId URL param. This is inconsistent with the risk page which still uses session-based org validation. An authenticated user could potentially access vendor data from other organizations by manipulating the URL, unless there's middleware protection not visible in this diff.

Additional Locations (1)

Fix in Cursor Fix in Web

@vercel vercel bot temporarily deployed to staging – portal December 23, 2025 23:37 Inactive
@vercel vercel bot temporarily deployed to staging – app December 23, 2025 23:37 Inactive
* feat(api): update firecrawl integration and enhance risk assessment task

* feat(api): enhance news item processing in firecrawl agent

---------

Co-authored-by: Tofik Hasanov <[email protected]>
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