Task 009 implement plan generation review gate

This commit is contained in:
2026-05-21 19:56:58 +03:00
parent b7e2fa34b2
commit 5b27d1a3ca
24 changed files with 2422 additions and 59 deletions
+817 -3
View File
@@ -1169,6 +1169,36 @@
"title": "HTTPValidationError",
"type": "object"
},
"PlanListResponse": {
"additionalProperties": false,
"properties": {
"plans": {
"items": {
"$ref": "#/components/schemas/PlanSummary"
},
"title": "Plans",
"type": "array"
}
},
"required": [
"plans"
],
"title": "PlanListResponse",
"type": "object"
},
"PlanResponse": {
"additionalProperties": false,
"properties": {
"plan": {
"$ref": "#/components/schemas/PlanSummary"
}
},
"required": [
"plan"
],
"title": "PlanResponse",
"type": "object"
},
"PlanReviewStatus": {
"enum": [
"PENDING_REVIEW",
@@ -1178,6 +1208,82 @@
"title": "PlanReviewStatus",
"type": "string"
},
"PlanRevisionRequest": {
"additionalProperties": false,
"properties": {
"notes": {
"minLength": 1,
"title": "Notes",
"type": "string"
}
},
"required": [
"notes"
],
"title": "PlanRevisionRequest",
"type": "object"
},
"PlanSectionEditRequest": {
"additionalProperties": false,
"properties": {
"claims_to_support": {
"items": {
"type": "string"
},
"title": "Claims To Support",
"type": "array"
},
"evidence_needs": {
"items": {
"type": "string"
},
"title": "Evidence Needs",
"type": "array"
},
"heading": {
"minLength": 1,
"title": "Heading",
"type": "string"
},
"key_points": {
"items": {
"type": "string"
},
"title": "Key Points",
"type": "array"
},
"purpose": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Purpose"
},
"target_word_count": {
"anyOf": [
{
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Target Word Count"
}
},
"required": [
"heading"
],
"title": "PlanSectionEditRequest",
"type": "object"
},
"PlanSectionSummary": {
"additionalProperties": false,
"properties": {
@@ -1193,6 +1299,13 @@
"title": "Claims To Support",
"type": "array"
},
"evidence_needs": {
"items": {
"type": "string"
},
"title": "Evidence Needs",
"type": "array"
},
"heading": {
"minLength": 1,
"title": "Heading",
@@ -1203,6 +1316,13 @@
"title": "Id",
"type": "string"
},
"key_points": {
"items": {
"type": "string"
},
"title": "Key Points",
"type": "array"
},
"purpose": {
"anyOf": [
{
@@ -1251,6 +1371,18 @@
"title": "Article Id",
"type": "string"
},
"audience": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Audience"
},
"claims_to_prove": {
"items": {
"type": "string"
@@ -1263,11 +1395,37 @@
"title": "Created At",
"type": "string"
},
"evidence_needs": {
"items": {
"type": "string"
},
"title": "Evidence Needs",
"type": "array"
},
"excluded_sources": {
"items": {
"type": "string"
},
"title": "Excluded Sources",
"type": "array"
},
"id": {
"format": "uuid",
"title": "Id",
"type": "string"
},
"reader_persona": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reader Persona"
},
"recommended_title": {
"anyOf": [
{
@@ -1306,6 +1464,20 @@
"title": "Sections",
"type": "array"
},
"seo_notes": {
"items": {
"type": "string"
},
"title": "Seo Notes",
"type": "array"
},
"source_requirements": {
"items": {
"type": "string"
},
"title": "Source Requirements",
"type": "array"
},
"status": {
"$ref": "#/components/schemas/PlanReviewStatus"
},
@@ -1321,10 +1493,36 @@
"default": null,
"title": "Thesis"
},
"title_options": {
"items": {
"type": "string"
},
"title": "Title Options",
"type": "array"
},
"tone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Tone"
},
"version": {
"minimum": 1,
"title": "Version",
"type": "integer"
},
"visual_needs": {
"items": {
"type": "string"
},
"title": "Visual Needs",
"type": "array"
}
},
"required": [
@@ -1337,6 +1535,220 @@
"title": "PlanSummary",
"type": "object"
},
"PlanUpdateRequest": {
"additionalProperties": false,
"properties": {
"audience": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Audience"
},
"claims_to_prove": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Claims To Prove"
},
"evidence_needs": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Evidence Needs"
},
"excluded_sources": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Excluded Sources"
},
"reader_persona": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reader Persona"
},
"recommended_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Recommended Title"
},
"risks": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Risks"
},
"search_intent": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Search Intent"
},
"sections": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/PlanSectionEditRequest"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Sections"
},
"seo_notes": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Seo Notes"
},
"source_requirements": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Source Requirements"
},
"thesis": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Thesis"
},
"title_options": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Title Options"
},
"tone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Tone"
},
"visual_needs": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Visual Needs"
}
},
"title": "PlanUpdateRequest",
"type": "object"
},
"PublishCommitSummary": {
"additionalProperties": false,
"properties": {
@@ -3068,6 +3480,124 @@
]
}
},
"/api/articles/{article_id}/plan/generate": {
"post": {
"operationId": "post_generate_plan_api_articles__article_id__plan_generate_post",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Generate Plan",
"tags": [
"plans"
]
}
},
"/api/articles/{article_id}/plans": {
"get": {
"operationId": "get_plans_api_articles__article_id__plans_get",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanListResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Get Plans",
"tags": [
"plans"
]
}
},
"/api/articles/{article_id}/plans/generate": {
"post": {
"operationId": "post_generate_plan_api_articles__article_id__plans_generate_post",
@@ -3127,9 +3657,155 @@
]
}
},
"/api/articles/{article_id}/plans/{plan_id}": {
"get": {
"operationId": "get_plan_route_api_articles__article_id__plans__plan_id__get",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "path",
"name": "plan_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Plan Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Get Plan Route",
"tags": [
"plans"
]
},
"patch": {
"operationId": "patch_plan_api_articles__article_id__plans__plan_id__patch",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "path",
"name": "plan_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Plan Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanUpdateRequest"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Patch Plan",
"tags": [
"plans"
]
}
},
"/api/articles/{article_id}/plans/{plan_id}/approve": {
"post": {
"operationId": "approve_plan_api_articles__article_id__plans__plan_id__approve_post",
"operationId": "post_approve_plan_api_articles__article_id__plans__plan_id__approve_post",
"parameters": [
{
"in": "path",
@@ -3190,9 +3866,147 @@
"description": "Validation Error"
}
},
"summary": "Approve Plan",
"summary": "Post Approve Plan",
"tags": [
"articles"
"plans"
]
}
},
"/api/articles/{article_id}/plans/{plan_id}/request-revision": {
"post": {
"operationId": "post_request_plan_revision_api_articles__article_id__plans__plan_id__request_revision_post",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "path",
"name": "plan_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Plan Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanRevisionRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReviewActionResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Request Plan Revision",
"tags": [
"plans"
]
}
},
"/api/articles/{article_id}/research/start": {
"post": {
"operationId": "post_start_research_api_articles__article_id__research_start_post",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"202": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobListResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Start Research",
"tags": [
"plans"
]
}
},
+50
View File
@@ -197,13 +197,36 @@ export type HTTPValidationError = {
detail?: ValidationError[];
};
export type PlanListResponse = {
plans: PlanSummary[];
};
export type PlanResponse = {
plan: PlanSummary;
};
export type PlanReviewStatus = "PENDING_REVIEW" | "APPROVED" | "REVISION_REQUESTED";
export type PlanRevisionRequest = {
notes: string;
};
export type PlanSectionEditRequest = {
claims_to_support?: string[];
evidence_needs?: string[];
heading: string;
key_points?: string[];
purpose?: string | null;
target_word_count?: number | null;
};
export type PlanSectionSummary = {
article_plan_id: string;
claims_to_support?: string[];
evidence_needs?: string[];
heading: string;
id: string;
key_points?: string[];
purpose?: string | null;
sort_order: number;
target_word_count?: number | null;
@@ -211,16 +234,43 @@ export type PlanSectionSummary = {
export type PlanSummary = {
article_id: string;
audience?: string | null;
claims_to_prove?: string[];
created_at: string;
evidence_needs?: string[];
excluded_sources?: string[];
id: string;
reader_persona?: string | null;
recommended_title?: string | null;
risks?: string[];
search_intent?: string | null;
sections?: PlanSectionSummary[];
seo_notes?: string[];
source_requirements?: string[];
status: PlanReviewStatus;
thesis?: string | null;
title_options?: string[];
tone?: string | null;
version: number;
visual_needs?: string[];
};
export type PlanUpdateRequest = {
audience?: string | null;
claims_to_prove?: string[] | null;
evidence_needs?: string[] | null;
excluded_sources?: string[] | null;
reader_persona?: string | null;
recommended_title?: string | null;
risks?: string[] | null;
search_intent?: string | null;
sections?: PlanSectionEditRequest[] | null;
seo_notes?: string[] | null;
source_requirements?: string[] | null;
thesis?: string | null;
title_options?: string[] | null;
tone?: string | null;
visual_needs?: string[] | null;
};
export type PublishCommitSummary = {