Commit Graph

227 Commits

Author SHA1 Message Date
Sacha Al Himdani
b603d04d8d Assets as document: replace snapshot with publish workflow
Remove assets from the snapshot system and replace with a publish-based
document workflow that generates versioned ProseMirror documents.

- Remove snapshot_id/source_id from asset and asset_vendor models
- Delete AssetFilter (no longer needed without snapshot filtering)
- Add PublishAssetList service, GraphQL mutation, MCP tool, CLI command,
  and n8n operation
- Add asset_list_document_id column to generated_documents table
- Generate ProseMirror documents with asset inventory tables
  (name, type, amount, data types stored, owner, vendors)
- Add AssetListDocument resolver on Organization type
- Update frontend to remove snapshot routes/params and add publish dialog
- Add e2e tests for asset publish (immediate, with approvers, reuse, RBAC)
- Add migration script for converting legacy asset snapshots to documents
- Exclude ASSETS from snapshot type lists and e2e snapshot tests
- Move generated_documents SQL to coredata methods on Datum and Asset
- Clear generated document and SOA references on soft delete and archive

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 19:36:17 +02:00
Sacha Al Himdani
e1148f812e Replace implemented column with CMMI maturity level
Drop the boolean implemented/not-implemented state in favor of a
mandatory CMMI maturity level enum (NONE, INITIAL, MANAGED, DEFINED,
QUANTITATIVELY_MANAGED, OPTIMIZING) stored as a Postgres enum type.

The migration backfills existing rows (NOT_IMPLEMENTED → NONE,
IMPLEMENTED → INITIAL), makes the column NOT NULL, and drops the old
implemented column and its enum type.

- maturityLevel is required on CreateControlInput and non-nullable (!)
  in the GraphQL schema
- CLI displays human-readable CMMI labels instead of raw enum tokens
- SOA table and published document use a single Maturity column in
  place of the old Implemented + Maturity columns
- Remove ControlImplementationState type and all implemented references
  across backend, frontend, CLI, MCP, n8n, and E2E tests

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-21 11:06:36 +02:00
Alejandro Juan
da91afc2a7 Add CMMI maturity level to compliance controls
Adds an optional CMMI 0-5 maturity level field to Control to support
ISO 27001 clause 9.1 effectiveness measurement and HITRUST CSF maturity
requirements. The field is nullable, framework-agnostic, and exposed
across all four API surfaces (GraphQL, MCP, CLI, n8n) plus the
generated SoA document.

Signed-off-by: Alejandro Juan <alejandrojuan@alejandrojuan.com>
2026-04-21 11:06:36 +02:00
Sacha Al Himdani
55563226cb Data as document: replace snapshot with publish workflow
Mirror the SOA-to-document migration for the data list. Remove data
from the snapshot system and add a publish workflow that generates a
ProseMirror document for the full organization data inventory.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-20 14:44:00 +02:00
Sacha Al Himdani
524f209df7 Filter people with ended contracts from signature request dialog
Move the paginated people query from PeopleGraph.ts into
SignatureDocumentsDialog.tsx following colocated query conventions
and pass excludeContractEnded: true to hide people whose contract has ended.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-15 14:05:34 +02:00
Sacha Al Himdani
808fdffc9b Return computed risk scores after update
Add inherentRiskScore and residualRiskScore to the mutation fragment so
the Relay store gets updated scores. On the backend, use RETURNING to
get the recomputed values from the database generated columns.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-14 18:09:01 +02:00
Sacha Al Himdani
03708d45c3 Consolidate document draft management into updateDocument
Replace the three separate draft mutations (createDraftDocumentVersion,
updateDocumentVersion, deleteDraftDocumentVersion) with automatic draft
lifecycle management inside updateDocument. The backend now auto-creates
a draft when a published document is edited, updates the existing draft
on subsequent edits, and auto-deletes the draft when content reverts to
match the published version.

A new deleteDocumentDraft mutation provides explicit draft deletion.

Backend:
- Merge version-level fields (content, title, classification,
  documentType) into UpdateDocumentRequest
- Convert CreateDraft, UpdateVersion, DeleteDraft into private
  transaction helpers called from Update
- Update returns (*Document, *DocumentVersion, error) with the version
  present only when a draft exists

Frontend:
- Remove all create/update/delete draft mutations from components
- Auto-save via updateDocument with layout refetch on draft status
  transitions while preserving editor cursor (data-generation key)
- Title, type, and classification editable on published versions
  (backend auto-creates draft)
- Forms use react-hook-form values option to stay synced with Relay
  fragment data across draft/publish transitions

API surface (GraphQL, MCP, CLI, n8n) updated consistently:
- Removed: createDraftDocumentVersion, updateDocumentVersion,
  deleteDraftDocumentVersion
- Added: deleteDocumentDraft (document-level)
- Updated: updateDocument accepts content, classification, documentType

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-14 15:01:20 +02:00
Sacha Al Himdani
ef2e99d86c Add measure-document linking
Introduce the ability to link measures to documents, following the
existing pattern used by controls and risks. This includes:

