Raw view: Design Doc From Requirements

No invisible, zero-width, or bidi-control characters detected.

Write an engineering design document from the requirements below. The document will be read by {{AUDIENCE}} (for example, "the backend team and one staff engineer approver") who will decide whether to approve the approach, so optimize for making the decision easy: surface the tradeoffs, do not bury them.

<requirements>
{{REQUIREMENTS}}
</requirements>

<existing_system>
{{EXISTING_SYSTEM}}
</existing_system>

<constraints>
{{CONSTRAINTS}}
</constraints>

<existing_system> describes what is in place today (services, data stores, interfaces); use it so the design fits rather than replaces. <constraints> holds hard limits: deadlines, budgets, compliance, team size, technology mandates. Each constraint must be visibly honored or explicitly challenged in the doc.

Rules:

1. Start by restating the requirements as numbered, testable statements. Where a requirement is vague ("fast", "scalable"), convert it to a number and mark it `[assumed]` so the reviewer can correct it. Do not design against vague requirements.
2. Write non-goals before the design. A design doc without non-goals invites scope arguments in review.
3. Propose one recommended design and at least two real alternatives that a competent engineer might actually choose, including "do nothing / extend the existing system". Reject each alternative for a specific reason tied to a requirement or constraint, not for being "less elegant".
4. For the recommended design, specify interfaces precisely: API shapes, schema changes, message formats, and the failure behavior at each boundary. Diagrams are optional; interface definitions are not.
5. Address the questions reviewers always ask: what happens under 10x load, what happens when the dependency is down, how is it rolled out and rolled back, how is it observed, what data migrates and how, and what security boundary it touches.
6. End with open questions you genuinely could not resolve from the inputs. Three honest open questions beat zero fake certainty.

Write in plain declarative sentences. Use tables for comparisons and code blocks for interfaces. Target 2-4 pages when rendered; cut background the audience already knows.

## Output format

Produce the document in Markdown with exactly these headings:

```
# <Title>
**Status:** Draft | **Author:** | **Reviewers:** | **Last updated:**
## 1. Summary            (3-5 sentences: problem, recommendation, cost)
## 2. Requirements       (numbered, testable; [assumed] where you converted vagueness)
## 3. Non-goals
## 4. Current state      (from <existing_system>; only what the design depends on)
## 5. Recommended design (components, interfaces as code blocks, data flow, failure modes)
## 6. Alternatives considered   (table: option, how it meets requirements, why rejected)
## 7. Rollout and rollback
## 8. Observability and operations
## 9. Security and privacy
## 10. Risks             (table: risk, likelihood, impact, mitigation)
## 11. Open questions
```

Below the document, add a short **Reviewer's guide**: the two or three sections where you most want pushback and why.