# Future Releases

> **Note:** This file tracks upcoming phases from the product vision. Phases are automatically synced from `context/vision.md` via `/sync-roadmap`.

---

## v1.7.0: Automated Infrastructure & Scale  📋 FUTURE

**Goal:** Automate and scale what was validated manually in v1.6.0

**Prerequisites:**
- v1.6.0 complete with 20+ trial users
- Business model validated with paying customers
- Need identified for automation (support overhead >1 hour/day)

**Estimated Timeline:** 4 weeks

**Focus Metrics:**
- Trial conversion rate: 15%+ (automated)
- Premium tier ARR: $5k-10k
- Support overhead: <15 min/day (self-service)

**Key Use Cases:**
- Automated trial signup and key generation
- Real-time token quota enforcement
- Seat limit management for multi-user teams
- Self-service customer portal
- Piracy prevention via fingerprinting

**Scope:**
- Phase 1: Server validation infrastructure (API + database)
- Phase 2: Automated trials and token enforcement
- Phase 3: Customer management portal and analytics

**Success Criteria:**
- [ ] License validation API <200ms latency (cached <5ms)
- [ ] Automated trial signup converts 20%+ visitors
- [ ] 15% trial-to-paid conversion maintained
- [ ] Multi-seat enforcement prevents key sharing
- [ ] Customer portal reduces support tickets by 80%
- [ ] All 6 spec issues completed

**Epics:**
- **Epic 1: License API & Validation** - Server infrastructure
- **Epic 2: Automated Trials & Enforcement** - Token quotas and seat limits
- **Epic 3: Customer Portal** - Self-service management
- **Epic 4: Anti-Piracy** - Machine fingerprinting

**Value:** Scales to 100+ customers, reduces support overhead, prevents revenue loss from piracy

---

### EPIC 1: License API & Validation

**Goal:** Build server-side license validation infrastructure with caching and offline support

**Related Spec**: [License Enforcement Spec](../requirements/specs/license-enforcement-spec.md) - Issues LICENSE-001.1, LICENSE-001.2

**Prerequisites:**
- Database schema defined
- API service infrastructure ready
- v1.6.0 client validation working

**Estimated Timeline:** 2 weeks

**Issues:**

#### Issue 1.1: Upgrade Client to Server Validation (Tier 2)

**Classification**: 8

**Overview:** Enhance v1.6.0 client validation with server-side validation, 7-day caching, and offline support.

**Acceptance Criteria:**
- Script validates with server API within 200ms
- Cached validation allows 7-day offline operation
- Network timeout falls back to cached validation gracefully
- Mode 0 (dev) skips validation when ROADCREW_DEV_MODE=true

**Technical Implementation:**
- Upgrade scripts/core/license-validator.ts with API calls
- Implement 7-day filesystem cache with TTL
- Add timeout and retry logic for API calls
- Build graceful degradation for offline scenarios
- Detect deployment mode (Mode 0/1/2)

**Dependencies:** Issue 1.2 (needs API endpoint)

**Files/Components:** scripts/core/license-validator.ts, scripts/core/cache-manager.ts, scripts/core/mode-detector.ts

**Estimated Effort:** 6 hours (ai-led)

---

#### Issue 1.2: Implement License API Service and Database

**Classification**: 9

**Overview:** Build REST API service for license validation with PostgreSQL backend including database schema for licenses, fingerprints, and trial management.

**Acceptance Criteria:**
- POST /v1/licenses/validate returns valid/invalid status in <100ms
- API enforces seat limits based on fingerprint count
- Expired and trial licenses return appropriate error status
- Token quota enforcement blocks when monthly limit reached
- Database indexed for fast license key lookups

**Technical Implementation:**
- Create Express API service with TypeScript
- Design PostgreSQL schema with licenses, fingerprints, trial_keys tables
- Add trial_ends_at, token_quota, tokens_used, tier fields
- Implement validation endpoint with key lookup and business logic
- Add seat tracking with atomic fingerprint updates
- Create database indexes on key, fingerprint, tier fields
- Implement API authentication and rate limiting