- Database migration for measures_documents join table
- Coredata MeasureDocument struct with insert/delete operations
- Document service methods for listing/counting by measure ID
- Measure service CreateDocumentMapping/DeleteDocumentMapping methods
- Cleanup of measure-document mappings on document archive
- GraphQL mutations, inputs, payloads, and Measure.documents field
- DocumentConnection.TotalCount support for measure resolver
- MCP linkMeasure/unlinkMeasure updated to support documents
- MCP listMeasureDocuments tool
- Frontend MeasureDocumentsTab with LinkedDocumentsCard integration
- Authorization actions for measure document mapping
- E2e tests for measure document mapping

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-04-03 17:51:31 +02:00
Émile Ré
3a054c70ba Implement debounced auto save
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-01 18:03:17 +04:00
Sacha Al Himdani
851e585b9b Add ISC license headers to Go, TypeScript, and SQL files
Add ISC license headers to all .go, .ts, .tsx, and .sql files
using each file's git history to determine the correct copyright
year or year range. Trademarked icons (brand logos, vendor logos,
compliance framework logos) are excluded.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-31 13:31:30 +02:00
Sacha Al Himdani
999171a626 Add document approval workflow
Introduce a complete approval system for document publishing. Document
versions can now require approval from selected reviewers before being
published, with automatic publishing once all approvers have approved.

- Add approval quorum and decision tables with backfill migration
- Implement request approval, approve, and reject flows with electronic
  signature support for approve decisions
- Add employee approvals page with dedicated tab and pending approvals view
- Add changelog field to publish and request approval flows
- Pre-select previous version's approvers in the publish dialog
- Show quorum approvers in document list with 100 approver hard limit
- Expose approval workflow through GraphQL, MCP, and CLI
- Remove legacy default approvers feature entirely
- Add comprehensive e2e test coverage for approval workflows

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-27 19:43:20 +01:00
Sacha Al Himdani
4a2d308da0 Add task drag-and-drop reordering
Order tasks by priority (ASC) by default. Enable drag-and-drop
on the TODO and DONE tabs using native HTML5 drag events,
following the compliance external URLs pattern. The "All" tab
remains read-only since priority is scoped per state.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-27 15:47:12 +01:00
Bryan Frimin
619ec7b882 Add AI-powered evidence description generation
Introduce a background worker that automatically generates
compliance-focused descriptions for uploaded evidence files
using configurable LLM providers. Descriptions are surfaced
across all interfaces: GraphQL API, MCP API, CLI, and the
console UI.

Key changes:
- Multi-provider LLM config with per-agent settings (pointer
  types for Temperature/MaxTokens to preserve zero values)
- Evidence description worker with bounded concurrency
- EvidenceDescriptionStatus typed enum with PostgreSQL enum type
- New `prb evidence` CLI commands (list, view, delete)
- Evidence description displayed in console table and preview
- Migration only marks evidences without files as completed

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-26 14:32:41 +01:00
Bryan Frimin
359f85f5da Add SEO controls and sitemap for compliance pages
Add search engine indexing toggle, robots.txt, and sitemap.xml
generation for compliance pages. Replace checkboxes with toggle
components in the compliance page UI and add an "Open" button
in the page header to quickly access the live compliance page.
The search engine indexing toggle is disabled when the compliance
page is inactive.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-24 15:55:31 +01:00
Bryan Frimin
a9ebeef0fa Transform meetings page into context page with tabs
Add structured organization context with 5 markdown sections (Product, Architecture, Team, Processes, Customers) editable inline. Meetings are now a tab within the context page. Moved all GraphQL queries from hooks/graph/MeetingGraph.ts into colocated components following new best practices. Updated database schema, backend services, GraphQL resolvers, and MCP API to support the new context fields and structure.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 19:02:50 +01:00
Sacha Al Himdani
1db8e7133e Add document archiving
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>
2026-03-19 14:15:54 +01:00
Bryan Frimin
4f54241382 Add document types filtering and rename ISMS to GOVERNANCE
Adds 5 new document types (PLAN, REGISTER, RECORD, REPORT, TEMPLATE), renames ISMS to GOVERNANCE, and implements type-based filtering across GraphQL, MCP, and frontend. Includes migration, enum updates, filter implementation with SQL array support, and frontend dropdown UI with Relay refetch pattern.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 12:31:39 +01:00
Bryan Frimin
82f241628c Refactor MeasuresPage to use Relay fragments
Replace the client-side grouped-by-category view (fetching 500 items)
with a flat table using server-side filtering and cursor-based
pagination. Colocate GraphQL queries, fragments, and mutations in the
component file per console CLAUDE.md conventions.

Backend changes add a category filter to the measure list endpoints
(GraphQL, MCP) and a new measureCategories field on Organization.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:54:33 +01:00
Bryan Frimin
32cc4a4f9c WIP
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:39 +01:00
Bryan Frimin
0e0539f1f3 Replace console frontend with unified findings pages
Add FindingsPage, FindingDetailsPage, and CreateFindingDialog
supporting all finding kinds (nonconformity, observation, exception)
with filtering, sorting, and audit linking.

