What rulegen.py emits

.ini in, make rules out for contributors

At build time rulegen.py checks every section of one INI file, then prints a header, the group's download directory and four blocks of make rules per system - common, fetch, URL and boot - whose recipes call macros defined in mk/.

On the map: build time

▶ Watch this deck — 7 scenes, ~5 min

Worth seeing first

01 Five lines in, ninety-three out

GENERATED RULES 139 systems, about 90 lines of make each rulegen.py $ ./rulegen.py data/ubuntu.ini >data/050-ubuntu.gen.mk the Makefile, once per INI file [ubuntu-cloud-24.04.x86_64] URL=https://cloud-images.ubuntu.com/… SHA256SUMS=https://cloud-images… Arch=x86_64 Boot=efi Release=24.04 GARDEN_SYSTEMS += ubuntu-cloud-24.04.x86_64 ubuntu-cloud-24.04.x86_64.meta-data: ubuntu-cloud-24.04.x86_64.user-data: ubuntu-cloud-24.04.x86_64.run: …/ubuntu/ubuntu-cloud-24.04.x86_64.url: …/ubuntu/ubuntu-cloud-24.04.x86_64.filename: …/ubuntu/ubuntu-cloud-24.04.x86_64.qcow2: ubuntu-cloud-24.04.x86_64.qcow2: 93 lines for this system; build output, not in git
139 systems need about 90 lines of make each. The Makefile runs ./rulegen.py data/ubuntu.ini and saves its output as data/050-ubuntu.gen.mk. The five-line section of ubuntu-cloud-24.04.x86_64 becomes 93 lines of rules for its meta-data, user-data, launcher, .url, .filename, download and disk, all named after the system. The rule files are build output, not in git

At build time the Makefile runs ./rulegen.py data/ubuntu.ini >data/050-ubuntu.gen.mk. The five-line section of ubuntu-cloud-24.04.x86_64 becomes 93 lines of rules; all 139 systems give about 13,000.

The INI files describe 139 systems, and each one needs about ninety lines of make: rules for its cloud-init files, its download, its disk and its launcher. Nobody wants to write, or review, thirteen thousand lines like that. So rulegen.py writes them. When image-garden itself is built, the Makefile runs it once per INI file and saves what it prints as that distribution's rule file. Our system's section is five lines long. Out of it come ninety-three lines of rules, for files whose names all start with ubuntu-cloud-24.04.x86_64. The rule files are build output: they aren't in git, and you change them by changing the INI file or rulegen.py.

Details and sources

