# BRD & PRD Amendments - License Enforcement Alignment

## Purpose
Surgical changes to align BRD and PRD with the updated License Enforcement Technical Specification, addressing terminology consistency, trial periods, token metering, and mode integration.

---

## AMENDMENTS TO BRD (submodule-isolation-brd.md)

### Amendment 1: Add Token Metering to Pricing Model (Section 5)

**Location:** Section 5 - Pricing Model table

**Current:**
```markdown
| Tier        | Price        | Key Features (≤6 words)           | Audience              |
|-------------|--------------|-----------------------------------|-----------------------|
| Free        | $0           | Manual commands, single repo      | Solo founders         |
| Starter     | $49/mo       | AI automation, 100k tokens/mo     | Small teams 1-3       |
| Enterprise  | $999+/mo     | Multi-repo, unlimited tokens, SLA | Growth teams 50+      |
```

**Change:** Add "30-day trial" to Starter tier features

**New:**
```markdown
| Tier        | Price        | Key Features (≤6 words)                    | Audience              |
|-------------|--------------|--------------------------------------------|-----------------------|
| Free        | $0           | Manual commands, single repo               | Solo founders         |
| Starter     | $49/mo       | AI automation, 100k tokens/mo, 30-day trial| Small teams 1-3       |
| Enterprise  | $999+/mo     | Multi-repo, unlimited tokens, SLA          | Growth teams 50+      |
```

---

### Amendment 2: Add License Enforcement to Key Risks (Section 8)

**Location:** Section 8 - Key Risks & Mitigations table

**Current:**
```markdown
| Risk                            | Mitigation                                      |
|---------------------------------|-------------------------------------------------|
| AI costs increase unexpectedly  | Pass-through pricing with immediate adjustments |
| Low free-to-paid conversion     | 30-day trial of premium agent features          |
| Namespace conflicts persist     | Submodule isolation model (this feature)        |
| Consulting doesn't scale        | Standardize packages, create playbooks          |
```

**Change:** Add row for unauthorized use

**New:**
```markdown
| Risk                            | Mitigation                                      |
|---------------------------------|-------------------------------------------------|
| AI costs increase unexpectedly  | Pass-through pricing with immediate adjustments |
| Low free-to-paid conversion     | 30-day trial of premium agent features          |
| Namespace conflicts persist     | Submodule isolation model (this feature)        |
| Consulting doesn't scale        | Standardize packages, create playbooks          |
| Unauthorized premium feature use| License validation with token quota enforcement |
```

---

## AMENDMENTS TO PRD (submodule-isolation-prd.md)

### Amendment 3: Standardize Environment Variable Name (Section 6, Step 4-5)

**Location:** Section 6 - User Journey table, Steps 4-5

**Current:**
```markdown
| Step | Action                                      | Expected Result                                  |
|------|---------------------------------------------|--------------------------------------------------|
| 4    | Try /enrich-release --ai without key       | Upgrade prompt shown, trial link provided        |
| 5    | Set ROADCREW_API_KEY, run --ai flag        | Premium feature executes, token usage tracked    |
```

**Change:** Replace `ROADCREW_API_KEY` with `ROADCREW_LICENSE_KEY`

**New:**
```markdown
| Step | Action                                      | Expected Result                                  |
|------|---------------------------------------------|--------------------------------------------------|
| 4    | Try /enrich-release --ai without key       | Upgrade prompt shown, trial link provided        |
| 5    | Set ROADCREW_LICENSE_KEY, run --ai flag    | Premium feature executes, token usage tracked    |
```

---

### Amendment 4: Add Token Quota to Functional Requirements (Section 4.1)

**Location:** Section 4.1 - Functional Requirements

**Current:**
```markdown
- R4: Gate premium features (--ai, --toc flags) via API key validation
```

**Change:** Expand to include token quota enforcement

**New:**
```markdown
- R4: Gate premium features (--ai, --toc flags) via license key validation and token quota enforcement
```

---

### Amendment 5: Add License Validation to Non-Functional Constraints (Section 4.2)

**Location:** Section 4.2 - Non-Functional Constraints (add as new bullet)

**Add After:** Current bullet 3

**New Bullet:**
```markdown
- License validation must work across Mode 0 (dev), Mode 1 (submodule), Mode 2 (multi-repo)
```

---

### Amendment 6: Add Trial Period to Acceptance Criteria (Section 4.3)

**Location:** Section 4.3 - Acceptance Criteria (add as new item)

