Skip to content

Codebase Map

This page is a contributor’s map of the jackin’ source tree. It is written for people who want to understand how jackin’ is built, debug its internals, or work on the project itself. If you only want to use jackin’, start at Concepts and the Operator Guide — you do not need this page.

PathWhat lives there
src/Rust CLI binary — every command jackin’ implements
docker/construct/Source for the shared base Docker image (projectjackin/construct:trixie)
docker/runtime/entrypoint.shThe entrypoint script jackin’ injects into every derived image at /jackin/runtime/entrypoint.sh
docs/This documentation site (Astro + Starlight)
.github/workflows/CI for jackin’, the construct image, and the docs site
tests/End-to-end and integration tests

Different contribution shapes have different natural entry points.

Start at src/cli/mod.rs — the top-level Cli and Command enum. Each subcommand has its own clap module:

SubcommandModule
load / hardline / consolesrc/cli/role.rs
rolesrc/cli/role.rs and src/role_authoring.rs
eject / purgesrc/cli/cleanup.rs
prunesrc/cli/prune.rs
workspacesrc/cli/workspace.rs
configsrc/cli/config.rs
exile (unit variant)src/cli/mod.rs
Bare jackin / console dispatchsrc/cli/dispatch.rs

Command dispatch lives in src/app/. Every clap subcommand has a match arm in src/app/mod.rs (run) that calls into the relevant domain module (workspace/, runtime/, config/, etc.). When you add a flag, also update the matching docs page under docs/src/content/docs/commands/.

”I want to change container lifecycle behaviour”

Section titled “”I want to change container lifecycle behaviour””

The container lifecycle lives in src/runtime/:

Instance-local state helpers live in src/instance/:

The end-to-end shape of “what happens when you run jackin load” is described in Architecture → Container lifecycle. The detailed contract for instance names, manifests, lookup indexes, restore decisions, cleanup guards, and parallel sessions lives in Runtime Instance Model.

”I want to change workspace or mount behaviour”

Section titled “”I want to change workspace or mount behaviour””

The workspace model is in src/workspace/:

Per-mount isolation (worktree / clone) lives in a separate module because it has its own materialization lifecycle:

”I want to change a config-file shape”

Section titled “”I want to change a config-file shape””

The TOML config model lives in src/config/:

Whenever a config field changes, also update Configuration File so the schema reference stays accurate.

”I want to change role-manifest behaviour”

Section titled “”I want to change role-manifest behaviour””

The jackin.role.toml schema, validator, migration chain, and role-authoring entrypoints live across a small set of files:

Whenever the manifest schema changes, also update Role Manifest.

”I want to change the operator console (TUI)”

Section titled “”I want to change the operator console (TUI)””

The interactive console lives in src/console/:

  • src/console/mod.rsrun_console entrypoint, event loop, and the quit-confirm overlay; per-screen drawing lives under src/console/manager/render/.
  • src/console/state.rsConsoleState and WorkspaceChoice.
  • src/console/preview.rs — workspace preview and detail lines.
  • src/console/manager/ — the workspace-manager TUI subsystem.
  • src/console/widgets/ — reusable modal and widget components.

General terminal-UI helpers (palette, intro/outro animation, prompt helpers) are split out into src/tui/.

A handful of files at the crate root own concerns that don’t cluster into a single module:

FileOwns
src/env_model.rsReserved-runtime-env list, is_reserved, interpolation reference extraction, topological env order with cycle detection.
src/env_resolver.rsRuntime env resolution — interpolation, interactive prompts.
src/selector.rsRole-selector parsing (agent-smith, chainargos/backend-engineer, …).
src/repo.rsRole-repo validation — required files, path-traversal checks.
src/repo_contract.rsEnforces that role Dockerfiles extend the construct base.
src/derived_image.rsGenerates the derived Dockerfile from the role’s repo + the construct base.
src/docker.rsDocker command builder — CommandRunner trait and ShellRunner.
src/paths.rsXDG-compliant data and config directory resolution (JackinPaths).

When a code change affects user-visible behaviour, the matching docs page must change in the same PR. The full table lives at the bottom of PROJECT_STRUCTURE.md; the most common pairings are:

Code change inUpdate docs in
src/cli/**Commands
src/workspace/** (mount logic)Workspaces, Mounts
src/config/**Configuration File
src/runtime/**Architecture, Runtime Instance Model
src/instance/**Runtime Instance Model
src/isolation/**Workspaces (per-mount isolation), Architecture (materialization + finalizer), Configuration File
src/manifest/**Role Manifest
src/instance/auth.rsAuthentication, Security Model
src/derived_image.rsConstruct Image
docker/construct/DockerfileConstruct Image

The docs site (this site) is an Astro + Starlight project under docs/. Bun is the only supported package manager.

PathPurpose
docs/astro.config.tsSite metadata, sidebar layout, edit-link target
docs/src/content/docs/All MDX content — file path maps to URL
docs/src/components/overrides/Starlight component overrides (Head, SiteTitle, …)
docs/src/pages/index.astroLanding route — plain Astro page, NOT a Starlight content entry

To run the site locally:

Terminal window
cd docs
bun install --frozen-lockfile
bun run dev # http://localhost:4321/

If you have not contributed before, these files are worth reading first:

  • AGENTS.md — house rules (apply equally to humans and agents).
  • CONTRIBUTING.md — contribution flow, DCO sign-off.
  • BRANCHING.md — branch naming and merge policy.
  • COMMITS.md — Conventional Commits format.
  • TESTING.md — how to run the test suite.
  • PROJECT_STRUCTURE.md — agent-facing pointer covering the multi-repo ecosystem and the per-PR docs contract; the detailed module map this page surfaces is the source of truth.

The Roadmap is the catalogue of in-flight and planned design work. When picking up a task, the matching roadmap entry usually has the problem statement, the chosen approach, and the related source files.