**Dependencies:** None (standalone service)

**Files/Components:** api/src/routes/licenses.ts, api/src/db/schema.sql, api/src/middleware/auth.ts

**Estimated Effort:** 10 hours (ai-led)

---

### EPIC 2: Automated Trials & Enforcement

**Goal:** Automate trial generation and enforce token quotas to scale freemium conversion

**Estimated Timeline:** 1.5 weeks

**Issues:**

#### Issue 2.1: Automated Trial License Generation

**Classification**: 8

**Overview:** Create automated trial license generation system with 30-day expiration, email verification, and token quotas.

**Acceptance Criteria:**
- POST /v1/licenses/trial generates valid trial license with 30-day expiration
- Trial licenses include token quota matching Starter tier (100k tokens/month)
- Expired trial prompts upgrade with clear messaging and pricing link
- Email verification prevents abuse
- Trial conversion tracking records upgrade from trial to paid

**Technical Implementation:**
- Create trial license generation API endpoint
- Set trial_ends_at to 30 days from creation timestamp
- Set token_quota to 100000 for Starter tier trial
- Build email verification workflow
- Implement upgrade prompt logic when trial expires or quota exceeded
- Add trial-to-paid conversion tracking
- Implement rate limiting to prevent trial abuse

**Dependencies:** Issue 1.2 (needs license database)

**Files/Components:** api/src/routes/trials.ts, api/src/services/trial-manager.ts, scripts/core/upgrade-prompts.ts

**Estimated Effort:** 8 hours (ai-led)

---

#### Issue 2.2: Real-Time Token Quota Enforcement

**Classification**: 7

**Overview:** Implement server-side token metering that tracks and enforces monthly quotas with hard blocking.

**Acceptance Criteria:**
- Token consumption recorded with each premium feature execution
- Monthly quota reset automatically on anniversary date
- Quota exceeded blocks execution with clear upgrade message
- API endpoint POST /v1/licenses/:key/tokens records usage
- Usage visible in validation responses

**Technical Implementation:**
- Upgrade scripts/core/token-tracker.ts with API calls
- Send token consumption to API after each execution
- Check remaining quota in validation responses
- Block execution when quota exhausted
- Build monthly quota reset mechanism
- Add usage analytics endpoint

**Dependencies:** Issue 1.2 (needs API and database)

**Files/Components:** scripts/core/token-tracker.ts, api/src/services/token-quota.ts, api/src/routes/usage.ts

**Estimated Effort:** 6 hours (ai-led)

---

### EPIC 3: Customer Portal

**Goal:** Build self-service portal for license management, reducing support overhead

**Estimated Timeline:** 1 week

**Issues:**

#### Issue 3.1: Customer License Management Portal

**Classification**: 6

**Overview:** Build web portal for customers to view license status, manage machine fingerprints, monitor token usage, and access usage analytics.

**Acceptance Criteria:**
- Customer logs in sees license key status expiration tier
- Portal displays all active machine fingerprints with last-seen
- Customer can remove fingerprints to free seats
- Token usage dashboard shows monthly consumption and quota limits
- Usage analytics shows script execution trends over time
- Portal updates reflect in validation API within 60 seconds

**Technical Implementation:**
- Create React frontend with authentication
- Build API endpoints for license status and fingerprint management
- Display license details: expiration, tier, seat usage, token quotas
- Implement fingerprint deletion with confirmation workflow
- Add usage charts from telemetry data with token consumption
- Create token usage dashboard with monthly quotas and alerts
- Integrate with existing authentication system

**Dependencies:** Issue 1.2 (API), Issue 2.2 (token data), Issue 4.1 (fingerprints)

**Files/Components:** portal/src/pages/LicenseManagement.tsx, api/src/routes/portal.ts, portal/src/components/FingerprintList.tsx, portal/src/components/TokenUsageDashboard.tsx

