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.

2 Skipped Deployments
Project Deployment Review Updated (UTC)
app (staging) Skipped Skipped Dec 24, 2025 3:48pm
portal (staging) Skipped Skipped Dec 24, 2025 3:48pm

@cursor
Copy link

cursor bot commented Dec 23, 2025

PR Summary

Adds end-to-end task item management and vendor risk automation with notifications.

  • New Task Management module: CRUD, stats, attachments (60MB), special S3 paths for task_item, activity logs, and role-gated endpoints (admin/owner)
  • Auth enhancements: userRoles in context, RequireRoles guard, InternalTokenGuard; updated decorators/guards
  • Notifications: Novu integration (NOVU_API_KEY) and email templates; mention/assignment notifiers for comments and task items
  • Vendor automation: Trigger.dev tasks to create "Risk Assessment" task items, Firecrawl agent-based research, batch internal trigger API; vendor creation now triggers assessment
  • App UI: add TaskItems to Vendor/Risk detail with deep links; rename Tasks to Evidence; vendor create now requires organizationId and optional website; onboarding finalization ensures active org; expanded email preferences (task mentions/assignments)
  • Build/config: include packages/email in Docker build; add deps (@trycompai/email, Firecrawl); env examples updated

Written by Cursor Bugbot for commit 0a2bd7a. 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]>
@vercel vercel bot temporarily deployed to staging – portal December 24, 2025 15:06 Inactive
@vercel vercel bot temporarily deployed to staging – app December 24, 2025 15:48 Inactive
@vercel vercel bot temporarily deployed to staging – portal December 24, 2025 15:48 Inactive
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