/home/techb158/cosmic-risk.abdallabala.com/docs
NameSizeModeActions
00-design-study.md36780644editdlrm
01-uml-class-diagram.puml118690644editdlrm
02-use-case-diagram.puml37630644editdlrm
03-sequence-diagrams.puml97320644editdlrm
04-database-entity-model.mmd70510644editdlrm
05-database-schema.sql133720644editdlrm
06-diagram-preview.html50210644editdlrm
07-design-checklist.md32560644editdlrm
08-step-2-storage-layer.md53250644editdlrm
09-step-3-risk-crud-ui.md33800644editdlrm
10-step-4-mitigation-workflow.md39960644editdlrm
11-step-5-deployment-gate-workflow.md22920644editdlrm
12-step-6-multi-pm-integration.md37700644editdlrm
13-step-6-1-microsoft-planner-integration.md23350644editdlrm
14-step-7-reporting-export.md41580644editdlrm
15-step-7-1-oauth-live-connectors.md45450644editdlrm
16-step-8-user-roles-access-control.md32970644editdlrm
17-step-9-production-deployment-security.md42280644editdlrm
18-step-10-final-academic-submission.md31990644editdlrm
19-final-report-draft.md68140644editdlrm
20-instructor-submission-checklist.md36390644editdlrm
21-demo-script.md39480644editdlrm
22-traceability-matrix.md48470644editdlrm
23-testing-evidence.md29610644editdlrm
24-evaluation-rubric-mapping.md29100644editdlrm
25-final-deployment-runbook.md32140644editdlrm
26-known-limitations-and-future-work.md26320644editdlrm
27-final-qa-checklist.md28930644editdlrm
28-demo-rehearsal-script.md36180644editdlrm
29-submission-freeze-report.md27690644editdlrm
30-final-known-issues.md18760644editdlrm
31-saas-rebuild-implementation.md25730644editdlrm
application-documentation.md275150644editdlrm
conversation-log.md185030644editdlrm
dashboard-spec.md36910644editdlrm
database-guide.md378260644editdlrm
development-summary.md70700644editdlrm
github-architecture.svg62880644editdlrm
integration-pull-push-plan.md73840644editdlrm
Edit: /home/techb158/cosmic-risk.abdallabala.com/docs/09-step-3-risk-crud-ui.md (3380B)
# Step 3: Risk CRUD UI Workflow ## Purpose Step 3 connects the dashboard interface to the backend storage layer. Users can now manage risks and mitigation actions from the browser instead of using only API calls. This step implements the use cases defined in the design package: - Register AI risk. - Update AI risk. - Delete AI risk. - Add mitigation action. - Recalculate risk dashboard. - Evaluate deployment gate. ## Source alignment Source-derived concepts used by this step: - AI risk must be measurable. - Risk dimensions are organizational, technical, and human. - Indicators, evidence, and interpretation rules support risk assessment. - The software prototype should expose a REST API and integrate with project-management workflows. Implementation extensions added by this step: - Browser-based create, edit, delete forms. - Score preview in the risk form. - Action buttons inside the risk register. - Toast notifications. - Gate evaluation button. - API workflow test. ## User workflows ### Create risk 1. User opens the Risk register page. 2. User clicks Add risk. 3. User enters title, dimension, domain, lifecycle phase, probability, impact, detectability, owner, status, approval state, due date, and evidence. 4. UI displays a score preview. 5. User saves. 6. API creates the risk in `data/database.json`. 7. Dashboard reloads and recalculates scores, top risks, lifecycle counts, and gate status. ### Edit risk 1. User clicks Edit in a risk row. 2. Existing risk values are loaded into the form. 3. User changes values. 4. API updates the risk. 5. Dashboard reloads and recalculates. ### Delete risk 1. User clicks Delete in a risk row. 2. UI asks for confirmation. 3. API deletes the risk and linked score, mitigation, evidence, and Trello mapping rows. 4. Dashboard reloads. ### Add mitigation 1. User clicks Mitigate in a risk row. 2. User enters mitigation title, owner, status, progress, effectiveness, due date, and description. 3. API creates the mitigation action. 4. Dashboard reloads. 5. Residual risk is recalculated from mitigation progress and effectiveness. ### Evaluate deployment gate 1. User opens the Deployment gate page. 2. User clicks Evaluate and persist gate. 3. API calculates the gate status. 4. API stores gate, criteria, decision, and risk score records. 5. Dashboard reloads. ## Files changed - `public/index.html` - `public/app.js` - `public/styles.css` - `server.js` - `package.json` - `README.md` - `openapi.yaml` - `tests/api-workflow.test.js` ## Acceptance criteria | Check | Expected result | |---|---| | Add risk | Risk appears in the risk register after saving | | Edit risk | Changed fields persist after reload | | Delete risk | Risk is removed and dashboard total decreases | | Add mitigation | Mitigation count appears and residual score recalculates | | Evaluate gate | Gate result is persisted to the JSON database | | Tests | `npm test` passes risk engine, storage, and API workflow tests | ## Test result ```text All COSMIC AI-Risk engine tests passed. All COSMIC AI-Risk storage layer tests passed. All COSMIC AI-Risk API workflow tests passed. ``` ## Development note This is still a prototype storage design. The JSON database is acceptable for Step 3 because it preserves traceability and keeps the domain model visible. A later step should move this structure to SQLite or PostgreSQL.