- VERSION file tracks release version (0.0.1)
- Full matrix now triggered by tags only (or TEST_ALL_SDKS var)
- Removed [test-all] commit message trigger
Three ways to trigger all 42+ SDKs:
1. Set CI variable TEST_ALL_SDKS=true
2. Include [test-all] in commit message
3. Push a tag (releases test everything)
- Build C CLI binary for testing all SDKs through unsandbox
- test-sdk.sh runs: build/un → unsandbox → SDK → unsandbox → test code
- Each SDK is tested for --help and code execution
- No local language interpreters needed on build server
GitLab validates include directives at pipeline creation time, before
any jobs run. The generate-matrix job creates test-matrix.yml as an
artifact, but GitLab needs the file to exist in the repo when parsing
.gitlab-ci.yml.
This placeholder allows the pipeline to be created successfully. The
generate-matrix job will overwrite it with actual test definitions.
Complete SDK implementations with full API surface:
- Python: sync/async with all 43 functions
- Go: sync/async with full API
- Java: sync/async with full API
- JavaScript: sync/async with full API
- PHP: sync/async with full API
- Ruby: sync/async with full API
- Rust: sync/async with full API
Added:
- clients/README.md - SDK overview
- clients/CLI_SPEC.md - CLI specification
Removed:
- un_deno.ts (moved to clients/typescript/)
C SDK now declares the complete API matching Python/Go/Java/etc:
- 8 Execution functions (stubbed - need JSON parsing)
- 9 Session functions (5 working: destroy/freeze/unfreeze/boost/unboost)
- 17 Service functions (11 working: all operations except list/get/execute)
- 8 Snapshot functions (6 working: all operations except list/get)
- 1 Key validation function (working)
Working functions call actual internal CLI code via wrappers.
Stubbed functions return NULL - they need JSON response parsing
which the CLI doesn't have (it prints to stdout).
Header includes complete struct definitions for all return types.
33 unit tests pass.
C SDK changes:
- Add #include un.h when building as library
- Export library functions: version, detect_language, hmac_sign, health_check
- Add NULL safety checks to wrapper functions
- Rewrite tests to call ACTUAL exported functions (no more local re-implementations)
- Tests now verify real HMAC-SHA256 against known test vectors
Documentation:
- Add SDK Testing Philosophy to CLAUDE.md
- Create docs/TESTING.md with unit/integration/functional test definitions
- Document the THREE testing levels required for all SDKs
- Explicitly forbid mocking and local re-implementation in tests
33 unit tests pass, testing real exported functions.
- Add #ifndef UNSANDBOX_LIBRARY around main() to allow library use
- Add CFLAGS_LIB with -DUNSANDBOX_LIBRARY for library compilation
- Add -lwebsockets to LDFLAGS for WebSocket support
- Build now compiles cleanly, tests pass (22/0)
Go Async SDK (clients/go/async/):
- Fixed case-sensitive language detection bug (.R for R language)
- Created go.mod for module management
- Added comprehensive test suite
- Created 3 examples with expected output comments
- Added README with full documentation
Java Sync SDK (clients/java/sync/):
- RENAMED: Unsandbox.java -> Un.java (matches naming convention)
- Updated class name from Unsandbox to Un
- Created pom.xml for Maven build
- Added 6 examples (simple + SDK client versions)
- Created test suite with JUnit 5
- Added README with API documentation
JavaScript Async SDK (clients/javascript/async/):
- Fixed unused import
- Created package.json with ES module support
- Added 5 examples covering all async patterns
- Created 71 tests (all passing)
- Added comprehensive README
PHP Sync SDK (clients/php/sync/):
- RENAMED: Unsandbox.php -> un.php (matches naming convention)
- Created composer.json with PSR-4 autoloading
- Created phpunit.xml for testing
- Added 4 examples with expected output comments
- Created 54 tests across 4 test files
- Added README with full documentation
Ruby Sync SDK (clients/ruby/sync/):
- Created Gemfile and un.gemspec
- Created Rakefile with test task
- Updated examples to actually use the SDK
- Added 4 examples (hello_world, async_job, language_detection, snapshots)
- Created comprehensive test suite with 30+ tests
- Added README with documentation
Rust Sync SDK (clients/rust/sync/):
- Updated Cargo.toml with example declarations
- Created 4 examples (hello_world, fibonacci, multi_language, async_polling)
- Added comprehensive README with API reference
- All dependencies verified correct
All SDKs verified:
- HMAC-SHA256 authentication implemented
- 4-tier credential system (args > env > ~/.unsandbox > ./accounts.csv)
- Expected output comments for pipeline validation
- Proper error handling
- Language detection support
Add per-client Makefiles for C, Python, and Go with:
- CLI mode: Tests --help, arg parsing, syntax validation
- Library mode: Unit tests, import verification
- Integration mode: API contract validation (with credentials)
- Functional mode: Real-world scenario tests
C client:
- 22 library tests (SHA-256, HMAC-SHA256, detect_language)
- Full unsandbox.c implementation with examples
Python client (sync + async):
- Delegates to sync/ and async/ subdirectories
- pytest-based test suites with coverage
- Examples for concurrent execution, streaming
Go client:
- Delegates to sync/ and async/ subdirectories
- go test integration with vet and fmt
Also update detect-changes.sh to detect changes in
both root-level un.* files AND clients/ directory.
Add complete Go SDK implementation with all 13 API functions:
- ExecuteCode: Execute code synchronously
- ExecuteAsync: Execute code asynchronously
- GetJob: Get job status
- WaitForJob: Poll job with exponential backoff
- CancelJob: Cancel running job
- ListJobs: List all jobs
- GetLanguages: Get supported languages (1-hour cache)
- DetectLanguage: Detect language from filename extension
- SessionSnapshot: Create session snapshot (NEW)
- ServiceSnapshot: Create service snapshot (NEW)
- ListSnapshots: List all snapshots (NEW)
- RestoreSnapshot: Restore from snapshot (NEW)
- DeleteSnapshot: Delete snapshot (NEW)
Features:
- Standard Go conventions (PascalCase exports)
- 4-tier credentials resolution (ResolveCredentials)
- HMAC-SHA256 using crypto/hmac and crypto/sha256
- Exponential backoff with time.Sleep
- Languages cache in ~/.unsandbox/languages.json (1-hour TTL)
- Comprehensive error handling with custom CredentialsError type
- Full documentation comments for all exported functions
Add complete async Python SDK implementation with all 13 API functions using aiohttp:
- execute_code: Execute code asynchronously
- execute_async: Start async code execution
- get_job: Get job status
- wait_for_job: Poll job with exponential backoff (async)
- cancel_job: Cancel running job
- list_jobs: List all jobs
- get_languages: Get supported languages (1-hour cache)
- detect_language: Detect language from filename extension
- session_snapshot: Create session snapshot (NEW)
- service_snapshot: Create service snapshot (NEW)
- list_snapshots: List all snapshots (NEW)
- restore_snapshot: Restore from snapshot (NEW)
- delete_snapshot: Delete snapshot (NEW)
Features:
- Full async/await support with aiohttp
- 4-tier credentials resolution
- HMAC-SHA256 authentication
- Exponential backoff polling with asyncio.sleep
- Languages cache (1-hour TTL)
- Type hints and comprehensive docstrings
Add complete testing infrastructure that validates clients in:
1. CLI MODE: Test as standalone command-line tool
- Argument parsing (--help, --version)
- File execution (un.py code.py)
- Environment variables (-e VAR=val)
- Commands (execute, session, service)
2. LIBRARY MODE: Test as importable SDK
- Client object creation
- Method availability (execute, create_session)
- Authentication/HMAC generation
- Return types and data structures
3. INTEGRATION MODE: Test API contract validation
- Valid/invalid authentication (200/401)
- Language support verification
- Error handling (rate limits, timeouts)
- Artifacts and file operations
- Environment variable passing
4. FUNCTIONAL MODE: Real-world usage scenarios
- Fibonacci calculation
- Data analysis (pandas, etc.)
- Web requests (semitrusted mode)
- File I/O operations
- Subprocess handling
- JSON parsing
- Error handling
- Async/await code
Added:
- TEST-TEMPLATES.md: Complete test templates for Python, Go, JavaScript
(easily adaptable to all 42+ languages)
- Test structure examples for each mode
- Python pytest, Go testing, Jest patterns
- Integration patterns for API validation
- Functional test scenarios
- Enhanced Makefile with multi-mode targets:
- make test-python: All 4 modes for Python
- make test-python-cli: Only CLI mode
- make test-python-library: Only Library mode
- make test-all-cli: CLI for all languages
- make test-all: All modes for all languages
- make test-integration-all: Cross-language API validation
How it works:
- Each client implementation tests as CLI AND library
- Integration validates auth, error codes, API contract
- Functional tests prove real-world usage works
- Makefile targets guide developers to create per-language tests
- CI can run all 4 modes or specific modes on changes
Add comprehensive testing infrastructure for UN clients:
1. Smart Change Detection (detect-changes.sh)
- Detects changes in BOTH root-level (un.py, un.go) AND clients/ directory
- Maps file extensions and directory names to languages
- Triggers test_all when infrastructure changes
2. Language-Specific CI Matrix (generate-matrix.sh compatible)
- Only runs tests for languages with changes
- Example: modify clients/python/ → pytest runs, Go/Ruby skipped
3. Testing Strategy Document (TESTING-STRATEGY.md)
- Complete testing matrix by language tier (compiled, interpreted, inception)
- Unit, integration, embedding, and parity tests
- Inception pattern for languages without local interpreters
- Common failures and fixes
- Rollout schedule for client/ migration
4. Makefile Targets
- 'make test-python', 'make test-go', etc. for local development
- 'make test-all' for comprehensive testing
- 'make test-integration' for API contract validation
- 'make test-ci-locally' to simulate CI pipeline
5. Updated CLAUDE.md
- Documents SDK architecture (in growth state)
- Explains three purposes: CLI, library, embeddable
- References TESTING-STRATEGY.md for details
This enables:
✓ Per-language testing (only run what changed)
✓ Local developer workflow (make test-LANG)
✓ 42+ language feature parity validation
✓ Cross-language integration testing
- session_snapshot(session_id): Create snapshot of session state
- service_snapshot(service_id): Create snapshot of service state
- list_snapshots(): List all available snapshots
- restore_snapshot(snapshot_id): Restore from snapshot
- delete_snapshot(snapshot_id): Delete a snapshot
All snapshot functions added to:
- Module-level exports (Python __all__, JS module.exports)
- Client class methods (for ease of use with stored credentials)
- Full JSDoc/docstring documentation
Agents should now include snapshot functions in all SDK refactoring work.
- Implement detect-changes stage: identifies which SDKs changed
- Implement generate-matrix stage: creates dynamic test matrix based on changes
- Only test SDKs that changed (5x faster than testing all 42)
- Parallel test execution via GitLab matrix strategy
- Science jobs for pool burning: validate-examples, lint-all-sdks, benchmark-clients
- Zero cost execution: uses warm pool + idle capacity
- Comprehensive reporting with JUnit XML and markdown summaries
Pipeline flow:
detect-changes → generate-matrix → build → test (parallel) → science → report
The unfair advantage:
- GitLab sees changes, tests only what's needed
- GitHub shows traditional Actions (external view)
- Internal: 5x faster, $0 per execution
- External: looks normal (strategic asymmetry)
- test_sdk_library.py: Python test framework for validating library functions
- run_sdk_tests.sh: Master test runner for all language SDKs
- SDK_TESTING_GUIDE.md: Detailed guide on test structure and patterns
- AGENT_REFACTORING_INSTRUCTIONS.md: Step-by-step refactoring walkthrough
- REFACTORING_CHECKLIST.md: Comprehensive checklist for SDK refactoring
Agents can now validate their refactoring work independently with:
python3 tests/test_sdk_library.py --languages {language}
./tests/run_sdk_tests.sh --languages {language}
Framework tests:
- Unit tests: credential loading, HMAC signing, function signatures
- Integration tests: real API calls (requires UNSANDBOX_API_KEY)
- Functional tests: end-to-end CLI execution
This enables parallel refactoring with automatic validation.
Adds --resize ID --vcpu N flag to resize running services live.
PATCH /services/{id} with {"vcpu": 1-8} applies CPU/memory limits
without restart. Memory formula: 2GB per vCPU.