/home/techb158/trellopowerup.abdallabala.com
Edit: /home/techb158/trellopowerup.abdallabala.com/openapi.yaml (16096B)
openapi: 3.0.3
info:
title: COSMIC AI-Risk Trello Power-Up API
version: 0.4.5
description: REST API for scoring, saving, trending, exporting, and summarizing AI project risks in Trello.
servers:
- url: http://localhost:3000
paths:
/config.js:
get:
summary: Runtime browser configuration for Trello Power-Up iframes
responses:
'200':
description: JavaScript assigning window.COSMIC_* configuration values
content:
application/javascript:
schema:
type: string
/api/health:
get:
summary: Health check
responses:
'200':
description: Service status and local store metadata
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
/api/taxonomy:
get:
summary: Reference taxonomy
responses:
'200':
description: Lifecycle phases, typologies, risk dimensions, and gate criteria
content:
application/json:
schema:
type: object
/api/boards/{boardId}:
post:
summary: Upsert Trello board metadata
parameters:
- $ref: '#/components/parameters/BoardId'
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
'200':
description: Stored board metadata
content:
application/json:
schema:
$ref: '#/components/schemas/BoardRecord'
/api/cards/{cardId}:
post:
summary: Upsert Trello card metadata
parameters:
- $ref: '#/components/parameters/CardId'
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
'200':
description: Stored card metadata
content:
application/json:
schema:
$ref: '#/components/schemas/CardRecord'
/api/risks/score:
post:
summary: Score a risk assessment without saving it
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RiskAssessmentInput'
responses:
'200':
description: Scored risk assessment
content:
application/json:
schema:
$ref: '#/components/schemas/RiskScore'
/api/boards/{boardId}/cards/{cardId}/assessments:
post:
summary: Save a card-level assessment as a new history entry
parameters:
- $ref: '#/components/parameters/BoardId'
- $ref: '#/components/parameters/CardId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RiskAssessmentInput'
responses:
'201':
description: Saved assessment with trend metadata versus the previous card assessment
content:
application/json:
schema:
$ref: '#/components/schemas/SavedAssessment'
get:
summary: Card assessment history scoped to the active board
parameters:
- $ref: '#/components/parameters/BoardId'
- $ref: '#/components/parameters/CardId'
responses:
'200':
description: Saved board/card assessments with score trend metadata
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SavedAssessment'
delete:
summary: Remove all saved assessments for a card on a board
parameters:
- $ref: '#/components/parameters/BoardId'
- $ref: '#/components/parameters/CardId'
responses:
'200':
description: Count of deleted assessment history entries
content:
application/json:
schema:
type: object
required: [deleted]
properties:
deleted:
type: integer
minimum: 0
/api/boards/{boardId}/cards/{cardId}/assessments/latest:
get:
summary: Latest card assessment scoped to the active board
parameters:
- $ref: '#/components/parameters/BoardId'
- $ref: '#/components/parameters/CardId'
responses:
'200':
description: Latest saved board/card assessment or null if none exists
content:
application/json:
schema:
type: object
required: [assessment]
properties:
assessment:
oneOf:
- $ref: '#/components/schemas/SavedAssessment'
- type: 'null'
/api/cards/{cardId}/assessments:
get:
summary: Card assessment history, newest first
parameters:
- $ref: '#/components/parameters/CardId'
responses:
'200':
description: Saved assessments with score trend metadata
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SavedAssessment'
/api/cards/{cardId}/assessments/latest:
get:
summary: Latest card assessment for editing an existing assessment workflow
parameters:
- $ref: '#/components/parameters/CardId'
responses:
'200':
description: Latest saved assessment or null if the card has no assessment
content:
application/json:
schema:
type: object
required: [assessment]
properties:
assessment:
nullable: true
allOf:
- $ref: '#/components/schemas/SavedAssessment'
/api/boards/{boardId}/summary:
get:
summary: Board risk summary using the latest assessment per card
parameters:
- $ref: '#/components/parameters/BoardId'
responses:
'200':
description: Board-level risk summary with trend counts and latest assessments
content:
application/json:
schema:
$ref: '#/components/schemas/BoardSummary'
/api/boards/{boardId}/review-queue:
get:
summary: Board review queue using latest assessment signals
parameters:
- $ref: '#/components/parameters/BoardId'
responses:
'200':
description: Review-needed cards sorted by urgency
content:
application/json:
schema:
$ref: '#/components/schemas/ReviewQueue'
/api/boards/{boardId}/review-queue.csv:
get:
summary: Download board review queue as CSV
parameters:
- $ref: '#/components/parameters/BoardId'
responses:
'200':
description: CSV export containing only review-needed cards
headers:
Content-Disposition:
schema:
type: string
content:
text/csv:
schema:
type: string
/api/boards/{boardId}/export.json:
get:
summary: Download board risk export as JSON
parameters:
- $ref: '#/components/parameters/BoardId'
responses:
'200':
description: JSON evidence package containing latest card assessments, trend fields, and review signals
headers:
Content-Disposition:
schema:
type: string
content:
application/json:
schema:
allOf:
- type: object
required: [reportType, version]
properties:
reportType:
type: string
example: cosmic-board-risk-export
version:
type: string
example: 0.4.5
- $ref: '#/components/schemas/BoardSummary'
/api/boards/{boardId}/export.csv:
get:
summary: Download board risk export as CSV
parameters:
- $ref: '#/components/parameters/BoardId'
responses:
'200':
description: CSV export of latest card assessments, trend fields, and review signals
headers:
Content-Disposition:
schema:
type: string
content:
text/csv:
schema:
type: string
components:
parameters:
BoardId:
name: boardId
in: path
required: true
schema:
type: string
CardId:
name: cardId
in: path
required: true
schema:
type: string
schemas:
HealthResponse:
type: object
required: [ok, service, version, store]
properties:
ok:
type: boolean
example: true
service:
type: string
example: cosmic-ai-risk-trello-powerup
version:
type: string
example: 0.4.5
store:
$ref: '#/components/schemas/StoreInfo'
StoreInfo:
type: object
required: [mode, file, boards, cards, assessments]
properties:
mode:
type: string
enum: [json-file]
file:
type: string
example: ./data/store.json
boards:
type: integer
minimum: 0
cards:
type: integer
minimum: 0
assessments:
type: integer
minimum: 0
BoardRecord:
type: object
required: [boardId, createdAt, updatedAt]
additionalProperties: true
properties:
boardId:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
CardRecord:
type: object
required: [cardId, createdAt, updatedAt]
additionalProperties: true
properties:
cardId:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
RiskAssessmentInput:
type: object
properties:
projectTypology:
type: string
enum: [incremental, disruptive, applied_research, ai_enabler, citizen_led]
lifecyclePhase:
type: string
enum: [needs_analysis, data_preparation, design, model_development, testing_evaluation, deployment_monitoring]
measurementMaturity:
type: string
enum: [ad_hoc, defined, measured, controlled]
approvalState:
type: string
enum: [draft, approved, accepted, rejected]
metrics:
type: object
properties:
modelPerformanceScore:
type: number
minimum: 0
maximum: 100
dataReadinessScore:
type: number
minimum: 0
maximum: 100
ethicalReviewCompleted:
type: boolean
legalReviewCompleted:
type: boolean
risks:
type: array
items:
$ref: '#/components/schemas/RiskInput'
RiskInput:
type: object
properties:
title:
type: string
dimension:
type: string
enum: [organizational, technical, human]
category:
type: string
enum: [strategic_organizational, technical, legal_ethical]
probability:
type: number
minimum: 1
maximum: 5
impact:
type: number
minimum: 1
maximum: 5
detectionDifficulty:
type: number
minimum: 1
maximum: 5
mitigationCompleteness:
type: number
minimum: 0
maximum: 100
mitigation:
type: string
RiskScore:
type: object
required: [score, status, gate]
additionalProperties: true
properties:
score:
type: number
status:
type: string
enum: [low, medium, high, critical]
weightedRisk:
type: number
highestRisk:
$ref: '#/components/schemas/RiskInput'
dimensionScores:
type: object
additionalProperties:
type: number
gate:
type: object
required: [deploymentReady, blockingReasons]
properties:
deploymentReady:
type: boolean
blockingReasons:
type: array
items:
type: string
SavedAssessment:
type: object
required: [id, boardId, cardId, input, score, previousScore, scoreDelta, trend, review, createdAt, updatedAt]
properties:
id:
type: string
boardId:
type: string
cardId:
type: string
input:
$ref: '#/components/schemas/RiskAssessmentInput'
score:
$ref: '#/components/schemas/RiskScore'
previousScore:
type: number
nullable: true
scoreDelta:
type: number
nullable: true
trend:
type: string
enum: [new, improved, worse, unchanged]
review:
$ref: '#/components/schemas/ReviewSignal'
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
ReviewSignal:
type: object
required: [needed, reasons, actions, stale, ageDays, staleAfterDays]
properties:
needed:
type: boolean
reasons:
type: array
items:
type: string
actions:
type: array
items:
type: string
stale:
type: boolean
ageDays:
type: integer
nullable: true
minimum: 0
staleAfterDays:
type: integer
minimum: 1
ReviewQueue:
type: object
required: [boardId, generatedAt, reviewStaleDays, count, items]
properties:
boardId:
type: string
generatedAt:
type: string
format: date-time
reviewStaleDays:
type: integer
minimum: 1
count:
type: integer
minimum: 0
items:
type: array
items:
$ref: '#/components/schemas/SavedAssessment' BoardSummary:
type: object
required: [boardId, generatedAt, cardCount, averageScore, statusCounts, deploymentBlocked, improved, worsened, unchanged, reviewNeeded, staleAssessments, reviewStaleDays, latestAssessments]
properties:
boardId:
type: string
generatedAt:
type: string
format: date-time
cardCount:
type: integer
minimum: 0
averageScore:
type: number
statusCounts:
type: object
additionalProperties:
type: integer
deploymentBlocked:
type: integer
minimum: 0
improved:
type: integer
minimum: 0
worsened:
type: integer
minimum: 0
unchanged:
type: integer
minimum: 0
reviewNeeded:
type: integer
minimum: 0
staleAssessments:
type: integer
minimum: 0
reviewStaleDays:
type: integer
minimum: 1
latestAssessments:
type: array
items:
$ref: '#/components/schemas/SavedAssessment'