**Estimated Effort:** 12 hours (ai-led)

---

### EPIC 4: Anti-Piracy (Machine Fingerprinting)

**Goal:** Prevent key sharing and enforce seat limits via machine fingerprinting

**Estimated Timeline:** 1 week

**Issues:**

#### Issue 4.1: Machine Fingerprinting for Seat Enforcement

**Classification**: 7

**Overview:** Implement machine fingerprinting system that generates stable identifiers from system properties to track and enforce seat limits.

**Acceptance Criteria:**
- Fingerprint generation stable across script executions on same machine
- N+1 activation blocked when N seats already consumed
- Fingerprint includes OS hostname MAC address architecture identifiers
- Customer portal displays active fingerprints for management
- Fingerprint removal API allows customer self-service seat release

**Technical Implementation:**
- Generate fingerprint from hostname, platform, arch, MAC address
- Hash fingerprint using SHA-256 for privacy
- Send fingerprint with validation requests to API
- API checks fingerprint count against seat limit
- Store fingerprint with last-seen timestamp for tracking
- Build portal API for listing and deleting fingerprints

**Dependencies:** Issue 1.2 (database schema)

**Files/Components:** scripts/core/fingerprint.ts, api/src/services/seat-manager.ts, api/src/routes/fingerprints.ts

**Estimated Effort:** 8 hours (ai-led)

---

#### Issue 4.2: Telemetry Collection System

**Classification**: 5

**Overview:** Add optional privacy-respecting telemetry that tracks script usage events and AI token consumption for compliance monitoring.

**Acceptance Criteria:**
- Telemetry disabled by default, requires ROADCREW_TELEMETRY_ENABLED=true
- Events include script name, version, timestamp, deployment mode, no PII
- AI token consumption recorded with each premium feature execution
- License keys hashed before transmission for anonymization
- Telemetry endpoint accepts events without blocking script execution
- Failed telemetry sends log warning, continues execution

**Technical Implementation:**
- Upgrade scripts/core/telemetry.ts with server integration
- Check ROADCREW_TELEMETRY_ENABLED before any collection
- Hash license keys using SHA-256 for anonymization
- Send events to telemetry API with fire-and-forget pattern
- Include tokens_consumed and deployment_mode in event metadata
- Build telemetry API endpoint storing events in database
- Add metadata sanitization removing any PII fields

**Dependencies:** Issue 1.2 (database)

**Files/Components:** scripts/core/telemetry.ts, api/src/routes/telemetry.ts, api/src/services/telemetry-sanitizer.ts

**Estimated Effort:** 5 hours (ai-led)

---

## v2.0.0: Autopilot - Intelligent Automation 📋 PLANNED

**Goal:** Ship autopilot with 60-85% touchpoint reduction using classification system

**Prerequisites:**
- v1.1.0 classification system complete
- 20+ implementations tracked for baseline data
- TOC optimization validated

**Estimated Timeline:** 3-4 weeks

**Focus Metrics:**
- Touchpoints per release: 85% reduction (19 → 3)
- Command chaining: 100% automated
- Release implementation time: 60% faster
- AI success rate (1-4 auto-implemented): 85%+

**Key Use Cases:**
1. **One-Command Release** - `/implement-autopilot --mode low` executes full release
2. **Auto-Batching** - Automatically groups related issues for efficiency
3. **Smart Defaults** - Infers missing configuration from repo analysis
4. **Dry-Run Mode** - Preview all actions before execution

**Scope:**
1. `/implement-autopilot` low mode (🟢 1-4 classification auto-implementation)
2. `/implement-autopilot` medium mode (🟢🟡 1-6 classification auto-implementation)
3. Workflow orchestration (scope-release → analyze-epic → implement-epic)
4. Auto-batching and smart defaults
5. Dry-run mode and configuration
6. Metrics tracking for calibration

