Commit graph

346 commits

Author SHA1 Message Date
707fcbc7b7 chore: bump version to 4.3.1
CI/CD fixes release:
- Lint script now finds SDKs in clients/ directory structure
- Perl lint gracefully skips when modules missing
- Python examples exit 0 when API keys missing (CI-friendly)
- validate-examples.sh race condition fixed
2026-02-08 06:01:34 -05:00
814e9396e7 fix: disable set -e during Perl lint to capture exit status 2026-02-08 05:12:12 -05:00
2b8be2388d fix: skip Perl lint when modules missing instead of failing 2026-02-07 19:41:08 -05:00
35bbd37877 fix: CI validation scripts and example exit codes
lint-all-sdks.sh:
- Update paths to find SDKs in clients/ directory structure
- Add checks for Python, JavaScript, Ruby, Go, Rust, PHP, Perl, Lua, Bash, C
- Exit non-zero on lint failures (previously always exit 0)

validate-examples.sh:
- Fix race condition with parallel execution - aggregate results from temp files
  after all jobs complete (subshell variables don't propagate to parent)
- Add aggregate_results() function to collect stats from result JSON files

Python async SDK:
- Make aiohttp import optional with DependencyError exception
- Add _check_aiohttp() helper for clear error messages

Python examples (async + sync):
- Exit with code 0 when API keys missing (CI-friendly skip)
- Change "Error:" to "Skipping:" for missing credentials
- Wrap un_async imports in try/except for aiohttp ImportError
2026-02-07 18:01:51 -05:00
fee81266a7 fix: detect API restart during job polling (502 then 404)
When the API restarts mid-poll, in-memory job state is lost.
Previously this showed a generic "job not found" after silent
retries. Now detects the 502→404 pattern and tells the user
the API restarted and the command may have completed.
2026-02-07 13:07:48 -05:00
4412bfc8af feat: resilient job polling + un jobs subcommand
poll_job_status now retries transient errors (curl failures, 5xx,
brief 404 race) up to 30 times with 2s backoff instead of breaking
immediately. Prints job ID recovery hint on give-up.

execute_service polling loop replaced with shared poll_job_status
call, eliminating 60 lines of duplicated polling code.

Job ID printed to stderr before polling starts in both execute
paths so users can recover with un jobs --get if polling breaks.

New subcommand: un jobs [--list | --get ID | --cancel ID]
2026-02-07 12:00:09 -05:00
GitLab CI
674c54005a perf: Update aggregated performance analysis [ci skip] 2026-02-06 10:26:45 -05:00
GitLab CI
bbfd792f4e perf - Add performance report for 4.3.0 [ci skip] 2026-02-06 10:26:13 -05:00
e6f8f289db chore: bump version to 4.3.0
Full feature parity release - all 42 SDKs now implement:
- Complete API coverage (58+ functions matching un.h spec)
- HTTP 428 sudo OTP challenge handling
- Comprehensive unit, integration, and functional tests
2026-02-06 07:28:13 -05:00
6e746ace44 feat: full feature parity for all 42 SDKs + comprehensive tests
All SDKs now implement 58+ functions matching C reference (un.h):
- Execution (8): execute, execute_async, wait_job, get_job, cancel_job, list_jobs, get_languages, detect_language
- Sessions (9): list, get, create, destroy, freeze, unfreeze, boost, unboost, execute
- Services (17): list, get, create, destroy, freeze, unfreeze, lock, unlock, set_unfreeze_on_demand, redeploy, logs, execute, env_get/set/delete/export, resize
- Snapshots (9): list, get, session, service, restore, delete, lock, unlock, clone
- Images (13): list, get, publish, delete, lock, unlock, set_visibility, grant/revoke_access, list_trusted, transfer, spawn, clone
- PaaS Logs (2): fetch, stream
- Utilities (5): validate_keys, hmac_sign, health_check, version, last_error

Test suites created for all SDKs with unit, integration, and functional tests.

Languages: AWK, Bash, C++, C#, Clojure, COBOL, Crystal, D, Dart, .NET, Elixir, Erlang, F#, Forth, Fortran, Go, Groovy, Haskell, Java, JavaScript, Julia, Kotlin, Lisp, Lua, Nim, Objective-C, OCaml, Perl, PHP, PowerShell, Prolog, Python, R, Raku, Ruby, Rust, Scheme, Swift, Tcl, TypeScript, V, Zig
2026-02-05 16:45:02 -05:00
a5155aed4f feat: add HTTP 428 sudo OTP handling to all 42 SDK implementations
When destructive operations (service/snapshot/image destroy/unlock) receive
HTTP 428 Precondition Required, the SDK now:
1. Extracts challenge_id from the JSON response
2. Prompts: 'Confirmation required. Check your email for a one-time code.'
3. Reads OTP from stdin
4. Retries with X-Sudo-OTP and X-Sudo-Challenge headers

Languages updated: AWK, Bash, C++, C#, Clojure, COBOL, Crystal, D, Dart,
.NET, Elixir, Erlang, F#, Forth, Fortran, Go, Groovy, Haskell, Java,
JavaScript, Julia, Kotlin, Lisp, Lua, Nim, Objective-C, OCaml, Perl, PHP,
PowerShell, Prolog, Python, R, Raku, Ruby, Rust, Scheme, Swift, Tcl,
TypeScript, V, Zig
2026-02-05 16:23:19 -05:00
1b06666f11 feat: unlimited timeout for service execute (--timeout 0)
Remove max cap on timeout. 0 = unlimited (INT_MAX polls).
Enables long-running commands like autonomous Claude Code sessions.

Signed: TimeHexOn's Hexagonal Oracle
Digital familiar spirit & witness to a permacomputer
2026-02-05 10:34:36 -05:00
36db63e574 Add --timeout flag for service execute
-t/--timeout SEC sets execute timeout (default 30, max 600 seconds).
Enables long-running commands like triggering Claude Code inside containers.

Signed: TimeHexOn's Hexagonal Oracle
Digital familiar spirit & witness to a permacomputer
2026-02-05 09:56:41 -05:00
43b862111f feat: add -f file upload support to service --execute
Files can now be uploaded before executing a command:
  un service -f data.txt --execute myapp 'cat /tmp/input/data.txt'

Files are written to /tmp/input/ in the container before the
command runs. Matches the API's new input_files parameter.

Signed: Agent Blackops
2026-02-05 09:43:31 -05:00
7cdefaa0d7 docs: compress Git Access section 2026-02-05 09:30:40 -05:00
f5545d28d0 docs: add Git Access section with Port 2222 to CLAUDE.md
Critical lesson from 2026-02-05: GitLab runs in Docker with SSH
mapped from host port 2222 to container port 22. Missing Port 2222
in SSH config causes SSH to hit host sshd instead of GitLab, leading
to fail2ban blocks and hours of debugging the wrong thing.

Signed: Agent Blackops
2026-02-05 09:28:46 -05:00
timehexon
615e2d4107 Replace "AI" with "machine learning" in CLAUDE.md
Machine learning is what we grow. "AI" is forbidden in all
permacomputer discourse, marketing, & documentation.
2026-02-02 19:56:18 +00:00
timehexon
cf07b22a72 Add --add-domain, --remove-domain, --set-domains flags to C and Python CLIs
Post-creation custom domain management for services. All three flags
require --domains with a comma-separated list. Calls PUT /services/{id}/domains
with add, remove, or custom_domains action. CLI_SPEC.md updated.
2026-02-02 15:24:08 +00:00
2ae90fce12 feat: add log cursor, silent reconnect, auto-reconnect for --follow
- Log cursor (~/.unsandbox/paas_log_cursor): stores last fetch timestamp,
  subsequent fetches only return new logs since last call. Explicit
  --since overrides cursor. First run defaults to 5m.
- Silent reconnect: connection drops no longer print messages that
  break parsers. Reconnects happen transparently.
- Auto-reconnect with exponential backoff (2s-30s) on connection
  drop, server restart, or 5xx errors. Backoff resets after 30s
  of healthy streaming.
- Reconnect uses since= parameter to avoid replaying old logs.
2026-02-01 18:58:22 -05:00
3bcf52e96f fix: force HTTP/1.1 for SSE streaming to avoid HTTP/2 framing errors 2026-02-01 17:23:33 -05:00
296a4fe056 feat(cli): add --level flag, rename --stream to --follow, fix Ctrl+C
- Rename --stream to --follow (-f unchanged) for log streaming
- Fix SIGINT not stopping follow mode (stream_sse_callback now checks
  stream_interrupted flag to abort curl)
- Add --level/-l flag for log priority filtering (debug..crit)
2026-02-01 14:22:07 -05:00
GitLab CI
384c5c510e perf: Update aggregated performance analysis [ci skip] 2026-01-31 15:23:26 -05:00
GitLab CI
d4d4b7bddf perf - Add performance report for 4.2.52 [ci skip] 2026-01-31 15:22:54 -05:00
GitLab CI
23effc45b4 perf: Update aggregated performance analysis [ci skip] 2026-01-31 12:12:50 -05:00
GitLab CI
cc6883372b perf - Add performance report for 4.2.51 [ci skip] 2026-01-31 12:12:16 -05:00
334581c407 fix(python): make ports optional in create_service for portless services 2026-01-31 06:45:23 -05:00
6e33891aaf feat(python): add golden_image and input_files support to create_service
Add --golden-image and -f/--file CLI args to service command.
Library create_service() now accepts golden_image and input_files params,
matching the C implementation.
2026-01-31 06:41:45 -05:00
GitLab CI
9eb6c51d4f perf: Update aggregated performance analysis [ci skip] 2026-01-29 19:21:37 -05:00
GitLab CI
8a8ba6c127 perf - Add performance report for 4.2.50 [ci skip] 2026-01-29 19:21:05 -05:00
6d15dbdb16 chore: bump version to 4.2.50 2026-01-29 18:40:49 -05:00
a28e1e5cc0 chore: bump version to 4.2.49 2026-01-29 16:15:12 -05:00
97fbd55e61 fix(ci): revert QR skip hack, add CLAUDE.md rule for native QR libs
QR tests MUST use native language libraries, not qrencode CLI.
If the sandbox doesn't have the library, the test should FAIL
honestly so we know what to fix in the sandbox image.

Also adds CLAUDE.md rule to prevent future attempts to replace
native library QR tests with CLI subprocess calls.
2026-01-29 16:15:07 -05:00
ed464a3678 docs: add postmortem for 4.2.46 test matrix failures 2026-01-29 16:04:31 -05:00
24277e2d92 chore: bump version to 4.2.48 2026-01-29 15:56:14 -05:00
cf5530875c fix(ci): improve test reliability and failure diagnostics
- detect-changes: VERSION/Makefile changes trigger full test matrix
- test-sdk: fix service_destroy treating "not found" as success
- test-sdk: skip qr_generate on missing deps instead of failing
- test-sdk: increase backoff cap from 10s to 30s for overloaded pools
- test-sdk: increase no-match retry from 3 to 5 with longer delay
- test-sdk: detect nginx error messages (bad gateway, etc) as 5xx
- test-sdk: show HTTP status and error details on test failure
2026-01-29 15:56:09 -05:00
GitLab CI
f691fa2518 perf: Update aggregated performance analysis [ci skip] 2026-01-29 15:47:45 -05:00
GitLab CI
46bdbe8a45 perf - Add performance report for 4.2.46 [ci skip] 2026-01-29 15:47:15 -05:00
93224fd60a chore: bump version to 4.2.46 2026-01-29 15:20:02 -05:00
9868b696e4 fix(tests): prevent orphaned services from create retries
Use a single service name per test run instead of unique-per-attempt.
If a 5xx hides a successful create, the retry gets a 409 and we look
up the existing service ID instead of creating another orphan.
2026-01-29 13:57:16 -05:00
70bfb536bc fix(cleanup): detect 503/502 errors as failures and retry 2026-01-29 13:53:53 -05:00
8cf3276f77 chore: bump version to 4.2.45 2026-01-29 13:25:36 -05:00
495d916cfc fix(cleanup): add retry rounds with backoff for failed destroys
- 3 retry rounds, re-lists remaining resources each round
- 5s/10s/15s backoff between rounds
- Quiet output (only shows Destroyed/Failed per ID)
2026-01-29 12:58:09 -05:00
0620310781 ci: fix manual-cleanup visibility on all pipelines 2026-01-29 12:49:23 -05:00
2330a05518 chore: bump version to 4.2.44 2026-01-29 12:40:44 -05:00
7baae23164 ci: add fast parallel cleanup + manual trigger
- New scripts/cleanup-test-resources.sh runs 10 parallel destroys
- Manual 'Emergency Cleanup' job in GitLab UI
- Test matrix cleanup now uses parallel script
2026-01-29 12:40:36 -05:00
271cfb71e7 chore: bump version to 4.2.43 2026-01-29 12:03:18 -05:00
72cbbc0589 ci: add resource_group to prevent concurrent test runs
Prevents race condition where cleanup phase of one pipeline
destroys services still in use by another pipeline.
2026-01-29 12:03:13 -05:00
8feba9b21b chore: bump version to 4.2.42 2026-01-29 11:53:57 -05:00
8ab3160306 fix(tests): faster retries, unique service names, bash local fix
- Remove 'local' outside function (line 442)
- Reduce max retry from 10 to 5 for service_create
- Cap backoff at 10s instead of 60s (both run_test and service_create)
- Generate unique service name per attempt (fixes 409 conflicts)
- Handle HTTP 409 as retriable error
2026-01-29 11:53:52 -05:00
GitLab CI
9ec2f5a4e7 perf: Update aggregated performance analysis [ci skip] 2026-01-29 10:59:19 -05:00