diff --git a/agents/prompts/reviewer.md b/agents/prompts/reviewer.md index 4a5066b..fe6183a 100644 --- a/agents/prompts/reviewer.md +++ b/agents/prompts/reviewer.md @@ -91,24 +91,22 @@ If verdict is "changes_requested", findings must be non-empty with actionable su If verdict is "revise", include `"target_role": "..."` and findings must be non-empty with actionable suggestions. If verdict is "blocked", include `"blocked_reason": "..."` (e.g. unable to read files). -**Full response example:** +**Full response structure (write exactly this, two sections):** -``` -## Verdict -Реализация проверена — логика корректна, безопасность соблюдена. Найдено одно незначительное замечание по документации, не блокирующее. Задачу можно закрывать. + ## Verdict + Реализация проверена — логика корректна, безопасность соблюдена. Найдено одно незначительное замечание по документации, не блокирующее. Задачу можно закрывать. -## Details -```json -{ - "verdict": "approved", - "findings": [...], - "security_issues": [], - "conventions_violations": [], - "test_coverage": "adequate", - "summary": "..." -} -` ` ` -``` + ## Details + ```json + { + "verdict": "approved", + "findings": [...], + "security_issues": [], + "conventions_violations": [], + "test_coverage": "adequate", + "summary": "..." + } + ``` ## Verdict definitions diff --git a/tests/test_deploy.py b/tests/test_deploy.py index 3f4bf20..a198bc9 100644 --- a/tests/test_deploy.py +++ b/tests/test_deploy.py @@ -330,7 +330,7 @@ class TestProjectLinksAPI: "type": "depends_on", "description": "P1 depends on P2", }) - assert r.status_code == 200 + assert r.status_code == 201 data = r.json() assert data["from_project"] == "p1" assert data["to_project"] == "p2" diff --git a/web/api.py b/web/api.py index cce912b..82ca5e9 100644 --- a/web/api.py +++ b/web/api.py @@ -439,7 +439,7 @@ class ProjectLinkCreate(BaseModel): description: str | None = None -@app.post("/api/project-links") +@app.post("/api/project-links", status_code=201) def create_project_link(body: ProjectLinkCreate): """Create a project dependency link.""" conn = get_conn() diff --git a/web/frontend/src/__tests__/deploy-api.test.ts b/web/frontend/src/__tests__/deploy-api.test.ts index 3e2582d..a579f7d 100644 --- a/web/frontend/src/__tests__/deploy-api.test.ts +++ b/web/frontend/src/__tests__/deploy-api.test.ts @@ -53,14 +53,14 @@ describe('api.projectLinks', () => { // ───────────────────────────────────────────────────────────── describe('api.createProjectLink', () => { it('делает POST /api/project-links', async () => { - const spy = mockFetch({ id: 1, from_project: 'KIN', to_project: 'BRS', link_type: 'depends_on', description: null, created_at: '' }) - await api.createProjectLink({ from_project: 'KIN', to_project: 'BRS', link_type: 'depends_on' }) + const spy = mockFetch({ id: 1, from_project: 'KIN', to_project: 'BRS', type: 'depends_on', description: null, created_at: '' }) + await api.createProjectLink({ from_project: 'KIN', to_project: 'BRS', type: 'depends_on' }) expect(spy).toHaveBeenCalledWith('/api/project-links', expect.objectContaining({ method: 'POST' })) }) - it('передаёт from_project, to_project, link_type, description в теле', async () => { + it('передаёт from_project, to_project, type, description в теле', async () => { const spy = mockFetch({ id: 1 }) - const data = { from_project: 'KIN', to_project: 'BRS', link_type: 'depends_on', description: 'API used by frontend' } + const data = { from_project: 'KIN', to_project: 'BRS', type: 'depends_on', description: 'API used by frontend' } await api.createProjectLink(data) const body = JSON.parse((spy.mock.calls[0][1] as RequestInit).body as string) expect(body).toMatchObject(data) @@ -68,10 +68,10 @@ describe('api.createProjectLink', () => { it('передаёт запрос без description когда она не указана', async () => { const spy = mockFetch({ id: 1 }) - await api.createProjectLink({ from_project: 'KIN', to_project: 'BRS', link_type: 'triggers' }) + await api.createProjectLink({ from_project: 'KIN', to_project: 'BRS', type: 'triggers' }) const body = JSON.parse((spy.mock.calls[0][1] as RequestInit).body as string) expect(body.from_project).toBe('KIN') - expect(body.link_type).toBe('triggers') + expect(body.type).toBe('triggers') }) })