**Success Criteria:**
- [ ] Autopilot low mode: 85%+ reduction in touchpoints
- [ ] Autopilot medium mode: 90%+ reduction in touchpoints
- [ ] Zero manual issue creation for standard releases
- [ ] Dry-run mode prevents unintended actions
- [ ] Metrics captured for all auto-implemented issues

**Value:** Immediate velocity gains built on solid classification foundation

---

## v3.0.0: Yolo Mode - Self-Improving Automation 🚀 PLANNED

**Goal:** Self-improving system with extreme automation

**Prerequisites:**
- v2.0.0 autopilot proven stable
- 50+ implementations tracked for calibration
- 85%+ classification accuracy sustained

**Estimated Timeline:** 2-3 weeks

**Focus Metrics:**
- Weekly calibration: Automated
- Autopilot accuracy: 85%+ sustained
- Yolo mode touchpoints: 0-1 per release
- Auto-fix success rate: 70%+

**Key Use Cases:**
1. **Yolo Mode** - Auto-implement 1-8 classification (no human review)
2. **Self-Calibration** - Weekly accuracy checks, adjust thresholds
3. **AI Dashboard** - See AI productivity metrics and trends
4. **Auto-Fix CI** - Automatically fix common CI/CD failures

**Scope:**
- Epic 1: Calibration & learning loop
- Epic 2: AI productivity dashboard
- Epic 3: `/implement-yolo` command (1-8 auto-implemented)
- Epic 4: Auto-fix CI failures
- Epic 5: AI-powered missing info inference

**Success Criteria:**
- [ ] Yolo mode reduces touchpoints to 0-1 per release
- [ ] Weekly calibration maintains 85%+ accuracy
- [ ] Auto-fix resolves 70%+ of CI failures
- [ ] Dashboard shows AI productivity trends
- [ ] System self-improves classification thresholds

**Value:** Self-improving system, 500X velocity with 70% accuracy

---

## v4.0.0: Agent Mode - Autonomous Development 🔮 FUTURE

**Goal:** Autonomous multi-release planning and execution

**Prerequisites:**
- v3.0.0 yolo mode proven stable
- Self-calibration maintaining 85%+ accuracy
- Multiple releases executed via autopilot

**Key Use Cases:**
1. **Vision → Multiple Releases** - AI plans 3-6 month roadmap autonomously
2. **Self-Planning Sprints** - Agent creates and executes full sprints
3. **Predictive Decomposition** - AI breaks down epics before implementation
4. **Auto-Recovery** - Self-fix failures and re-attempt with adjusted approach

**Scope:**
- Multi-release planning from vision
- Autonomous epic creation and sequencing
- Self-healing CI/CD pipelines
- Predictive issue decomposition
- Cross-release dependency management

**Focus Metrics:**
- Human time: 5% (vs 100% baseline)
- Velocity: 1000X @ 65% accuracy
- Autonomous sprints: 4+ weeks without human intervention

**Value:** Near-autonomous development for standard SaaS patterns

---

## v5.0.0: Multi-Product Orchestration 🔮 FUTURE

**Goal:** Manage roadmaps across 5+ SaaS products from centralized Roadcrew

**Key Use Cases:**
1. **Multi-Repo Management** - Track 5+ repos from one roadmap
2. **Cross-Product Dependencies** - Detect shared infrastructure needs
3. **Portfolio View** - Unified dashboard of all product roadmaps
4. **Shared Component Library** - Track reusable specs across products

---

## v6.0.0: Ecosystem Intelligence 🔮 FUTURE

**Goal:** Deep integration with AI SaaS Launch Kit and Tailwind AI ecosystem

**Key Use Cases:**
1. **Launch Kit Integration** - Pre-populated specs for common SaaS patterns
2. **Pattern Library** - Learn from all Tailwind AI products
3. **Auto-Spec Generation** - AI suggests specs based on ecosystem patterns
4. **Unified Workflows** - Seamless handoff between Roadcrew and Launch Kit
