Skip to content

Commit 54221b3

Browse files
leogdionclaude
andcommitted
docs: add comprehensive VirtualBuddy TSS API documentation to CLAUDE.md
Documents the VirtualBuddy API integration including: - API endpoint, board config, and response fields - Rate limits (2 req/5 sec) and 12-hour server cache - HTTP status codes and error handling - Client-side rate limiting implementation (2.5-5.0s random delays) - Deduplication priority (authoritative source for isSigned) - Example JSON responses for signed and unsigned builds Based on TSSBuddy.pdf API documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ba3ff55 commit 54221b3

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

CLAUDE.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,72 @@ Multiple sources provide overlapping data. The pipeline deduplicates using:
154154

155155
See `.claude/implementation-patterns.md` for detailed deduplication logic and code examples.
156156

157+
### VirtualBuddy TSS API Integration
158+
159+
**Purpose**: VirtualBuddy provides real-time TSS (Tatsu Signing Status) verification for macOS restore images for virtual machines.
160+
161+
**API Endpoint**:
162+
```
163+
GET https://tss.virtualbuddy.app/v1/status?apiKey=<key>&ipsw=<IPSW URL>
164+
```
165+
166+
**Board Config**: Checks `VMA2MACOSAP` (macOS virtual machines)
167+
168+
**Key Response Fields**:
169+
- `isSigned` (boolean) - true if Apple is signing the build, false otherwise
170+
- `uuid` - Request tracking ID for debugging
171+
- `version` - macOS version (e.g., "15.0")
172+
- `build` - Build number (e.g., "24A5327a")
173+
- `code` - Status code (0 = SUCCESS, 94 = not eligible)
174+
- `message` - Human-readable status message
175+
176+
**HTTP Status Codes**:
177+
- `200` - Success (returned regardless of signing status)
178+
- `400` - Bad request (invalid IPSW URL)
179+
- `429` - Rate limit exceeded
180+
- `500` - Internal server error
181+
182+
**Rate Limits & Caching**:
183+
- **Rate limit**: 2 requests per 5 seconds
184+
- **Server-side CDN cache**: 12 hours (to avoid Apple TSS rate limiting)
185+
- **Client-side implementation**: Random delays of 2.5-5.0 seconds between requests
186+
187+
**Implementation Details**:
188+
- **File**: `Sources/BushelCloudKit/DataSources/VirtualBuddyFetcher.swift`
189+
- **Integration**: Enriches RestoreImageRecord with real-time signing status after other data sources
190+
- **Error handling**: HTTP 429 errors are logged; original record preserved on any error
191+
- **Progress tracking**: Shows "X/Y images checked" during sync
192+
- **Performance**: ~3-4 minutes for 50 images (acceptable for 8-16 hour sync schedules)
193+
194+
**Deduplication Priority**:
195+
- VirtualBuddy is an **authoritative source** for `isSigned` status (along with MESU)
196+
- Takes precedence over other sources when merging duplicate records
197+
- See `DataSourcePipeline.swift:429-447` for merge logic
198+
199+
**Example Response (Signed)**:
200+
```json
201+
{
202+
"uuid": "67919BEC-F793-4544-A5E6-152EE435DCA6",
203+
"version": "15.0",
204+
"build": "24A5327a",
205+
"code": 0,
206+
"message": "SUCCESS",
207+
"isSigned": true
208+
}
209+
```
210+
211+
**Example Response (Unsigned)**:
212+
```json
213+
{
214+
"uuid": "02A12F2F-CE0E-4FBF-8155-884B8D9FD5CB",
215+
"version": "15.1",
216+
"build": "24B5024e",
217+
"code": 94,
218+
"message": "This device isn't eligible for the requested build.",
219+
"isSigned": false
220+
}
221+
```
222+
157223
### Logging
158224

159225
The project uses structured logging with `BushelLogger` (wrapping `os.Logger`):

0 commit comments

Comments
 (0)