@@ -9,14 +9,16 @@ contracts used by the built-in modules.
99` main.go ` builds an ` internal.Engine ` with:
1010
1111- a ` Runtime ` , which stores recipe root, home directory, environment access,
12- stdio, and whether the current run is interactive;
12+ runtime environment overrides, stdio, color preference, and whether the current
13+ run is interactive;
1314- an entrypoint, normally ` BOOT.star ` ;
1415- a list of modules, each exposed as a Starlark module.
1516
1617` Engine.Load ` executes the entrypoint with predeclared globals:
1718
1819- ` task(...) ` registers a task;
1920- ` fail(message) ` stops recipe evaluation;
21+ - ` host() ` returns host/runtime metadata for top-level branching;
2022- each Go module appears under its module name, such as ` fs ` or ` pkg ` .
2123
2224Top-level Starlark should only register tasks and choose machine profiles. Host
@@ -25,8 +27,8 @@ mutation belongs in task functions through module actions.
2527## Tasks and Actions
2628
2729A task is a named Starlark callable. When the engine runs a task, it attaches
28- the task to the Starlark thread with ` SetTask ` . Module functions validate
29- ` InTask (thread)` and call ` AddAction(thread, Action{...}) ` .
30+ the task to the Starlark thread with ` SetTask ` . Module functions call
31+ ` RequireTask (thread, b )` and then ` AddAction(thread, Action{...}) ` .
3032
3133An ` Action ` has:
3234
@@ -59,16 +61,18 @@ that emits one idempotent action over a general-purpose command wrapper.
5961
6062Module function checklist:
6163
62- - Require task context for functions that emit actions.
64+ - Require task context for functions that emit actions with ` boot.RequireTask ` .
6365- Parse arguments with ` starlark.UnpackArgs ` .
6466- Resolve recipe inputs with ` Runtime.ResolveSource ` .
6567- Resolve host targets with ` Runtime.ResolveTarget ` .
66- - Use ` Runtime.ExpandHome ` or ` Runtime.Hostname ` rather than duplicating that
67- logic.
68+ - Use ` Runtime.ExpandHome ` , ` Runtime.Hostname ` , ` Runtime.EnvValue ` , and
69+ ` Runtime.SetEnv ` rather than duplicating that logic.
6870- Do not mutate the host while registering actions.
6971- In dry-run, perform enough checks to decide skip/change but do not write.
70- - Include command output in returned errors; use ` boot.CommandError ` when it
71- fits.
72+ - Include command output in returned errors; prefer ` boot.RunCommand ` ,
73+ ` boot.RunCmd ` , ` boot.CommandOutput ` , or ` boot.CommandError ` .
74+ - Use ` boot.Output ` and ` boot.BulletList ` for user-visible check details.
75+ - Validate Starlark file modes with ` boot.FileMode ` .
7276- Keep successful JSON or textual output minimal; noisy reporting belongs in
7377 explicit check modules.
7478
@@ -93,6 +97,10 @@ Use `--json` when another program needs stable output. JSON runs intentionally
9397use a simpler sequential execution path so action results are ordered and easy
9498to consume.
9599
100+ Task selection is strict: if ` -only ` , ` -skip ` , or ` -tag ` leaves a selected task
101+ without one of its declared dependencies, selection fails instead of silently
102+ ignoring the missing dependency.
103+
96104When debugging command execution, prefer fake commands in a temporary ` PATH `
97105inside tests. See the ` packages ` , ` systemd ` , and ` rescue ` tests for examples.
98106
0 commit comments