ShtukbaseStandard

Core

core · version 0.2.3
Corein Basic14 norms

What a page, a package and an action are, how a package and the lock are built, and which rules the tool that installs packages follows.

About the package

The core is three things: a page, a package and an action. This package explains them to a project and records, as norms, the rules that the tool shtuk follows.

The package puts:

  • /base/kernel.md — what a page, a package and an action are and what the tool does;
  • /base/package-format.md — the format of a package (package.md) and of the lock (.shtukbase/packages.lock);
  • /base/conventions.md — the page type Convention: how a base package says what packages of its kind give, expect and may change, and a health check that only informs; the field follows;
  • /norms/rules/core/CORE-R01.md … CORE-R14.md — fourteen norms of the tool, one per rule.

The package has no checks (the conventions of the base packages have their health checks in those packages). The enforcer of each norm is the tool's code and its test; they live in the tool's repository (apps/shtuk/src/, apps/shtuk/test/), not in the project. The norms are derived from the code and tests of tool version 0, nothing beyond them is invented.

Where the boundary is

  • Here: the core's concepts, the format of a package and the lock, the rules of install, update, version choice and check.
  • The norm collections themselves and the checks of norm form are the package norms-core. Without it the core's norm pages lie as ordinary pages.
  • The page /base/packages.md (the package list) is written by the tool; this package does not put it.

Norms 14

IDNormLevelModeEnforcer
CORE-R01
Install and update lay files. Package code runs then only if the package is from a trusted source and the code is its action marked on: install or on: update. The rest of the package code runs only by the commands check and run.
MUST blocks
check
shtuk:apps/shtuk/src/trust.ts
shtuk:apps/shtuk/src/cli.ts
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/src/check.ts
shtuk:apps/shtuk/test/install-scripts.test.ts
shtuk:apps/shtuk/test/e2e.test.ts
CORE-R02
A package writes only simple relative paths: no "..", no absolute path, no hidden folder (.git, .shtukbase, .github). The folders .git and .shtukbase inside a package are not read.
MUST blocks
check
shtuk:apps/shtuk/src/manifest.ts
shtuk:apps/shtuk/test/e2e.test.ts
CORE-R03
Install, init and update first build the whole plan and only then write. A refusal at any step leaves the project untouched. A trial run (--dry-run) is the same plan without writing.
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/src/cli.ts
shtuk:apps/shtuk/test/e2e.test.ts
CORE-R04
Every project path belongs to one package. An install where a package lays a page that another package already owns, or where two packages lay the same page, refuses entirely.
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/test/new-style.test.ts
CORE-R05
A page whose text in the project differs from the package text is not overwritten by the tool. It is recorded in the lock as edited and named in the report.
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/test/e2e.test.ts
CORE-R06
When a new version of a package is installed, a page that has not been touched in the project since the last install is replaced with the new text. An edited one stays as it is, and the report writes "kept N edited".
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/test/update.test.ts
CORE-R07
A page that is not in the new version of a package is deleted by the tool if it was not edited. An edited one it keeps, stops accounting for, and names in the report.
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/test/update.test.ts
CORE-R08
A page with the state removed in the lock is not laid again. A page that has simply gone (missing) is laid by the next install.
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/src/lock.ts
shtuk:apps/shtuk/test/e2e.test.ts
CORE-R09
Installing the same package of the same version writes nothing, even on another day. Pages keep the day of the first install.
MUST blocks
check
shtuk:apps/shtuk/src/install.ts
shtuk:apps/shtuk/test/e2e.test.ts
shtuk:apps/shtuk/test/new-style.test.ts
CORE-R10
There is no solver: every package gets the highest version that fits all the ranges asked of it. A yanked version is not taken. No suitable one — an error that names who asked for what. A dependency cycle is an error.
MUST blocks
check
shtuk:apps/shtuk/src/resolve.ts
shtuk:apps/shtuk/test/resolve.test.ts
CORE-R11
update without a package number gives every installed package the newest version that its recorded source offers and that the ranges of the packages requiring it allow. With a number — only that package. An install without update keeps the installed version while it still fits.
MUST blocks
check
shtuk:apps/shtuk/src/resolve.ts
shtuk:apps/shtuk/src/cli.ts
shtuk:apps/shtuk/test/update.test.ts
shtuk:apps/shtuk/test/resolve.test.ts
CORE-R12
If a package of the new kind includes (includes) a package that is in no source, install is an error. A missing requirement (requires) is also an error. Only for the old set (set) a vanished include is a warning.
MUST blocks
check
shtuk:apps/shtuk/src/resolve.ts
shtuk:apps/shtuk/test/new-style.test.ts
shtuk:apps/shtuk/test/resolve.test.ts
CORE-R13
A package copy in the registry whose tree hash does not match the one recorded in the registry's index.md is not installed.
MUST blocks
check
shtuk:apps/shtuk/src/source.ts
shtuk:apps/shtuk/test/e2e.test.ts
CORE-R14
shtuk check runs every action with check: true of every installed package from the project root. Code 0 — the norm holds, another code — it is broken; stdout lines are findings. A check that did not answer in 60 seconds has failed. If at least one has failed, shtuk check exits with code 1.
MUST blocks
check
shtuk:apps/shtuk/src/check.ts
shtuk:apps/shtuk/test/new-style.test.ts
shtuk:apps/shtuk/test/e2e.test.ts

"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.

Pages 17

They go into the project at these paths.

Package files 1

They go into .shtukbase/packages/core/; actions run from there.

icon.svg 429 B