Definitions
The genctl commands for definitions: `apply`, `types`, `schema`, `compat`, `definitions`.
apply
register definitions; —check-only checks them and stores nothing
genctl apply [-f <path|glob> ...] [--channel latest] [--check-only] [--json]
A batch is one logical change: all are validated before any is written, and a child that
exists only in the batch resolves against it. Identical bytes mint no new version, and the
line reports the move —channel made either way: new minted one, existing matched a
version already stored (how a revert lands), current moved nothing.
$<resolver>: leaves resolve first, on —check-only too. —json is the server’s answer.
Files: -f takes several values and stops at the next flag; with no -f, definitions: in
the nearest .genroc. An existing path is used literally, anything else is globbed (**
matches any depth). A directory is refused.
Flags
--channel channel to apply definitions to (default latest)
--check-only report whether the definitions are valid, registering nothing
-f definition file or glob; an existing path is never globbed.
Takes several, and repeats
--json print the server's answer: the inferred schemas under
--check-only, what was registered otherwise
--server genroc server base URL ($GENROC_SERVER) (default
http://localhost:8448)
types
write the type declarations a resolver’s scripts import
genctl types [-f <path|glob> ...]
Runs each phase-2 resolver in “types” mode and writes what it generates, so an editor has the declarations before an apply ever runs. Needs no server: the types are inferred here.
Files: -f takes several values and stops at the next flag; with no -f, definitions: in
the nearest .genroc. An existing path is used literally, anything else is globbed (**
matches any depth). A directory is refused.
Flags
-f definition file or glob; an existing path is never globbed.
Takes several, and repeats
schema
what a slot’s type is, and what an expression there can read
genctl schema type <process> [address] [-e <expression>] [-f <path|glob> ...] [--json]
genctl schema context <process> [address] [-e <expression>] [-f <path|glob> ...] [--json]
type is what shape a slot IS, context what an expression there may READ. Same
addresses — input, output, tasks.<id>.output, tasks.<id>.action.input, raises[“a.code”]
— and an address may continue into the schema; quote a non-identifier key:
tasks[“step one”].output. With no address, each lists every slot it answers for. -e types
one expression at that address. Neither needs a server.
Files: -f takes several values and stops at the next flag; with no -f, definitions: in
the nearest .genroc. An existing path is used literally, anything else is globbed (**
matches any depth). A directory is refused.
compat
compare two versions and report what a move would break
genctl compat --from <sel> [-f <path|glob> ...]
genctl compat --from <sel> --to <sel> [--process <name>] [--ignore contract] [--json]
genctl compat <instance-id> --to <version|channel>
A side is one channel OR name@version pins (a version may itself be a channel); mixing
the two is refused, and —from is never defaulted. With -f the local files are the target
side. An instance id names the from side by itself: compat <id> --to N is the question
upgrade <id> --to N answers by moving.
Exits non-zero on a break, so it drops into a pipeline. —ignore contract drops that one check from the exit code and nothing else — the break is still printed, as “(ignored)”.
Files: -f takes several values and stops at the next flag; with no -f, definitions: in
the nearest .genroc. An existing path is used literally, anything else is globbed (**
matches any depth). A directory is refused.
Flags
-f definition file or glob to compare against --from; takes
several, and repeats
--from the side instances are running now: a channel, or name@version
(repeatable). An instance id names this side by itself
--ignore excuse a check from the exit code: only `contract` is
accepted, since the upgrade check answers for rows this
deployment already owns. It changes neither what is compared
nor what is printed
--json print the raw report
--process narrow the report to one process
--server genroc server base URL ($GENROC_SERVER) (default
http://localhost:8448)
--to the side to compare against: a channel, or name@version
(repeatable); after an instance id, a bare version or channel
definitions
list registered definitions
genctl definitions [--sort created|name] [--since <when>] [--until <when>] [--json]
The one list whose cap keeps the FIRST N rather than the newest, since —sort name walks an alphabet rather than a history.
Oldest to newest, so the newest is nearest the prompt. No —limit: each list shows its newest N (20; logs 200) and says on stderr when that dropped rows. —since reaches further back — a duration (2h, 45m) or a timestamp — and —until is its far end; [since, until) is half-open. Times display in, and are read in, the local zone ($TZ).
Flags
--json print the raw items as a JSON array
--server genroc server base URL ($GENROC_SERVER) (default
http://localhost:8448)
--since read forward from this point: a duration back from now (2h,
45m) or a timestamp (2006-01-02, 2006-01-02 15:04)
--sort sort key: created (newest registered first) or name (default
created)
--until stop at this point (same forms as --since); on its own it
keeps the cap, giving the newest rows before that instant