Skip to content

feat(envs): browse crowd-cast-envs task packages in the UI - #16

Draft
yllkryeziu wants to merge 1 commit into
mainfrom
yll/env-browser
Draft

yllkryeziu wants to merge 1 commit into
mainfrom
yll/env-browser

Conversation

@yllkryeziu

Copy link
Copy Markdown
Member

A read-only Environments view (g n) for the RL task packages in crowd-cast-envs, modelled on the MiMo RL-Envs Explorer. This PR only adds browsing; it doesn't run anything.

Config

[repos]
crowd-cast-envs = "/fast/project/<group>/repos/crowd-cast-envs"

[envs]
repo = "crowd-cast-envs"          # must name a [repos] entry
# rev       = "origin/main"       # default: as last fetched
# tasks_dir = "environments/crowd_envs_v1/crowd_envs_v1/tasks"

If [envs] is missing, the view explains how to enable it. tasks_dir must be relative with no ...

How it reads

  • Uses git plumbing at a commit: rev-parse, ls-tree, cat-file --batch and log -- <task>. It never reads the work tree and never fetches; run git fetch in the checkout to see new tasks. GIT_TERMINAL_PROMPT=0 and GIT_OPTIONAL_LOCKS=0 are set.
  • ?rev= is validated: no leading -, no .. or :, length ≤ 200. Snapshots are cached by resolved sha (max 64), so a page is about 30–65 ms against the real repo.
  • Grader side (scoring/, reference/) is only served with grader=1, and the server enforces this: grader files return 403 without it. Package-level provenance.json (built_from ids) is never served; a test asserts this.
  • Files over 1 MiB are truncated. A NUL byte or invalid UTF-8 marks a file as binary. Shiki highlighting is skipped above 200 KB.

UI

  • List: search across title, key, tags, authors and prompt, plus tag chips. Columns: World, Tags, Authors, Workspace (files · size), Agent time. Keys: j/k/Enter, /.
  • Task page with a sticky outline:
    • The task: metadata and prompt.md.
    • Workspace: file tree plus viewer, README first.
    • Sandbox: runtime, timeouts, extensions, setup, captured artifacts.
    • History.
  • Behind the grader toggle:
    • Grading: the reward formula; outcome, invariant and veto groups with points, latitude and out-of-bounds notes; the judge system prompt from scaffold/judge.py; the scorer source.
    • Provenance: recording, predicted difficulty, findings, checks, reproduce steps, builder notes.
    • Reference solution, opened on solve.sh.
  • Markdown is rendered with marked and sanitized with DOMPurify, with a Rendered/Source switch. Relative links and images are neutralised.
  • Revision picker: default, branches and tags, commits touching tasks, or any sha typed in. File reads are pinned to the commit the page loaded. Pre-contract commits (task.toml layout) show an explanation instead of an empty list, and they appear greyed out in a task's history.

Not in this PR

Rollouts, calibration results, a cross-task reward-design page, and generic RL-Env-Contract repos. Possible follow-ups: link runs to the env revision they trained on (via the RL repo's submodule sha), and add calibration results.

Testing

  • cargo test --all-features: 15 new tests over a temp git fixture.
    • rev validation; unknown rev returns None.
    • Snapshot finds manifests only and reports skipped dirs; older revisions.
    • Grader opt-in; provenance never surfaces.
    • History, plus the manifest flag on history commits.
    • Text vs binary; truncation; refs skip */HEAD.
    • Config validation.
  • cargo clippy --all-features --all-targets and cargo fmt --check are clean.
  • npm test: 64 pass, including new envs.test.ts. npm run check is unchanged from main (35 errors / 9 warnings, all pre-existing).
  • Manual: labctl serve on a copy of the Berlin config plus a local Postgres, against the real crowd-cast-envs checkout.
    • 18 tasks at d897b4c.
    • Grader 403s; traversal 404s; bad revs 400/404.
    • Older and pre-contract revisions.
    • A headless-Chromium walkthrough of every section in light and dark themes, with no console errors.

🤖 Generated with Claude Code

A read-only Environments view (g n) over the RL-Env-Contract task
packages in crowd-cast-envs, after the MiMo RL-Envs Explorer.

`[envs]` names a `[repos]` entry, a revision (default origin/main as
last fetched) and the tasks directory. `labctl serve` reads packages
with git plumbing at a commit (ls-tree, cat-file --batch, log), never
the work tree, never fetching. Snapshots are cached by sha.

List: search plus tag chips, authors, workspace size, agent time.
Task page with an outline: prompt (rendered, sanitized Markdown with a
source toggle), workspace file browser, sandbox spec, and per-task
history. Rubrics, recorded findings, build notes, the judge prompt and
the reference solution are behind a grader-side toggle, enforced
server-side (403 without grader=1). provenance.json is never served.
A revision picker and ?rev= open any branch, tag or sha; commits from
before task.json are explained rather than shown as empty.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant