ShtukbaseStandard

Core

Page, package and action: the three concepts of the core, and how the rest is built on them.

A project is a folder of files. The core has three concepts.

A page is a project file, usually Markdown with a YAML header. Everything the project knows and has decided lies in pages.

A package is a folder with pages and actions. It puts its pages into the project and brings its actions. A package can require other packages (requires) and include them (includes). The format is on the page Package and lock format.

An action is a package file that can be run. An action marked check: true is a check: it says whether a norm holds. An action marked on: install or on: update is a step after install or update; it runs by itself, only if the package is from a trusted source. Lenses, the server and other commands are also actions of their packages.

What the tool does

Packages are installed by a small tool, shtuk. It has no project norms or checks: all of that lies in packages. The commands:

  • shtuk install <source> — installs a package with everything it requires and includes;
  • shtuk update [<package>] — raises packages to the newest versions the ranges allow;
  • shtuk list — what is installed, which version, from where and in what state the pages are;
  • shtuk check — runs all the checks of the installed packages;
  • shtuk run <package> <action> — runs one action;
  • shtuk init <folder> --blueprint <source> — a new project from a blueprint.

A source is a package folder, a git address or a package number in the catalog (the registry).

The tool's rules

The rules the tool follows are written as the norms CORE-R01 … CORE-R14 in /norms/rules/core/. The main ones:

  • at install only the code of a trusted package runs, and only its actions with on;
  • the tool does not overwrite an edited page but reports it;
  • at update an untouched page is replaced, an edited one stays;
  • every project path has one owner package;
  • first a plan, then a write: a refusal spoils nothing.

The enforcer of these norms is the tool's code and its test. They live in the tool's repository, not in the project, so there are no paths to them in the project.

Where things lie

  • .shtukbase/packages.lock — the lock: which packages are installed and whose pages are whose;
  • .shtukbase/packages/<id>/ — the package's files except pages: its actions are run from here;
  • /base/packages.md — the package list for people; the table is written by the tool.
This page is built from apps/standard/packages/core/pages/base/kernel.md.Source text