Skip to content

feat(studio): data-repo registry — lab repo picker, "Rig id", no default repo (v0.72) - #178

Open
mbreiser wants to merge 2 commits into
mainfrom
feat/data-repo-registry
Open

feat(studio): data-repo registry — lab repo picker, "Rig id", no default repo (v0.72)#178
mbreiser wants to merge 2 commits into
mainfrom
feat/data-repo-registry

Conversation

@mbreiser

@mbreiser mbreiser commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

PR 2 of the data-repo work: generalizes the CSHL course-repo pipeline so the lab can use the new private reiserlab/arena-experiments day-to-day, with no behavior change for configured course benches.

What changes for users

  • File ▾ → GitHub → Repo is a picker: — none (local files) —, CSHL 2026 course, Reiser lab experiments, Other (owner/name)…. A never-configured browser has no repo (saves go to local files) — the course repo is no longer a silent default. Course benches already have their repo stored, so they see the course entry pre-selected.
  • "Bench id" → "Rig id" outside the course repo (label, placeholder, help), with a pick-list fed by the repo roster.yaml (people rig_ids + optional top-level rigs: list; a station's mac also drives the connect-time MAC cross-check when no person is bound to that rig).
  • Wording follows the repo: "Save → Reiser lab experiments", quick links, Open-from-repo headers ("This rig — …", "Shared protocols (lab-wide)"), promote / upload / run-log banners, sign-in "remember" prompt, lock titles, ? help.
  • Expired token during a run-log commit now clears the stored token and says so.
  • Pattern Designer + dashboard share the registry (parser, labels, repo suggestions).

Design

  • New classic dual-export js/studio-data-repos.js (registry + parseRepo + label helpers); Studio.courseSettings() uses it with an inline regex fallback so connect/run-log commit survive a failed script load.
  • Copy rule (now in CLAUDE.md): user-visible strings go through Studio.dataRepoLabel()/idLabel()/sharedLabel(); internal course* identifiers and localStorage keys are unchanged (tests anchor on them).
  • scripts/seed-data-repo.sh (dry-run default, idempotent) reproduces the lab-repo skeleton; docs/development/data-repo-setup.md is the operator guide.

Verification

  • pixi run test green incl. new tests/test-studio-data-repos.js (48 checks: registry, parser, labels, HTML wiring). Prettier clean on touched JS.
  • Local preview, fresh profile: picker shows the four options, nothing selected, "Save → local file", "Rig id", select disabled by the kiosk lock; unlocked: lab → "Rig id"/e.g. 3e229-g6a/"Save → Reiser lab experiments"/quick links; course → "Bench id"/e.g. bench03; Other → input shown, invalid owner/name rejected with banner and reverted, valid one stored; none → local file, quick links hidden; re-lock disables the select.
  • Mocked api.github.com: roster with rigs: fills the rig-id datalist, station MAC mismatch shows the chip, experimenter list from the lab roster; Open-from-repo lists "This rig — 3e229-g6a" and "Shared protocols (lab-wide)".
  • Pattern Designer and dashboard load the registry (dashboard datalist = both repos); the only console 404s are the pre-existing missing favicon.

Follow-up (next week)

scripts/migrate-data-repo-dirs.sh — move bench00/01/02 + bench02-il folders from the public course repo into the lab repo (plan step 12).

🤖 Generated with Claude Code

mbreiser and others added 2 commits September 4, 2026 17:03
…ult repo (v0.72)

Generalizes the CSHL course-repo pipeline into a data-repo pipeline the lab can
use daily, without changing behavior for configured course benches.

- NEW js/studio-data-repos.js (classic dual-export): DATA_REPOS registry
  (reiserlab/cshl-2026-course · public · "Bench id"; reiserlab/arena-experiments
  · private · "Rig id"), shared parseRepo(owner/name), findRepo, repoLabel,
  idLabel, idPlaceholder, sharedLabel. Loaded classic in the Studio, Pattern
  Designer and dashboard.
- Studio File ▾ GitHub block: Repo is a <select> (— none — / registry entries /
  Other… → free-text #ghRepoInput, still the value of record, validated by
  StudioUrlState.isSafeRepo). NO default repo on a fresh browser (saves go to
  local files) — DEFAULT_COURSE_REPO removed. The id row's label/placeholder/
  title follow the repo ("Bench id" for the course repo, "Rig id" otherwise);
  #ghBenchId gets a <datalist> fed by the repo roster (people rig_ids + a new
  optional top-level rigs: list, whose mac also drives the connect-time MAC
  cross-check). localStorage keys unchanged (studio_gh_repo, studio_bench_id).
- Copy sweep through Studio.dataRepoLabel()/idLabel()/sharedLabel(): save
  labels, destination line, quick links, Open-from-repo headers ("This rig —",
  "Shared protocols (lab-wide)"), promote / upload / run-log banners, sign-in
  remember prompt, lock titles, ? help texts. Internal course* identifiers are
  deliberately kept (tests anchor on them).
- Studio.dropInvalidToken(): a 401 on the run-log commit clears the stored
  token and says why (was: only "saved locally"). #ghWho shows "@login → repo".
- Pattern Designer: repoSettings() uses the shared parser + idLabel copy.
  Dashboard: DEFAULT_REPO from the registry, repo <datalist>, neutral strings.
- scripts/seed-data-repo.sh (dry-run default, idempotent) — creates/seeds a
  data repo in the expected layout. docs/development/data-repo-setup.md (new);
  proposal status, course test plan P3, github-overview, CLAUDE.md updated.
- Tests: tests/test-studio-data-repos.js (registry, parser, labels, HTML
  wiring — 48 checks) in the pixi chain; test-studio-github anchor updated.
  Footer v0.72 + release notes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <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