Sprint — #337 · #358 · #328 — Selfhosting · Chat · Voice
Cross-epic coordination doc for 36 open issues across Document Pipeline (#328), Chat Bedrock + Guardrails (#358), and Voice Infrastructure (#337). Identifies file-level conflicts, shared blockers, and recommended execution order.
Scope: 36 open issues across the 3 active epics:
- #328 Document Upload Pipeline (Selfhosting on S3 + Textract)
- #358 Chat Bedrock + Guardrails (Chat)
- #337 Voice Infrastructure — Self-Hosted AWS Migration (Voice)
Analysis date: 2026-04-06 Focus: identify interference, conflicts, blockers, and shared-resource collisions.
Update 2026-04-25: This doc was written 2026-04-06. Phase 0 unblocker status as of today is mixed — see annotated table in the "RECOMMENDED EXECUTION ORDER → Phase 0" section below. Cross-epic warnings about #338 (AWS credentials) and #357 (PDF/image stubs) are largely resolved; #328 (S3/IAM) is still open.
Overview: 3 Epics
| Epic | Issues | Priority Range | Blocker |
|---|---|---|---|
| #337 Voice AWS Migration | #338–#348 (11 issues) | P0–P2 | #338 (AWS credentials) |
| #358 Chat Bedrock + Guardrails | #359–#368 (10 issues) | P0–P2 | #338 (AWS credentials) |
| Document Upload Pipeline | #328–#334 (7 issues) | P0–P1 | #328 (S3/IAM credentials) |
Standalone: #325, #326, #327, #355, #356, #357
CRITICAL INTERFERENCE & PROBLEMS
1. Dual AWS Credential Blocker (#338)
Problem: Issue #338 (Voice AWS Credentials) is the single-point blocker for two independent epics (21 issues total):
- Voice AWS (#339–#348): all 10 sub-issues depend on #338
- Chat Guardrails (#359–#362): the first 4 sub-issues depend on #338 for Bedrock access in
eu-central-1
Risk: If #338 stalls, 21 issues across 2 epics are frozen. This is the biggest bottleneck in the entire backlog.
Recommendation: #338 must be resolved first. Both epics share AWS account + Bedrock access as prerequisites. Ensure the credential setup covers both voice (EC2 + model weights) and chat (Bedrock Mistral + Guardrails) requirements in a single pass.
Update 2026-04-25: #338 closed completed on 2026-04-12. The Voice AWS bring-up has continued past credential setup; the active work is now tracked under the voice bring-up epic (state: 2026-04-24 memory note). The 21-issue freeze risk no longer applies.
2. Chat Route Quadruple Collision (#359 / #363 / #333 / #325)
Problem: Four issues across 3 epics + 1 standalone all modify app/api/chat/route.ts:
| Issue | Epic | Change |
|---|---|---|
| #359 | Chat Guardrails | Wire chat route to Bedrock Mistral (eu-central-1) |
| #363 | Chat Guardrails | Add Cloudflare Turnstile verification |
| #333 | Document Pipeline | Inject document context into chat route (Prompt Hardening) |
| #325 | Standalone | Implement server-side onFinish chat history persistence |
Required order:
- #359 first — establishes the Bedrock Mistral provider and the route shape everyone else builds on
- #363 (Turnstile) — wraps the route with bot protection
- #333 (document context injection) — must adapt to the Bedrock route signature, NOT a Vercel-AI-SDK signature
- #325 (history persistence) — last, since onFinish hook position depends on the final route shape
Risk: #333 lives in the Document Pipeline epic but is silently coupled to the Chat epic. If Document Pipeline lands #333 in parallel with Chat Guardrails landing #359, the merge will fail.
Recommendation: Move #333 into Chat Guardrails ordering, OR explicitly gate it on #359 completion.
3. Document Route Bug Before Refactor (#357)
Problem: #357 (PDF/image stubs in summarize + simplify) is a real bug. Both routes currently work only for text/plain. This must be fixed before any other Document Pipeline work touches those routes, otherwise the pipeline will be built on broken multimodal handling.
Recommendation: Land #357 first as a bug fix.
Update 2026-04-25: #357 closed (state_reason: not_planned) on 2026-04-07 — folded into the document pipeline. The simplify route (
apps/web/app/api/documents/simplify/route.ts) on main no longer reads file content directly; it readsocr_confirmed_textfrom theuser_documentsrow, which means the PDF/image stub problem is resolved by the OCR pipeline, not by patching this route.
4. Document Upload: DB Schema Bugs Block Pipeline (#355, #356)
Problem: Two bugs exist in the current document system that will interfere with the Document Upload Pipeline epic:
- #355:
is_sharedcolumn referenced in 4 files but missing from DB migration003_create_documents.sql - #356:
document_typenot saved on upload (route ignores it, DB column may not exist)
Conflict: The Document Upload Pipeline (#328–#334) builds a completely new upload flow with S3 + Textract. If the current DB schema is broken, the migration path (#334: Supabase→S3) will fail because existing data is inconsistent.
Recommendation: Fix #355 and #356 before starting the Document Upload Pipeline. These are quick schema/route fixes that prevent data integrity issues during migration.
Update 2026-04-25: #355 closed completed 2026-04-07; #356 closed completed 2026-04-18. Both schema fixes are landed; the Document Upload Pipeline is no longer blocked by these.
5. Voice Guardrail Cross-Epic Dependency (#366)
Problem: Chat Guardrails #366 (Voice pipeline guardrail alignment) depends on:
- Voice AWS #344 (Docker Compose) — from a different epic
- Chat Guardrails #361 (crisis detection categories)
This creates a cross-epic dependency: the Chat Guardrails epic cannot fully close until the Voice AWS epic reaches issue #344.
Recommendation: Acknowledge this as a late-stage integration task. Don't schedule #366 until both epics are well advanced.
6a. DB Migration Sequence (#355 / #364 / Document Pipeline)
Problem: Three groups create or modify Supabase migration files in scripts/:
| Issue | Migration |
|---|---|
| #355 | Fix 003_create_documents.sql (add missing is_shared column) |
| #356 | Add document_type column (likely new migration or amend #003) |
| #364 | New migration: guardrail_events table for chat + voice logging |
| #329, #330, #331, #334 | Document Pipeline schema additions for S3 metadata |
Risk: Multiple developers writing SQL migrations in parallel will collide on migration numbering. Migrations must be numbered sequentially and cannot be retroactively renumbered after merge.
Recommendation:
- Centralize migration number assignment (one person reserves slots)
- Bundle #355 + #356 in one migration
- #364 is independent (different table) — can run in parallel but reserve a number first
- Document Pipeline migrations are owned by Stream A, sequence them within that stream
6b. AWS Credential Sharing (#338 vs #328)
Problem: Both #338 (Voice/Chat AWS) and #328 (S3/Textract AWS) configure AWS credentials. They must agree on:
AWS_REGION(eu-central-1for both — confirm Textract availability in this region!)AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY— single set or separate IAM users?- IAM policy scopes (Bedrock + S3 + Textract permissions)
Risk: Two parallel credential setups produce two .env entries that drift, two IAM users with overlapping/missing permissions, or hard-to-debug regional mismatches (e.g., Textract not available in eu-central-1 historically — verify!).
Recommendation: Single IAM user with combined policy (Bedrock + S3 + Textract). Single AWS region. #338 and #328 owners must coordinate before either starts.
6c. Document↔Chat Cross-Epic Coupling (#333)
Problem: Issue #333 (Document Upload — API Route Refactor + Prompt Hardening) lives in the Document Pipeline epic but modifies the chat route to inject document context into prompts. This is the only Document Pipeline issue that touches chat infrastructure.
Recommendation: Treat #333 as a dual-epic issue. It depends on:
- Document Pipeline #330 (Textract done) + #331 (master.md) — document data must exist
- Chat Guardrails #359 (Bedrock route) — chat route shape must be finalized
Schedule #333 after both #331 and #359 — i.e., late in Phase 1 or early Phase 2, not in parallel with the early Document Pipeline chain.
7. package.json Contention
Problem: Multiple issues across the 3 epics add AWS SDK packages (@aws-sdk/client-bedrock-runtime, @aws-sdk/client-s3, @aws-sdk/client-textract).
Recommendation: Coordinate merges. Document Pipeline adds AWS deps first (#329, #330, #333). Chat Guardrails adds Bedrock dep next (#359). Voice AWS adds its remaining deps last.
8. Standalone Issues — Low Interference
| Issue | Title | Interference |
|---|---|---|
| #325 | Chat history: onFinish is a stub | Touches chat/page.tsx. Re-evaluate after #359 since the chat route shape is finalized there. |
| #326 | Voice UI only for Knotencheck | Independent. No file conflicts. |
| #327 | Clinical studies data is static | Independent. No file conflicts. |
| #355 | is_shared column missing | Touches documents/route.ts + migration. Fix before Document Pipeline. |
| #356 | document_type not saved | Touches same files as #355. Bundle together. |
| #357 | Summarize/Simplify stubs for PDFs | Touches summarize + simplify routes. Fix before any other doc-route work. |
RECOMMENDED EXECUTION ORDER
Phase 0 — Unblockers (do first, parallel)
| Issue | What | Why |
|---|---|---|
| #338 | AWS Credentials & Accounts | Blocks 21 issues across 2 epics |
| #328 | S3 + IAM + Textract Credentials | Blocks 6 Document Pipeline issues |
| #355 + #356 | DB schema bug fixes | Blocks clean Document Pipeline migration |
| #357 | PDF/image summarize bug fix | Must land before other doc-route work |
Update 2026-04-25: Phase 0 status snapshot:
Issue State Closed at Reason #338 closed 2026-04-12 completed #328 open — still in progress #355 closed 2026-04-07 completed #356 closed 2026-04-18 completed #357 closed 2026-04-07 not_planned (folded into pipeline) Phase 0 is 4-of-5 done. Only #328 (S3 + IAM + Textract Credentials) remains open and continues to block downstream Document Pipeline issues #329–#334.
Phase 1 — P0 Core Work (after Phase 0)
| Stream | Issues | Parallel? |
|---|---|---|
| Document Pipeline | #329 → #330 → #331 → #332 → (#333 deferred) | Sequential chain |
| Voice AWS | #339 + #340 (parallel) → #341 → #342 → #343 → #344 | Partial parallel |
| Chat Guardrails | #359 → #360 → #361 | Sequential chain |
| Cross-epic gate | #333 runs only after #331 ∧ #359 | Dual-dependency |
Phase 2 — P1 Features
| Stream | Issues |
|---|---|
| Chat Guardrails | #362 → #363 → #364 → #365 |
| Voice AWS | #345 → #346 |
| Document Pipeline | #334 (S3 migration) |
| Chat Guardrails ↔ Voice | #366 (cross-epic, needs #344 + #361) |
Phase 3 — P2 Cleanup & Docs
| Issue | What |
|---|---|
| #347 | Voice AWS — delete deprecated files |
| #348 | Voice AWS — monitoring & logging |
| #367 | Chat Guardrails — false positive management |
| #368 | Chat Guardrails — regulatory documentation |
| #325 | Chat history persistence (after Bedrock chat route stable) |
Phase 4 — Standalone Enhancements (anytime)
| Issue | What |
|---|---|
| #326 | Voice UI for Julia Chat |
| #327 | Clinical studies live API |
SUMMARY: Key Numbers
- Total in-scope open issues: 36 (+ 2 epics + 1 sprint epic + 5 phase sub-issues = 42 open total — 100% covered)
- Critical blockers: 2 (#338 AWS credentials, #328 S3/IAM credentials)
- File-level conflicts identified: 5
app/api/chat/route.ts— #325, #333, #359, #363 (quadruple)app/api/documents/route.ts— #355, #356app/dokumente/page.tsx— #355, #356app/api/moderation/analyze/route.ts— owned by #358/#359 (Bedrock Guardrails)package.json— #329, #330, #333, #359 (AWS SDKs)
- DB migration coordination required: #355, #356, #364, plus Document Pipeline schema migrations
- Cross-epic couplings: 3
- #338 shared AWS blocker (Voice + Chat)
- #366 voice+chat guardrail alignment (needs #344 + #361)
- #333 document↔chat coupling (needs #331 + #359) ← previously missed
- AWS credential coordination: #338 + #328 must agree on region, IAM, env var names
- Recommended first actions: #338, #328, #355, #356, #357 (all parallelizable)
Ingested from repo-root
SPRINT_337_358_328.mdon 2026-04-25 (#647).
Comprehensive Issue Resolution Plan
88-issue, 7-sprint resolution plan covering security, design, accessibility, bugs, and config — organized by dependency order with file-level cross-references.
fragJulia Launch-Day Audit — 2026-04-04
Pre-launch functionality audit identifying 1 critical, 2 high, 4 medium, and 3 low-priority issues — including the proxy.ts vs middleware.ts bug, Stripe origin handling, and CSP gaps.