Feature Category
Problem Statement
After a job completes and its sandbox is destroyed, there is no way to query job artifacts, results, or status from the SDK. Harbor jobs persist structured data (result.json, trajectory, logs) to OSS via the mirror mechanism, but Bash jobs only upload a flat directory with no status metadata. Additionally, the two job types have completely different artifact structures, making unified status tracking impossible.
Key gaps:
- No SDK client for reading job artifacts from OSS after sandbox teardown
- Bash jobs have no completion marker — cannot distinguish "running" from "completed" or "crashed"
- No unified metadata format across Harbor and Bash job types
Proposed Solution
-
JobViewer SDK client (rock.sdk.job.viewer): Synchronous Python API for reading job results, trials, trajectories, artifacts, and logs from OSS. Supports both direct AK/SK and admin STS authentication. Follows the same OSS key layout as Harbor viewer (artifacts/{namespace}/{experiment_id}/{job_name}/...).
-
Unified job metadata (rock_meta.json): Written inside the sandbox by wrapper scripts (crash-safe, independent of SDK process). Both BashTrial and HarborTrial inject prologue/epilogue blocks into their generated scripts:
- Prologue: writes
rock_meta.json with status: "running" before main command
- Epilogue: updates to
status: "completed"/"failed" with exit_code after main command
- Leverages existing upload mechanisms (ossutil for Bash, Harbor's OSS mirror for Harbor) — zero additional upload code
-
CLI subcommands: rock job list/show/trials/trial for querying job status and details from the terminal.
Files Changed
rock/sdk/job/viewer.py — JobViewer client + data models
rock/sdk/job/meta.py — JobMeta model + render_meta_json helper
rock/sdk/job/trial/bash.py — inject meta writing into wrapper script
rock/sdk/job/trial/harbor.py — inject meta writing into script template
rock/cli/command/job.py — add viewer CLI subcommands
rock/sdk/job/__init__.py — export JobViewer
CLAUDE.md — update module descriptions
- 70 new unit tests (test_viewer.py + test_meta.py)
Feature Category
Problem Statement
After a job completes and its sandbox is destroyed, there is no way to query job artifacts, results, or status from the SDK. Harbor jobs persist structured data (result.json, trajectory, logs) to OSS via the mirror mechanism, but Bash jobs only upload a flat directory with no status metadata. Additionally, the two job types have completely different artifact structures, making unified status tracking impossible.
Key gaps:
Proposed Solution
JobViewer SDK client (
rock.sdk.job.viewer): Synchronous Python API for reading job results, trials, trajectories, artifacts, and logs from OSS. Supports both direct AK/SK and admin STS authentication. Follows the same OSS key layout as Harbor viewer (artifacts/{namespace}/{experiment_id}/{job_name}/...).Unified job metadata (
rock_meta.json): Written inside the sandbox by wrapper scripts (crash-safe, independent of SDK process). Both BashTrial and HarborTrial inject prologue/epilogue blocks into their generated scripts:rock_meta.jsonwithstatus: "running"before main commandstatus: "completed"/"failed"withexit_codeafter main commandCLI subcommands:
rock job list/show/trials/trialfor querying job status and details from the terminal.Files Changed
rock/sdk/job/viewer.py— JobViewer client + data modelsrock/sdk/job/meta.py— JobMeta model + render_meta_json helperrock/sdk/job/trial/bash.py— inject meta writing into wrapper scriptrock/sdk/job/trial/harbor.py— inject meta writing into script templaterock/cli/command/job.py— add viewer CLI subcommandsrock/sdk/job/__init__.py— export JobViewerCLAUDE.md— update module descriptions