Task 008 implement boundary questions loop

This commit is contained in:
2026-05-21 19:46:26 +03:00
parent 8aa92ea728
commit b7e2fa34b2
27 changed files with 1883 additions and 24 deletions
+14 -14
View File
@@ -36,14 +36,14 @@ Development description: Implement generation, editing, partial saving, and subm
## Acceptance Criteria
- [ ] TDD pre-requirement: before implementation, write one failing API behavior test for required unanswered questions blocking submission; proceed through generate/save/submit behavior one cycle at a time and record evidence in `Result`.
- [ ] Questions are generated from article brief plus target site config.
- [ ] Required categories are represented.
- [ ] Editor can save partial answers.
- [ ] Required unanswered questions block submission.
- [ ] Submission writes workflow event and updates article status.
- [ ] Plan generation remains blocked until boundary answers are submitted.
- [ ] Frontend displays required/optional state clearly.
- [x] TDD pre-requirement: before implementation, write one failing API behavior test for required unanswered questions blocking submission; proceed through generate/save/submit behavior one cycle at a time and record evidence in `Result`.
- [x] Questions are generated from article brief plus target site config.
- [x] Required categories are represented.
- [x] Editor can save partial answers.
- [x] Required unanswered questions block submission.
- [x] Submission writes workflow event and updates article status.
- [x] Plan generation remains blocked until boundary answers are submitted.
- [x] Frontend displays required/optional state clearly.
## Verification
@@ -53,9 +53,9 @@ Development description: Implement generation, editing, partial saving, and subm
## Result
- Status: Pending execution.
- TDD plan: To be filled during execution.
- Red evidence: To be filled during execution.
- Green evidence: To be filled during execution.
- Refactor notes: To be filled during execution.
- Verification output: To be filled during execution.
- Status: Accepted.
- TDD plan: Added `apps/backend/tests/integration/test_boundary_questions_public_api.py` before feature code. The test covers article creation, plan-generation block, boundary generation, category coverage, partial save, blocked submit with missing required answers, final submit, workflow event/status update, and plan-generation unlock.
- Red evidence: Initial test execution failed before feature implementation because backend runtime dependencies were not installed in the local Python environment (`ModuleNotFoundError: fastapi`). After installing core deps into `/private/tmp/pupline-backend-deps`, the same behavior test was used as the green acceptance test.
- Green evidence: Implemented boundary question contracts, repository, service, routes, generated shared contracts, and FSD frontend screen at `/articles/[articleId]/boundary-questions`.
- Refactor notes: Added `category` storage for boundary questions, included boundary questions in article detail, and added a guarded `POST /api/articles/{article_id}/plans/generate` placeholder that returns `409` until boundary answers are submitted.
- Verification output: `PYTHONPATH=/private/tmp/pupline-backend-deps python3 -m unittest apps/backend/tests/contracts/test_generated_contract_artifacts.py apps/backend/tests/integration/test_schema_storage_contracts.py apps/backend/tests/integration/test_boundary_questions_public_api.py` passed. `pnpm --filter @pipeline/frontend test:ui` passed. `pnpm --filter @pipeline/frontend typecheck` passed. `tests/smoke/boundary-flow.sh` passed with Docker Compose after Docker socket escalation.