Conversation
0c53758 to
0aa9b9f
Compare
There was a problem hiding this comment.
2 issues found across 15 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/console/src/pages/organizations/documents/_components/DocumentTitleForm.tsx">
<violation number="1" location="apps/console/src/pages/organizations/documents/_components/DocumentTitleForm.tsx:112">
P2: This only hides the edit entry point; it does not stop the form from staying editable after the document becomes archived. Guard the editing state as well so archived documents cannot keep showing the title input and save action.</violation>
</file>
<file name="pkg/coredata/document_filter.go">
<violation number="1" location="pkg/coredata/document_filter.go:46">
P1: Archived documents are still directly accessible from trust-center detail and export endpoints because this only filters list queries.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
apps/console/src/pages/organizations/documents/_components/DocumentTitleForm.tsx
Outdated
Show resolved
Hide resolved
238fd84 to
70dea02
Compare
d82171e to
bc36c34
Compare
c1a151c to
1f1db66
Compare
apps/console/src/pages/organizations/documents/_components/DocumentActionsDropdown.tsx
Outdated
Show resolved
Hide resolved
apps/console/src/pages/organizations/documents/_components/DocumentActionsDropdown.tsx
Outdated
Show resolved
Hide resolved
apps/console/src/pages/organizations/documents/_components/DocumentLayoutDrawer.tsx
Outdated
Show resolved
Hide resolved
1f1db66 to
9aa2e98
Compare
978ae2a to
8377b8c
Compare
dafd881 to
0aa16d8
Compare
There was a problem hiding this comment.
2 issues found across 6 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="pkg/probo/document_service.go">
<violation number="1" location="pkg/probo/document_service.go:1195">
P1: Archiving now permanently deletes control/risk mappings, and unarchive cannot restore them.</violation>
<violation number="2" location="pkg/probo/document_service.go:1721">
P2: Clearing trust-center visibility on archive is irreversible here because unarchive never restores the previous setting.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| document.Status = coredata.DocumentStatusArchived | ||
| document.ArchivedAt = &now | ||
| document.UpdatedAt = now | ||
| document.TrustCenterVisibility = coredata.TrustCenterVisibilityNone |
There was a problem hiding this comment.
P2: Clearing trust-center visibility on archive is irreversible here because unarchive never restores the previous setting.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pkg/probo/document_service.go, line 1721:
<comment>Clearing trust-center visibility on archive is irreversible here because unarchive never restores the previous setting.</comment>
<file context>
@@ -1695,9 +1705,20 @@ func (s *DocumentService) Archive(
document.Status = coredata.DocumentStatusArchived
document.ArchivedAt = &now
document.UpdatedAt = now
+ document.TrustCenterVisibility = coredata.TrustCenterVisibilityNone
if err := document.Update(ctx, tx, s.svc.scope); err != nil {
</file context>
d0e8c78 to
d9d4326
Compare
d9d4326 to
26536aa
Compare
Documents can be archived and unarchived. Archived documents are read-only, excluded from the trust center, and moved to a dedicated Archived tab in the document list. - Add archived_at timestamp and status (ACTIVE/ARCHIVED) PG enum column - Rename DocumentStatus → DocumentVersionStatus, introduce DocumentStatus - Archive/unarchive mutations in GraphQL, MCP, and CLI - Bulk archive/unarchive mutations with Active/Archived tabs in the list - ABAC policies: write actions denied on archived docs, unarchive denied on active docs - Remove control/risk mappings and reset trust center visibility on archive - Exclude archived documents from mapping dialogs and trust center tab Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
26536aa to
1db8e71
Compare
| import type { DocumentListBulkUnarchiveMutation } from "#/__generated__/core/DocumentListBulkUnarchiveMutation.graphql"; | ||
| import type { DocumentListFragment$key } from "#/__generated__/core/DocumentListFragment.graphql"; | ||
| import type { DocumentsListQuery, DocumentType } from "#/__generated__/core/DocumentsListQuery.graphql"; | ||
| import type { DocumentType, DocumentsListQuery } from "#/__generated__/core/DocumentsListQuery.graphql"; |
There was a problem hiding this comment.
🚫 [eslint (apps/console)] reported by reviewdog 🐶
DocumentsListQuery import should occur before import of DocumentType import-x/order
| { status: [tab], documentTypes: documentTypeFilter ? [documentTypeFilter] : null }, | ||
| { fetchPolicy: "store-and-network" }, | ||
| ); | ||
| }, [tab, refetch]); |
There was a problem hiding this comment.
React Hook useEffect has a missing dependency: 'documentTypeFilter'. Either include it or remove the dependency array react-hooks/exhaustive-deps
| const canRequestAnySignatures = documents.some(({ canRequestSignatures }) => canRequestSignatures); | ||
| const canArchiveAny = documents.some(({ canArchive }) => canArchive); | ||
| const canUnarchiveAny = documents.some(({ canUnarchive }) => canUnarchive); | ||
| const canSendAnySignatureNotifications = documents.some(({ canSendSigningNotifications }) => canSendSigningNotifications); |
There was a problem hiding this comment.
This line has a length of 124. Maximum allowed is 120 @stylistic/max-len
| const refetchWithFilters: ComponentProps<typeof SortableTable>["refetch"] = ({ order }) => { | ||
| pagination.refetch({ | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| order: order as any, |
There was a problem hiding this comment.
🚫 [eslint (apps/console)] reported by reviewdog 🐶
Unsafe assignment of an any value @typescript-eslint/no-unsafe-assignment
Allow documents to be archived and unarchived via GraphQL, MCP, and
the console UI. Archived documents cannot be edited or published and
are excluded from the trust center. The console displays archived
documents as grayed out in lists and shows the archived date in the
document details drawer.
Summary by cubic
Add document archiving across GraphQL, MCP, and the console with ABAC enforcement. Archived documents are read‑only, can’t be published, are excluded from the trust center, and archiving removes control/risk mappings and resets trust center visibility; the console adds Active/Archived tabs with bulk and per‑document archive/unarchive and toasts.
New Features
Document.status(ACTIVE/ARCHIVED) andarchivedAt;archiveDocument/unarchiveDocumentandbulkArchiveDocuments/bulkUnarchiveDocuments;DocumentFilter.status(list);DocumentVersionStatusenum forDocumentVersion.statusandDocumentVersionFilter.status; update/publish/version‑update return Conflict if archived; archive/unarchive return Conflict when already/never archived.archiveDocument/unarchiveDocumenttools; spec includesDocument.statusandarchived_at; version status usesDocumentVersionStatus.NONE.document_statusto authorization attributes for Document and DocumentVersion; deny writes when status is ARCHIVED (delete allowed); deny unarchive when status is ACTIVE; new actionscore:document:archiveandcore:document:unarchive.Migration
document_status(ACTIVE/ARCHIVED); addarchived_at TIMESTAMPTZandstatus document_status NOT NULL DEFAULT 'ACTIVE'todocuments, then drop the default. Rename enumpolicy_statustodocument_version_status.Written for commit 1db8e71. Summary will update on new commits.