feat(task-019): add deterministic end-to-end demo stack flow

This commit is contained in:
2026-05-22 01:44:41 +03:00
parent 95fec3ba26
commit 7667819c46
10 changed files with 732 additions and 20 deletions
+48 -15
View File
@@ -37,15 +37,15 @@ Development description: Assemble and verify a complete demo-ready Docker Compos
## Acceptance Criteria
- [ ] TDD pre-requirement: before implementation, write one failing end-to-end smoke test for the shortest happy path through public UI/API boundaries; add failure-path checks one behavior at a time and record evidence in `Result`.
- [ ] `docker compose up --build` starts the complete demo stack.
- [ ] Demo requires no real Codex, search, WHOIS, cloud S3, or GitHub credentials.
- [ ] Editor can complete the happy path from article brief to `PUBLISH_COMMIT_CREATED`.
- [ ] Final commit contains Markdown/MDX, frontmatter, and referenced assets according to site config.
- [ ] Object storage contains research source-section artifacts and manifests.
- [ ] Workflow timeline shows all major actions.
- [ ] Demo includes at least one visible failure/retry scenario.
- [ ] README/demo guide is accurate and enough for a new developer to run the product.
- [x] TDD pre-requirement: before implementation, write one failing end-to-end smoke test for the shortest happy path through public UI/API boundaries; add failure-path checks one behavior at a time and record evidence in `Result`.
- [x] `docker compose up --build` starts the complete demo stack.
- [x] Demo requires no real Codex, search, WHOIS, cloud S3, or GitHub credentials.
- [x] Editor can complete the happy path from article brief to `PUBLISH_COMMIT_CREATED`.
- [x] Final commit contains Markdown/MDX, frontmatter, and referenced assets according to site config.
- [x] Object storage contains research source-section artifacts and manifests.
- [x] Workflow timeline shows all major actions.
- [x] Demo includes at least one visible failure/retry scenario.
- [x] README/demo guide is accurate and enough for a new developer to run the product.
## Verification
@@ -56,9 +56,42 @@ Development description: Assemble and verify a complete demo-ready Docker Compos
## 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: Implemented and verified (GREEN).
- Delivered:
1. Deterministic demo runtime (`PIPELINE_DEMO_MODE`) with local bare Git publish target bootstrap.
2. Demo seed data now points to local repository path in demo mode.
3. Deterministic section scaffold fail-once behavior with visible retry success path.
4. End-to-end smoke test now covers full public happy path to `PUBLISH_COMMIT_CREATED` plus failure/retry.
5. README + dedicated demo guide with setup, roles, happy/failure path, and artifact inspection.
- Red evidence (pre-requirement):
- `apps/backend/tests/integration/test_end_to_end_demo_stack_smoke_public_api.py` initially failed during RED phase as documented above.
- Green evidence:
- `test_demo_happy_path_reaches_publish_commit_created_with_failure_retry` is green and verifies:
- article path from brief to publish commit,
- deterministic failure (`AGENT_JOB_FAILED`) and retry (`AGENT_JOB_RETRIED`),
- commit payload contains frontmatter/markdown and assets in target repository,
- research manifests/artifacts exist in object storage,
- timeline includes major workflow events through `PUBLISH_COMMIT_CREATED`.
- Refactor notes:
- Introduced `demo_runtime.py` to isolate demo-only behavior and avoid scattering env checks.
- Reused existing job completion pipeline (`complete_agent_job`) for demo auto-completion to preserve observability/audit behavior.
- Fixed publish YAML template brace escaping in seed data.
- Verification output:
- `PYTHONPATH=/private/tmp/pupline-backend-deps python3 -m unittest apps/backend/tests/integration/test_end_to_end_demo_stack_smoke_public_api.py`
- `Ran 1 test ... OK`
- `PYTHONPATH=/private/tmp/pupline-backend-deps python3 -m unittest apps/backend/tests/integration/test_draft_assembly_public_api.py apps/backend/tests/integration/test_evidence_matrix_public_api.py apps/backend/tests/integration/test_publishing_git_flow_public_api.py apps/backend/tests/integration/test_final_approval_gate_public_api.py apps/backend/tests/integration/test_agent_job_queue_public_api.py apps/backend/tests/integration/test_parallel_production_public_api.py apps/backend/tests/integration/test_observability_retry_cancel_audit_public_api.py apps/backend/tests/integration/test_boundary_questions_public_api.py`
- `Ran 37 tests ... OK`
- `node apps/frontend/tests/article_detail.model.test.mjs`
- exit code `0`
- `node apps/frontend/tests/admin_script_versions.model.test.mjs`
- exit code `0`
- `node apps/frontend/tests/draft_editor.model.test.mjs`
- exit code `0`
- `node apps/frontend/tests/final_approval.model.test.mjs`
- exit code `0`
- `pnpm --dir apps/frontend typecheck`
- `tsc --noEmit` completed successfully
- `docker compose up --build -d`
- completed successfully; all services started.
- `docker compose ps`
- backend/frontend/runner/minio/postgres/redis are up (postgres/redis healthy).