Details

  • The section is five keys under [ubuntu-cloud-24.04.x86_64] (ubuntu.ini:237-242).
  • The Makefile's pattern rule data/050-%.gen.mk: rulegen.py data/%.ini runs ./rulegen.py data/X.ini >data/050-X.gen.mk (Makefile:57-58). rulegen.py accepts several files and prints to standard output (rulegen.py:741-757).
  • Counted in a scratch build of the pinned commit: 93 lines from the system's GARDEN_SYSTEMS += line to the next system's; 13,135 lines in the thirteen data/050-*.gen.mk files for 139 systems; 5,224 of them in 050-ubuntu.gen.mk.
  • data/*.mk and image-garden.mk are in .gitignore (.gitignore:16-17). A checkout's copies may be older than the INI files; read rulegen.py and the INI files, or build them again.

Read more

02 Check everything, then print

THREE STEPS PER FILE [META] [ubuntu-cloud-14.04.x86_64] … [ubuntu-cloud-24.04.x86_64] … [ubuntu-cloud-26.10.ppc64el] data/ubuntu.ini 1 check every section URL or URLProgram, not both a known Arch, in the name a URL that names the Arch a checksum a Boot its Arch supports data/ubuntu.ini: error: Image 'ubuntu-cloud-24.04.x86_64' defines no checksum, use one of … 2 compare cache names 3 print every rule data/050-ubuntu.gen.mk a mistake anywhere in the file: no rules printed for it
data/ubuntu.ini goes through three steps. First every section is checked: URL or URLProgram, a known architecture contained in the name, a URL naming it, a checksum, a boot type the architecture supports; the first problem stops the run with data/ubuntu.ini: error: and a message naming the section. Second, the cached file names are compared. Third, all rules are printed into data/050-ubuntu.gen.mk. A file with a mistake gives no rules

Every section is read and checked before anything is printed: data/X.ini: error: … names the file and the section. Then the cached file names are compared. A file with a mistake gives no rules at all.

rulegen.py takes a file in three steps. First it reads every section and checks it: URL or URLProgram but not both, an architecture it knows and that the section's name contains, a URL that names that architecture, a checksum, and a boot type that architecture has rules for. The first problem ends the run, with the file's name, the word error, and a message naming the section. Next, it compares the cache file names the sections will use, so that no two images land on one file. Only then does it print, every rule of the file in one go. So for a file with a mistake in it, rulegen.py prints no rules at all.

Details and sources

Details

  • load_images reads the file and checks each section in this order: URL against URLProgram, the file-name keys, Arch (an architecture rulegen.py knows, contained in the section name), the architecture in the URL, the @URL@ placeholder, a checksum, then Boot, which must be one the architecture has rules for (rulegen.py:336-445, rulegen.py:300-333). Missing [META], Group, Variant or Arch are reported the same way, as are INI syntax errors (rulegen.py:280-297, rulegen.py:338-348). The architectures and boot types are the enums at rulegen.py:17-29.
  • main turns the generator into a list first, so every section is checked before any output; a ValueError becomes SystemExit("FILE: error: MESSAGE"), exit status 1 (rulegen.py:753-757). The message on the slide is the one for a section without a checksum, as tests/check-rulegen.sh expects it.
  • The second step collects the local file names known at build time, per group, and stops on the first one used twice (rulegen.py:758-775). It is reported the same way, without a traceback: data/X.ini: error: per-group local filename collision in group 'G': 'NAME' used by 'A' and 'B' (run on a two-section test file).
  • The third step prints the header, then the rules of every system in file order (rulegen.py:777-822).
  • Given several files, rulegen.py handles them one after the other, so the rules of earlier files are already printed when a later one fails. The Makefile gives it one file at a time.

Read more

03 Four blocks for every system

ONE RULE FILE, TOP TO BOTTOM header .RECIPEPREFIX=+ once per file group $(GARDEN_DL_DIR)/ubuntu: | $(GARDEN_DL_DIR) once per file common GARDEN_SYSTEMS += ubuntu-cloud-24.04.x86_64 all:: when GARDEN_ARCH is x86_64 ubuntu-cloud-24.04.x86_64.meta-data: ….user-data: clean:: fetch fetch: distclean:: .PRECIOUS: …/ubuntu/ubuntu-cloud-24.04.x86_64.qcow2: download-with-sha256sums, link URL …/ubuntu/ubuntu-cloud-24.04.x86_64.url: echo https://cloud-images.ubuntu.com/… …/ubuntu/ubuntu-cloud-24.04.x86_64.filename: echo noble-server-cloudimg-amd64.img boot Arch=x86_64, Boot=efi ubuntu-cloud-24.04.x86_64.run: ubuntu-cloud-24.04.x86_64.qcow2:
The rule file for data/ubuntu.ini, top to bottom: a header with .RECIPEPREFIX=+ and the rule for the download directory of the group, once per file; then for ubuntu-cloud-24.04.x86_64 the common block (GARDEN_SYSTEMS, all::, meta-data, user-data, clean), the fetch block (fetch, distclean, the verified download and its link), the .url and .filename rules, and the boot block for x86_64 and efi with the .run and .qcow2 rules

Per file: a header and the group's download directory. Per system: the common block, the fetch block, the .url and .filename rules, and the boot block, chosen by Arch and Boot.

Here's what it prints, in order. A header comes first, once per file, and a rule that makes the group's directory in the download cache. Then four blocks for each system. The common block adds the name to the list of systems, and to all when the architecture matches your machine, and writes the rules for the meta-data and user-data files and for clean. The fetch block makes the system's link in the cache from a verified download, with the helper its checksum key asks for. Next come the rules for the .url and .filename files. Last is the boot block, the disk and the launcher, picked by Arch and Boot.

Details and sources

Details

  • main prints ruleset_header, then for the first system ruleset_group, and for every system ruleset_common, ruleset_fetch_common, the .url rule (ruleset_fetch_direct or ruleset_fetch_prog), the .filename rule (ruleset_filename_static, _dynamic_basename or _dynamic_pattern) and the boot ruleset; ruleset_footer ends the file (rulegen.py:777-822).
  • Common (rulegen.py:452-478): GARDEN_SYSTEMS += NAME, which list-systems prints; all:: NAME.qcow2 NAME.run inside ifeq ($(GARDEN_ARCH),ARCH); NAME.meta-data and NAME.user-data from the templates, with the group, the upper-case group and the release; clean:: lines for the link, the disk, the launcher and the cloud-init files. The meta-data template gets the group and the release, so its local-hostname matches the user-data hostname.
  • Fetch (rulegen.py:480-518): fetch: for the host's architecture, distclean:: (the download, the link, .url and .filename), .PRECIOUS for the link, and the rule for $(GARDEN_DL_DIR)/GROUP/NAME.qcow2, which runs download-with-sha512sums, -sha256sum or -sha256sums and makes the link. All three are written inside nested ifneq tests on the checksum keys, so make keeps the first one that is set.
  • URL and file name (rulegen.py:520-591): see URLProgram and local file names.
  • Boot (rulegen.py:593-724): NAME.run and NAME.qcow2; which ruleset a system gets is in Architecture first, then boot type. Every combination rulegen.py accepts has a ruleset.
  • The group directory rule is printed once per file, for the first section, so every section of a file is expected to share one group, the file's [META] group (rulegen.py:778-780).
  • Every section on x86_64, aarch64, riscv64 and loongarch64 has a Boot that has a boot block: rulegen.py refuses a missing or unsupported one, so no system gets all:: for a .qcow2 without a rule to make it (rulegen.py:300-333).

Read more

04 Thin rules, macros in mk/

WHAT THE RULES CALL ubuntu-cloud-24.04.x86_64.run: … +$(call EMIT_QEMU_RUN_SCRIPT_QUERY_PREAMBLE,…) +$(call EMIT_QEMU_SYSTEM_X86_64_EFI_RUN_COMMAND,…) ubuntu-cloud-24.04.x86_64.qcow2: … +$(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,…) ubuntu-cloud-24.04.x86_64.user-data: … $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,UBUNTU,24.04) …/ubuntu/ubuntu-cloud-24.04.x86_64.qcow2: … +$(GARDEN_ITSELF) download-with-sha256sums … mk/010-qemu.mk mk/010-qemu-x86_64.mk the image-garden script rulegen.py fills in names; how a system boots is changed in mk/ rulegen.py changes for a new key in the sections or a new architecture
The generated rules of ubuntu-cloud-24.04.x86_64 call macros: the .run rule calls EMIT_QEMU_RUN_SCRIPT_QUERY_PREAMBLE and EMIT_QEMU_SYSTEM_X86_64_EFI_RUN_COMMAND, the .qcow2 rule QEMU_SYSTEM_X86_64_EFI_CMDLINE, the user-data rule PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR, and the download runs the image-garden script. The macros live in mk/010-qemu.mk and mk/010-qemu-x86_64.mk, so how a system boots is changed there, not in rulegen.py

Generated recipes call macros: EMIT_QEMU_RUN_SCRIPT_QUERY_PREAMBLE, EMIT_QEMU_SYSTEM_X86_64_EFI_RUN_COMMAND, QEMU_SYSTEM_X86_64_EFI_CMDLINE, PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR, and image-garden download-with-sha256sums. How a system boots is changed in mk/.

Look inside those rules and you'll find very little QEMU. The launcher rule calls two macros: one writes the query preamble, the other the command for an x86 machine with EFI. The disk rule calls the macro with that machine's command line. The user-data rule asks the template picker which template applies. The download calls image-garden itself. All of those live in the hand-written files in mk, or in the script. So rulegen.py mostly fills in names. To change how every EFI system on x86 boots, you edit the x86 QEMU makefile, not the generator. You touch rulegen.py when sections need a new key, or a new architecture needs rules of its own.

Details and sources

Details

  • The x86_64 EFI ruleset: the .run recipe calls EMIT_QEMU_RUN_SCRIPT_QUERY_PREAMBLE and EMIT_QEMU_SYSTEM_X86_64_EFI_RUN_COMMAND; the .qcow2 recipe runs $(QEMU_IMG) create and QEMU_SYSTEM_X86_64_EFI_CMDLINE with the seed attached (rulegen.py:593-610).
  • The macros are defined by hand: EMIT_QEMU_RUN_SCRIPT_QUERY_PREAMBLE (010-qemu.mk:57-57), CLOUD_INIT_META_DATA_TEMPLATE (010-qemu.mk:97-106), PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR (010-qemu.mk:293-298), QEMU_SYSTEM_X86_64_EFI_CMDLINE (010-qemu-x86_64.mk:13-13) and EMIT_QEMU_SYSTEM_X86_64_EFI_RUN_COMMAND (010-qemu-x86_64.mk:49-49). Each architecture has its own mk/010-qemu-ARCH.mk with the same set.
  • The user-data and meta-data rules pass the group, the upper-case group and the release to the templates (rulegen.py:460-471).
  • $(GARDEN_ITSELF) is the path of the image-garden script, which image-garden make passes to make; download-with-sha256sums is one of its commands (rulegen.py:510-514, image-garden:460-473).
  • Because the macros are expanded when make runs, an edit in mk/ reaches every generated system without running rulegen.py again; image-garden.mk still has to be rebuilt from the parts (how image-garden.mk is put together).
  • What rulegen.py decides itself: the target names, the prerequisites, which checksum helper and which boot ruleset, the ifeq on GARDEN_ARCH, the .url and .filename recipes.

05 Writing a ruleset

THREE KINDS OF ESCAPING in rulegen.py in the rule file what the shell runs {img.name}.run: ubuntu-cloud-24.04.x86_64.run: awk 'BEGIN {{ … awk 'BEGIN { … awk 'BEGIN { … name="$$(basename …)" name="$$(basename …)" name="$(basename …)" +mkdir -p $@ +mkdir -p $@ mkdir -p …/dl/ubuntu .RECIPEPREFIX=+ the rules of every system in the file .RECIPEPREFIX= header: + starts a recipe footer: tabs again
Three columns: the text in rulegen.py, the line in the rule file, and what the shell runs. {img.name}.run: becomes ubuntu-cloud-24.04.x86_64.run:. awk 'BEGIN {{ becomes awk 'BEGIN {. A doubled dollar stays doubled in the rule file and reaches the shell as one. A recipe line starting with + runs as a recipe because the header sets .RECIPEPREFIX=+, and the footer sets it back

Rulesets are str.format templates: {img.name} is a field, {{ and }} are braces, $$ is a dollar for the shell. Recipe lines start with + under .RECIPEPREFIX=+, which the footer resets.

If you change a block, you're editing a Python string that becomes a makefile, and three kinds of escaping meet in it. Fields in braces, such as the system's name, are filled in with str.format. So a brace you want in the output, like the ones awk needs, is written twice. A dollar sign meant for the shell is doubled as well, this time for make. And every recipe line starts with a plus sign, not a tab. The header sets .RECIPEPREFIX to plus, so the templates don't depend on tabs surviving in Python source. The footer sets it back, so whatever make reads next uses tabs again.

Details and sources

Details

  • Each ruleset is a module-level string printed with .format(img=img) or .format(group=…), so {img.name}, {img.group}, {img.arch} and the properties of Image are fields (rulegen.py:777-822).
  • Literal braces are doubled: the awk program of the .filename rule is written awk 'BEGIN {{ … }}', and "$${{META_DATA}}" becomes "$${META_DATA}" in the rule file and "${META_DATA}" for the shell (rulegen.py:460-471, rulegen.py:546-591).
  • $$ is make's escape for one $; $@, $<, $^ and $(…) are left single on purpose, for make. The row on the slide is from the .filename rule for a URLProgram without a pattern (rulegen.py:538-544); the +mkdir -p $@ row is the group directory rule (rulegen.py:447-450).
  • Values that come from the INI file and are quoted for the shell (LocalFilename, URLPattern, LocalFilenameTemplate) go through shlex.quote and have every $ doubled (rulegen.py:138-158). URL and URLProgram are pasted as they are, so they are written in make syntax in the INI file.
  • The header: "Set recipe prefix to the plus character. Rules are no longer sensitive to tabs." .RECIPEPREFIX=+; the footer: "Reset rules to use tabs." .RECIPEPREFIX= (rulegen.py:726-738). A continuation line of a recipe, such as the -drive lines of the provisioning boot, starts with spaces.
  • .RECIPEPREFIX needs GNU make 3.82 or later (derived, from GNU make's documentation).

Read more

06 Testing a change to rulegen.py

BEFORE YOU SEND IT $ make check-py mypy --strict rulegen.py … Success: no issues found in 4 source files $ make check-rulegen [META] Group=test Variant=cloud [test-cloud.x86_64] Arch=x86_64 Boot=efi URL=… rulegen.py expect a piece of the rules, or of the error message PASS: url-placeholder-sha256sums PASS: url-placeholder-twice PASS: no-checksum PASS: loongarch64-bad-url $ diff -u before/050-fedora.gen.mk data/050-fedora.gen.mk no output: unchanged
Three checks. make check-py runs mypy --strict and reports no issues. make check-rulegen writes a tiny INI file with one test-cloud.x86_64 section, runs rulegen.py and expects a fragment of the rules or of the error; it prints PASS lines such as PASS: no-checksum. Finally the rule files from before the change are compared with the new ones, and an untouched distribution shows no difference

make check-py runs mypy --strict; make check-rulegen runs tests/check-rulegen.sh, whose cases expect a fragment of the output or of the error. Comparing data/050-*.gen.mk before and after shows what the change did to each distribution.

Before you send a change to rulegen.py, run three checks from the top of the tree. make check-py runs mypy in strict mode over it, so every new field needs a type. make check-rulegen runs a shell script that writes tiny INI files, one test section each, runs rulegen.py on them, and expects either a piece of the rules or a piece of an error message. Each case prints PASS or FAIL. Add a case for every new key or message you introduce. And keep the rule files from before your change: build again and compare them. A distribution you didn't mean to touch should come out exactly the same.

Details and sources

Details

  • check-py runs mypy --strict on rulegen.py and three Python test helpers; check-rulegen runs tests/check-rulegen.sh; both are part of make check (Makefile:66-67, Makefile:88-100). Run in a scratch copy of the pinned commit, both passed: "Success: no issues found in 4 source files" and 38 PASS lines.
  • The script's helpers: write_ini NAME FIELD… writes [META] Group=test Variant=cloud and one [test-cloud.x86_64] section with Arch=x86_64, Boot=efi and the given fields; expect_ok NAME [PATTERN] wants rulegen.py to succeed with PATTERN, a fixed string, in its output; expect_error NAME PATTERN wants it to fail with PATTERN in the error and no Python traceback (tests/check-rulegen.sh:18-74).
  • The cases cover @URL@, a missing checksum, loongarch64, LocalFilename, URLPattern and LocalFilenameTemplate, the file-name clash, the [META] keys, Arch, Boot per architecture, a duplicate section and a missing file (tests/check-rulegen.sh:76-223).
  • The comparison is advice, not a target of the Makefile: copy data/050-*.gen.mk aside, rebuild with make image-garden.mk, and diff the files. The file name on the slide is an example.
  • The other checks of make check need more tools: shellcheck, the pkgproxy download tests, the allocate test, the rebase test and the unpack-lock test (Makefile:66-115).

Read more

07 Where to go from here

ROADS rulegen.py Boot types which boot block a system gets The target chain the files, in build order image-garden.mk generated and hand-written joined The .ini files every key of a section Checksums SHA256SUMS, SHA512SUMS, @URL@ URLProgram URLs that move
Six roads from this deck: boot types, the target chain, how image-garden.mk is assembled, the INI keys, checksums and URLProgram

Next: boot types, the target chain, how image-garden.mk is assembled, and the INI, checksum and URLProgram keys.

That's rulegen.py: it checks a whole file, then prints four blocks of thin rules for every system, and leaves the real work to macros in mk. The boot types deck shows which boot block a system gets. The target chain follows the files these rules make, in the order make builds them. To see how the rule files join the hand-written ones in image-garden.mk, take the assembly deck. And the INI, checksum and URLProgram decks explain the keys rulegen.py reads.

Details and sources

Details

  • The order of a rule file: header, group directory, then per system the common, fetch, URL and boot blocks, then the footer (rulegen.py:777-822).

Read more

Basis of the statements on this page

Read in rulegen.py, the Makefile, tests/check-rulegen.sh, mk/010-qemu.mk and mk/010-qemu-x86_64.mk of image-garden at the pinned commit ("code"). The line counts, the error messages and the test results come from running make image-garden.mk, make check-py, make check-rulegen and rulegen.py on small INI files in a scratch copy of that commit ("run"). Advice on comparing rule files, and the GNU make version for .RECIPEPREFIX, are not in the source ("derived").

Command line

./rulegen.py [--systems-meta FILE] FILE.ini...

ArgumentEffect
FILE.ini...checked one after the other; the rules of each are printed to standard output
--systems-meta FILEalso appends five variables per system to FILE; see how image-garden.mk is put together

The Makefile runs ./rulegen.py data/X.ini >data/050-X.gen.mk for each INI file, and ./rulegen.py --systems-meta data/000-systems.mk data/X.ini >/dev/null for each to build the metadata (Makefile:57-64).

What a rule file holds

BlockRulesetWhenMain targets
headerruleset_headeronce per file.RECIPEPREFIX=+
groupruleset_grouponce per file, from the first section$(GARDEN_DL_DIR)/GROUP
commonruleset_commonevery systemGARDEN_SYSTEMS, all::, NAME.meta-data, NAME.user-data, clean::
fetchruleset_fetch_commonevery systemfetch, distclean::, .PRECIOUS, $(GARDEN_DL_DIR)/GROUP/NAME.qcow2
URLruleset_fetch_direct or ruleset_fetch_progURL or URLProgram$(GARDEN_DL_DIR)/GROUP/NAME.url
file nameruleset_filename_static, _dynamic_basename or _dynamic_patternby the keys$(GARDEN_DL_DIR)/GROUP/NAME.filename
bootruleset_x86_64_efi, _x86_64_bios, _aarch64_efi, _riscv64_efi, _loongarch64_efi, ruleset_s390x, ruleset_ppc64by Arch and BootNAME.run, NAME.qcow2
footerruleset_footeronce per file.RECIPEPREFIX=

Sources: rulegen.py:447-738, rulegen.py:777-822. Which boot ruleset each combination gets is tabled in boot types.

Sizes

Lines
rules for ubuntu-cloud-24.04.x86_6493
data/050-ubuntu.gen.mk (56 systems)5,224
all thirteen data/050-*.gen.mk (139 systems)13,135
data/000-systems.mk847
image-garden.mk15,889

How errors are reported

ProblemOutput
a mistake in the data: a missing or wrong key, an unknown Arch or Boot, a Boot the architecture lacks, two sections with one static cache file name, an INI syntax error, a missing filedata/X.ini: error: MESSAGE, exit status 1, no traceback
a lone % in a valuea Python traceback ending in configparser.InterpolationSyntaxError

When the Makefile runs it, make then deletes the empty data/050-X.gen.mk (.DELETE_ON_ERROR, Makefile:16-18) and the next make runs rulegen.py again.

The messages for each key are listed in the .ini files in data/ and URLProgram and local file names.

The macros the rules call

Macro or commandDefined inCalled from
CLOUD_INIT_META_DATA_TEMPLATEmk/010-qemu.mkNAME.meta-data
PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FORmk/010-qemu.mkNAME.user-data
GARDEN_LOG_SECTION, GARDEN_LOG_SUBSECTION, GARDEN_SYMLINKmk/000-garden.mkmost recipes
image-garden download-with-…the image-garden scriptthe download rule
EMIT_QEMU_RUN_SCRIPT_QUERY_PREAMBLEmk/010-qemu.mkNAME.run
EMIT_QEMU_SYSTEM_ARCH_…_RUN_COMMAND, QEMU_SYSTEM_ARCH_…_CMDLINEmk/010-qemu-ARCH.mkNAME.run, NAME.qcow2
QEMU_IMG, QEMU_IMG_SIZEmk/010-qemu.mkNAME.qcow2

Roads from here

ARCHITECTURES · machines and firmware

  • Boot types — which boot block a system gets for its Arch and Boot

RUNTIME · make rules and the CLI

BUILD TIME · data and rules