**Add After:** AC3

**New Acceptance Criterion:**
```markdown
- AC3.1: Trial license allows 30-day premium access with 100k token quota
```

---

### Amendment 7: Update User Story US2 for Trial Details (Section 5)

**Location:** Section 5 - User Stories table, row US2

**Current:**
```markdown
| US2 | Small team lead    | Try premium AI features via trial      | Evaluate value before $49/mo commitment   |
```

**Change:** Add token quota detail

**New:**
```markdown
| US2 | Small team lead    | Try premium AI features via 30-day trial with 100k tokens | Evaluate value before $49/mo commitment   |
```

---

### Amendment 8: Add License Validation to PRD → Spec Mapping (Section 9)

**Location:** Section 9 - Mapping to Spec table

**Current:**
```markdown
| Functional Requirement                | Spec Section |
|---------------------------------------|--------------|
| R1: Install as submodule              | 2.1 Mode 1   |
| R2: Copy commands to .cursor/commands | 2.1 install.js |
| R3: Detect mode and resolve paths     | 2.2 Mode Detection |
| R4: Gate premium features             | 2.3 License Validation |
| R5: Multi-repo orchestration          | 2.4 Mode 2 |
| R6: Update without overwriting        | 2.5 Update Process |
```

**Change:** Update R4 reference and add R7

**New:**
```markdown
| Functional Requirement                | Spec Section |
|---------------------------------------|--------------|
| R1: Install as submodule              | 2.1 Mode 1   |
| R2: Copy commands to .cursor/commands | 2.1 install.js |
| R3: Detect mode and resolve paths     | 2.2 Mode Detection |
| R4: Gate premium features             | LICENSE-001 (License Enforcement Spec) |
| R5: Multi-repo orchestration          | 2.4 Mode 2 |
| R6: Update without overwriting        | 2.5 Update Process |
| R7: Token quota enforcement           | LICENSE-001.6 (Trial & Token System) |
```

---

### Amendment 9: Add License Validation to Impact & Dependencies (Section 8)

**Location:** Section 8 - Impact & Dependencies

**Current:**
```markdown
- **Affected Systems:** .cursor/commands/ (all command files), install scripts, path resolution utilities
- **Dependencies:** Git submodule support, Node.js >=16, GitHub API access (multi-repo mode)
```

**Change:** Add license validation to both

**New:**
```markdown
- **Affected Systems:** .cursor/commands/ (all command files), install scripts, path resolution utilities, premium script license validation
- **Dependencies:** Git submodule support, Node.js >=16, GitHub API access (multi-repo mode), license validation API (premium features)
```

---

## SUMMARY OF CHANGES

### Terminology Alignment
- **Changed:** `ROADCREW_API_KEY` → `ROADCREW_LICENSE_KEY` (PRD Section 6)

### Trial Period Integration
- **Added:** "30-day trial" to BRD pricing model (BRD Section 5)
- **Added:** Trial acceptance criterion AC3.1 (PRD Section 4.3)
- **Updated:** User story US2 with token quota details (PRD Section 5)

### Token Quota Enforcement
- **Updated:** R4 to include token quota enforcement (PRD Section 4.1)
- **Added:** R7 for token quota tracking in spec mapping (PRD Section 9)

### Mode Integration
- **Added:** License validation works across Mode 0/1/2 (PRD Section 4.2)

### Risk Management
- **Added:** Unauthorized use risk to BRD (BRD Section 8)

### Spec Cross-References
- **Updated:** R4 spec reference to LICENSE-001 (PRD Section 9)
- **Added:** License validation to dependencies (PRD Section 8)

---

## VALIDATION CHECKLIST

After applying amendments, verify:
- [ ] All references to API key changed to license key
- [ ] Trial period mentioned consistently (30 days, 100k tokens)
- [ ] Token quota enforcement referenced in functional requirements
- [ ] Mode 0/1/2 compatibility documented
- [ ] Spec cross-references point to LICENSE-001 issues
- [ ] No conflicts between BRD pricing and license spec tiers
- [ ] User journey reflects ROADCREW_LICENSE_KEY environment variable

---

## IMPLEMENTATION NOTES

**Do NOT change:**
- Word counts or bullet limits in any section
- Table structures or formatting
- Section numbers or anchors
- Downstream template mapping comments

**Only change:**
- Specific table cells, bullets, or sentences identified above
- Nothing else to maintain document integrity for automation