## Summary Remove devcontainer support from the product surface and codebase: the parser crate, workflow bridge, lifecycle execution path, typed events, CLI progress rendering, generated client field, and public/internal documentation references are all gone. ## What Changed - Deleted the dedicated parser crate and removed its Cargo dependencies and lockfile entries. - Removed workflow initialization paths that resolved repository devcontainer metadata, applied Daytona snapshots from it, merged environment variables from it, or ran its lifecycle commands. - Removed the typed event variants and CLI progress handlers for the retired lifecycle events while leaving shared unknown-event handling intact. - Cleaned the generated TypeScript client and tracked docs so repository search has no remaining devcontainer references outside git history. ## Verification - `cargo +nightly-2026-04-14 fmt --all` - `cargo +nightly-2026-04-14 fmt --check --all` - `cargo build --workspace` - `cargo nextest run -p fabro-types` - `cargo nextest run -p fabro-workflow` - `cargo nextest run -p fabro-cli run_progress` - `cd lib/packages/fabro-api-client && bun run generate && bun run typecheck` - `cargo metadata --no-deps --format-version 1 | rg -i "fabro-devcontainer|devcontainer"` - `rg -n -i "devcontainer|dev container|dev-container|dev_container|fabro-devcontainer|\\.devcontainer" . --glob '!target/**' --glob '!.worktrees/**'` --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with GPT-5 via [Codex](https://openai.com/codex)
7.2 KiB
Sandbox Services Backend Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Add a backend API that lists listening TCP services inside a run sandbox and marks Daytona-previewable ports.
Architecture: The server reconnects to the run-owned sandbox, starts it if needed, runs ss -H -ltnp, parses the raw output outside the sandbox command, groups services by port, and returns a provider-neutral JSON response. This phase owns the API contract, server implementation, parser tests, and generated clients; the frontend is implemented separately.
Tech Stack: Rust, Axum, OpenAPI, progenitor, fabro-sandbox Sandbox::exec_command, generated TypeScript Axios client.
Scope
- Add
GET /api/v1/runs/{id}/sandbox/services. - Use only
ss -H -ltnpfor v1; do not addnetstatorlsoffallback. - Return all parsed listening TCP ports, including ports outside Daytona's preview range.
- Compute preview support outside the sandbox command:
provider == "daytona" && 3000 <= port <= 9999. - Do not probe HTTP readiness or read repository setup metadata.
Files
- Modify:
docs/public/api-reference/fabro-api.yaml - Modify:
lib/crates/fabro-types/src/lib.rs - Create or modify:
lib/crates/fabro-types/src/sandbox_services.rs - Modify:
lib/crates/fabro-api/src/lib.rs - Modify:
lib/crates/fabro-api/build.rs - Create:
lib/crates/fabro-api/tests/sandbox_services_round_trip.rs - Modify:
lib/crates/fabro-server/src/server/handler/sandbox.rs - Modify:
lib/crates/fabro-server/src/server/handler/mod.rs - Modify:
lib/crates/fabro-server/src/demo/mod.rs - Regenerate: generated Rust API code via
cargo build -p fabro-api - Regenerate:
lib/packages/fabro-api-client/src/**viacd lib/packages/fabro-api-client && bun run generate
Tasks
Task 1: Define the API Contract and Shared Types
- Add schemas to
docs/public/api-reference/fabro-api.yaml:SandboxServicewith required fieldsport,addresses,processes,preview_supported.SandboxServiceListResponsewith required fielddata.portis an integer withminimum: 1,maximum: 65535.addressesis an array of strings, preserving bind addresses fromss.processesis an array of strings, preserving visible process summaries fromss.preview_supportedis a boolean.
- Add
GET /api/v1/runs/{id}/sandbox/servicesunder the Human-in-the-Loop tag:- Summary:
List Sandbox Services. - Description: lists listening TCP services discovered inside the run sandbox.
200returnsSandboxServiceListResponse.404returnsErrorResponsefor missing run.409returnsErrorResponsewhen the run has no active sandbox or service discovery fails.
- Summary:
- Add shared Rust types in
fabro-types:SandboxService { port: u16, addresses: Vec<String>, processes: Vec<String>, preview_supported: bool }SandboxServiceListResponse { data: Vec<SandboxService> }
- Re-export the shared types from
fabro-types/src/lib.rs. - Reuse the shared types from
fabro-apiwithwith_replacement(...)entries inbuild.rs. - Add
fabro-api/tests/sandbox_services_round_trip.rsproving:fabro_api::types::SandboxServiceis the same type asfabro_types::SandboxService.- JSON shape matches the OpenAPI contract.
- Minimal response with an empty
dataarray deserializes.
Task 2: Implement Service Discovery in the Server
- Add a route in
lib/crates/fabro-server/src/server/handler/sandbox.rs:.route("/runs/{id}/sandbox/services", get(list_sandbox_services))
- Implement
list_sandbox_serviceswith the same auth and run-id parsing style aslist_sandbox_files. - Use
reconnect_run_sandbox(&state, &id).awaitso the sandbox is reconnected and started before service discovery. - Execute
ss -H -ltnpwith:- timeout
5_000. - no custom working directory.
- no custom environment variables.
- no cancellation token.
- timeout
- If
exec_commandreturns an error, return409with the cause chain. - If the command exits non-zero, return
409with stderr when present, otherwise stdout, otherwisess -H -ltnp failed. - Parse only stdout on success.
- Determine provider from the loaded sandbox record, not from parsed command output.
- Sort response rows by ascending port.
Task 3: Add a Focused Parser
- Add private parser helpers in
sandbox.rs, near the route handler or in a small private module inside the file:parse_ss_listening_services(output: &str, provider: &str) -> Vec<SandboxService>preview_supported(provider: &str, port: u16) -> bool
- Parser rules:
- Input lines are from
ss -H -ltnp. - Ignore blank lines and malformed lines.
- The local address field is the fourth whitespace-delimited field for standard
ss -H -ltnpoutput. - Extract the port from the last colon-separated segment.
- Handle IPv4, IPv6 bracketed addresses, wildcard binds, and loopback binds.
- Keep the full local address string in
addresses. - Keep the process field and any remaining trailing text in
processeswhen present. - Group duplicate rows by port, deduplicating
addressesandprocesses.
- Input lines are from
- Parser tests should cover:
127.0.0.1:30000.0.0.0:5173[::]:8080[::1]:2500- malformed and non-numeric ports ignored.
- same port with multiple addresses grouped.
- Daytona
2500is not previewable. - Daytona
3000and9999are previewable. - Docker
3000is not previewable.
Task 4: Demo and Auth Coverage
- Add
/runs/{id}/sandbox/servicestodemo_routes. - Add
list_sandbox_services_stubreturning at least:- port
3000, preview-supportedtrue. - port
2500, preview-supportedfalse.
- port
- Add the route to the server user-only route auth test so worker tokens cannot call it.
- Add a server test for non-zero
ssoutput if an existing fake sandbox setup can cover it cleanly; otherwise keep the failure behavior covered by parser/unit tests and the handler implementation review.
Task 5: Generate and Verify
- Run
cargo build -p fabro-api. - Run
cd lib/packages/fabro-api-client && bun run generate. - Run
cargo nextest run -p fabro-api. - Run
cargo nextest run -p fabro-server. - Run
cargo +nightly-2026-04-14 fmt --check --all. - Run
cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings.
Acceptance Criteria
GET /api/v1/runs/{id}/sandbox/servicesreturns all parsed listening TCP ports.- Preview support is true only for Daytona ports
3000..=9999. - The sandbox command performs no filtering beyond
ss -H -ltnp. - Non-Daytona providers can list services but never mark rows previewable.
- Missing
ssor a failingsscommand returns a clear409. - Generated Rust and TypeScript clients expose the new endpoint and response types.
Assumptions
- The intended preview range is
3000..=9999. ssis available often enough for v1; fallback commands are deferred.- Process names from
ssare useful display hints only and are not parsed into structured PID/name fields in this phase.