Skip to content

Commit eaa83aa

Browse files
committed
Merge branch 'main' of https://github.com/trycompai/comp into chas/add-comments-to-findings
2 parents 1d3d714 + 7a96f39 commit eaa83aa

198 files changed

Lines changed: 14904 additions & 2607 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/settings.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "file=\"$CLAUDE_FILE_PATH\"; if echo \"$file\" | grep -qE '\\.(ts|tsx)$' && echo \"$file\" | grep -qE '^(apps/api|apps/app)/'; then echo 'TypeScript file modified — remember to run typecheck before committing'; fi"
9+
"command": "file=\"$CLAUDE_FILE_PATH\"; if echo \"$file\" | grep -qE '\\.(ts|tsx)$' && echo \"$file\" | grep -qE '^(apps/|packages/)'; then echo 'TypeScript file modified — run the cleanup skill and typecheck before committing'; fi"
1010
}
1111
]
1212
},

‎.claude/skills/cleanup/SKILL.md‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
name: cleanup
3+
description: "MUST run after writing or modifying code — reviews changed files for verbose patterns, inconsistencies, and readability issues before considering work done"
4+
---
5+
6+
# Post-Implementation Cleanup
7+
8+
**This skill is mandatory.** After writing or modifying code, you MUST review all changed files before reporting the task as complete. Code must be readable at a glance.
9+
10+
## When to Run
11+
12+
- After completing any implementation work
13+
- After fixing bugs
14+
- After refactoring
15+
- Before committing
16+
17+
## Checklist
18+
19+
For every file you changed, verify:
20+
21+
### 1. No Verbose Defensive Checks
22+
23+
Extract repeated patterns into typed helpers.
24+
25+
```tsx
26+
// ❌ Verbose and repeated
27+
const perms = typeof role.permissions === 'string'
28+
? JSON.parse(role.permissions) : role.permissions;
29+
if (perms && typeof perms === 'object' && Array.isArray(perms.portal) && perms.portal.length > 0) {
30+
31+
// ✅ Typed helper
32+
const perms = parseRolePermissions(role.permissions);
33+
if (perms?.portal?.length) {
34+
```
35+
36+
### 2. Consistent Idioms Across Files
37+
38+
The same check must use the same pattern everywhere.
39+
40+
```tsx
41+
// ❌ Inconsistent
42+
file1: perms?.portal?.length > 0
43+
file2: perms?.portal?.length
44+
45+
// ✅ Pick one
46+
perms?.portal?.length
47+
```
48+
49+
### 3. No Redundant Type Casts
50+
51+
If you need a cast to satisfy TypeScript, extract a helper function instead.
52+
53+
```tsx
54+
// ❌ Verbose cast repeated in every file
55+
const restrictedRoles: readonly string[] = RESTRICTED_ROLES;
56+
restrictedRoles.includes(role);
57+
58+
// ✅ Helper in shared package
59+
export function isRestrictedRole(role: string): boolean {
60+
return (RESTRICTED_ROLES as readonly string[]).includes(role);
61+
}
62+
```
63+
64+
### 4. Error Handling on Boundaries
65+
66+
`JSON.parse`, external API calls, and DB queries at system boundaries need error handling.
67+
68+
```tsx
69+
// ❌ Unguarded parse
70+
const parsed = JSON.parse(value);
71+
72+
// ✅ Safe parse
73+
try {
74+
return JSON.parse(value);
75+
} catch {
76+
return null;
77+
}
78+
```
79+
80+
### 5. Shared Patterns Belong in Shared Packages
81+
82+
If the same logic appears in 2+ apps (api, app, portal), extract it to a shared package (`packages/auth`, `packages/db`, etc.).
83+
84+
### 6. No Dead Code
85+
86+
- Remove unused imports
87+
- Remove unused variables
88+
- Remove unused function parameters
89+
- Remove props that are always null/false
90+
91+
### 7. Readable at a Glance
92+
93+
- Function and variable names should convey intent without reading the implementation
94+
- One-liner expressions over multi-line when equally clear
95+
- No nested ternaries
96+
97+
## How to Run
98+
99+
1. List all files you modified: `git diff --name-only`
100+
2. Read each file and check against this checklist
101+
3. Fix any issues found
102+
4. Typecheck after fixes: `npx tsc --noEmit`

