GSU language profile labs

These disposable labs set up one project for each of several languages, and check it with just verify. Python, TypeScript and Rust use a profile of jnterfaces. A profile is the set of tools, configs and recipes for one language. Go has no profile, so its lab joins the setup snippets of gsu.

A setup snippet is a short template file, for example a set of ignore rules or the recipes of a Justfile. The labs are examples, and they are not reference generators of projects. Use them to test the workflow in a new chat or in a clean project. Then delete the lab folders.

The repository has a live local end-to-end harness for the labs:

just language-profile-labs

The command makes four disposable repositories, for Python, TypeScript, Go and Rust. Python, TypeScript and Rust have a profile of jnterfaces, and Go has none. So the labs start in two ways:

The command does not make GitHub remotes or pull requests. The labs are setup profiles for languages, and they are not tutorials for the flow of a pull request.

Each lab must show these results:

Python, TypeScript and Rust

Each of these labs runs the steps of Start a Python, TypeScript or Rust project. In the commands, $jnterfaces is the clone that scripts/find_jnterfaces.sh finds:

git init
uv run "$jnterfaces/scripts/install_stack.py" --profile python --defaults typecheck
just fmt
just verify

Then each of these labs checks the commit gate of the tasker role:

  1. It adds a line that the lint of the profile fails on, and stages it.
  2. just check must fail at lint.
  3. A commit by a person must stop at the gate, with the message “no pass of just check for this tree”.
  4. It takes the line out. just check must pass, and the same commit must go through.

The profiles are jnprofile-python, jnprofile-typescript and jnprofile-rust. The lab writes no config of a tool, so a change to a profile shows up in the lab. Each lab differs in these ways:

  • Python. The lab adds the tool typecheck. The code is hello.py, and the test is tests/test_hello.py.
  • TypeScript. The lab adds the tool test. The code and the test are in src/. The test imports ./hello.js, the name that the build writes.
  • Rust. The lab is a library. It runs cargo init --lib --vcs none before the install, so cargo init names the package after the folder, hello-rust. It runs just setup first, to make Cargo.lock. Each item has a doc comment, because docstring-check fails on an item with none.

Go

Profile snippets:

  • templates/gitignore/base.gitignore
  • templates/gitignore/go.gitignore
  • templates/env/go.envrc
  • go.just, from the just skill of jnterfaces

Local state:

  • .local/go-build holds GOCACHE.
  • .local/go-mod holds GOMODCACHE.
  • .envrc can expose .local/bin, GOCACHE and GOMODCACHE.
  • go.mod pins the version of the Go language.
  • Commit go.sum when Go makes it.

The hello-world verification used these commands:

git -c init.defaultBranch=main init
gest init --local
direnv allow .
direnv exec . just verify

The lab copies go.just from the just skill of jnterfaces as its Justfile. Its recipes are fmt, lint, typecheck, build, test, docs, smoke and diff-check. verify depends on all of them except docs. The template holds the tool that each recipe runs.

Lesson: GOCACHE must be an absolute path. In a recipe of just, $PWD/.local/go-build gives that path. No profile covers Go, so the recipes of the template are the only recipes.

Add a profile for a new kind of project

When a new kind of project appears, gsu does these steps:

  1. It writes candidate snippets.
  2. It asks the user about each real choice of policy.
  3. It runs a disposable lab or a focused check of the setup.
  4. It moves the stable snippets into templates/.

These profiles are good candidates for the next labs:

  • Python machine learning with uv or pixi.
  • Python notebooks.
  • A browser UI in TypeScript, with spot checks in a browser.
  • Separate profiles for a Rust library and a Rust binary.
  • A Go service with generated OpenAPI or protobuf artifacts.