---
issue: 155
title: Railway Internal Networking Validation
analyzed: 2025-10-20T19:42:47Z
estimated_hours: 3
parallelization_factor: 2.0
---

# Parallel Work Analysis: Issue #155

## Overview

Validate Railway's internal networking (`service.railway.internal`) for service-to-service HTTP communication. Deploy two minimal test services and verify DNS resolution, HTTP connectivity, latency (<50ms), and reliability (>95% success over 100 requests). This is a Phase 0 blocker - if internal networking fails, architecture must pivot to public URLs with authentication.

## Parallel Streams

### Stream A: Test Services Setup & Deployment
**Scope**: Create and deploy minimal Express test services to Railway
**Files**:
- `.claude/epics/bot-spawner-extraction/test-services/service-a/index.ts` (client)
- `.claude/epics/bot-spawner-extraction/test-services/service-a/package.json`
- `.claude/epics/bot-spawner-extraction/test-services/service-b/index.ts` (server)
- `.claude/epics/bot-spawner-extraction/test-services/service-b/package.json`
- `.claude/epics/bot-spawner-extraction/test-services/railway.json` (deployment config)
**Agent Type**: backend-specialist
**Can Start**: immediately
**Estimated Hours**: 1.5 hours
**Dependencies**: none

**Deployment Target**:
- **Railway Project**: buzztrail-voice-agent (ID: 655e15d5-19b0-40a0-b6a4-d556806f3746)
- **Environment**: production (ID: fcf69ef3-8d2b-41f0-9226-a1f454624b4d)
- **Existing Services**: slide-system, voice-agent
- **New Services**: test-service-a, test-service-b (temporary validation)

**Deliverables**:
- Service A (client) with `/test-call` endpoint that fetches from Service B
- Service B (server) with `/health` endpoint
- Both services deployed to same Railway project as slide-system
- Railway internal networking configured (service-b.railway.internal)

### Stream B: Test Script & Metrics Collection
**Scope**: Create test automation script and results analysis tooling
**Files**:
- `.claude/epics/bot-spawner-extraction/test-services/test-runner.sh` (bash script)
- `.claude/epics/bot-spawner-extraction/test-services/analyze-results.ts` (metrics analyzer)
**Agent Type**: backend-specialist
**Can Start**: immediately (can write script before deployment)
**Estimated Hours**: 1 hour
**Dependencies**: none

**Deliverables**:
- Bash script to run 100 consecutive HTTP requests
- Metrics collection (success rate, latency stats)
- JSON output format for analysis
- Results analyzer that calculates min/max/avg/p95 latency

### Stream C: Documentation & Results Analysis
**Scope**: Execute tests, analyze results, document findings, make GO/NO-GO decision
**Files**:
- `.claude/epics/bot-spawner-extraction/phase0-networking-results.md`
**Agent Type**: general-purpose
**Can Start**: after Streams A & B complete
**Estimated Hours**: 0.5 hours
**Dependencies**: Stream A (deployment), Stream B (test script)

**Deliverables**:
- Run 100 test requests using Stream B's script
- Calculate success rate and latency metrics
- Document findings in phase0-networking-results.md
- Make GO/NO-GO recommendation for bot-spawner extraction
- Document fallback plan if networking fails

## Coordination Points

### Shared Files
No files are shared between streams - clean separation.

### Sequential Requirements
1. **Parallel Phase** (Streams A & B): Can run simultaneously
   - Stream A: Deploy test services
   - Stream B: Write test scripts
2. **Sequential Phase** (Stream C): Must wait for A & B
   - Use deployed services (from A) with test script (from B)
   - Execute tests and analyze results

### Integration Point
Stream C requires:
- Railway service URLs from Stream A deployment
- Test script from Stream B
- Both must be ready before Stream C can execute

## Conflict Risk Assessment

**Risk Level: LOW**

- Stream A works on `test-services/service-a/` and `test-services/service-b/`
- Stream B works on `test-services/test-runner.sh` and `test-services/analyze-results.ts`
- Stream C works on `phase0-networking-results.md`
- No file overlap, no coordination needed during parallel phase

## Parallelization Strategy

**Recommended Approach**: hybrid

**Phase 1 (Parallel)**: Launch Streams A & B simultaneously
- Stream A: Deploy test services to Railway (~1.5h)
- Stream B: Write test automation scripts (~1h)
- Both can proceed independently

**Phase 2 (Sequential)**: Stream C executes after A & B complete
- Use deployed services + test script to run validation (~0.5h)

**Why Hybrid**:
- Streams A & B have zero dependencies and no file conflicts
- Stream C naturally depends on both outputs
- Small coordination overhead (passing URLs from A to C)

## Expected Timeline

**With parallel execution:**
- Phase 1 (parallel): 1.5 hours (max of A and B)
- Phase 2 (sequential): 0.5 hours
- **Wall time: 2 hours**
- **Total work: 3 hours**
- **Efficiency gain: 33%** (2h vs 3h sequential)

**Without parallel execution:**
- Stream A: 1.5h
- Stream B: 1h
- Stream C: 0.5h
- **Wall time: 3 hours**

## Agent Assignments

**Stream A Agent**: Backend specialist (TypeScript, Railway deployment)
- Strong in Express, Railway CLI, service configuration
- Understands internal networking concepts

**Stream B Agent**: Backend specialist (scripting, metrics)
- Strong in bash scripting, TypeScript analysis tools
- Focus on test automation and metrics collection

**Stream C Agent**: General-purpose (documentation, analysis)
- Executes tests, interprets results
- Writes clear documentation with recommendations

## Notes

**Critical Success Factor**: This is a GO/NO-GO decision point for the entire bot-spawner extraction epic. If Railway internal networking fails:
- Document the failure clearly
- Provide fallback architecture (public URLs + API key auth)
- Update Epic tasks to reflect new approach

**Testing Strategy**:
- 100 consecutive requests ensures reliability
- >95% success rate threshold is strict but necessary
- <50ms latency target ensures internal networking is truly "fast"

**Cleanup**: Test services should be kept temporarily for debugging but can be deleted after validation completes and bot-spawner is working.

**Railway Configuration**:
- Project: buzztrail-voice-agent (existing)
- Current services: slide-system, voice-agent
- Test services will be added temporarily to same project
- Internal networking only works within same Railway project
- After validation, bot-spawner service will be added to this project

**Railway Internal Networking Docs**: https://docs.railway.com/guides/private-networking

**Important**: Test services are temporary and should be removed after validation completes. The real bot-spawner service will be deployed to this same project in later tasks.