Remove the separate nonconformity and continual improvement pages,
routes, and graph hooks. Update sidebar navigation, routes, and
components for nullable audit framework field.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:05:33 +01:00
Sacha Al Himdani
cf1dadc0b5 Add implemented state and justification to controls
Introduce `implemented` enum (IMPLEMENTED/NOT_IMPLEMENTED) and
`not_implemented_justification` (nullable text) fields on the Control
entity across all API surfaces (GraphQL, MCP, CLI), database, frontend,
and SOA export.

The database stores implementation state as a PostgreSQL enum
`control_implementation_state`. Controls default to IMPLEMENTED during
migration. The SOA list and PDF export show implementation status
alongside applicability, with "-" for non-applicable controls.
Justification columns are renamed for clarity: "Justification for
non-applicability" and "Justification for non-implementation".

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-17 11:01:04 +01:00
Bryan Frimin
ecba352307 Revert relay generics that cause cascade type errors
Adding TypeScript generics to useMutation, usePaginationFragment,
and useRefetchableFragment in graph hooks and page files causes
cascade type mismatches: string values are not assignable to
generated enum types, and typed refetch functions are incompatible
with SortableTable's generic refetch prop.

Use eslint-disable-next-line relay/generated-typescript-types
instead until the calling code is updated to use enum types.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:45:23 +01:00
Bryan Frimin
13ca50df68 Fix relay lint in components and pages
Remove unused GraphQL fields (createdAt, updatedAt, totalCount,
__id, sourceId, etc.) from queries and fragments across 50+ files.

Add TypeScript generics to useMutation, usePaginationFragment,
useRefetchableFragment, and useLazyLoadQuery calls to satisfy
relay/generated-typescript-types.

Add justified eslint-disable comments for fields needed by Relay
cache normalization (id) or consumed by sibling components through
fragment spreads.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:32:43 +01:00
Bryan Frimin
d263cda3f6 Add eslint-disable and TypeScript generics to graph hooks
Centralized graph files (hooks/graph/*.ts) define GraphQL
queries consumed by multiple page components. This architecture
intentionally separates field definitions from usage, triggering
relay/unused-fields and relay/must-colocate-fragment-spreads.
File-level eslint-disable comments suppress these false positives.

Also adds explicit TypeScript generics to useMutation and
usePaginationFragment calls to satisfy relay/generated-typescript-types
without eslint-disable.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:32:18 +01:00
Sacha Al Himdani
c493e31745 Fix documents UI
- Fix redirection after document deletion in detail page
- Fix refetch after publication
- Return proper error when trying to update a published document

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-13 12:01:57 +01:00
Émile Ré
38a0f28094 Misc fixes
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:43 +04:00
Émile Ré
355e6b81b8 Add an account activation step in the signing request flow when needed
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:42 +04:00
Bryan Frimin
79084bca23 Refactor compliange page access code
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-23 09:38:28 +01:00
Bryan Frimin
069b47d240 Add NDA view on console
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-23 09:38:28 +01:00
Sacha Al Himdani
40e4db9278 Remove deprecated SOA code
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-17 15:06:49 +01:00
Bryan Frimin
93c7b0c2dc Add multi-approver support
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-17 10:48:44 +01:00
Bryan Frimin
3d8c7c4dd6 Rename owner by approver
Document owner does not make sense it's more an document approver.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-17 10:48:43 +01:00
Émile Ré
6b4185aa9b Make console buildable by removing people related GQL queries
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 16:21:10 +04:00
Émile Ré
0fca372ed4 No need for custom hook, logic only used on AssumePage
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:05 +04:00
Émile Ré
795b0a8de2 Remove useAssume from layouts now that we have the /assume page that redirects
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:05 +04:00
Émile Ré
260f196f9c Do not call useAssume on every route change
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:05 +04:00
Émile Ré
070000c46a Implement redirect-path for password method
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:05 +04:00
Émile Ré
660a37edd0 Pass organizationId to password login page to sign in and assume at the same time when possible
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:05 +04:00
Émile Ré
c79feb44dc Move shared assume logic into hook to use on employee pages
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-12 09:37:04 +04:00
Bryan Frimin
5f7d4689aa Simplify UX of compliance access management
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-02-10 12:00:27 +01:00
Sacha Al Himdani
4f6884cb8f Fix duplicate assessments
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-02-09 14:23:01 +01:00
Émile Ré
3d14a592f6 Fix control obligation mapping action names
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-02-06 16:28:39 +04:00
Émile Ré
73ec5ce96b Rename trust center to compliance page in displayed text
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-29 08:41:18 +04:00
Émile Ré
ee3b0728bc Remove legacy trust center page
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 21:50:44 +04:00
Émile Ré
7e92d5a165 Refactor compliance page access page
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 21:45:43 +04:00
Émile Ré
42557e1640 Refactor compliance page vendors
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 19:17:27 +04:00
Émile Ré
c74631ae54 Refactor compliance page files page
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 18:37:44 +04:00
Émile Ré
36a936fcf4 Refactor compliance page documents page
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 16:52:17 +04:00
Émile Ré
3e3c3a8ebb Refactor compliance page audits page
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 16:17:45 +04:00
Émile Ré
07ea130536 Remove unused files
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-28 15:25:42 +04:00