openapi: 3.1.0 info: title: AI Requirements Intelligence API version: 0.1.0 description: | Agent-driven API for requirements discovery, clarification, feature definition, and implementation planning. Supports the early phase of the software development lifecycle — from raw project materials to structured tickets. ## Streaming All agent-triggered endpoints (`/ingest`, `/generate`, `/rebuild`) return a Server-Sent Events stream (`text/event-stream`). Each event is a JSON object on a `data:` line. The stream closes when the agent emits a `result` or `error` event. Example stream: ``` data: {"type":"status","message":"Starting ingestion"} data: {"type":"progress","message":"Processing document 2 of 4","progress":50} data: {"type":"result","data":{...}} ``` servers: - url: http://localhost:8000 description: Local development - url: https://api.requirements.example.com description: Production tags: - name: Projects description: Create and manage project contexts - name: Sources description: Upload and manage project discovery material - name: Ingestion description: Trigger ingestion and context building - name: Context description: Inspect and rebuild project knowledge context - name: Requirements description: Generate and manage structured requirements - name: Questions description: Generate and answer clarification questions - name: Personas description: Generate user personas from approved requirements - name: Features description: Generate product features from approved requirements - name: Tickets description: Generate implementation tickets from approved features - name: Steering description: Project steering — rules + reference docs pinned to every agent - name: Framing description: Project framing — goals, non-goals, metrics, constraints, risks paths: # ─── Projects ──────────────────────────────────────────────────────────────── /projects: post: tags: [Projects] summary: Create a project operationId: createProject requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateProjectRequest' responses: '201': description: Project created content: application/json: schema: $ref: '#/components/schemas/Project' '422': $ref: '#/components/responses/ValidationError' get: tags: [Projects] summary: List projects operationId: listProjects parameters: - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Offset' responses: '200': description: List of projects content: application/json: schema: $ref: '#/components/schemas/ProjectList' /projects/{project_id}: get: tags: [Projects] summary: Get a project operationId: getProject parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: Project detail content: application/json: schema: $ref: '#/components/schemas/Project' '404': $ref: '#/components/responses/NotFound' # ─── Sources ───────────────────────────────────────────────────────────────── /projects/{project_id}/sources: post: tags: [Sources] summary: Upload a source document operationId: uploadSource parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Upload into a specific pipeline version. Defaults to the project's current pipeline_version; first upload creates v1. requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: type: string format: binary description: Document file (PDF, DOCX, TXT, MD, etc.) label: type: string description: Optional human-readable label for this source role: type: string enum: [client_material, steering] default: client_material responses: '201': description: Source uploaded content: application/json: schema: $ref: '#/components/schemas/Source' '404': $ref: '#/components/responses/NotFound' '409': description: Version is locked by downstream artifacts content: application/json: schema: type: object properties: detail: $ref: '#/components/schemas/VersionLockedError' get: tags: [Sources] summary: List sources for a project operationId: listSources parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Filter sources to a specific pipeline version. Defaults to the project's current pipeline_version. - in: query name: role required: false schema: type: string enum: [client_material, steering] responses: '200': description: List of sources content: application/json: schema: $ref: '#/components/schemas/SourceList' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/sources/multi: post: tags: [Sources] summary: Upload multiple source documents operationId: uploadSourcesMulti parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Upload into a specific pipeline version. Defaults to the project's current pipeline_version; first upload creates v1. requestBody: required: true content: multipart/form-data: schema: type: object required: [files] properties: files: type: array items: type: string format: binary role: type: string enum: [client_material, steering] default: client_material responses: '201': description: Sources uploaded content: application/json: schema: type: array items: $ref: '#/components/schemas/Source' '404': $ref: '#/components/responses/NotFound' '409': description: Version is locked by downstream artifacts content: application/json: schema: type: object properties: detail: $ref: '#/components/schemas/VersionLockedError' /projects/{project_id}/sources/chunks: get: tags: [Sources] summary: List extracted chunks for a project operationId: listChunks parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Filter chunks to a specific pipeline version. Defaults to all chunks when omitted. responses: '200': description: List of extracted document chunks content: application/json: schema: $ref: '#/components/schemas/DocumentChunkList' '404': $ref: '#/components/responses/NotFound' # ─── Ingestion ─────────────────────────────────────────────────────────────── /projects/{project_id}/ingest: post: tags: [Ingestion] summary: Trigger ingestion and context build description: | Runs the ingestion pipeline over all unprocessed sources. Extracts text, creates embeddings, builds the knowledge graph, and updates project context. Returns an SSE stream. The `result` event contains ingestion summary data. operationId: triggerIngestion parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Run ingestion for a specific pipeline version. Defaults to the project's current pipeline_version. responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' # ─── Context ───────────────────────────────────────────────────────────────── /projects/{project_id}/context: get: tags: [Context] summary: Inspect project knowledge context description: Returns the current state of the project knowledge graph and context index. operationId: getContext parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Filter context to a specific pipeline version. Defaults to the project's current pipeline_version. responses: '200': description: Project context summary content: application/json: schema: $ref: '#/components/schemas/ProjectContext' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/context/rebuild: post: tags: [Context] summary: Rebuild project context description: | Re-runs context engineering over all processed sources. Returns an SSE stream. The `result` event contains the updated context summary. operationId: rebuildContext parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: type: integer description: Rebuild context for a specific pipeline version. Defaults to the project's current pipeline_version. responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' # ─── Requirements ───────────────────────────────────────────────────────────── /projects/{project_id}/requirements/generate: post: tags: [Requirements] summary: Generate a requirements specification description: | Runs the requirements extraction agent over the current project context. Returns an SSE stream. The `result` event contains the generated `RequirementsSpec`. operationId: generateRequirements parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/requirements/latest: get: tags: [Requirements] summary: Get the latest requirements specification operationId: getLatestRequirements parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: Latest requirements specification content: application/json: schema: $ref: '#/components/schemas/RequirementsSpec' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/requirements/versions: get: tags: [Requirements] summary: List all requirements versions operationId: listRequirementsVersions parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: All requirements versions for the project content: application/json: schema: type: array items: $ref: '#/components/schemas/RequirementsSpec' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/requirements/versions/{version}: get: tags: [Requirements] summary: Get a specific requirements version operationId: getRequirementsVersion parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Requirements specification for the given version content: application/json: schema: $ref: '#/components/schemas/RequirementsSpec' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/requirements/{requirement_id}: patch: tags: [Requirements] summary: Edit a requirement description: Correct or amend a generated requirement before approving the version. operationId: patchRequirement parameters: - $ref: '#/components/parameters/ProjectId' - name: requirement_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PatchRequirementRequest' responses: '200': description: Updated requirement content: application/json: schema: $ref: '#/components/schemas/Requirement' '404': $ref: '#/components/responses/NotFound' '409': description: Requirement version is already approved /projects/{project_id}/requirements/{version}/approve: post: tags: [Requirements] summary: Approve a requirements version description: Marks a specific version as approved, unlocking feature generation. operationId: approveRequirements parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Version approved content: application/json: schema: $ref: '#/components/schemas/RequirementsSpec' '404': $ref: '#/components/responses/NotFound' '409': description: Version already approved or superseded # ─── Clarification Questions ───────────────────────────────────────────────── /projects/{project_id}/questions/generate: post: tags: [Questions] summary: Generate clarification questions description: | Runs the clarification agent to identify gaps and ambiguities. Returns an SSE stream. The `result` event contains the generated questions. operationId: generateQuestions parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/questions: get: tags: [Questions] summary: List clarification questions operationId: listQuestions parameters: - $ref: '#/components/parameters/ProjectId' - name: answered in: query schema: type: boolean description: Filter by answered status responses: '200': description: List of clarification questions content: application/json: schema: $ref: '#/components/schemas/QuestionList' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/answers: post: tags: [Questions] summary: Submit answers to clarification questions description: | Stores client answers. After submission, trigger a context rebuild to incorporate the new information. operationId: submitAnswers parameters: - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SubmitAnswersRequest' responses: '200': description: Answers recorded content: application/json: schema: $ref: '#/components/schemas/AnswerList' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' # ─── Personas ──────────────────────────────────────────────────────────────── /projects/{project_id}/personas/generate: post: tags: [Personas] summary: Generate user personas description: | Derives user personas from the approved requirements. Personas are used to inform feature generation. Returns an SSE stream. The `result` event contains the generated personas. operationId: generatePersonas parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' '409': description: No approved requirements version found /projects/{project_id}/personas/latest: get: tags: [Personas] summary: Get the latest personas operationId: getLatestPersonas parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: Latest persona set content: application/json: schema: $ref: '#/components/schemas/PersonaSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/personas/versions: get: tags: [Personas] summary: List all persona versions operationId: listPersonaVersions parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: All persona versions for the project content: application/json: schema: type: array items: $ref: '#/components/schemas/PersonaSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/personas/versions/{version}: get: tags: [Personas] summary: Get a specific persona version operationId: getPersonaVersion parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Persona set for the given version content: application/json: schema: $ref: '#/components/schemas/PersonaSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/personas/{persona_id}: patch: tags: [Personas] summary: Edit a persona description: Correct or amend a generated persona before feature generation. operationId: patchPersona parameters: - $ref: '#/components/parameters/ProjectId' - name: persona_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PatchPersonaRequest' responses: '200': description: Updated persona content: application/json: schema: $ref: '#/components/schemas/Persona' '404': $ref: '#/components/responses/NotFound' # ─── Features ──────────────────────────────────────────────────────────────── /projects/{project_id}/features/generate: post: tags: [Features] summary: Generate product features description: | Runs the planning agent to derive features from approved requirements. Returns an SSE stream. The `result` event contains the generated `FeatureSet`. operationId: generateFeatures parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' '409': description: No approved requirements version found /projects/{project_id}/features/latest: get: tags: [Features] summary: Get the latest feature set operationId: getLatestFeatures parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: Latest feature set content: application/json: schema: $ref: '#/components/schemas/FeatureSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/features/versions: get: tags: [Features] summary: List all feature set versions operationId: listFeatureVersions parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: All feature set versions for the project content: application/json: schema: type: array items: $ref: '#/components/schemas/FeatureSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/features/versions/{version}: get: tags: [Features] summary: Get a specific feature set version operationId: getFeatureVersion parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Feature set for the given version content: application/json: schema: $ref: '#/components/schemas/FeatureSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/features/{feature_id}: patch: tags: [Features] summary: Edit a feature description: Correct or amend a generated feature before approving the set. operationId: patchFeature parameters: - $ref: '#/components/parameters/ProjectId' - name: feature_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PatchFeatureRequest' responses: '200': description: Updated feature content: application/json: schema: $ref: '#/components/schemas/Feature' '404': $ref: '#/components/responses/NotFound' '409': description: Feature set is already approved /projects/{project_id}/features/{version}/approve: post: tags: [Features] summary: Approve a feature set version description: Marks a feature set as approved, unlocking ticket generation. operationId: approveFeatures parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Feature set approved content: application/json: schema: $ref: '#/components/schemas/FeatureSet' '404': $ref: '#/components/responses/NotFound' '409': description: Version already approved or superseded # ─── Tickets ───────────────────────────────────────────────────────────────── /projects/{project_id}/tickets/generate: post: tags: [Tickets] summary: Generate implementation tickets description: | Runs the planning agent to decompose approved features into tickets. Returns an SSE stream. The `result` event contains the generated `TicketSet`. operationId: generateTickets parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': $ref: '#/components/responses/SseStream' '404': $ref: '#/components/responses/NotFound' '409': description: No approved feature set found /projects/{project_id}/tickets/latest: get: tags: [Tickets] summary: Get the latest ticket set operationId: getLatestTickets parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: Latest ticket set content: application/json: schema: $ref: '#/components/schemas/TicketSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/tickets/versions: get: tags: [Tickets] summary: List all ticket set versions operationId: listTicketVersions parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: All ticket set versions for the project content: application/json: schema: type: array items: $ref: '#/components/schemas/TicketSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/tickets/versions/{version}: get: tags: [Tickets] summary: Get a specific ticket set version operationId: getTicketVersion parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Ticket set for the given version content: application/json: schema: $ref: '#/components/schemas/TicketSet' '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/tickets/export: post: tags: [Tickets] summary: Export tickets to an external system description: | Exports the latest approved ticket set to a destination system. Not implemented in phase 1 — returns 501. operationId: exportTickets parameters: - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ExportTicketsRequest' responses: '501': description: Not implemented in phase 1 '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/pipeline-versions: get: tags: [Pipeline] summary: List pipeline versions operationId: listPipelineVersions parameters: - $ref: '#/components/parameters/ProjectId' responses: '200': description: Pipeline versions for the project content: application/json: schema: type: array items: $ref: '#/components/schemas/PipelineVersionSummary' '404': $ref: '#/components/responses/NotFound' post: tags: [Pipeline] summary: Create a new pipeline version operationId: createPipelineVersion parameters: - $ref: '#/components/parameters/ProjectId' requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/CreateVersionRequest' responses: '200': description: Created pipeline version content: application/json: schema: type: object required: [version] properties: version: type: integer '400': description: Invalid copy parameters '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/pipeline-versions/{version}: delete: tags: [Pipeline] summary: Delete a pipeline version and its artifacts operationId: deletePipelineVersion parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '204': description: Pipeline version deleted '404': $ref: '#/components/responses/NotFound' /projects/{project_id}/pipeline-versions/{version}/supersede-downstream: post: tags: [Pipeline] summary: Mark all non-superseded downstream artifacts (requirements, personas, features, tickets) at this version as superseded operationId: supersedeDownstreamAtVersion parameters: - $ref: '#/components/parameters/ProjectId' - name: version in: path required: true schema: type: integer responses: '200': description: Counts of rows superseded per stage content: application/json: schema: type: object required: [requirements, personas, features, tickets] properties: requirements: { type: integer } personas: { type: integer } features: { type: integer } tickets: { type: integer } '404': $ref: '#/components/responses/NotFound' # ─── Steering ──────────────────────────────────────────────────────────────── /projects/{project_id}/steering: get: tags: [Steering] operationId: getSteering parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: { type: integer } responses: '200': description: Project steering with computed budget content: application/json: schema: $ref: '#/components/schemas/ProjectSteering' '404': $ref: '#/components/responses/NotFound' put: tags: [Steering] operationId: putSteering parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: { type: integer } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PutSteeringRequest' responses: '200': description: Updated steering content: application/json: schema: $ref: '#/components/schemas/ProjectSteering' patch: tags: [Steering] operationId: patchSteering parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: { type: integer } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PatchSteeringRequest' responses: '200': description: Updated steering content: application/json: schema: $ref: '#/components/schemas/ProjectSteering' # ─── Framing ───────────────────────────────────────────────────────────────── /projects/{project_id}/framing: get: tags: [Framing] operationId: getFraming parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: { type: integer } responses: '200': description: Project framing content: application/json: schema: $ref: '#/components/schemas/ProjectFraming' '404': $ref: '#/components/responses/NotFound' put: tags: [Framing] operationId: putFraming parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: { type: integer } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PutFramingRequest' responses: '200': description: Updated framing content: application/json: schema: $ref: '#/components/schemas/ProjectFraming' patch: tags: [Framing] operationId: patchFraming parameters: - $ref: '#/components/parameters/ProjectId' - in: query name: version required: false schema: { type: integer } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PatchFramingRequest' responses: '200': description: Updated framing content: application/json: schema: $ref: '#/components/schemas/ProjectFraming' # ─── Components ──────────────────────────────────────────────────────────────── components: parameters: ProjectId: name: project_id in: path required: true schema: type: string format: uuid Limit: name: limit in: query schema: type: integer default: 20 minimum: 1 maximum: 100 Offset: name: offset in: query schema: type: integer default: 0 minimum: 0 responses: SseStream: description: | Server-Sent Events stream. Each line is `data: `. Stream closes after a `result` or `error` event. content: text/event-stream: schema: $ref: '#/components/schemas/AgentEvent' NotFound: description: Resource not found content: application/json: schema: $ref: '#/components/schemas/Error' ValidationError: description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' schemas: # ── Primitives ────────────────────────────────────────────────────────────── Error: type: object required: [detail] properties: detail: type: string AgentEvent: type: object required: [type] description: | A single SSE event emitted by an agent endpoint. - `status` — informational message (agent started, step begun) - `progress` — progress update with optional percentage - `result` — final output; `data` contains the generated artefact - `error` — terminal failure; stream closes after this properties: type: type: string enum: [status, progress, result, error] message: type: string progress: type: integer minimum: 0 maximum: 100 description: Present on `progress` events data: type: object description: Present on `result` events — the generated artefact # ── Projects ──────────────────────────────────────────────────────────────── CreateProjectRequest: type: object required: [name] properties: name: type: string description: type: string Project: type: object required: [id, name, status, pipeline_version, created_at, updated_at] properties: id: type: string format: uuid name: type: string description: type: string nullable: true status: type: string enum: [draft, active, archived] pipeline_version: type: integer description: Monotonic counter of pipeline versions created for this project. 0 means no versions yet. default: 0 created_at: type: string format: date-time updated_at: type: string format: date-time ProjectList: type: object required: [items, total] properties: items: type: array items: $ref: '#/components/schemas/Project' total: type: integer # ── Sources ───────────────────────────────────────────────────────────────── Source: type: object required: [id, project_id, pipeline_version, file_name, file_type, role, status, created_at] properties: id: type: string format: uuid project_id: type: string format: uuid pipeline_version: type: integer description: The pipeline version this source was uploaded against. file_name: type: string file_type: type: string label: type: string nullable: true status: type: string enum: [uploaded, processing, processed, failed] role: type: string enum: [client_material, steering] default: client_material pinned_text: type: string nullable: true pinned_kind: type: string enum: [compact, summarised] nullable: true created_at: type: string format: date-time ingested_at: type: string format: date-time nullable: true SourceList: type: object required: [items, total] properties: items: type: array items: $ref: '#/components/schemas/Source' total: type: integer DocumentChunk: type: object required: [id, source_id, chunk_index, content, created_at] properties: id: type: string format: uuid source_id: type: string format: uuid chunk_index: type: integer content: type: string token_count: type: integer nullable: true created_at: type: string format: date-time DocumentChunkList: type: object required: [items, total] properties: items: type: array items: $ref: '#/components/schemas/DocumentChunk' total: type: integer PipelineVersionSummary: type: object required: [version, has_requirements, has_personas, has_features, has_tickets] properties: version: type: integer has_requirements: type: boolean has_personas: type: boolean has_features: type: boolean has_tickets: type: boolean CreateVersionRequest: type: object properties: copy_from: type: integer nullable: true description: Version to copy state from. Required when any copy_* flag is true. copy_sources: type: boolean default: false copy_chunks: type: boolean default: false description: Requires copy_sources=true. copy_graph: type: boolean default: false description: Requires copy_chunks=true. VersionLockedError: type: object required: [error, current_version, message] properties: error: type: string enum: [version_locked] current_version: type: integer would_create_version: type: integer nullable: true description: Present on upload-attempt 409s; absent on delete-attempt 409s. message: type: string # ── Context ───────────────────────────────────────────────────────────────── ProjectContext: type: object required: [project_id, entity_count, relationship_count, chunk_count, last_built_at] properties: project_id: type: string format: uuid entity_count: type: integer relationship_count: type: integer chunk_count: type: integer glossary: type: array items: type: object properties: term: type: string definition: type: string last_built_at: type: string format: date-time nullable: true # ── Requirements ──────────────────────────────────────────────────────────── Requirement: type: object required: [id, type, title, description, priority, status] properties: id: type: string format: uuid type: type: string enum: [functional, non_functional, business_rule, constraint, assumption] title: type: string description: type: string priority: type: string enum: [high, medium, low] status: type: string enum: [draft, approved, superseded] source_ids: type: array items: type: string format: uuid PatchRequirementRequest: type: object properties: title: type: string description: type: string priority: type: string enum: [high, medium, low] type: type: string enum: [functional, non_functional, business_rule, constraint, assumption] RequirementsSpec: type: object required: [id, project_id, version, status, requirements, created_at] properties: id: type: string format: uuid project_id: type: string format: uuid version: type: integer status: type: string enum: [draft, approved, superseded] requirements: type: array items: $ref: '#/components/schemas/Requirement' created_at: type: string format: date-time approved_at: type: string format: date-time nullable: true # ── Questions ─────────────────────────────────────────────────────────────── ClarificationQuestion: type: object required: [id, project_id, question, priority, created_at] properties: id: type: string format: uuid project_id: type: string format: uuid question: type: string context: type: string nullable: true priority: type: string enum: [high, medium, low] requirement_ids: type: array items: type: string format: uuid answer: type: string nullable: true answered_at: type: string format: date-time nullable: true created_at: type: string format: date-time QuestionList: type: object required: [items, total] properties: items: type: array items: $ref: '#/components/schemas/ClarificationQuestion' total: type: integer SubmitAnswersRequest: type: object required: [answers] properties: answers: type: array items: type: object required: [question_id, answer] properties: question_id: type: string format: uuid answer: type: string AnswerList: type: object required: [items] properties: items: type: array items: $ref: '#/components/schemas/ClarificationQuestion' # ── Personas ──────────────────────────────────────────────────────────────── Persona: type: object required: [id, name, role, goals, pain_points] properties: id: type: string format: uuid name: type: string description: Persona name (e.g. "Sarah the Finance Manager") role: type: string description: Job title or role goals: type: array items: type: string pain_points: type: array items: type: string requirement_ids: type: array items: type: string format: uuid PatchPersonaRequest: type: object properties: name: type: string role: type: string goals: type: array items: type: string pain_points: type: array items: type: string PersonaSet: type: object required: [id, project_id, version, status, personas, created_at] properties: id: type: string format: uuid project_id: type: string format: uuid version: type: integer status: type: string enum: [draft, approved, superseded] personas: type: array items: $ref: '#/components/schemas/Persona' created_at: type: string format: date-time approved_at: type: string format: date-time nullable: true # ── Features ──────────────────────────────────────────────────────────────── Feature: type: object required: [id, title, description, status] properties: id: type: string format: uuid title: type: string description: type: string user_value: type: string nullable: true persona_ids: type: array description: References to personas this feature serves items: type: string format: uuid requirement_ids: type: array items: type: string format: uuid acceptance_criteria: type: array items: type: string dependencies: type: array items: type: string format: uuid status: type: string enum: [draft, approved] PatchFeatureRequest: type: object properties: title: type: string description: type: string user_value: type: string acceptance_criteria: type: array items: type: string FeatureSet: type: object required: [id, project_id, version, status, features, created_at] properties: id: type: string format: uuid project_id: type: string format: uuid version: type: integer status: type: string enum: [draft, approved, superseded] features: type: array items: $ref: '#/components/schemas/Feature' created_at: type: string format: date-time approved_at: type: string format: date-time nullable: true # ── Tickets ───────────────────────────────────────────────────────────────── Ticket: type: object required: [id, title, description, complexity, status] properties: id: type: string format: uuid feature_id: type: string format: uuid nullable: true title: type: string description: type: string acceptance_criteria: type: array items: type: string dependencies: type: array items: type: string format: uuid complexity: type: string enum: [xs, s, m, l, xl] requirement_ids: type: array items: type: string format: uuid status: type: string enum: [draft, exported] TicketSet: type: object required: [id, project_id, version, tickets, created_at] properties: id: type: string format: uuid project_id: type: string format: uuid version: type: integer tickets: type: array items: $ref: '#/components/schemas/Ticket' created_at: type: string format: date-time ExportTicketsRequest: type: object required: [destination] properties: destination: type: string enum: [linear, jira, github] # ── Steering ──────────────────────────────────────────────────────────────── Budget: type: object required: [status, estimated_tokens, page_equivalent] properties: status: type: string enum: [light, comfortable, heavy, very_heavy] estimated_tokens: type: integer page_equivalent: type: number format: float ProjectSteering: type: object required: [project_id, pipeline_version, rules, reference_doc_ids, presets, budget] properties: project_id: { type: string, format: uuid } pipeline_version: { type: integer } rules: type: array items: { type: string } reference_doc_ids: type: array items: { type: string, format: uuid } presets: type: array items: { type: string } updated_at: type: string format: date-time nullable: true budget: { $ref: '#/components/schemas/Budget' } PutSteeringRequest: type: object required: [rules, reference_doc_ids] properties: rules: type: array items: { type: string } reference_doc_ids: type: array items: { type: string, format: uuid } PatchSteeringRequest: type: object properties: rules: type: array items: { type: string } reference_doc_ids: type: array items: { type: string, format: uuid } # ── Framing ───────────────────────────────────────────────────────────────── ProjectFraming: type: object required: [project_id, pipeline_version, goals, non_goals, success_metrics, constraints, risks, additional_context] properties: project_id: { type: string, format: uuid } pipeline_version: { type: integer } goals: type: array items: { type: string } non_goals: type: array items: { type: string } success_metrics: type: array items: { type: string } constraints: type: array items: { type: string } risks: type: array items: { type: string } additional_context: { type: string } updated_at: type: string format: date-time nullable: true PutFramingRequest: type: object required: [goals, non_goals, success_metrics, constraints, risks, additional_context] properties: goals: { type: array, items: { type: string } } non_goals: { type: array, items: { type: string } } success_metrics: { type: array, items: { type: string } } constraints: { type: array, items: { type: string } } risks: { type: array, items: { type: string } } additional_context: { type: string } PatchFramingRequest: type: object properties: goals: { type: array, items: { type: string } } non_goals: { type: array, items: { type: string } } success_metrics: { type: array, items: { type: string } } constraints: { type: array, items: { type: string } } risks: { type: array, items: { type: string } } additional_context: { type: string }