‎.env.example‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RESEND_API_KEY="" # API key from Resend for email authentication / invites
66
RESEND_FROM_MARKETING=""
77
RESEND_FROM_SYSTEM=""
88
RESEND_FROM_DEFAULT=""
9+
RESEND_FROM_TRUST_PORTAL="" # Sender for Trust Portal access/NDA emails (falls back to RESEND_FROM_SYSTEM)
910
RESEND_TO_TEST=""
1011
RESEND_REPLY_TO_MARKETING=""
1112
REVALIDATION_SECRET="" # openssl rand -base64 32

‎CHANGELOG.md‎

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
1+
# [3.57.0](https://github.com/trycompai/comp/compare/v3.56.0...v3.57.0) (2026-05-19)
2+
3+
4+
### Features
5+
6+
* **pen-test-marketing:** add marketing components and empty state for penetration tests ([445e433](https://github.com/trycompai/comp/commit/445e433ae910ca5bc9489083129e1bf73f491507))
7+
8+
# [3.56.0](https://github.com/trycompai/comp/compare/v3.55.2...v3.56.0) (2026-05-15)
9+
10+
11+
### Bug Fixes
12+
13+
* **app:** add new exemption fields to createMockMember ([ada894d](https://github.com/trycompai/comp/commit/ada894dbbfbbadf5fb57d96a804d03ab695a302d))
14+
* **background-check:** persist exemption reason + justification on member ([6988e37](https://github.com/trycompai/comp/commit/6988e37e7ad65ca6b662782cc4a7631a40995c9e))
15+
* **cloud-tests:** address cubic findings on production deploy PR ([33042e7](https://github.com/trycompai/comp/commit/33042e79918196f8c4e585844649622329e6f041))
16+
* **cloud-tests:** address cubic review findings ([c05da23](https://github.com/trycompai/comp/commit/c05da233efe41a10baaeeb556a60c4ca51c927b9))
17+
* **cloud-tests:** address cubic review on RemediationSection and enrichEmptyState ([79bfb0f](https://github.com/trycompai/comp/commit/79bfb0f328ad41ec4f30c442a7a35aadeb0d6e00))
18+
* **cloud-tests:** address cubic round 4 findings ([0e193c2](https://github.com/trycompai/comp/commit/0e193c2ff5b187496554a38d20268edd92b4bab4))
19+
* **cloud-tests:** deterministic backstop for empty CURRENT/PROPOSED in fix-plan dialog ([8111faf](https://github.com/trycompai/comp/commit/8111faf787087bbb967e3ec3fe6a9c897186efbf))
20+
* **cloud-tests:** differentiate check-definition fields + structured remediation rendering ([9faf036](https://github.com/trycompai/comp/commit/9faf03637cb1ec4f30f2c371fc8bd3cb533c2028))
21+
* **cloud-tests:** legacy result-filter robustness + Prisma migration cleanup ([d52294e](https://github.com/trycompai/comp/commit/d52294eb67b6c86b57fa83ac6e59bce18d2d6a89)), closes [#6](https://github.com/trycompai/comp/issues/6)
22+
* **cloud-tests:** nested arrays in sanitizer + strict date-only expiry validation ([12411c7](https://github.com/trycompai/comp/commit/12411c7e64bf94552c5f3d4f896fc5f0ad6d2e86))
23+
* **cloud-tests:** teach AI fix-plan to describe create-from-scratch remediations ([11d717f](https://github.com/trycompai/comp/commit/11d717fa2b9fdf0797e0845c70482e734ae62e2b))
24+
25+
26+
### Features
27+
28+
* **cloud-tests:** auditor visibility improvements (phases 1-5) ([3456655](https://github.com/trycompai/comp/commit/34566555f85845a4d7e6bf7fe6ad25fe82851a20))
29+
30+
## [3.55.2](https://github.com/trycompai/comp/compare/v3.55.1...v3.55.2) (2026-05-15)
31+
32+
33+
### Bug Fixes
34+
35+
* **people:** send single combined email for admin+employee invites with portal ([#2857](https://github.com/trycompai/comp/issues/2857)) ([a4adb20](https://github.com/trycompai/comp/commit/a4adb2035779fb3d77d0f21adbb50f8714956407))
36+
* **risks:** treatment plan disappears when switching strategies ([#2860](https://github.com/trycompai/comp/issues/2860)) ([9b052f5](https://github.com/trycompai/comp/commit/9b052f50f55280fdb24f9f33ae771e2553048a59))
37+
38+
## [3.55.1](https://github.com/trycompai/comp/compare/v3.55.0...v3.55.1) (2026-05-15)
39+
40+
41+
### Bug Fixes
42+
43+
* **cloud-security:** use credential report for iam-root-access-keys check ([#2846](https://github.com/trycompai/comp/issues/2846)) ([2e58e26](https://github.com/trycompai/comp/commit/2e58e26d160998854aedca64307dcdd7594c3bf8))
44+
45+
# [3.55.0](https://github.com/trycompai/comp/compare/v3.54.3...v3.55.0) (2026-05-15)
46+
47+
48+
### Features
49+
50+
* **trust-portal:** dedicated FROM env var for trust portal emails ([#2851](https://github.com/trycompai/comp/issues/2851)) ([69b9157](https://github.com/trycompai/comp/commit/69b91570bbcfa7bd658b94619d10dc6a6b087362))
51+
52+
## [3.54.3](https://github.com/trycompai/comp/compare/v3.54.2...v3.54.3) (2026-05-14)
53+
54+
55+
### Bug Fixes
56+
57+
* **frameworks:** populate framework-scoped link tables during org onboarding ([7cbbaa0](https://github.com/trycompai/comp/commit/7cbbaa0329802e88ec5d1a52ff8312768f23afd9))
58+
59+
## [3.54.2](https://github.com/trycompai/comp/compare/v3.54.1...v3.54.2) (2026-05-14)
60+
61+
62+
### Bug Fixes
63+
64+
* **integrations:** remove fragile heredoc from AWS auditor setup script ([6acb361](https://github.com/trycompai/comp/commit/6acb3610d5a11ae12b6dbc67f9f54c22510e74c0))
65+
* **portal:** resolve RBAC permissions instead of checking role names ([9316c6d](https://github.com/trycompai/comp/commit/9316c6d29d95f7e6019c6954a01666c1b5f9c73e))
66+
67+
## [3.54.1](https://github.com/trycompai/comp/compare/v3.54.0...v3.54.1) (2026-05-14)
68+
69+
70+
### Bug Fixes
71+
72+
* **integrations:** remove fragile heredoc from AWS auditor setup script ([#2845](https://github.com/trycompai/comp/issues/2845)) ([f056c60](https://github.com/trycompai/comp/commit/f056c60ab8e6ebc59eed43df541f43bad0cfeea4))
73+
74+
# [3.54.0](https://github.com/trycompai/comp/compare/v3.53.0...v3.54.0) (2026-05-13)
75+
76+
77+
### Bug Fixes
78+
79+
* **background-check:** address cubic review — arrow nav, credit filter, trim payload ([800265a](https://github.com/trycompai/comp/commit/800265afcdb5ecbafa7d3831445d6594350ddfbd))
80+
* **background-check:** align V1 content with tab strip and page header ([9d5454b](https://github.com/trycompai/comp/commit/9d5454b8f3987462acb44c047a385901f21d88a8))
81+
82+
83+
### Features
84+
85+
* **background-check:** redesign overview and report to surface real verification methodology ([a5ebe77](https://github.com/trycompai/comp/commit/a5ebe7778dee104affff0480772e5f980e8402c6))
86+
* **background-check:** replace marketing overview with V1 two-paths task surface ([4c81b38](https://github.com/trycompai/comp/commit/4c81b38bafe7d7daeeea8e5145b6b060f066ff73))
87+
88+
# [3.53.0](https://github.com/trycompai/comp/compare/v3.52.0...v3.53.0) (2026-05-13)
89+
90+
91+
### Bug Fixes
92+
93+
* **pentest:** wire authorization error to checkbox via aria-invalid + aria-describedby ([2e871d6](https://github.com/trycompai/comp/commit/2e871d67f886f192fdb7b297c1dd02d545a630b3))
94+
95+
96+
### Features
97+
98+
* **pentest:** improve scan-creation copy and add authorization gate ([5d58635](https://github.com/trycompai/comp/commit/5d58635e91ef19e4c3bf4cb1cce410a027347a36))
99+
100+
# [3.52.0](https://github.com/trycompai/comp/compare/v3.51.0...v3.52.0) (2026-05-13)
101+
102+
103+
### Bug Fixes
104+
105+
* **rbac:** enforce app:read for app access, use permissions for member invites, gate portal ([d47cd5d](https://github.com/trycompai/comp/commit/d47cd5db15a4d198cfc0c67b549bda138b83ac4e))
106+
107+
108+
### Features
109+
110+
* **control-template:** enhance control template service and controller for document type linking ([a024822](https://github.com/trycompai/comp/commit/a024822a36ef7ad328466d70bd4168c19c3fcc3a))
111+
* **controls:** add frameworkInstanceId support for control linking and retrieval ([8d23f15](https://github.com/trycompai/comp/commit/8d23f156a47593beac1c3b42ca23757971a7c12b))
112+
1113
# [3.51.0](https://github.com/trycompai/comp/compare/v3.50.0...v3.51.0) (2026-05-12)
2114

3115

‎apps/api/.env.example‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ GROQ_API_KEY=
4444
RESEND_API_KEY=
4545
RESEND_FROM_SYSTEM= # e.g., noreply@mail.trycomp.ai
4646
RESEND_FROM_DEFAULT= # e.g., hello@mail.trycomp.ai
47+
RESEND_FROM_TRUST_PORTAL= # e.g., Comp AI <noreply@mail.trust.inc> — sender for Trust Portal access/NDA emails (falls back to RESEND_FROM_SYSTEM)
4748

4849
# Background checks
4950
BACKGROUND_CHECK_API_BASE_URL=https://glad-sturgeon-729.convex.site

‎apps/api/src/admin-organizations/admin-findings.controller.spec.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('AdminFindingsController', () => {
3636
findByOrganizationId: jest.fn(),
3737
create: jest.fn(),
3838
update: jest.fn(),
39+
delete: jest.fn(),
3940
};
4041

4142
beforeEach(async () => {
@@ -122,4 +123,26 @@ describe('AdminFindingsController', () => {
122123
expect(result).toEqual(updated);
123124
});
124125
});
126+
127+
describe('remove', () => {
128+
it('should delete a finding as platform admin', async () => {
129+
const deleted = {
130+
message: 'Finding deleted successfully',
131+
deletedFinding: { id: 'fnd_1' },
132+
};
133+
mockService.delete.mockResolvedValue(deleted);
134+
135+
const result = await controller.remove('org_1', 'fnd_1', {
136+
userId: 'usr_admin',
137+
});
138+
139+
expect(mockService.delete).toHaveBeenCalledWith(
140+
'org_1',
141+
'fnd_1',
142+
'usr_admin',
143+
null,
144+
);
145+
expect(result).toEqual(deleted);
146+
});
147+
});
125148
});

‎apps/api/src/admin-organizations/admin-findings.controller.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
Controller,
3+
Delete,
34
Get,
45
Post,
56
Patch,
@@ -92,4 +93,14 @@ export class AdminFindingsController {
9293
null,
9394
);
9495
}
96+
97+
@Delete(':orgId/findings/:findingId')
98+
@ApiOperation({ summary: 'Delete a finding for an organization (admin)' })
99+
async remove(
100+
@Param('orgId') orgId: string,
101+
@Param('findingId') findingId: string,
102+
@Req() req: AdminRequest,
103+
) {
104+
return this.findingsService.delete(orgId, findingId, req.userId, null);
105+
}
95106
}

0 commit comments

Comments
 (0)