Evidence Sources
This guide is derived from reverse-engineering Amp Code (Sourcegraph's AI coding agent). This document catalogs all evidence sources used.
Primary Sources
1. Production Bundle Analysis (Highest Confidence)
| Version | Date | Size | Notes |
|---|---|---|---|
| v0.0.1769212917 | Jan 2026 | 7.2MB / 353K lines | Latest analyzed version |
| v0.0.1766534507 | Dec 2025 | 7.2MB / 374K lines | Previous version |
| v0.0.1766390481 | Dec 2025 | 7.2MB / 373K lines | Earlier December |
What we extracted:
- Complete tool definitions and schemas
- System prompts (verbatim)
- All constants and magic numbers
- State machine logic
- Mode configurations
- Subagent prompts and configurations
2. Rosetta Stone (Original TypeScript)
| Version | Size | Files |
|---|---|---|
| v0.0.1744408301-dev | 289KB bundle | 71 .ts files |
Contains: Original TypeScript source with source maps, providing ground truth for:
- Class names and interfaces
- Function signatures
- Type definitions
- Architecture patterns
3. Changelog Analysis
Source: ampcode.com/news
Covered period: April - December 2025 (~1,980 versions)
Provided:
- Feature evolution timeline
- Mode introduction dates
- Tool additions and changes
- Breaking changes
Extraction Methodology
Deobfuscation Process
- Bundle extraction - Pulled from
~/.sourcegraph/installation - Deobfuscation - Restored readable variable names where possible
- Cross-reference - Matched patterns against Rosetta Stone
- Verification - Tested against live behavior
Confidence Levels
| Level | Meaning | Examples |
|---|---|---|
| ⭐⭐⭐⭐⭐ | Verbatim from source | System prompts, tool schemas |
| ⭐⭐⭐⭐ | High confidence, deobfuscated | Constants, state logic |
| ⭐⭐⭐ | Inferred from patterns | Some architectural decisions |
| ⭐⭐ | Educated guess | Internal motivations |
What We Did NOT Access
- Private Sourcegraph documentation
- Internal design docs
- Backend/server code
- Analytics or telemetry data
- User data of any kind
All analysis was performed on the publicly distributed client bundle.
Verification Methods
1. Cross-Version Verification
Compared structures across multiple versions to confirm stability:
- Tool names consistent across 3+ versions
- Prompt patterns stable
- Constants unchanged
2. Behavioral Testing
Where possible, tested against live Amp Code:
- Tool execution patterns
- Mode switching behavior
- Error handling
3. Rosetta Stone Matching
Matched deobfuscated patterns against original TypeScript:
- Class hierarchies
- Interface shapes
- Function signatures
Limitations
- Minification artifacts - Some variable names remain obfuscated
- Server-side logic - Cannot see backend processing
- Dynamic configuration - Some values may be server-controlled
- Version drift - Analysis reflects specific versions; newer versions may differ
Original Analysis
The excavation was performed on the npm package @sourcegraph/amp.
The analysis that produced this specification is maintained separately.
This specification is for educational purposes. All analyzed code belongs to Sourcegraph.