cstudy is a tool you install, and you practice in a workspace: a directory of your own, versioned in its own git repository if you want, that holds your solutions, notes and progress. The tool ships the content (problems, runners, schemas and the workspace templates), so this repository never doubles as a workspace and solutions are never committed to it by accident (ADR 0008).
brew install bkuberek/tap/cstudy
uv tool install git+https://github.com/bkuberek/coding-study
pipx install git+https://github.com/bkuberek/coding-studyHomebrew installs a release: its wheel from the GitHub release, into a virtual environment on Homebrew's Python 3.13, with the runtime dependencies pinned in uv.lock (ADR 0013, Homebrew tap). Installing by full name (bkuberek/tap/cstudy) works on a fresh machine; Homebrew 7 refuses other commands on the tap, such as brew info cstudy, until brew trust bkuberek/tap has been run once. The formula installs the same way with Homebrew on Linux, where python@3.13 also brings Homebrew's own glibc and GCC, and the runtime dependencies come as manylinux wheels. uv and pipx build the project at the repository root of the default branch. A content author works from a checkout instead: uv run cstudy ... in the checkout, or uv tool install --editable . to put that checkout's cstudy on PATH.
When several installs exist, the first cstudy on PATH runs; Homebrew's caveat says so, and cstudy doctor WARNs when it finds more than one (the installs row). No install method brings the language toolchains: install the language toolchains, then run cstudy doctor.
| Item | Rule |
|---|---|
| Distribution | coding-study, defined by the root pyproject.toml (hatchling); the cstudy script |
| Wheel | coding_study/ from cli/src/coding_study/, the web UI's built assets in coding_study/entrypoints/web/static/ included (Web UI assets), plus coding_study/content/{problems,guides,runners,schemas} from the repository root |
| Runtime dependencies | Those in uv.lock, which include starlette, uvicorn (without its standard extra), h11 and wsproto for cstudy serve: pure-Python wheels, so the Homebrew formula needs no change (ADR 0015) |
| Release files | The wheel and requirements.txt (the runtime dependencies from uv.lock, with hashes), attached to the GitHub release of each version (versioning) |
| sdist | The same top-level paths as the checkout (cli/src, problems, guides, runners, schemas), so a wheel built from the sdist equals one built from the checkout |
| Excluded | Build output and caches (node_modules, build, .gradle, .kotlin, .venv, __pycache__, .pytest_cache, .ruff_cache, target) and runners/python/tests |
| Workspace templates | Package data in coding_study/adapters/workspace_template/: the practice projects with the Gradle wrapper and lock files, and the root go.work |
The content root holds problems/, guides/ (concept guides and learning paths, which a root may leave out), user-docs/ (the user docs, which a root may leave out too), runners/ and schemas/. cstudy reads it and never writes to it, except cstudy new in a checkout.
| Order | Source | Used for |
|---|---|---|
| 1 | --content PATH (global flag) |
An author verifying a checkout with an installed cstudy |
| 2 | CSTUDY_CONTENT |
Same, from the environment |
| 3 | The bundled copy (coding_study/content/) |
Any installed cstudy |
| 4 | The source checkout cstudy runs from (cli/src/coding_study two levels below a directory with problems/ and schemas/) |
uv run cstudy and editable installs in a checkout |
A root given by flag or variable must contain problems/ and schemas/, or the command exits 3. A checkout found by rule 1, 2 or 4 is editable: cstudy new writes into it. The bundled copy is read-only.
| Order | Source |
|---|---|
| 1 | --workspace PATH (global flag) |
| 2 | CSTUDY_WORKSPACE |
| 3 | The nearest directory, from the current one upward, that holds .cs/workspace.toml |
| 4 | The current directory |
The marker .cs/workspace.toml makes a directory a workspace. Every command that needs one (all but cstudy init, cstudy doctor, cstudy list and cstudy show) exits 3 when the resolved directory has no marker: no coding-study workspace at <dir> (no .cs/workspace.toml): run cstudy init. Outside a workspace, cstudy list and cstudy show read the catalog with empty progress and keep their caches in $XDG_CACHE_HOME/coding-study/catalog/ (default ~/.cache/coding-study/catalog/); cstudy doctor checks the toolchains only.
# coding-study workspace (docs/specs/installation-and-workspaces.md); keep it in version control.
schema = 1
created_with = "0.1.0"| Key | Meaning |
|---|---|
schema |
Workspace layout version; this cstudy supports 1. A newer schema fails cstudy doctor (upgrade cstudy) and every command that needs a workspace exits 3 |
created_with |
The cstudy version that ran cstudy init; cstudy doctor prints it next to the running version |
languages |
The workspace's languages, a list of one or more of python, typescript, java, kotlin, go and rust, each once: languages = ["python", "go"]. cstudy writes them in that order and reads them in any. Written by cstudy init --lang and cstudy lang; absent, the workspace has all six with Go and Rust optional (Workspace languages). A value that is not a list, an empty list, an unknown value or a value listed twice makes the marker unreadable, with the marker's full path and the first problem found: <workspace>/.cs/workspace.toml: languages: then not a list; use python, typescript, java, kotlin, go or rust, empty; list at least one of python, typescript, java, kotlin, go or rust, unknown language "golang"; use python, typescript, java, kotlin, go or rust or go is listed twice; list each once |
[licenses.<server>] |
Written only when you accept the license of a server that has one, the Kotlin LSP's ([licenses.kotlin-lsp]), with cstudy doctor --fix: the agreement's name and url. An acceptance holds while they match the agreement the build --fix fetches comes under, so a newer version of it asks again (Licenses) |
A workspace's languages decide which practice folders it has, which toolchains cstudy doctor checks, which IDE files it gets and which languages a new attempt starts in. They are the languages of the learner profile (ADR 0028).
| Language | Its template files |
|---|---|
python |
python/ |
typescript |
typescript/ |
java, kotlin |
jvm/, whole: one Gradle build holds both subprojects, so either language writes it, and the other's subproject stays in it unused |
go |
go/ and go.work |
rust |
rust/ |
| Every workspace | notes/, problems/, projects/, README.md, .gitignore and the marker |
| State | Rule |
|---|---|
| Not chosen | A marker without languages, which every workspace created before this key and every cstudy init without --lang has: all six languages, every template file, and cstudy doctor as before, the four core toolchains required and Go and Rust optional (ADR 0012) |
| Chosen | A marker with languages: those languages' template files only, and each chosen language's toolchain required, Go and Rust included (cli) |
| Adding | cstudy lang add writes the language's missing template files, never overwriting one, and refreshes the IDE files cstudy wrote; cstudy doctor --fix then installs its toolchain files (uv sync, pnpm install, the Gradle warm-up) |
| Removing | cstudy lang remove keeps the folder by default: it and its practice files stay, and stop being checked, generated for or offered. With --delete-folder, after a question, it deletes the language's template folders above, whole (jvm/ only when neither Java nor Kotlin remains), and refuses while an attempt in that language is in progress (deleting a language's folder). Progress, .archive/, projects/ and notes/ always stay. A folder of a language the workspace does not list is never written, refreshed or reported missing |
| Upgrading | Nothing changes for a workspace without the key. The marker's schema stays 1, since the key is additive; an older cstudy ignores it, and its cstudy doctor reports the folders a narrowed workspace lacks as missing |
| Other content | .cs/runtime/ keeps every language's runner (internal and small), cstudy reset treats every practice folder that exists as before, and your own problems may still list any language, and start in one of them only once the workspace has it |
The language folders below (python/, typescript/, jvm/, go/ with go.work, rust/) are those of a workspace that has all six languages; a workspace that chose its languages has theirs only.
<workspace>/
.cs/workspace.toml # marker (tracked)
.cs/ide.json # digests of the IDE files cstudy wrote (tracked)
.cs/runtime/ # materialized runners and the IntelliJ launcher (ignored, per machine)
.cs/serve/ # web UI preferences and the transient --open redirect file (ignored)
.cs/lsp/ # language servers for the web UI's code intelligence, installed by cstudy doctor --fix while it is on (ignored)
.cs/lsp/jdtls/ # JDT LS, the Java server: a milestone downloaded and checked by SHA-256 (ignored)
.cs/lsp/jdtls-data/ # JDT LS's configuration, index and caches, per root and session (ignored)
.cs/lsp/kotlin-lsp/ # the Kotlin LSP's newest build in server/ and its record, installed.json, once its license is accepted, and beside it, once a Kotlin service project is installed, its Linux build in linux/ and linux.json, which that project's sidecar runs (ignored)
.cs/lsp/kotlin-lsp-data/ # the Kotlin LSP's index, configuration and logs, per root and session (ignored)
.cs/lsp/bin/ # gopls, built by go install at the version the selected Go pins (ignored)
.cs/lsp/rust-library/ # links to the toolchain's standard library, per root, for rust-analyzer (ignored)
.cs/backups/ # progress.db as it was before each migration, <db stem>-schema-<N>-<UTC time>.db, kept and never pruned (ignored)
.cs/ # index, cases, calibration, build, runs caches, project manifests and locks (ignored)
.gitignore, README.md
.vscode/, .idea/ # IDE project files: tasks, run and debug configurations, SDK settings
python/ # pyproject.toml (dev tools: pyright, ruff, debugpy, pytest), uv.lock, practice/<snake_slug>.py
typescript/ # package.json, pnpm-lock.yaml, tsconfig.json, support.ts, practice/<slug>.ts
jvm/ # Gradle wrapper, settings.gradle.kts, java/ and kotlin/ subprojects
go/ # go.mod (module workspace, Go 1.24), practice/<snake_slug>/<snake_slug>.go
go.work # use ./go, so gopls and the go command find go/ from the root
rust/ # Cargo.toml (package practice, one [[example]] per started problem), .cargo/config.toml, lib.rs, practice/<snake_slug>.rs
projects/ # one folder per started project problem: projects/<slug>/ (tracked)
notes/ # answers to rubric problems
problems/ # your own problems, overlaid on the catalog
sets.yaml # your problem sets, written by cstudy set or by hand (tracked; made at the first write)
.archive/ # previous attempts (tracked)
.statements/ # rendered statements (ignored)
progress.db # SQLite, created on first use (ignored; cstudy export backs it up)
.cs/lsp/ is a pnpm project that cstudy owns (ADR 0018): package.json and pnpm-lock.yaml, copied from the package data in cli/src/coding_study/adapters/language_servers/ and rewritten when they differ, and the node_modules/ that pnpm install --frozen-lockfile --ignore-scripts builds from them. The manifest pins exact versions with integrity hashes, basedpyright 1.40.2 and typescript-language-server 6.0.3 in phase 1, and a cstudy release moves them. It holds about 46 MB after a 6.7 MB download, made only by cstudy doctor --fix while the web UI's code_intelligence preference is on, so a user who never turns it on downloads nothing; after that nothing is downloaded. Beside the pnpm project, jdtls/ holds JDT LS (phase 2), a milestone archive of 51 MB that --fix downloads under the same rule, checks by its SHA-256 and unpacks (52 MB), once: a later --fix finds its core plugin and downloads nothing. jdtls-data/<root>/<n>/ holds what JDT LS writes, 50 to 150 MB per root: its configuration, its index and the caches it would keep in ~/.cache, one directory per session that runs at once, reused by the next; JDT LS writes nothing into jvm/ or a project folder. kotlin-lsp/server/ holds the Kotlin LSP, JetBrains' newest build of the archive for this machine with its own runtime (360 MB to download, 1.1 GB unpacked), which --fix fetches under the same rule and only once you accepted its license (Licenses), checks by the SHA-256 JetBrains publishes beside it and unpacks again only when JetBrains publishes a newer build, and kotlin-lsp/installed.json records its version, its last day, its license, its URL and its SHA-256; kotlin-lsp-data/<root>/<n>/ holds what it writes per root and session, its index (about 575 MB for jvm/), its configuration and its logs, and it writes nothing into jvm/ or a project folder beyond Gradle's own .gradle/. bin/gopls (phase 3) is the gopls that --fix builds under the same rule with go install, GOBIN pointing there and GOTOOLCHAIN=local, at the version the selected Go pins (v0.21.1 on Go 1.25, v0.23.0 on 1.26, v0.24.0 on 1.27), about 40 MB; a later --fix builds it again only for a Go that pins another version. rust-analyzer is never in .cs/lsp/: it is the Rust toolchain's (rustup component add rust-analyzer), and cstudy never changes the toolchain. Its cargo check builds into the root's target/rust-analyzer/, a target directory of its own, and it reads the standard library from rust-library/<root>/, links a session makes to the toolchain's library sources without their Cargo manifest, so the vendored crates.io of rust/.cargo/config.toml never reaches that library. Deleting .cs/lsp/ is safe: --fix installs it again, and a session builds its data again (cli, web-ui).
A language server never sees what holds a reference solution or generated data: .cs/build/ (the materialized references), .cs/cases/ (generated cases with their expected outputs), .cs/runs/ (the data of runs) and the content root. Both phase 1 servers are Node programs, so cstudy serve starts them with NODE_OPTIONS=--require=<hide_paths.cjs> and the four directories in CSTUDY_HIDDEN_DIRECTORIES; in them, and in every Node process they start, a path in those directories fails as a file that is not there does, whatever the document names. The broker also leaves them out of definition answers and refuses them as library files. A content root that holds the workspace is left out of the list, since the server could not work without it. A server that is not a Node program must keep them out in its own way (web-ui, ADR 0018).
Every path cstudy prints for a workspace file is relative to the workspace root (python/practice/two_sum.py, .statements/two-sum.md). progress_db in the config file is relative to it too; changing it moves no data (configuration).
cstudy reset goes by what a path holds: what you practiced goes, and what cstudy doctor --fix would have to install again stays.
| Path | Holds | A reset |
|---|---|---|
progress.db |
Attempts, test runs, scheduled reviews, bench runs, submissions, level unlocks, guides read, and the AI preview's reviews, requests and consents (ai) | Empties every table in one transaction; the file, its schema and meta stay |
.cs/runs/ |
The data of runs | Deletes each run's folder |
.statements/ |
Statements rendered for the attempts | Deletes them; cstudy start renders them again |
python/practice/, typescript/practice/, jvm/*/src/main/*/practice/, go/practice/, rust/practice/ |
Your practice files | With --files: deletes all but .gitkeep, and takes the problems out of rust/Cargo.toml |
projects/, .cs/projects/ |
Your project folders, their manifests and locks | With --files: deletes all but .gitkeep, and refreshes VS Code's linked projects when cstudy wrote them |
notes/ |
Your answers to rubric problems | With --files: deletes all but .gitkeep |
.archive/ |
The files of earlier attempts | With --archive only |
config.toml, credentials.toml, .cs/serve/ |
Your configuration, your AI provider keys, which are never in the workspace (keys), and your preferences | Keeps |
.cs/workspace.toml, .cs/ide.json, .vscode/, .idea/, .gitignore, README.md |
The marker and the project files | Keeps |
.cs/runtime/, .cs/lsp/, python/.venv, node_modules/, the Gradle wrapper |
Toolchains and language servers | Keeps: cstudy doctor --fix would have to install them again |
.cs/build/, .cs/cases/, .cs/calibration/, the index |
Caches of the content | Keeps: they hold nothing of yours and cost time to build |
.cs/backups/ |
Copies of progress.db made before each migration |
Keeps: they are your progress as an older cstudy left it (migrations) |
problems/ |
Your own problems | Keeps: you wrote them; they are not practice |
sets.yaml |
Your problem sets | Keeps, with --files and with --archive: a set is what you plan to do, not what you did |
progress-export.json |
Your backup | Keeps |
A project folder that stays keeps its manifest, so a later cstudy start copies only the starter files it lacks. Kept practice files stay as they are, too: cstudy start reopens them.
cstudy init [PATH] [--lang L]... [--git] [--force] [--ide vscode|idea]... [--no-ide]
Creates a workspace in PATH (default: --workspace, then CSTUDY_WORKSPACE, then the current directory), creating the directory when needed.
| Step | Rule |
|---|---|
| Refusals (exit 3) | PATH already holds a marker (cstudy doctor --fix repairs a workspace); PATH is inside another workspace; PATH is at or below a content checkout (a directory with problems/ and schemas/) unless --force |
| Files | Copies the template: the practice projects (python/, typescript/, jvm/, go/, rust/) and go.work, notes/, problems/ and projects/ (each with .gitkeep), README.md and .gitignore; makes jvm/gradlew executable; writes the marker. An existing file is never overwritten, so cstudy init can adopt a directory that already has files (for example a cloned repository) |
--lang |
Repeatable, one of python, typescript, java, kotlin, go and rust: the workspace's languages. The marker gets languages with them, in that order and each once, and only their template files are copied, with the shared ones. Without --lang the marker has no languages and every template file is copied, as before. Another value exits 3 (unknown language "golang"; use python, typescript, java, kotlin, go or rust) before anything is written |
| Runtime | Materializes the runners into .cs/runtime/ (below), so an IDE can import the projects right away |
| IDE files | Writes the IDE files of VS Code and IntelliJ IDEA, as cstudy ide does; --ide vscode or --ide idea (repeatable) writes only those, --no-ide none, and both together exit 3 |
--git |
Runs git init in PATH; cstudy never commits |
| Output | created workspace <path>, then languages python, go with --lang (languages all six without), the number of files written and skipped, the IDE files line of cstudy ide, then the next steps: cd <path>, cstudy doctor --fix, cstudy start two-sum. The start line names --lang with the first chosen language when default_lang is not one of them (cstudy start two-sum --lang go) |
cstudy init installs nothing: cstudy doctor --fix runs uv sync, pnpm install and the Gradle warm-up (skipped, with a FAIL line that says skipped: java is not installed or does not run or skipped: JDK 17 is older than 21 and the JDK to select or install, when the selected JDK is missing or older than 21; a JDK above the supported range still warms up, so the problems that opt in to it build offline too). The Go and Rust toolchains are optional, although problems have Go and Rust references: neither command runs go or cargo, so a machine without them gets the same workspace, and only --lang go needs Go 1.25 or newer and --lang rust Rust 1.80 or newer (without them, cstudy test exits 4 with go was not found on PATH or cargo was not found on PATH). cstudy doctor checks go, rustc and cargo and only warns when one is missing or too old (ADR 0012).
rust/Cargo.toml is for the editor: each problem file is an [[example]] with crate-type = ["lib"], a crate of its own that rust-analyzer checks, with autoexamples = false so only listed files count and cs_support, rust_decimal and chrono as dev-dependencies; rust/.cargo/config.toml resolves crates.io from the runtime's vendored crates, so rust-analyzer needs no network. cstudy start --lang rust appends the problem's entry when the manifest has none for its name or file, and leaves a manifest that does not parse alone. lib.rs is empty: a package needs one target before the first problem starts. cstudy builds solutions elsewhere (runners), so an edit to the manifest never affects a run.
The workspace .gitignore ignores /.cs/* except /.cs/workspace.toml and /.cs/ide.json, /.statements/, progress.db*, node_modules/, .venv/, build/, .gradle/, .kotlin/, target/, __pycache__/, .ruff_cache/, projects/*/.venv and projects/*/uv.lock (project folders: the .venv of a project is a symbolic link, which the pattern .venv/ with its trailing slash does not match), projects/*/go.work and projects/*/go.work.sum, projects/*/Cargo.lock, which the native cargo test writes, and IntelliJ's per-user files (.idea/workspace.xml, tasks.xml, usage.statistics.xml, dictionaries/, shelf/, libraries/, modules.xml, dataSources*, contentModel.xml, *.iml). Practice files, project folders, notes, .archive/, your problems, sets.yaml and the IDE files stay tracked, and you commit them when you choose (PRD Q3).
The practice projects build and run against the runners, and Gradle, uv and Node write next to what they build. The bundled runners live in the installed package, which must stay read-only, so each workspace gets its own copy:
| Item | Rule |
|---|---|
| Location | .cs/runtime/runners/{python,typescript,jvm,go,rust}: the content root's runners/<name>/ without tests/ and build output |
| Stamp | .cs/runtime/stamp.json: a SHA-256 over the relative path and bytes of every copied source file |
| Refresh | Before the first runner prepares in a command that runs code, and in cstudy doctor --fix and cstudy init; plain cstudy doctor only reports a missing or stale runtime and changes nothing (workspace checks). When the stamp differs from the content's digest, changed files are rewritten, removed files deleted, unchanged files keep their timestamps, and build output (build/, .gradle/, node_modules/, .kotlin/, target/, __pycache__/) stays. It changes a compiled runner's copy only under the lock that runner's builds hold while they read it, taken exclusively, and takes that lock only when the copy changes: .cs/build/jvm-locks/runtime.lock for jvm (JVM build details), .cs/build/go/.cstudy.lock for go and .cs/build/rust/runtime.lock for rust (Rust build details). A build by another cstudy process therefore never compiles sources half copied; the refresh waits for it to end |
| Wiring | Relative paths in the tracked project files: python/pyproject.toml depends on ../.cs/runtime/runners/python (editable), typescript/support.ts re-exports ../.cs/runtime/runners/typescript/support.ts, jvm/settings.gradle.kts includes ../.cs/runtime/runners/jvm, go/go.mod replaces the module cstudy (the runner and cstudy/support) with ../.cs/runtime/runners/go and github.com/shopspring/decimal with its copy in ../.cs/runtime/runners/go/third_party, rust/Cargo.toml takes cs_support from ../.cs/runtime/runners/rust/cs_support and rust/.cargo/config.toml replaces crates.io with ../.cs/runtime/runners/rust/vendor, and the reference build in .cs/build/jvm includes ../../runtime/runners/jvm while .cs/build/go/go.work replaces cstudy with ../../runtime/runners/go |
| IDE launcher | .cs/runtime/ide/cstudy-launcher.jar, a copy of the jar shipped in the package (IDE files); installed whenever the runtime is refreshed, even when the stamp matches, and by cstudy ide. A missing or different copy makes the runtime stale |
Because the wiring is relative, a workspace keeps working when it moves or is cloned on another machine; there cstudy doctor --fix recreates .cs/runtime/ (with the launcher), the venv, node_modules and the Gradle build. Editors open the workspace root with its IDE files, or each project on its own: python/ (pyright and ruff find .venv), typescript/ (tsserver finds node_modules), jvm/ (IntelliJ imports it as one Gradle project), go/ (gopls reads go.mod) and rust/ (rust-analyzer reads Cargo.toml).
A service project runs in Docker with only this folder mounted, installs dependencies into it, and uses none of the links below. See service projects. Its generated files live under .cs/runs/<stack>/ for the run, and its install record at .cs/projects/<slug>.install.json.
A project problem is solved in projects/<slug>/: one self-contained folder per started project, which cstudy start fills from the problem's starter/ tree and which you track like practice files (ADR 0014). It opens as an editor root of its own. Nothing is installed per project: the folder reaches the workspace's toolchain installs by relative path, so a project starts offline (NFR-6), on the JVM once cstudy doctor --fix has cached the test libraries (below), and survives a move or a clone of the workspace.
| Item | Python | TypeScript |
|---|---|---|
| Toolchain | The workspace venv, through the relative symbolic link projects/<slug>/.venv -> ../../python/.venv, which cstudy start creates. A relative target survives moving and copying the workspace, where an absolute one would dangle. The workspace template's dev group lists pytest, next to debugpy, pyright and ruff |
The workspace's Node and typescript/node_modules: tsconfig.json takes its types from ../../typescript/node_modules/@types |
| Build files | The starter's pyproject.toml, tool tables only (starter): no [project] table, requires-python or [tool.uv], because a requires-python above the venv's Python makes uv run delete the target of the .venv link, the shared python/.venv. Without a [project] table no second venv is created and no uv.lock is needed |
The starter's package.json ("type": "module", no dependencies) and tsconfig.json |
| Editors | pyright, basedpyright and Pylance resolve imports between the project's files, its tests/ and subfolders, pytest and cs_support, through [tool.pyright] venvPath = "." and venv = ".venv"; ruff reads [tool.ruff] |
tsserver reads tsconfig.json; VS Code uses the workspace's TypeScript (typescript.tsdk) |
How cstudy runs it |
python/.venv/bin/python by path, never the venv's console scripts, whose shebangs keep the venv's absolute path after the workspace moves. Every process it starts for a project gets UV_NO_SYNC=1 and PYTHONPYCACHEPREFIX=<workspace>/.cs/pycache, so no bytecode lands in the folder; the runner keeps the project root off the front of sys.path (project jobs) |
node on the files, as for other TypeScript runs |
| Native command | .venv/bin/pytest in the folder (after a workspace move, once python/.venv is recreated), or uv run --no-sync pytest; a plain uv run there writes a uv.lock (ignored) and warns about requires-python. Not python -m pytest from the folder: it puts the folder first on sys.path, where a file such as random.py shadows the standard library |
node --test in the folder |
| Caches | -p no:cacheprovider in the starter keeps .pytest_cache out; __pycache__/ is ignored if a native run writes one |
none |
A Go folder is a module of its own (ADR 0014):
| Item | Go |
|---|---|
| Toolchain | The go on PATH, as for practice files. The starter's go.mod (module <slug>) reaches the vendored decimal module in the runner runtime through replace ../../.cs/runtime/runners/go/third_party/..., so the folder needs no go.sum and no network |
go.work |
projects/<slug>/go.work, holding the higher of go 1.24 and the go line of the folder's go.mod (so go 1.25 for a virtual-clock project, whose go.mod says so) and use ., which cstudy start writes when it is missing. The go command and gopls look for a go.work from the folder upward, so this one keeps the workspace's root go.work from claiming the folder. The root go.work never lists a project folder: a use line there breaks every go command once --fresh archives the folder, and two folders with one module path fail together. The file is untracked, like a Python folder's .venv link |
| Editors | gopls resolves the folder's packages, its subpackages and the vendored module through its go.work, whether the editor opens the folder or the workspace root |
How cstudy runs it |
Binaries of its own in .cs/build/go, built against a go.work per project root there (Go project jobs); the folder's own go.work is not used |
| Native command | go test ./... in the folder |
| Caches | none in the folder: the go command keeps its build cache per user |
| Rule | Detail |
|---|---|
| Start | A new attempt copies starter/ without overwriting a file; a resumed attempt copies it only when the folder is missing, writes back a missing generated test file of an unlocked level, and recreates a missing or dangling .venv link (cli) |
| Archive | --fresh and review attempts move the folder to .archive/<slug>/<attempt_id>-<lang>/, without the .venv link and caches, before copying the starter again. When that directory already exists, cstudy start exits 3 and moves nothing |
| Manifest | .cs/projects/<slug>.json, outside the folder and ignored like the rest of .cs/: every file cstudy provided in the folder, each starter file and the generated test file of each open level, with the SHA-256 of the content it provided, also where it kept a file of yours at that path. The document is {"format": 1, "files": {<path>: {"origin": "starter" or "level", "level": <n>, "sha256": <digest>}}}, sorted by path, with level for generated files only. A new attempt writes it anew from the starter; a generated test file is recorded when cstudy writes it, or keeps a file at its path that the manifest does not name yet; a resumed attempt keeps it, and writes it again from the starter when the folder or the manifest is missing (a folder you deleted, a clone). An archived folder takes none along. cstudy status compares the folder with it, so a starter file stays unchanged after a newer cstudy changes the starter |
| Lock | .cs/projects/<slug>.lock, an exclusive file lock that every command writing to a project takes, so two commands, or an interface racing the CLI, never interleave: cstudy start holds it for the whole start (a second cstudy start then resumes the attempt the first began), a submission that passed every case holds it while it opens the next level or records the full pass, and cstudy start --restore while it writes the file back. Under the lock the submission reads the attempt again: of two submissions graded at once only one opens the level, and one graded while cstudy start --fresh replaced the attempt opens nothing. Grading and cstudy test run without it. A second command waits for it; the lock ends with its holder, however it ends |
| Watched and hashed | Every file under the folder except .venv, node_modules, __pycache__, .pytest_cache, .ruff_cache, build, .gradle, .kotlin and target, and the folder's uv.lock and Cargo.lock: cstudy test --watch watches them and code_hash hashes their relative paths and bytes in path order. The workspace .gitignore already ignores build/, .gradle/, .kotlin/ and target/ wherever they appear, in project folders too |
Go go.work |
cstudy start writes the folder's go.work when it is missing, on a new and on a resumed attempt, and cstudy doctor --fix restores it; it is untracked, so code_hash, --watch and archives leave it out with go.work.sum |
A Java or Kotlin project folder is a Gradle build of its own, opened as an editor root of its own (ADR 0014).
| Item | Java and Kotlin |
|---|---|
| Toolchain | The selected JDK, 21 to 26, with no Gradle toolchain, and the workspace's Gradle wrapper and daemon and runner runtime. settings.gradle.kts finds the workspace by walking up to .cs/workspace.toml, takes jvm/gradle/libs.versions.toml as its version catalog and includes .cs/runtime/runners/jvm, whose cs.project plugin sets the release level, JUnit, kotlin.test and the runner. No link is needed, and the same files build in a reference's copy under .cs/build/projects/ |
| Build files | The starter's settings.gradle.kts, build.gradle.kts, gradle.properties and gradle/wrapper/gradle-wrapper.properties, exactly as the template writes them (starter); the wrapper properties name the workspace's Gradle, so an IDE that opens the folder uses it |
| Editors | IntelliJ IDEA opens the folder as a Gradle project; VS Code's Java extension imports it with the settings the workspace already has (java.import.gradle.enabled) |
How cstudy runs it |
jvm/gradlew -p projects/<slug> --offline csClasspath (or csMainClasspath before grading) on the shared daemon, under an exclusive lock per project build, then java on a private copy of what it built (JVM project builds) |
| Native command | ../../jvm/gradlew test in the folder, which runs JUnit through Gradle's own test task |
| Caches | build/, .gradle/ (the configuration cache) and, for Kotlin, .kotlin/, all ignored |
| Offline | A project build runs with --offline. JUnit, kotlin-test, the kotlinx-coroutines-core and kotlinx-coroutines-test that the cs.coroutines plugin adds to a Kotlin project on the virtual clock, and their dependencies (apiguardian-api among them) are not in the workspace's own build, so cstudy doctor --fix builds the warm-up projects .cs/runtime/runners/jvm/project-warmup/java and project-warmup/kotlin once online, project folders like any other with one test each, the Kotlin one on the virtual clock, and every folder then builds offline. Until then a build exits 4 naming cstudy doctor --fix |
A Rust project folder is a crate of its own (problem-format).
| Item | Rust |
|---|---|
| Toolchain | The workspace's rustc and cargo, and the runtime's vendored crates, which the folder's .cargo/config.toml names by the relative path ../../.cs/runtime/runners/rust/vendor. cstudy start writes that file when the folder lacks it, on a new or a resumed attempt, and never changes one that exists |
| Build files | The starter's Cargo.toml and .cargo/config.toml. The folder is not a member of rust/: Cargo refuses a member outside the workspace root |
| Editors | rust-analyzer analyzes a Cargo project that rust-analyzer.linkedProjects names, so cstudy ide adds projects/<slug>/Cargo.toml of each Rust folder to it, and so does cstudy start of a new Rust folder once cstudy has written .vscode/settings.json |
How cstudy runs it |
It builds in .cs/build/rust-projects/<slug>/ with the dev profile and a private CARGO_HOME, and writes nothing into the folder (runners) |
| Native command | cargo test in the folder: it writes target/ and Cargo.lock there, both ignored |
| Caches | target/ |
cstudy init and cstudy ide write project files so that the workspace root opens in VS Code or IntelliJ IDEA with every cstudy action ready to run and debug (ADR 0010). cstudy stays the judge: the IDE runs cstudy commands, and debugging attaches to the runner that cstudy test --debug starts.
| Action | Current file (the solution in the editor is the target) | Active attempt (no target) |
|---|---|---|
test, test --perf, test --typecheck (TypeScript), bench, hint |
yes | yes |
done --rating=ok|easy|hard, done --gave-up |
yes | yes |
submit, status (project problems) |
yes | yes |
solution, show, start --no-open |
yes | no: the target is required |
test --debug (VS Code), test --debug --debug-connect (IntelliJ, Java and Kotlin) |
yes | yes |
next, stats, doctor |
workspace commands, no target |
One catalog (coding_study/domain/ide_actions.py) lists these actions, and both IDEs' files are generated from it; the tests parse every command line with the real cstudy command line.
| File | Holds |
|---|---|
.vscode/tasks.json |
A process task per action and scope (cstudy test (current file) runs cstudy test ${file} in ${workspaceFolder}); done asks for the outcome through a pickString input. The cstudy test --debug tasks are background tasks whose problem matcher ends at cstudy: waiting for debugger on 127.0.0.1:<port> |
.vscode/launch.json |
Debug current file (<language>) and Debug active attempt (<language>) for Python (debugpy attach, port 5678), TypeScript (node attach, 9229), Java (java attach, 5005), Go (the Go extension's go attach in "mode": "remote" to the headless Delve, 2345) and Rust (CodeLLDB's lldb attach: targetCreateCommands ["target create \"\""], an empty target that takes the executable the debug server reports, since each run launches its own copy of the runner, then processCreateCommands ["gdb-remote 127.0.0.1:12345"]; preTerminateCommands an lldb script one-liner that kills the process only while it is alive (lldb.process.is_alive; a plain process kill would print error: Process must be launched. after a run that already finished), because CodeLLDB detaches from an attached process when its session ends and the runner would go on without a debugger; and sourceLanguages ["rust"] for Rust's formatters), each starting its cstudy test --debug task first; all on 127.0.0.1. None for Kotlin: VS Code's Java debugger never binds Kotlin breakpoints (vscode-java-debug#241) |
.vscode/settings.json |
python.defaultInterpreterPath ${workspaceFolder}/python/.venv/bin/python, typescript.tsdk typescript/node_modules/typescript/lib, java.import.gradle.enabled, go.toolsEnvVars {"GOTOOLCHAIN": "local"}, rust-analyzer.linkedProjects ["rust/Cargo.toml"], then projects/<slug>/Cargo.toml of each Rust project folder in path order, with rust-analyzer.check.allTargets, watcher and search exclusions for build output (target included) and for projects/*/.venv, the links to the shared venv; no JDK path |
.vscode/extensions.json |
Recommends ms-python.python, ms-python.debugpy, vscjava.vscode-java-pack, vscjava.vscode-gradle, golang.go, rust-lang.rust-analyzer, vadimcn.vscode-lldb (CodeLLDB, the Rust debugger) |
.idea/misc.xml |
The project JDK named after the feature release of the selected JDK (26; JavaSDK) and the language level of the build's release level (JDK_26, which JDK 27 gets too), so IntelliJ's Gradle import, which runs with the project JDK, compiles as cstudy test does. With no JDK selected it names the recommended 25. cstudy ide replaces it while it is still as written, so a JDK switch updates it, and keeps it, with a warning, once IntelliJ or you changed it |
.idea/gradle.xml |
jvm/ linked as a Gradle project with its java and kotlin modules, run with the project JDK (#USE_PROJECT_JDK) |
.idea/runConfigurations/*.xml |
Shared run configurations in the folders cstudy: current file (JAR Application configurations that start the launcher with "$FilePath$"), cstudy: active attempt and cstudy: workspace (Shell Script configurations run in the terminal), and cstudy: debug: Debug JVM (listen), a Remote JVM Debug configuration listening on port 5005 that restarts after each session, and the compounds Debug current file (Java, Kotlin) and Debug active attempt (Java, Kotlin), each starting the listener and cstudy test --debug --debug-connect. Each file is named after its configuration as IntelliJ names it (cstudy test (current file) is cstudy_test__current_file_.xml) |
Go and Rust need no tasks or run configurations of their own: every action is language-agnostic, so cstudy test (current file) runs cstudy test ${file} on a .go or .rs solution as it does on a .py one, and IntelliJ writes no Go or Rust project files and no Go or Rust debug configurations: debug them in VS Code (above) or with any client of debug mode. The settings are what the two editors need to analyze the practice files:
| Setting | Why |
|---|---|
go.toolsEnvVars GOTOOLCHAIN=local |
The Go extension's tools (gopls) run as cstudy does and never download the toolchain go/go.mod asks for (toolchains). gopls finds go/ through the go.work at the workspace root; no setting is needed for that |
rust-analyzer.linkedProjects rust/Cargo.toml |
The Cargo project is in rust/, not at the workspace root |
rust-analyzer.linkedProjects projects/<slug>/Cargo.toml |
Each Rust project folder is a crate of its own, outside rust/; a folder is a Rust project when it holds a Cargo.toml. cstudy start refreshes VS Code's files when it writes a new Rust folder, once cstudy has written them; a folder started otherwise, or while a settings.json you edited is kept, is missing until cstudy ide runs again, and cstudy doctor says so |
rust-analyzer.check.allTargets |
Each problem is an [[example]] built as a library crate (ADR 0012); checking every target covers them. rust-analyzer passes --keep-going to cargo check itself, so the errors of every problem show when one is broken; the setting rust-analyzer.check.extraArgs ["--keep-going"], which earlier cstudy versions wrote, makes cargo reject the duplicate and VS Code show no Rust diagnostics, so cstudy ide drops it while settings.json is as cstudy wrote it, and an edited one needs the key removed by hand or cstudy ide --force |
An existing workspace gets the new settings and extensions from cstudy ide, which follows the rewriting rule below: it updates settings.json and extensions.json while they are as cstudy wrote them, and keeps (with a warning) the ones you edited until cstudy ide --force, or until you copy the keys over. cstudy doctor --fix never writes IDE files. Go and Rust debug configurations are VS Code's only, in launch.json (above); IntelliJ IDEA gets none.
The files cover the workspace's languages. A workspace that has not chosen them gets everything above. One that has gets, of what is language-specific, only its languages' parts:
| File | Written for |
|---|---|
.vscode/tasks.json |
Every action, which is language-agnostic, except the cstudy test --typecheck tasks, written with typescript only, and the cstudy test --debug tasks, written while the workspace lists a language VS Code debugs (python, typescript, java, go, rust) |
.vscode/launch.json |
The configurations of each listed language VS Code debugs; not written for a workspace whose only languages are none of them (kotlin alone) |
.vscode/settings.json |
python.defaultInterpreterPath with python; typescript.tsdk with typescript; java.import.gradle.enabled with java or kotlin; go.toolsEnvVars with go; the rust-analyzer.* keys with rust. The watcher and search exclusions always |
.vscode/extensions.json |
ms-python.python and ms-python.debugpy with python; vscjava.vscode-java-pack and vscjava.vscode-gradle with java or kotlin; golang.go with go; rust-lang.rust-analyzer and vadimcn.vscode-lldb with rust |
.idea/misc.xml, .idea/gradle.xml |
java or kotlin |
.idea/runConfigurations/ |
The folders cstudy: current file, cstudy: active attempt and cstudy: workspace always, with every action but those of one language: cstudy test --typecheck is written with typescript only and cstudy test --debug --debug-connect with java or kotlin; cstudy: debug (the listener and its compounds) with java or kotlin |
A language added or removed changes these files by the rewriting rule below: cstudy lang refreshes the files of each IDE whose files cstudy wrote, and a file this cstudy no longer generates for the workspace is deleted while it matches its digest.
| Rule | Detail |
|---|---|
| Launcher | IntelliJ expands macros such as $FilePath$ in JAR Application configurations but not in Shell Script ones, so current-file configurations run .cs/runtime/ide/cstudy-launcher.jar (runtime). It runs cstudy <arguments> with the same standard streams and exits with its exit code; it finds cstudy through -Dcstudy.executable, CSTUDY_EXECUTABLE, PATH, UV_TOOL_BIN_DIR, XDG_BIN_HOME and ~/.local/bin, and exits 127 naming CSTUDY_EXECUTABLE when it finds none. Built reproducibly from tools/ide-launcher/ (javac 21, Java 17 bytecode) and shipped as package data; a test rebuilds it and compares the bytes |
| No editor focused | IntelliJ passes the project directory as $FilePath$; a directory target exits 3 with open a solution file in the editor first |
| Manifest | .cs/ide.json: {"format": 1, "files": {<path>: <SHA-256 of what cstudy wrote>}}, sorted, tracked with the IDE files so a clone knows which files are still as cstudy wrote them |
| Rewriting | A missing file is written; a file still matching its recorded digest is overwritten; a file already holding the new content is left as it is (and recorded); any other file at a generated path, edited since or never written by cstudy, is kept with a warning until cstudy ide --force. Files cstudy does not generate are never touched |
| Removal | A recorded file this cstudy no longer generates is deleted while it matches its digest; once edited, it is kept and forgotten |
| Stable output | JSON with two-space indents in a fixed key order; XML from ElementTree in IntelliJ's layout; every file ends with a newline, so generating again changes no byte |
Not set from project files, because IDEs keep them per user or need a plugin: the JDK definition behind the name in .idea/misc.xml (IntelliJ offers to set up a missing SDK), the first Load Gradle Project in IntelliJ, a Python SDK in IntelliJ (Python plugin), a JDK for VS Code's Java extension, Python and Node debugging in IntelliJ (Python plugin; Node attach is IntelliJ IDEA Ultimate only), and Kotlin debugging in VS Code. The workspace README lists them.
In a workspace that has chosen its languages, every check below that belongs to a language is left out for the languages it does not list, and --fix skips their steps:
| Checks | Belong to |
|---|---|
python/.venv, python debugpy, python pytest, project links, python/.venv location, runner python, code intelligence python |
python |
typescript/node_modules, runner typescript, code intelligence typescript |
typescript |
jvm/gradlew, runner java, java project libraries, code intelligence java |
java (jvm/gradlew also kotlin) |
runner kotlin, kotlin project libraries, code intelligence kotlin and its service-projects row |
kotlin |
go projects, code intelligence go |
go |
rust project config, rust linked projects, code intelligence rust |
rust |
workspace files then covers the template files of the chosen languages and the shared ones, and FAILs for any missing; there is no go and rust files row, since a chosen Go or Rust is not optional. A languages row follows workspace (cli). The machine's toolchain rows are scoped the same way (cli). With no languages chosen, every row below shows, as before.
| Check | ok |
Otherwise |
|---|---|---|
languages |
The workspace's languages (python, go), or all six (none chosen; cstudy lang remove narrows them), with the default language when default_lang is not one of them |
Never WARN or FAIL: a marker whose languages does not load fails the workspace row instead |
content |
Path, bundled or checkout |
FAIL when the content root cannot be found |
workspace |
Path and created with cstudy <version> (with the running version when it differs) |
WARN when there is no workspace (fix: cstudy init); FAIL for an unreadable marker or a newer schema |
workspace files |
Every core template file exists (everything but the Go and Rust files below), and every directory of problems/ is named by a slug and has no id: line in its meta.yaml |
FAIL listing up to 5 missing files, fix: cstudy doctor --fix; WARN, when none is missing, naming up to 5 such directories with the fix to make: the quoted mv to run from the workspace root and the id: line to delete (your own problems) |
go and rust files |
go.work and the files of go/ and rust/ exist |
WARN listing up to 5 missing files, fix: cstudy doctor --fix: a workspace created before Go and Rust existed lacks them, and nothing fails until you use --lang go or --lang rust |
runner runtime |
The stamp matches the content and the IDE launcher is the shipped one | FAIL when missing or stale, fix: cstudy doctor --fix |
progress database |
progress.db (the file progress_db names) records the schema this cstudy migrates to: schema <n>; not created yet (created on first use) before the first command opens it |
WARN when it records an older schema, the row names both schemas and says it migrates on next use and that --fix migrates now, fix: cstudy doctor --fix; FAIL when it records a newer one (fix: upgrade cstudy: a later cstudy wrote it, and this one cannot know its tables) or the file is not a progress database. cstudy doctor only reads it, never migrating or creating it |
jvm/gradlew, python/.venv, python debugpy, typescript/node_modules and runner <lang> |
As in cli | As in cli |
projects |
projects/ exists |
WARN, fix: cstudy doctor --fix (a workspace created before project problems lacks it) |
python pytest |
pytest is installed in python/.venv |
WARN, fix: cstudy doctor --fix: only Python project problems need it, and a workspace created before the template listed pytest (v0.7.0 and earlier) lacks it |
project links |
Every Python project folder's .venv is the relative link to ../../python/.venv and resolves |
WARN listing up to 5 folders whose link is missing or dangling; cstudy doctor --fix recreates them |
go projects |
Every Go project folder (projects/<slug> with a go.mod) has its go.work, every replace in its go.mod that names a directory (the vendored modules' copies) names one that exists, and no two folders declare one module path |
WARN listing up to 5 problems: a missing go.work (cstudy doctor --fix writes it), a replace that does not resolve (fix: cstudy start <slug> --restore go.mod), or a module path shared with another folder (give each folder its own module line). cstudy itself still grades and tests such folders |
rust project config |
Every Rust project folder (one with a Cargo.toml) has a .cargo/config.toml whose replacement source for crates.io is a directory that exists, resolved from the folder |
WARN listing up to 5 folders, fix: cstudy doctor --fix, which writes a missing file and refreshes the runtime; a file that names another directory is kept (cstudy start <slug> --restore .cargo/config.toml writes the starter's back) |
rust linked projects |
Every Rust project folder's Cargo.toml is in rust-analyzer.linkedProjects of .vscode/settings.json; no row without that file |
WARN listing up to 5 folders, fix: cstudy ide |
java project libraries, kotlin project libraries |
The language's warm-up project built, every library (jar) on the test runtime classpath it wrote still exists, and for Kotlin that classpath holds kotlinx-coroutines-core and kotlinx-coroutines-test at the release of the runners' version catalog, so project folders build offline. A workspace warmed up before Kotlin projects had the virtual clock lacks them: the kotlin warm-up project has not cached kotlinx-coroutines 1.11.0 yet (Kotlin projects on the virtual clock build with it) |
WARN, fix: cstudy doctor --fix (online once): only Java and Kotlin project problems need them; nothing to check before jvm/ exists |
web ui assets |
Every file entrypoints/web/static/manifest.json names is installed with its SHA-256: total size and digest matches |
WARN naming the first missing or different file, with the reinstall command of the running install as its fix (cli: brew reinstall cstudy, uv tool install --reinstall coding-study, pipx reinstall coding-study): only cstudy serve needs them |
web server |
starlette, uvicorn and wsproto import: their versions | WARN, with the same reinstall fix: only cstudy serve needs them |
code intelligence python, code intelligence typescript, code intelligence java, code intelligence go, code intelligence rust |
Only while the web UI's code_intelligence preference is on: the server in .cs/lsp/ runs its version command and prints the pinned version (for gopls, the one the selected Go pins); JDT LS's core plugin is the pinned one and the selected JDK is 25 or 26; a rust-analyzer on PATH runs its --version |
WARN with the reason, fix: cstudy doctor --fix, for rust-analyzer fix: rustup component add rust-analyzer, or for a JDK the way to select one: only the page's code intelligence needs them (cli) |
python/.venv location |
The shebang of the venv's console scripts names this python/.venv |
WARN when it names another path (the workspace moved): the console scripts no longer run, though cstudy does; fix: rm -rf python/.venv && cstudy doctor --fix |
cstudy doctor --fix first writes every missing template file (never overwriting one, so practice files are never touched), recreates missing or dangling .venv links in Python project folders, missing go.work files in Go project folders and missing .cargo/config.toml files in Rust project folders, refreshes the runner runtime, migrates an older progress.db to the latest schema (under the same lock as the first command that opens it, after copying it to .cs/backups/ and with the line progress.db: backed up to .cs/backups/<file>; migrated from schema N to M; a copy that fails stops --fix with exit 4, cannot back up progress.db before migrating it: <reason>; nothing changed, the file unchanged, and so does a script that fails, which restores the copy and says so; a newer or unreadable one is left as it is, and its row stays), then runs uv sync in python/ and, when python/.venv cannot import pytest, adds it the way the template declares it (pytest>=9.1): uv add --dev --offline "pytest>=9.1", which needs only uv's cache, and, only if that fails, the same without --offline. When both fail, as when offline with pytest not cached, the step prints FAIL, the end of uv's output and fix: once online, run: uv add --dev "pytest>=9.1" --directory python, and --fix exits 4; the rest of the fix still runs. Then it runs pnpm install in typescript/ (and in the content checkout's runners/typescript when the content is a checkout), installs .cs/lsp/ while the code_intelligence preference is on (Layout), and runs the Gradle warm-up in jvm/: the runtime classpath of both practice projects, which caches the runner's own libraries, then the two warm-up projects of JVM project folders. Outside a workspace it exits 3.
In a workspace that has chosen its languages, --fix writes the missing template files of those languages and the shared ones only, so it never recreates a folder the workspace does not list; it runs uv sync and the pytest step only with python, pnpm install in typescript/ only with typescript (the content checkout's runners/typescript too), the Gradle warm-up only with java or kotlin, and then whole, both practice projects and both warm-up projects, since one Gradle build holds Java and Kotlin, relinks Python project folders only with python, writes Go go.work files only with go and Rust .cargo/config.toml files only with rust, and installs the language servers of those languages only. The runner runtime is refreshed whole, every runner included.
The page cstudy serve serves (web-ui) is a front end built from tools/web-ui/ and committed, built, under cli/src/coding_study/entrypoints/web/static/, as the IntelliJ launcher jar is built from tools/ide-launcher/ and committed (ADR 0010). uv tool install git+…, pipx and the release workflow build the wheel straight from the repository, so the bundle must already be there: installing cstudy never needs Node or the network.
| Item | Rule |
|---|---|
| Sources | tools/web-ui/: package.json with exact versions, pnpm-lock.yaml with integrity hashes, the TypeScript and CSS sources, and build.sh. Outside cli/src, so neither the wheel nor the sdist holds them |
| Build | tools/web-ui/build.sh: pnpm install --frozen-lockfile --ignore-scripts (run from tools/web-ui/, so Corepack reads the pinned pnpm), then esbuild into static/, with content-hashed chunk names, manifest.json (each file's SHA-256) and THIRD_PARTY_LICENSES.txt. Needs Node 24 and npm, a contributor's tools only |
Not build |
The output directory is static/: the wheel excludes directories named build |
| Checks | A fast test asserts the wheel holds every file manifest.json names; a slow test rebuilds and compares the bytes; cstudy doctor compares the installed files with the manifest (workspace checks) |
| Runtime | The page requests nothing but the server's own files (NFR-12) |
<workspace>/problems/ uses the problem format and is overlaid on the content root's problems/:
| Rule | Behavior |
|---|---|
| Catalog | The union, in the order of cstudy list; cstudy list, cstudy next, cstudy start, cstudy test and cstudy verify treat both alike |
| Slug collision | The workspace problem wins and hides the content problem with that slug entirely (no file-level merge). Your practice files and progress therefore always match the problem you wrote, also after an upgrade adds a problem with your slug |
| Languages | A problem in problems/ may list any non-empty subset of the six languages in its meta.yaml, and without a languages line it lists the four core languages (python, typescript, java, kotlin), which is not the catalog's default of all six: a problem written before Go and Rust keeps working, and it needs no Go or Rust reference. cstudy new writes the line explicitly (problem format) |
cstudy new |
With bundled content it writes problems/<slug>/ in the workspace; with an editable checkout it writes problems/<slug>/ into the checkout |
| Folder names | A folder is named by its slug. A folder named NNNN-<slug>, as cstudy new wrote them before, is reported, not migrated, and so is a folder whose meta.yaml has an id: line: it loads as no problem, cstudy verify fails on it (S2) and cstudy doctor warns, each with the quoted mv problems/<name> problems/<slug> to run from the workspace root and the id: line to delete (compatibility) |
| Rubric problems | Come from the content root only: a folder of your own problems/ of kind system-design or code-review is a content error, rubric problems are catalog-only; a problem of your own with the slug of one wins and hides it, as it hides any catalog problem with its slug; your answers to them go to notes/<track>/<slug>.md as before |
The checkout is content, not a workspace:
cstudy initinside it refuses without--force; as a second guard the root.gitignoreignores.cs/,.statements/,progress.db*andprogress-export.jsonanywhere, and/workspace/,/workspaces/,/ws/,/python/,/typescript/,/jvm/,/notes/,/projects/and/.archive/at the root.- Point
CSTUDY_WORKSPACE(or--workspace) at a workspace outside the checkout;uv run cstudy verifythen reads the checkout's content and builds with that workspace's toolchains. - A change to the web UI's front end is rebuilt with
tools/web-ui/build.shand committed with its sources (Web UI assets); the browser tests need the optional Playwright development group and its three engines (uv run --group browser playwright install chromium firefox webkit), and run in each one (browser support). - The CLI tests never use a workspace in the checkout: fixtures create temporary workspaces, and the slow tests set one up per session with
cstudy initand thecstudy doctor --fixsteps.
CS_ROOT and the repository-root search (problems/ and schemas/ above the current directory) are gone: CSTUDY_CONTENT or --content picks content, and CSTUDY_WORKSPACE or --workspace picks the workspace.