Dokumentation · Arkitektur og beslutninger
Packaging and setup – Build specification: prebuilt images, the setup in the browser, the results' outward form
Status: version 1.3, 26 November 2026. Written by worker elo-a5-packaging-setup-roadmap (Claude · Fable) on
the brief orchestration/tasks/a5-packaging-setup-roadmap.md, after the owner asked whether the install needs
60 GB, whether a non-technician can make it, whether the setup can be a page and the product one package
(docs/roadmap.md, the steps R1 and R2). Version 1.1 applies the first part of the static read,
reviews/build/A5-agy-r1.md (six findings, on R1), with the lead's rulings (orchestration/tasks/a5f-fixes.md)
and the owner's answers to the two questions of version 1; the last section says what was done. Version 1.2
applies its second part, A5-agy-r2a.md and A5-agy-r2b.md (twelve findings, on R2 and the outward form), with
the rulings of orchestration/tasks/a5f2-fixes.md. Version 1.3 applies the re-read of §2.4 and of B101's row as
fixed, reviews/build/A5-agy-reread.md (five findings), with the lead's rulings of the same hour. B104 corrects one placement (the last row of the closing table): import-state is a command of admin.
Precedence. docs/architecture/phase-1.md, phase-2.md and municipality-method.md stay the specification
of everything they describe; this document adds to them and changes only the sentences listed in §7. Where it
differs from docs/architecture/solution.md (its B23, B24 and its administration page), this document wins for
an install on one machine, and solution.md §8 stays the design of the shared install (§3.10).
0. Reading guide
Who reads what. Every builder: §0, §1, §8. Then the sections named in the epic's row of §5.2. The owner:
docs/roadmap.md, and §6 here.
Conventions. Those of phase-2.md §0: "§2" is a section of this document, "P1 §12.1" of phase-1.md,
"P2 §6.3" of phase-2.md, "MM §3.2" of municipality-method.md, "S §8.1" of solution.md, "ops §7.7" of
docs/operations.md. R0 to R6 are the steps of docs/roadmap.md; a research document is cited by its file
name here, never as "R1". [code] marks a statement about the code as it is on integ/m5b at 2bfd466,
read for this document. [M26] marks a measurement the lead made on the owner's stack on 26 November 2026
(orchestration/ROSTER.md, the entry of 14:03): sizes of the install, never a figure of the data.
[TBC] marks a statement about a tool or a service outside this repository that nobody verified for this
document (no network address was called, nothing was run): the epic named beside it measures it, and until then
nothing is built on it that cannot be changed. "The repository install" is today's: a checkout, make up, the
state in data/state/. "The packaged install" is R1's: Docker, one Compose file, no checkout. Epics are B100 to
B104 (R1), B110 to B114 (R2) and B120 (the outward form); migrations start at 0390.
The decisions that are built in. The owner's "ok" of 26 November to the lead's recommendation: prebuilt, versioned images first (R1); the setup in the browser (R2) and the outward form of the results specified meanwhile; login, Azure and Fabric planned when there is a concrete user. The owner's answers of 26 November to the two questions of version 1 (§6): the first user is the owner, with a company login of about 50 metering points, on Windows or under WSL; the source is not public to start with, and the images reach a user as a file. So Linux is R1's first platform (§2.8), and the file is the one way of distribution that is built (§2.2).
The rules that are not reopened. One request to Eloverblik in flight, the pace and its invariants (P1 §5.2);
one worker (P1 §1.2); the token in the worker alone (P1 §12.1); the API reads and never calls out (P1 §1.2);
nothing derived is stored (P1 §9.1, ADR-004); what may leave the database (docs/queries.md); no municipality of
a real account in the repository (MM §0). Each decision below says which of these it leans on.
1. Scope, and what is not built
| # | What | Section |
|---|---|---|
| K1 | A release: a version, four images for two architectures, one Compose file, handed over as a folder of files, built by one command | §2.1, §2.2 |
| K2 | The packaged install: Docker alone on the user's machine, one command to start, no bind mount of the host | §2.3, §2.4 |
| K3 | The commands a user still needs, from the image; the update; what the machine needs | §2.5 to §2.8 |
| K4 | The setup lane: the one place a browser can change the install, and what guards it on one machine | §3.1 to §3.4 |
| K5 | A token, the first loads, the settings and a renewal as pages; a removal prepared in a page and made by a command | §3.5 to §3.8 |
| K6 | The outward form of the results: relations, keys, units, a rule of change, a test | §4 |
| Not built | Why |
|---|---|
| An installer, a tray application, a bundled Docker runtime; Windows without WSL (R3) | The first install outside the Mac is under WSL2 (§2.8, §6). An installer is built only if a user appears who cannot use WSL |
| A push to a registry | The images reach a user as a file (§6). The registry's way is specified in §2.2 and not built |
| A faster overview at 50 metering points | The precondition of the first company install, in the API's lane: docs/roadmap.md §2. §3.6 says what of R2 leans on it |
| Login, sessions of named users, roles, TLS, the sealed token store, row-level security, audit events (R4) | P2 §6.1: needed only when somebody else than the owner looks or the stack leaves loopback. §3.10 names what R2 leaves for it |
| Anything for Azure or Fabric (R5, R6): a deployment, an export job, a semantic model | Planned with a concrete user (docs/roadmap.md §3). §4 fixes the form an export would write, and builds none |
| The repository install changed | The owner's own install, the capture (P1 §6.4, §12.2) and every developer command stay as they are; the packaged install is a second way to start the same services |
| The capture and its replay in the packaged install | The capture keeps the owner's 2021 (ops §7): a token made later has nothing to keep that the worker's first load does not read. It is why the state can leave the host (§2.4) |
| Passwords of the database roles per install | Today they are public values of deploy/dev.env [code], and what protects the database is that no port of it is published. That holds for the packaged install on one machine and is said plainly in §2.3; it ends with R4 |
| A backup job, a restore page | A command (§2.6). P1 §1.2 has no backup job, and this document adds none |
| The demo as a button of the first-run page | A database holds the demo's data or an account's, never both (the loader refuses, docs/stack.md); the way from one to the other is a purge. The demo stays two commands (§2.5) |
A page for set-price-area, refetch, withdraw-day | Not asked. They are commands of the image in R1 (§2.5) and candidates for a later page |
2. R1: prebuilt images
What installing takes today (ops §1, §7.2): git, uv, pnpm, Node and make beside Docker, a checkout
under the home directory, a build of the web app and of two images on the user's machine, and make for every
command. R1 takes all of it off the user's machine but Docker.
2.1 A release
Decision: a release is a tag vX.Y.Z on main, and the version is the tag's and no file's. The six
version fields of the workspace say 0.0.0 [code] and stay so. Reason: six fields can disagree with each
other and with the tag, and the tag is the one name a registry, a file and a user's question ("which version do
I run?") share. The build takes the version and the commit as arguments and puts them where each is asked:
| Where | What |
|---|---|
| Each image | The labels org.opencontainers.image.version, .revision (the commit) and .created; LICENSE, NOTICE and THIRD_PARTY.md under /licenses/ |
| The API | The version is in the image's environment and read by elo_api's settings: meta.context gains product.version, which the pages show in their footer; an image built without a version says 0.0.0+<commit> and the pages say "udviklingsversion" |
| The worker | One log line at its start, and elo version (§2.5) |
| The release's Compose file | The product's images by tag (§2.2, §2.3) |
| Number | May hold | So a user can |
|---|---|---|
Z (patch) | Fixes. No migration, no change of a variable or a volume of the Compose file, no change of the outward form (§4.4) | Go back to the patch before by starting its file |
Y (minor) | Migrations (forward-only, P1 §1.2), new variables with defaults, additions to the outward form | Go forward only; the way back is a backup (§2.6) |
X (major) | What a user must act on beyond a new file and the same command: a variable or volume removed or renamed, a new major of the outward form | Read the release's note first |
Before 1.0.0 the numbers are 0.Y.Z and Y has the freedom of a major; the release's note says when it uses
it. A test holds the patch rule: for a tag with Z above 0, the migration head and the generated Compose
file, image references aside, equal those of vX.Y.0.
What is built where and when. One command, make release VERSION=X.Y.Z, in a checkout of the tag with a
clean tree. It needs Docker with buildx and the repository's own tools, and nothing of the web tool chain on the
host: the web app is built in a stage of its image. It builds the four images of §2.2 for linux/amd64 and
linux/arm64, starts the generated Compose file from those images and runs the stack check in its release mode
against them (deploy/smoke.py, B100), and writes the release's folder (§2.2). It pushes nothing: the registry's
way is not built. A workflow runs it when a tag v* is pushed, never on a push to main; the lead may run
the same command on a machine when CI cannot (the roster: CI stops at the account's spending limit), and a label
of the images says which of the two built them. A tag is made only on a commit whose whole check passed. **[TBC,
B100]** whether CI builds arm64 natively or by emulation, and what either costs in minutes.
2.2 The images, what each holds, and how they reach a user
| Image | Built from | Takes the place of |
|---|---|---|
elo-api | services/api/Dockerfile [code], made two-stage | The build of api and migrate |
elo-worker | services/worker/Dockerfile [code], made two-stage | The build of worker; the host's tools for the commands of §2.5 |
elo-web | A new Dockerfile: a Node stage that builds web/apps/elo-web, then caddy:2.11.9-alpine | The image caddy and its two bind mounts [code] |
elo-demo | elo-worker, with the generator and the demo's loader on top | make demo-load's mounts of the checkout (fixtures/, tools/src) [code]. Only the demo uses it (§2.5) |
postgres:18.7-alpine3.24 stays its publisher's image, named by tag and digest in the release's file and pulled
from its publisher. An image has the tag X.Y.Z, which is never moved, and no latest: with it nobody can say
which version runs, and a start becomes a migration nobody asked for.
**Decision: B100 says file by file what an image holds, and a test fails on an image that lacks one or holds what
it must not (A5v-r1-02).** Today both Dockerfiles copy the whole Python workspace, tools/ included, and leave
uv in the image, and .dockerignore admits only that workspace [code]: the licence files, the web and the
factors' fixtures cannot reach a build at all.
| Image | Holds | Why |
|---|---|---|
| Every image | /licenses/LICENSE, /licenses/NOTICE, /licenses/THIRD_PARTY.md | It is handed to somebody else: Apache-2.0 §4, and the notices of what it carries |
elo-api | The virtual environment with elo_api and what it depends on, installed as packages and not as a checkout; the migrations (services/api/migrations/); the named queries (inside the package) | migrate and the API run from it. The build stage holds uv and the workspace; the final stage holds neither |
elo-worker | The virtual environment with elo_worker and what it depends on (elo_api among them [code]: the roles' bootstrap); the modules B102 moves out of elo_devtools (§2.5) | The worker and the one-shot commands run from it |
elo-web | Caddy, deploy/Caddyfile, the web build with its own licenses/ (the notices of notice-inventory.toml [code]), the update page (§2.6) | No path of the host is mounted |
elo-demo | What elo-worker holds, elo_devtools (the generator synth, demo_load), fixtures/factors/ | demo-load needs all three, and no other image should carry a generator |
| No image holds | Held by |
|---|---|
A file named .env*, a directory data, secrets or state, at any depth | .dockerignore: the three patterns gain **/, since the web's and the fixtures' trees are now admitted; and the test |
orchestration/, reviews/, docs/, .git, tests, node_modules, tools/ (but elo-demo), uv | The final stages copy what the table above names and nothing else; and the test |
The test lists each built image's files (docker export of a container made from it, never started) and compares
them with the two tables. .dockerignore stays a list of what is admitted [code], B100's to change: the three
licence files, web/, the Node workspace's four files, fixtures/factors/.
For the lead, with docs/legal/: what this document proposes for an image that is handed out. The three
files above in every image; the web's notices in elo-web; and, written at the release into /licenses/, the list
of the base image's packages with their versions (dpkg-query in the Python images, apk info in elo-web), with
one sentence in THIRD_PARTY.md that names the three base images, their publishers and where each publishes its
sources. Whether that sentence is enough for the copyleft packages of a base image, or a written offer is owed, is
the lead's ruling; B100 builds what is ruled and no image leaves before it.
**Decision: the images reach a user as a file (the owner's answer of 26 November, §6). The registry's way stays specified and is not built.**
| As a file: built by B100 | Through a registry: specified, not built | |
|---|---|---|
| What the release is | A folder: compose.yaml, elo.sh (§2.5), demo.env, SHA256SUMS, NOTE.md, and per architecture elo-images-X.Y.Z-<arch>.tar.gz (docker save of the three images) and elo-demo-X.Y.Z-<arch>.tar.gz | compose.yaml, elo.sh, SHA256SUMS, the note |
| What a user does with it | One command: docker load -i elo-images-X.Y.Z-<arch>.tar.gz; then the start (§2.3) | Nothing: the start pulls. With a private registry, a docker login with a token first [TBC] |
| How the file names the images | By name and tag, with pull_policy: never: a missing image is an error that says to load the file, never a pull of a name somebody else may hold on a public registry | By registry, name, tag and digest |
| How its integrity is told | SHA256SUMS holds the sum of every file of the folder and, per image, the identifier it must have once loaded. The owner sends one line beside the files, by another way than they travelled: the sum of SHA256SUMS itself. The user compares that line by eye with sha256sum SHA256SUMS, then sha256sum -c SHA256SUMS; ./elo.sh load does both steps' second half and compares the loaded images' identifiers | The digests in the Compose file; the Compose file by its sum |
| How an update is announced | By the sender, to the users the sender named. The product asks nobody whether a newer version exists (it would be a call to an address it does not call today). The pages' footer and elo version say which version runs; NOTE.md says what changed, whether a migration is in it, and what a user must do | The same: a registry is not asked either |
| When it is the better way | A few named users; nothing to run, nothing public | Several users who update often: the lead's recommendation of 26 November. Public images are a public source (§6) |
Signing the images is not built.
2.3 The one Compose file and the one command
**Decision: one source. deploy/compose.yaml stays the definition of the stack; the release's compose.yaml is
generated from it (python -m elo_devtools.release compose) by exactly the differences of the table below, and
a test fails on a difference the table does not list.** Rejected: an override file (the user then holds two
files and an order); a second file written by hand (it drifts, and the stack check would test another stack
than the one released).
| Where | The repository install [code] | The packaged install | Why |
|---|---|---|---|
api, migrate, worker | build: | image: <name>:X.Y.Z with pull_policy: never (§2.2) | Nothing is built on the user's machine |
caddy | The image caddy, with the Caddyfile and web/apps/elo-web/dist bound in; depends_on: api | The image elo-web, no mount; no depends_on (B103), and one more mount: the named volume update, read only (B103f, below) | No path of the host. Compose stops the dependents of a service it recreates before it runs migrate (measured), so a caddy that waited for api would be down during an update and could not show the update page (§2.6) |
The volume update | – (the same top-level volume in deploy/compose.yaml: both installs) | A tmpfs, uid=65534,mode=0755 (nobody, the API image's user, which migrate runs as), mounted read-write in migrate and read-only in caddy. It holds one file at most, failed.html, a fixed page with migrate's own refusal sentence (never a log line); ./elo.sh purge removes it, and a backup never holds it | B103f: the web server cannot otherwise know that migrate refused or failed, and would say "updating" for ever (§2.6) |
| The worker's state | A bind of data/state/, made and checked by make up | The named volume elo_state at /data/state | §2.4 |
| The worker's user | ${ELO_UID}:${ELO_GID}, the host user's | The image's own user, a fixed UID that is not 0 | §2.4 |
ELO_STATE_MOUNT | enforcing or passthrough, found by make up | volume | §2.4 |
restart: | None on the worker | unless-stopped on postgres, api, worker, web; "no" on migrate | §2.4: the stack returns with Docker |
| The roles' passwords | --env-file deploy/dev.env | The same public values as defaults in the file | One file. They are not secrets (§1): no port of the database is published |
Two one-shot services, tools and admin | – | Both the image elo-worker, under the profile tools, with the state volume. tools has the worker's database role. admin alone has what migrate has, ELO_ADMIN_DATABASE_URL and the owner's password. Both depend on postgres being healthy, so that Compose starts the database for a command that asks it, and neither on migrate nor on the worker | §2.5 (A5v-r1-04) |
A one-shot service demo-load | – | The image elo-demo, under the profile demo, with both roles as admin | §2.5 |
What the table does not hold, on purpose (A5v-r1-01, A5v-r1-02). The token's variable stays where it is: under
environment: of worker alone [code]. The names stay as they are: name: elo, and the worker's container
${COMPOSE_PROJECT_NAME:-elo}-worker [code], so that the demo is a second project as it is today. A second
folder with the same file is therefore the same install, not a second one, and the guide says so.
Decision: R1 changes nothing about how a token enters. The first account's token is the one line of .env,
now beside the Compose file, which Compose reads from its own folder; a further account's is a file written by
token-add (§2.5). The account env, the worker's test of the variable before it opens tokens/ and the
runtime's first account [code] are untouched by R1: they change in the epic that brings the page, B111, with
the conversion of the account env (§3.5). Reason: taking the variable away in R1 would leave a packaged
install that reads no token at all until an epic of R2 has merged.
What R1 keeps of .env, and what it loses | Detail |
|---|---|
| Kept | One line, ELOVERBLIK_REFRESH_TOKEN=<the token>, mode 0600, written by the printf line of ops §1; nothing else in the file |
| Lost: Compose's output is no longer hidden | make hides Compose's output wherever .env is read, because Compose quotes a line it cannot parse (B02bx-01). A plain docker compose command shows it. elo.sh asks Compose first, with the token blanked and the answer hidden, as the recipes do [code], and the guide's own commands for anything but the start go through it. What is left is a .env broken by hand and a start typed plainly: said in the guide, and ended by B111 |
Lost: make doctor's look at .env | ./elo.sh doctor looks at it on the host: that it is a regular file of mode 0600 with one line that begins with the variable's name. It prints what it found and never a character of the file (§2.5) |
| Where the folder lies | On a file system that has modes: under WSL the Linux file system, never /mnt/c (§2.8) |
What a user does:
- Installs Docker and starts it (§2.8).
2. Puts the release's folder in place and loads the images:
docker load -i elo-images-X.Y.Z-<arch>.tar.gz. 3. Writes the token's line into.envin that folder (ops §1), mode 0600. 4. Typesdocker compose up -d: the one command. It migrates and starts; the pages are athttp://elo.localhost:8080.
A setting (ops §2) is a variable of the shell that types the start, as today's first way: ELO_PORT=8081 docker compose up -d. Every start installs what it is given (B92's rule, unchanged), so a start typed without the
variable installs the default again; a setting that stays without a shell is B112's (§3.7).
2.4 The start guards without the Makefile
make up does five things before a container starts (docs/stack.md) [code]: it lets one launch run at a
time, it checks a directory of the host that a container cannot judge, it proves the mount, it hands the worker
a ticket that is good for one start, and it stops a worker whose directory it has just refused. All five exist
because the worker's secrets live in a directory of the host (P1 §5.2, N9). That directory is on the host
for one reason: the capture tool runs on the host and shares the egress with the worker (P1 §5.2, A3x-03).
**Decision: in the packaged install the state is a named volume, elo_state, mounted by the worker and, while
one runs, by a one-shot command of §2.5, and by no service that listens. No path of the host holds the state,
so there is no host half, no mount check and no ticket: docker compose up -d is the supported start, and so
is a restart.** Reasons: the packaged install has no capture (§1), so nothing on the host shares the state;
N9's rule, that a secret never lives where another user can write, is then kept by where Docker keeps a volume
(on Linux under Docker's own directory, which is root's; on macOS and Windows inside Docker's VM, at no path of
the host [TBC, B101]) instead of by a check of modes; and a start that needs no launcher is the only one a
user with Docker alone can make. Rejected: a launcher that the start depends on (the start must work typed
plainly); a container with Docker's socket (it would hold root's power over the machine: **no container gets the
socket**, A5v-r1-04); the bind mount kept and the checks dropped (the secret would sit in a directory nothing
judges). The first account's token is still a line of .env in R1 (§2.3): that file is the one secret the host
holds until B111.
| Guard today [code] | What it is for | In the packaged install |
|---|---|---|
up_guard: one make up at a time | Two launches each revoked the other's ticket (B19v-05) | No ticket, so nothing to revoke. Two docker compose up -d at once: Compose's own behaviour; the criterion is that the stack ends healthy with one worker or the second command fails, and never two workers that call (B101 measures which) |
up_guard: a project name only .env sets | The recipe and Compose addressed two projects (B19v-12) | Nothing addresses the stack but Compose, which reads the name from one place |
The host half of the start check; ELO_UID, ELO_GID; the refusal of UID 0 | The owner, the modes, the links and the ACLs of data/state/ and of every directory above it (N9) | No directory of the host. The worker runs as the image's own fixed user, which is not root; the image holds /data/state as that user's, mode 0700, and an empty volume takes that over [TBC, B101]. The worker's half stays, and on a volume it is the stricter check (A5v2-05): at every start, at /data/state and everything under it, every directory is 0700 and every file 0600, the worker's user's, a regular file has one link, no link is followed, and tokens/ is looked at whether or not a token is configured; it refuses with the path and the fault. Nothing on a volume needs a group. What the host directory's check keeps [code]: no write bit for group or others on a directory or a file that holds no secret (a checkout's own directories above the state may be 0755), 0600 on a token's file, the owner, no link, no ACL, every directory up to the repository's root; and tokens/ looked at when a token is configured. New in both (A5v-r1-06): the link count, which the directory's check never looked at [code] (statedir._judge); only the ticket's did, and the ticket goes |
The mount check (enforcing or passthrough) | Whether the container can see the host's owner of a file | A third kind, ELO_STATE_MOUNT=volume: the worker's half as on an enforcing mount, and no ticket asked. Taken here: in this kind the worker also reads its own mount table and refuses a /data/state that is a bind of a host path [TBC, B101: whether a container can tell that dependably on Linux and in a VM; where it cannot, the report says so and the claim below is the narrower one] |
| The start ticket, its 120 seconds, the revocations | A start without a host check just before it is refused (the launch contract) | None. What the ticket also gave, that a second worker started by hand refuses, is kept by the next decision |
| The worker stopped before the ticket; stopped again when the directory is refused | A secret is not left in use in a directory just judged unsafe | The worker judges its volume itself at its start and exits before any call, lock or file |
The egress ownership (egress/lock/, the handoff record) | One mode calls at a time, and the next continues the pace of the last (P4) | In the volume, and taken over only as the next decision says |
| The refusal while an account's removal did not finish (its journal) | The worker would make the removed account anew from its token files (B75) | The worker reads the journal at its start itself: an account whose journal is there is not made, and elo status and the log say what make up says today |
.env.local's reader; Compose's output hidden wherever .env is read | A setting never arrives as a token, and a token's line is never quoted | .env.local has no counterpart in R1 (§2.3). The settings are validated where they are installed, by migrate, as today. The hiding is elo.sh's for the commands it runs, and lost for a command typed plainly (§2.3) |
**Decision: one worker, by a lock in the database that the egress rests on (A5v-r1-05, A5v2-01, A5v2-02). The lock and the egress are one mechanism: who does not hold the lock cannot reserve a call, and who takes the lock over waits longer than the longest call its predecessor can still have in flight.**
| Step | Rule |
|---|---|
| Which connection | The lock is a session advisory lock, elo.worker, on the pace store's own connection: the one persistent connection through which every reservation and every completion of an Eloverblik call goes [code] (PostgresPaceStore). Not a connection of its own: a lock that could be lost while the reserving connection lived is the fault the first read found |
| Who makes it, and when (A5v2-01) | __main__ makes the pace store and takes the lock, at every start, whether or not a token is configured, and hands the store to the runtime when one is built. Today the store is made inside the runtime, and only when the variable is set [code] (runtime.py): a worker without a token (the demo, a start before the capture, a packaged stack before its .env) would hold no lock while it runs the scheduler and the lane of Energi Data Service, and a removal or a move would find the lock free beside it |
| The order at a start | 1. The check of the state, and of its home (below). 2. The lock: a process that cannot take it starts neither lane, runs no job, makes no call, is not healthy, says once a minute that another worker holds the lock, and takes it when it is free. 3. Then both lanes and the scheduler; the worker is healthy from here. The egress is taken as today, by the main loop, with the rule of takeover below: while it is another mode's (the capture's) or the wait runs, no Eloverblik call is made and the other jobs run, as today (P1 §5.2) |
| While it runs | The main loop asks the lock's connection at every poll (5 s by default [code]), also when no call is due. A worker that finds it gone stops: a database that restarted under an idle worker leaves it without the lock for a poll at most, not for as long as it lives |
| Before each call | A call is reserved on that connection (P1 §5.2 step 2). After the wait for its start, the worker asks that connection once more whether it holds the lock; a connection that is gone answers neither, and the call is not sent. Then the clock is read again, immediately before the request is handed to the HTTP library: where more than 2 seconds have passed since the lock's answer, the question is asked again, and so on until an answer is fresh. A stop of the process or a sleep of the machine between the answer and the send shows as such a gap |
| Which clock | A clock of the process that only moves forward and counts the time a stopped process and a sleeping machine lose: on Linux, where the worker always runs, the boot-time clock. Never the wall clock, and never the database's. Measured by B101 and its two reads (27 November 2026): inside a VM it need not count the host's sleep (on Colima the boot-time clock and the monotonic clock did not differ after six days with sleeps of the host). Where it does not, what holds instead is that the worker, its successor and PostgreSQL run under one kernel, so their clocks and the database's sessions stop and go on together, and a call that outlasts a sleep does so while its worker still holds the lock. This would not hold for a database outside the worker's VM, which no install kind of this document has. WSL2's behaviour under the host's sleep remains for the platform walk [TBC, platform walk] |
| How long a call lasts | 130 seconds at most, from the send to the answer or the giving up, on that clock: the connect timeout of 10 s and the read timeout of 120 s [code] as one deadline of the whole call. Today the 120 s are a limit of each read and bound no call (a slow answer in pieces can outlast any wait) |
| A worker that loses the lock | It reserves nothing further (it cannot). The one call that may be on the wire ends by its answer or its deadline. It then exits without touching the egress: it does not release the lock directory and does not write the handoff record, which are its successor's now. In the packaged install the restart policy starts it again, as a process that waits at step 2; in the repository install it stays down until make up, and make status says that no worker runs |
| What the successor waits for | The lock; and then, when the egress's owner record is still there (its predecessor did not stop gracefully), 150 seconds on its own clock from the moment it took the lock before it takes the egress over: longer than the longest call and the gap a check may have (130 s + 2 s). After the wait, the takeover with the recovery of P1 §5.2 step 0 (an unrecorded completion costs a full spacing). A predecessor that stopped gracefully released the egress itself: no record, no wait |
Egress._may_take_over | For the worker's mode it answers yes today without a test [code] ("exactly one worker container exists"). It becomes: this process holds elo.worker (asked of the store), and the owner record is gone or 150 s have passed on the clock since the lock was taken. The capture's mode is as it was |
| A worker cut off without its session ending | PostgreSQL then still shows the lock held: the successor waits longer, and the cut-off worker cannot reserve. The safe side |
The residual, said plainly (A5v2-02). A check and a send are two steps and cannot be made one. **One call that was already decided may leave after the lock is lost**: where the process is stopped, or the machine sleeps, in the instant between the last reading of the clock and the write to the socket, for longer than its successor's 150 s, and loses its session meanwhile. It is one call, once: the worker that sent it cannot reserve another and exits when the call ends; nothing records its answer; the successor's own recovery spaces its next call. Nothing in the process can see that instant, so nothing here claims to close it. The bound is tested with a clock the test moves: a check answered, the clock moved 3 s, the lock is asked again and, the connection gone, nothing is sent; moved 1 s, the call is sent on the first answer; the takeover is refused 149 s after the lock and allowed at 150 s; a jump of the wall clock changes neither.
Reason for a lock at all: today the proof that a predecessor has stopped is the fixed container name plus the
ticket (P1 §5.2, "A lock left by a crash"); without the ticket, docker compose run worker would be a second
worker that believes itself the first. The container's name stays as it is. **The repository install takes the
same lock and the same rule of takeover** (one rule for both); its ticket stays. The one-shot commands that must
run without a worker (account-remove, restore-prepare, import-state, adopt-state) take the same lock for
as long as they work: a worker running refuses them, and a worker started meanwhile waits at step 2.
The state has one home, and moves once (A5v-r1-06, A5v2-03). An install that exists, the owner's first, has
its state in data/state/ and its database in the volume elo_pgdata; the packaged file started on the same
Docker would meet that database with an empty volume, and a make up afterwards would run a second egress on
the same pace.
| Rule | Detail |
|---|---|
| The database says where the state is | One row, ingest.state_home: host or volume, and since when |
| What the migration that brings the row writes (A5v2-03) | host, for a database that already holds an install: an account, a stored request, a job or a capture's import. That is the home every such database has today. A database made new by the same run of migrate holds none of these and gets no row; the first worker that starts on it writes its own kind. So a packaged worker that is the first to start on an existing database finds host, and refuses; it never writes volume over an empty volume, and never marks a stored account absent. A dump of an earlier version, restored and migrated, is such a database |
| A worker whose kind is not the row's | Makes no call, runs no job, takes no lock, marks no account absent, and says the sentence that names the way out, in its log and in the status: on host, "this install's state is in a directory of the host: move it with ./elo.sh import-state"; on volume, "… is in the volume elo_state since …: start it with docker compose up -d". A worker of a bind kind then exits, and make up fails with that line. A worker of the kind volume stays, asks the row once a minute and goes on by itself when it says volume: Docker would otherwise restart it in a loop |
token-add | make token-add refuses on volume, tools token-add on host, each with the sentence above: a token written to the home the worker does not read would be lost, and one written into the volume before the move would make the move refuse |
| The move | Four steps, which ./elo.sh import-state <checkout> types in the release's folder (§2.5 says what each needs running): 1. make down in the checkout: the worker releases the egress and writes the handoff record. 2. docker compose run --rm migrate: Compose starts the database for it, the schema comes to the release's head (the row is then there, and says host), and no worker is started. 3. make -s -C <checkout> export-state piped into docker compose run --rm -T admin import-state. No bind mount: the host's files are read by the host's user, and the volume's are written by the image's. import-state is a command of admin, not of tools (B104: the worker's role may select and insert ingest.state_home and cannot change it, B101, so that no running worker can flip the row; the row is set by the owner's role). 4. docker compose up -d |
What export-state checks | The host half of the start check as make up runs it, the link count included; that no worker runs and no owner record, ticket or claim is left; that no account's removal is unfinished (it says to finish it first); that tokens/ holds no entry that is not a file of a label (a stopped write's temporary name, an editor's copy: any of them may hold a token), each named as the worker names it, never by a name that could be an identifier (ops §7.7). It writes nothing and changes nothing |
| What is carried | Every account's three files of tokens/, the first account's access token, the handoff record egress/pace.json (the pace continues, P4). Not the capture's access token (the capture stays the checkout's) |
What import-state checks | It holds elo.worker, on the session that sets the row, and asks that session before and after each step that changes anything and before each file (a lost session stops it, the written files left for the same line). It reads the row first and refuses when the row says volume, then when the volume holds anything that is not a part of the same archive (both exist). The archive ends in a member that counts the others, so an export that failed is refused whole. Each member of the archive is a directory or a regular file of a known name and the mode it had (0700, 0600), within a size; a link or anything else refuses the whole. It reads the archive in memory and writes with the worker's own writers, compares each file with the archive byte for byte, and sets the row to volume last |
| Lossless, and once | An import stopped before its end is finished by the same line: it then accepts a volume that holds exactly a part of the same archive, and the temporary names its own stopped write left, which it removes; nothing else. (B104f) The same archive is a fact the volume holds: an import record (.elo-import.record: the archive's SHA-256 and the member list, no content), written under an operating-system lock (flock on .elo-import.lock, held from before the first change to after the row is set, which survives the loss of the database session and which the packaged worker's start refuses while it is held) before any member, and removed last; every resume needs the same hash. adopt-state takes the same lock and refuses while a record or a stopped write is there, without the handoff, or without an account's <label>.token and <label>.json. ./elo.sh import-state first asks (admin import-state --check) and refuses a move already made before it stops anything. After the row is volume, data/state/ is left as it is, for the owner to delete; make up refuses on the row; the way back is not built |
| A restore over a state that has moved | A restore changes the database and not the state (§2.6). A dump made before the move says host, or after migration is given host, while this install's state is in the volume: the worker refuses, and the move refuses because the volume is not empty. docker compose run --rm admin adopt-state is the way out: under the lock, it shows the accounts of the database and the files of the volume, refuses unless every account of the database has its files in the volume (so that none would be marked absent), asks for the word volume typed, and sets the row |
.env | Copied by hand to the release's folder, mode 0600: the same token on the same machine for the same database (ops §7.1's rule is about two machines) |
What is claimed, and what is not. That the supported start puts no state at a path of the host; that the
worker refuses a volume whose entries are not its own and private; that at most one worker of an install has a
call in flight, by whatever route a second is started and however the first loses its database, **but for the
one call of the residual above**; that a database is never served by two states. Not claimed, as today
(docs/stack.md, "What the check cannot see"): anything against the machine's owner. Whoever may run Docker can
read a volume and .env, edit the Compose file or mount the state elsewhere; on Linux that is every member of
the group docker. The install guide says this to the user in these words (B103): docs/stack.md is a
checkout's, and a packaged user has none.
After a restart of the machine the stack returns when Docker does, by the restart policy, with no command and
no login item: make autostart has no counterpart. Docker's daemon restarts containers one by one and does not
wait for the database as Compose does [TBC, B101]: the API and the worker must come up against a database
that is not ready yet, which is a criterion of B101, not an assumption.
2.5 The commands a user still needs
**Decision: the image of the worker carries one command, elo, and every command has one place where it has the
role and the files it needs (A5v-r1-03, A5v-r1-04).** Four places, and no container among them has Docker's
socket:
| Place | Has | Has not |
|---|---|---|
The running worker: docker compose exec worker elo … | The worker's database role, the state, what the worker holds in memory | The owner's role |
tools: docker compose run --rm tools … | The worker's role, the state. Compose starts the database for it when it is down; it waits for neither migrate nor the worker. doctor alone is run without the database (--no-deps), since it must answer when the database cannot start | The owner's role |
admin: docker compose run --rm admin … | The owner's credentials, as migrate has them [code], and the state. It starts the database if it is down and never migrate | – |
The host: a command of Docker typed whole, or ./elo.sh <name>, which types the same commands in order | Docker | Any knowledge of the product: the script holds an order and no rule |
What stops and starts the worker is done on the host, never from inside a container. A command that needs the
worker stopped does not stop it: it takes the lock elo.worker (§2.4), which a running worker holds, and refuses
while it cannot. The stop before it and the start after it are the host's two commands, which elo.sh types
around it.
elo.sh is a file of the release in the POSIX shell, for Linux, WSL2 and macOS; a machine without a shell
types the commands the guide prints beside each of its names. It asks Compose whether it can read the
configuration, with the token blanked and the answer hidden, before any command whose output it shows (§2.3);
it prints no character of .env. It is tested where the stack check runs, under the shell CI's Linux has and
under macOS's, and holds no step of one system alone (§2.8).
The modules behind make status, refetch, probe-window are in the worker's package already [code];
those of token-add, account-remove, doctor and the reader of the state are in elo_devtools on the host
[code] and move to where the image runs them, one implementation for both installs. Where a module asks
Docker today (account-remove inspects the worker's container and reaches the database through docker compose exec postgres psql [code]), the packaged install asks the lock and connects to the database directly; the
repository install keeps its own questions and gains the lock.
make target | In the packaged install | Where, and why there |
|---|---|---|
up | docker compose up -d | The host |
down | docker compose stop (or down: the volumes stay) | The host |
status | docker compose exec worker elo status: the same text, the same exit codes (0, 3, 1). With the worker stopped, tools status says what can be read without it and that the worker does not run | The worker: it reads what the worker holds |
doctor | ./elo.sh doctor: on the host, .env as §2.3 has it, Docker's and Compose's versions, the images' identifiers against SHA256SUMS, and the last line migrate refused with, read from docker compose logs migrate as the recipe reads it today [code]; then tools doctor: Docker's memory and free disk against §2.7, the architecture, the clock against the database's when it answers, the state's home, an account's removal that did not finish | The host for what only the host can see (the file, the logs); tools for the rest, run with --no-deps |
token-add | ./elo.sh token-add --label … --party … [--company …]: tools token-add with the token on standard input alone and every refusal of ops §7.7, then docker compose restart worker | tools: the state, and the journal's question of the database with the worker's role |
account-remove | ./elo.sh account-remove --label …: docker compose stop worker; admin account-remove, which holds the lock from its first check to its last file, asks, takes the label typed again, writes the journal, removes as the owner's role and makes the statistics anew (ops §7.8); docker compose start worker | admin: ops.remove_account is the owner's alone [code]. That a worker runs it knows by the lock, by the egress's owner record in the volume and, in its transaction, by a job's row locked by a claim, as today |
verify, withdraw-day, set-price-area, unset-price-area | docker compose run --rm admin <the same name> … | admin: the four functions are the owner's, and the worker must not be able to withdraw a day by itself (P1 §4.3, R4) [code]. elo calls the same four functions as the SQL files of deploy/sql/ do, as elo_owner, and prints what they print; the files and the make targets stay |
refetch, probe-window | docker compose exec worker elo <the same name> … | The worker, as today [code] |
purge | ./elo.sh purge: the question again ("type purge"), then docker compose down, docker volume rm elo_pgdata, and the sentence that names an account's removal that did not finish, with the one command that ends it (admin account-remove, which then has no database to change, ops §7.8). Typed whole, the two commands of Docker ask nothing. docker compose down --volumes removes the state as well, tokens included; the guide names it once, as that, and never as the way to stop | The host: nothing inside the stack deletes the volume it runs on |
autostart, autostart-off | Nothing: the restart policy (§2.4) | – |
demo | A second project, as today: docker compose --env-file demo.env up -d, then docker compose --env-file demo.env run --rm demo-load. demo.env holds the project's name (elo-demo), ELO_DEMO=1 and a port, and no token | demo-load: the image elo-demo (§2.2). The loader also removes the one price area that make demo-load removes through psql today [code], as the owner's role, in both installs |
| – | ./elo.sh backup <file>, ./elo.sh restore <file> (§2.6); ./elo.sh load (§2.2); elo version | §2.6 |
| – | ./elo.sh import-state <checkout>: the four steps of the move (§2.4), make export-state in the checkout and admin import-state among them; admin adopt-state after a restore (§2.4) | The host's user reads the directory; admin writes the volume and sets the row, with the owner's role (the worker's role cannot change the row); the same for the row's change after a restore |
capture, load-capture, validate, stack-check, the developers' targets | Not in the packaged install (§1) | – |
What each command needs running, what starts it, and what it says when it is not there (A5v2-04). No command that asks the database is left to find it down:
| Command | Needs | What starts it | When it is not there |
|---|---|---|---|
tools doctor | Nothing: it is run with --no-deps | – | It names each part it could not look at (the database does not answer) and never says "nothing to fix" over one |
exec worker elo … (status, refetch, probe-window, setup-code) | The worker running | docker compose up -d | Docker's own line that the service does not run; the guide then names tools status |
tools status, tools token-add | The database, at the release's schema (the home's row, an unfinished removal) | Compose starts the database. The schema is the last start's | "the database is at an earlier version than this release: docker compose run --rm migrate", and nothing is written. After token-add the script restarts the worker where one ran, and says so where none did |
admin account-remove | The database at the release's schema; the worker stopped | Compose starts the database. The script types docker compose stop worker before and docker compose start worker after: only a worker that ran before is started, and migrate does not run again (a second run would install the settings of a shell that has none, §2.3) | A worker that runs: refused by the lock, with the line that says to stop it. The schema: the line above |
admin verify, withdraw-day, set-price-area, unset-price-area | The database at the release's schema | Compose starts the database | The line above |
make export-state | Nothing of Docker. The checkout's stack stopped | – | A worker that runs, or an owner record left: refused, with the line that says make down |
docker compose run --rm migrate (the move's second step) | The database | Compose starts it: migrate depends on it [code] | – |
admin import-state, admin adopt-state | The database at the release's schema; nobody holding elo.worker | The step before (migrate) left the database running at that schema | No row's table: the line above. A worker that waits on the home's row holds no lock and is no obstacle (§2.4) |
admin restore-prepare | The database, empty and not migrated | Compose starts it on the new volume; admin waits for no migrate | A schema of the product's: refused (§2.6) |
pg_dump and pg_restore in the database's container | That container running | For backup the script says the line when it is not (docker compose up -d postgres starts the database alone); for restore, step 3 started it | The line |
demo-load | The demo's stack up and migrated | The demo's first command; the service waits for migrate to have completed | – |
Rejected: external volumes, which docker compose down --volumes cannot remove. They would protect the
database from the one flag every tutorial shows, at the price of two commands before the first start. The guide
never prints the flag as a way to stop, and a backup is one command.
2.6 The update
**Decision: the dump and the restore are made by the database's own container, which holds pg_dump and
pg_restore of exactly its version; the product's images hold neither.** ./elo.sh backup and restore type
the commands below in order (A5v-r1-05).
| Step of an update | What happens | What the user sees |
|---|---|---|
1. ./elo.sh backup elo-backup.dump | docker compose exec -T postgres pg_dump -U elo -Fc elo, into the user's file. It holds the readings and no token (neither .env nor the state volume is in it) | A file. The guide says why: an install's database becomes the only copy of the years the API no longer gives (ops §1) |
2. The new release's folder in place of the old, .env kept; docker load -i of its image file | – | – |
3. docker compose up -d | Compose stops the worker, the API and the web server's old container (the worker's grace period of 150 s lets a call end and the pace be handed over), runs migrate, starts the rest; caddy has no depends_on in the release's file, so the new one is up while migrate runs | While migrate runs, the pages answer one static page, "Eloverblik opdateres" (status 503, Retry-After: 5, a refresh every five seconds), served by elo-web itself: its Caddyfile asks the API's /healthz before it serves the document and answers the page where the API is not there (the API's paths answer a JSON of the same status); then the pages, with the new version in the footer. When migrate refuses or fails it leaves /update/failed.html (B103f): the web server then shows that page, with the refusal's sentence and no refresh, in place of "updating"; migrate removes it when it starts, and it is gone with the volume's last container |
| 4. Afterwards | docker image rm of the old release's three images frees them (B103: docker image prune removes dangling images only, and a replaced tag is not one) | – |
Step of a restore (./elo.sh restore <file>) | Why |
|---|---|
| (before 1) | B103: the file is looked at (a backup of ./elo.sh backup: not empty, a custom-format dump) and the volume elo_pgdata listed before anything is stopped or run: docker compose run makes every volume of the project that is not there (B104), and a refusal that has stopped the stack has changed something |
1. docker compose down | No worker, no API |
2. It refuses unless the volume elo_pgdata is absent (the user removes it: the purge of §2.5), and says so | A restore is into an empty volume, and nothing here deletes a database unasked |
3. docker compose run --rm admin restore-prepare | admin depends on the database alone, so Compose starts postgres on a new, empty volume and not migrate. The command takes elo.worker (a worker that runs anywhere on this database refuses it), refuses a database that holds any schema that is not public or the system's (the product's own, migration included) or any table or function in public (B103f), and makes the three roles on the connection that holds the lock, with the lock asked after every changing statement (B103f) as migrate's first step makes them [code] (elo_api.db.bootstrap): a dump names its owners. B103: it makes no schema (the dump holds CREATE SCHEMA migration, and pg_restore --exit-on-error stops on one that exists) and sets the owner's password and a throwaway one for the two others: migrate sets all three at step 5 |
4. docker compose exec -T postgres pg_restore -U elo -d elo --exit-on-error --single-transaction < <file> | The database's own tool; B103 adds --single-transaction: a failure leaves the database holding nothing, so this line can be typed again (not ./elo.sh restore, which refuses from step 3 on: the volume is there (B103f)). The ways back after a failed step, which the script prints and a test types: after step 3, ./elo.sh purge then ./elo.sh restore; after step 4, steps 4 and 5 typed whole, or the same |
5. docker compose up -d | migrate brings an older dump forward, or refuses a newer one by the rule below; then the stack |
6. Only where the worker then refuses on the state's home: docker compose run --rm admin adopt-state | The dump says, or is given, a home that is no longer this install's (§2.4) |
| Rule | Detail |
|---|---|
| Forward only | A minor's migrations cannot be undone (P1 §1.2). migrate refuses a database that a newer release has started on: a head it does not know, or a product version of a later minor in the row it keeps (ops.product_version: the highest version that has started on this database; a minor without a migration shares its predecessor's head, so the head alone would let it be undone). One line that names both versions; nothing is changed; the API and the worker then do not start |
| A patch | No migration (§2.1), and migrate lets a lower patch of the same minor start: the file of the patch before starts on the same database |
One migrate at a time (B103f) | migrate takes the advisory lock elo.migrate on a session of the superuser's URL before it reads anything and holds it to the end: a second one (docker compose run --rm migrate, a demo-load's depends_on) waits (the first's work is then done and it finds the head there) and refuses with a sentence after 900 s (ELO_MIGRATE_LOCK_WAIT_S). The first connection is tried for 30 s |
| The version's row (B103f) | Written in the transaction of the last migration (on_version_apply in migrations/env.py), so that a database never stands at a head that no row explains; a start with nothing to apply writes it after the settings |
| A development version | 0.0.0 and 0.0.0+<commit> (a checkout, an image built without a version) are no release (B103): the head is compared, the row is neither compared nor recorded, so make up in a checkout still starts on a database that a release has started on, as long as the head is known |
| A failed migration | migrate exits, nothing else starts, ./elo.sh doctor repeats its one line. The way back is the old folder and a restore |
| What is not built | An automatic update, a check for a newer version (§2.2), a scheduled backup |
2.7 Disk and memory
| What | Measured [M26] | What it means for a packaged install |
|---|---|---|
| The database | 896 MB: fx 740 MB (the grid's mix 623 MB, the factors 107 MB), raw 75 MB, ts 40 MB | Most of it is the same for every install: the factors and the mix of two price areas from 2021, whatever the install holds. The transmission mix adds 0.5 to 1 GB (MM §3.3). An install's own data are small beside it; at 420 generated roots over six years the database was 4.13 GiB and its volume 5.5 GB (ADR-004 §8). The first company install, about 50 metering points (§6), lies between the two: B103 says where, from a generated organisation of that size |
| The images | About 1.3 GB | Loaded once; the file that carries them is smaller by its compression (B100 reports both). An update holds two versions until the old one is pruned |
| In use in the Docker VM | 5.3 GB, with the layers and the cache of the builds | Less: nothing is built. B103 measures it |
| The VM's disk file | 40 GB: it grew to its ceiling when the VM filled on 25 November and does not shrink | The ceiling is a setting of Docker, not a need of the product. 60 GB (ops §1) was the allowance of a machine that builds |
| Memory | Not measured per container. The project's VM has 6 GB and has carried the stack and the builds (orchestration/WORKERS.md); ops §1 says 8 | B103 measures the five containers at rest and during the first loads. shm_size: 1gb is a ceiling of PostgreSQL's shared memory, not memory in use. Under WSL2 the ceiling is the VM's (§2.8) |
The requirement the guide states: 20 GB of disk and 6 GB of memory for Docker, as the owner's guide says
since 26 November [M26], until B103 has measured a packaged install; its figures, with a margin, then take
their place in the guide and in elo doctor.
2.8 Linux and WSL2 first, macOS, and what is not known about Windows
The first install outside the owner's Mac is a Linux install inside WSL2 (the owner's answer, §6). So Linux is R1's first platform, not its second, and three things hold on Linux from R1's first epic:
| What | Where it is held |
|---|---|
The images exist for linux/amd64 and linux/arm64 | B100. The owner's Windows machine and the Linux laptop offered for the trial are x86-64; the Mac and its VMs are arm64. An image built for one alone would pass every trial on the Mac and fail on the first real install |
| A volume's ownership on Linux | B101's first criterion, measured on Linux: CI's runners are Linux, where a mount enforces owners (N9), which the Mac's VM does not |
No step of one system in the one command, the guide or elo.sh | No Colima, no DOCKER_CONTEXT, no Homebrew, no clipboard command; the script in the POSIX shell, run under CI's Linux shell and under macOS's. B104's and B103's criteria |
| Platform | What is known | What is not |
|---|---|---|
| Linux | Docker Engine with the Compose plugin; the user in the group docker (ops §1). The packaged install asks nothing of the host but Docker and a shell, and the stack returns at boot with Docker's service, without a login. B96 (running; orchestration/tasks/b96-linux-trial.md) makes the repository install on a Linux VM, with generated data, and corrects the guide | The packaged install on a real Linux host: B103's trial, on B96's VM (arm64) and on the x86-64 laptop the owner offered. An init for the worker (ops §7.5) |
| WSL2 | It is a Linux kernel with a Linux userland: what a Linux machine shows is most of what it will show. B96 writes the checklist of the rest | Everything on that checklist, each "to try on Windows": Docker Desktop's integration against Docker Engine inside the distribution; systemd on or off; the folder on the Linux file system against /mnt/c, where a file has no modes (§2.3); how a Windows browser reaches the stack, and the name elo.localhost (the pages also answer on localhost [code]); the clock after the laptop slept (the schedule and the pace read a clock, P1 §5.2); whether WSL stops when its last terminal closes: the worker is the scheduler and must run; the VM's memory ceiling; the start at login. The owner walks it on the Windows machine with the packaged install: R3's first part (docs/roadmap.md) |
| macOS | The repository install runs under Colima (ops §1). The packaged install has no bind mount, so the rule that the checkout lies under the home directory (ops §1) and the pass-through mount (N9) have no object | Docker Desktop was never used by this project: its terms for an organisation [TBC], whether it starts at login by default [TBC]. Colima needs Homebrew and does not start at login by itself [TBC]. The DNS workaround of ops §7.4 concerns the first pull, which is PostgreSQL's image |
| Windows without WSL | Nothing has been run, and nothing is planned: an installer for it is built only if a user appears who cannot use WSL (docs/roadmap.md, R3) | Everything. elo.sh does not run there; the guide's plain commands would |
3. R2: the setup in the browser
3.1 What changes, and the rule
Today the pages can change nothing [code]: the API has two routes, the health check and the named queries, which read; its role can write to no table; a token arrives as a file, a setting as a variable, a removal as a command. So the worst a hostile page, a second user of the machine or a fault in the web app can do is read. R2 adds the first requests that change the install, and that is the whole of its risk.
| Who | What they could do without a guard | What stops it (§3.3, §3.4) |
|---|---|---|
| A page of another origin, open in the owner's browser (a forged request, or a name rebound to loopback) | Post a token of its own choosing, change which municipalities are named to Energi Data Service | The Host allowlist; the Origin; a request that is never a "simple" one; and above all the session, which a browser never sends by itself |
| Another program or user of the same machine: loopback is every local user's | The same, with any header it likes | The session: it begins with a code that only someone who may run Docker can read |
| The owner's own browser, later and unattended; a script injected into the pages | Use a session that is still alive | The session's short life; nothing the lane can do removes data (§3.8); the pages' content policy; no answer ever holds a secret |
| Whoever reads a log, a browser's history, a cache | Find a token | A token travels in a request's body alone; no request line is logged [code]; no-store; never in an address |
| Someone on the network | – | Nothing is reachable: loopback. Over a network this design is not enough (§3.10) |
**The rule: a browser changes the install only through the setup lane, only with a session, and a session begins at the terminal. No answer of the lane holds a secret.**
3.2 The setup lane
**Decision: the lane is a listener inside the worker, in a thread of its own, on the stack's own network and on
no published port; Caddy passes /setup/* to it. The API stays as it is: it reads, and it never sees a token.**
Reasons: the token is in the worker alone (P1 §12.1), and the worker alone mounts the state, so a token written
there by the lane is written by the code and the process that write it today; and what follows a change is the
worker's to do, between its jobs: an account loaded without a restart. Rejected: the API takes the token (S §8.1
designed the sealed box for that; it is needed when the API is exposed, which is R4, and on one machine it would
give a second process the token at its entry and elo_api its first write); a container of its own (a second
mount of the state and a second process with the token, which must still tell the worker).
| Property | Detail |
|---|---|
| A third lane | Beside the main loop and the lane of Energi Data Service (docs/stack.md, "Two lanes"). It answers requests and never calls out. It validates, writes a token with token-add's writer and the account's row with the start's own code (§3.5), and tells the main loop, in the process and through no job of the queue, that the accounts changed. The main loop alone holds the Eloverblik runtime, as today |
| Its failures | A fault in the lane ends a request, never the worker. A lane that cannot listen is one line of the log and of elo status, with the reason; the worker runs on, the pages stay, and the commands of §2.5 do what the setup pages would |
| One source of the address (A5v-r2a-02) | deploy/compose.yaml gives worker the two variables it gives api today, by the same expressions [code]: ELO_PUBLIC_ADDRESS and ELO_PORT. The lane judges them with the API's own functions (elo_api.settings: is the address loopback, which hosts are allowed) and compares every Host and Origin with that one set. Where the address is not a loopback address, or either variable is missing or cannot be read, the lane does not listen, and says so in the log and in the status. A test holds that api, worker and caddy are given the port by one expression, so that a start on another port (ELO_PORT=8081, the demo's) moves all three |
| Where it runs | In both installs, and in the demo |
| Its routes | A fixed list (below). Anything else is 404; a route answers one method. Caddy's rule for the web build leaves /setup/* out, as it leaves /api/* out [code] |
| Its log | One line a request: the route's name, the outcome's code, the duration. Never a body, a header or an address; the server's own access log is off, as the API's is [code] |
| Route | What it does | Needs |
|---|---|---|
POST /setup/pair | A setup code for a session (§3.3) | The code |
POST /setup/unpair | Ends the session | The session |
GET /setup/state | What the pages need to draw themselves: the accounts with their labels, where each setting's value came from (§3.7), the age of the session | The session |
GET /setup/status | The status as data (§3.6) | The session |
POST /setup/accounts, POST /setup/accounts/{id}/token | A new account's token; an account's new token (§3.5, §3.8) | The session |
GET /setup/accounts/{id}/removal | What a removal would take, and the command that makes it (§3.8). It changes nothing | The session |
GET /setup/settings, POST /setup/settings | §3.7 | The session |
Whether the install has an account at all, the pages know without a session, from meta.context [code].
3.3 Pairing: the setup code and the session
**Decision: a browser is paired with the install by a code that is read at the terminal, and the code is never
in a log (A5v-r2a-04; the lead's ruling).** It is shown by one command, to the terminal that typed it, made at
that moment: docker compose exec worker elo setup-code prints a code and the address of the pairing page with
the code in its fragment. A start prints that the command exists, never a code: one line of the worker's log
when the lane listens, and the same line on the first-run page. Reason: on one machine the difference between
the installer and every other program is who may run Docker; the code carries exactly that to the browser, and
it is the trust the token files rest on already. A code in the worker's output would lie in a log that outlives
the minute it is for, readable by whatever reads the logs.
| The code | Detail |
|---|---|
| Form | 100 random bits as 20 letters and digits in four groups; in the address it is in the fragment, which a browser sends to no server |
| Life | Made when the command is typed. 15 minutes, one use, one at a time: a new code ends the one before; the worker holds its hash in memory alone, so a restart ends it |
| Wrong attempts | Five end the code; a second between attempts. The compare takes the same time whatever the input |
| How the command reaches the worker's process (A5v-r2a-05) | A socket of the file system, in the worker's /tmp: the lane's thread makes it at its start, mode 0600, the worker's user's. elo setup-code, run by docker compose exec as that user in that container, connects, asks for a code and prints what it is given. Chosen over a row in the database (it would outlive a restart, and writing it needs a role the command should not have) and over a route (/setup/* is reachable through Caddy; this is not): /tmp is the one writable path that is not the state, a tmpfs that a restart empties [code], and reaching it takes Docker, which is the trust the code stands for. Where the lane does not listen, the command says so with the lane's reason and prints no code |
**Decision: the session is a random value the page holds and sends in a header, X-Elo-Setup. There is no
cookie.** POST /setup/pair answers it once (256 bits); the worker keeps its hash in memory. The page keeps it
in the tab's sessionStorage and nowhere else. Reason: a cookie is sent by the browser on its own, also on a
request another page caused, and cookies of a host name are shared by every port of it: a page served by
another program on this machine's localhost would share the jar. A header that only this origin's own script
can add has neither weakness, and a forged request then fails by construction, not by a check. What it costs:
an injected script could read the value, as it could ride a cookie; §3.4's content policy is the guard.
| The session | Detail |
|---|---|
| Life | 30 minutes without a request, 8 hours at most, and the worker's own life: a restart ends it. One at a time: a new pairing ends the one before |
| What it may do | Everything of the lane. Nothing of the lane removes data (§3.8) |
| When it ends | The page says "Parringen er udløbet" with the command for a new code, and loses nothing typed but the token field, which is emptied |
3.4 The guards of every setup request
Each is tested by a request that breaks it and nothing else (B110), through Caddy and at the lane directly, on the default port and on another.
| # | Guard | Detail | When it fails |
|---|---|---|---|
| 1 | The binding | Only Caddy is published, on 127.0.0.1 [code]; the lane's port is published nowhere | – |
| 2 | Host | The allowlist of P1 §12.1, at Caddy [code] and again in the lane, from the one source of §3.2 | 421 |
| 3 | The client header | X-Elo-Client: web, as the API asks [code]; no CORS header is ever sent, so another origin's preflight fails | 403 |
| 4 | Origin | On every POST: present, and exactly http:// an allowed host with its port, from the same source. Sec-Fetch-Site, where a browser sends it, is same-origin | 403 |
| 5 | The body | Content-Type: application/json and nothing else; at most 16 KiB (the lane's own limit; Caddy's 8 MiB is the API's [code]); exactly the route's keys, a repeated key refused as the API refuses it [code] | 415, 413, 422 |
| 6 | The session | The header's value against the stored hash, in constant time | 401 not_paired |
| 7 | The pace of the lane | Pairing as §3.3; at most ten token submissions an hour (each is judged without a call) | 429 |
| 8 | The answer | Fixed words and codes, never a value that came in; Cache-Control: no-store; no token, no part of one, no fingerprint, in an answer or an error | – |
| 9 | The pages' headers | From elo-web, on every response: the content policy as the pages need it (A5v-r2a-06): scripts, styles, fonts and connections from the page's own origin alone, images from it and from data: (the page's own icon is one [code]), no framing (frame-ancestors 'none'), no base and no form target elsewhere; X-Content-Type-Options: nosniff; Referrer-Policy: no-referrer. What the charts need of the style rule the builder finds and says | The pages' own console test (pages.spec, which fails on any console message [code]) passes on every page with the policy enforced |
3.5 The first run and the token
While meta.context lists no account, the shell shows the first-run page ("Opsætning") in place of the pages,
in three steps: the code (already filled in when the page was opened by the address elo setup-code printed;
otherwise the page shows the command), the token, and then the status page of §3.6.
| Question | Answer |
|---|---|
| What the person gives | Whose token it is (a company's, with the company's name, or a private person's) and the token, pasted into a field that does not show it, is not completed by the browser and is not offered to its password store (B114 reports what that takes in each browser engine). The label of ops §7.7 is proposed by the page from the company's name and may be changed; its rules are the command's |
| Over which channel | In the body of one POST /setup/accounts, over HTTP, from the browser to Caddy on loopback and from Caddy to the worker on the stack's own network. It never leaves the machine, and that is why HTTP is accepted here: a certificate for a loopback name is one the browser does not trust, and it would protect against nobody this design admits, since whoever can read loopback traffic can read the volume. The lane does not listen off loopback (§3.2) |
| What is checked, and when | Everything, in the request, before anything is written (A5v-r2a-03), under one lock of the token store that token-add takes as well: what token-add checks [code] (one line, the form of a token, a Customer API refresh token, not expired, held by no other file; of its claims only exp and tokenType are read, P1 §12.1), and what only the database knows and the worker's start finds today (a company's name another account holds, the first account's company, a fingerprint an account has, a removal that did not finish). No call is made to check it: the worker's next token call does, a minute after any other (P1 §5.2) |
| What the answer is | The store's write, done. In the request, in this order: the token's file and its .json, by token-add's writer (a temporary name, synced, renamed); then the account's row, by the code the start uses to turn a token file into an account [code]. A row that cannot be written takes the file away again, and the answer is the refusal. So there is no moment at which an account's row exists and its token does not, and none at which the page says "saved" for something the worker would refuse |
| Where it is held | tokens/<label>.token, mode 0600, with its .json, in the worker's state (the volume of §2.4, or data/state/ in the repository install). Not in the database: the sealed store is R4's (§3.10) |
| Shown never again | No route returns a token, a part of one or its fingerprint. The answer holds the label, the party, the company and the day the token expires. The page empties the field when it sends, keeps the token in no state and no storage, and an error repeats nothing that was typed. The page carries the sentence of ops §7.7: a token that was shown where it does not belong is deleted at eloverblik.dk and made anew |
| What the page shows next | The account, from its row's own state: "gemt, første hentning afventer" until its first run has ended, then what the pages say of any account. meta.context lists it from the answer on, so the shell leaves the first run at once; the lane's kept status (§3.6) is dropped by every write of the lane |
| When the worker uses it | Without a restart, as a consequence of the write and by no job of the queue (A5v-r2a-01). The loop reads the Eloverblik runtime through one holder (the tick, the backfill's and the schedule's checks, the close), and the lane marks it changed; between two jobs, never during a call, the loop takes the stored accounts up into it. On an idle worker within two polls (10 s by default), and its token call a token spacing after any other; behind a job in hand, after that job, which a backfill run bounds at 300 s [code]. The account's daily and weekly runs are then due at once, as B76 has it |
The worker starts from the stored accounts alone (A5v-r2a-01). Today four places test the token's variable
before anything of tokens/ is opened, and the runtime is built on the first account [code] (state.py,
__main__.py, eloverblik/runtime.py, status.py). B111 owns all four: the state's check looks at tokens/
wherever it exists; the runtime is made with no account, with one, or with several, none of them special; a
worker with no account takes its lock and waits, and takes the egress when it has an account to call for.
| What exists today | What it becomes |
|---|---|
.env and the account env | In the repository install they stay: the pages show that account as "sat i installationens fil" and offer neither its renewal nor its removal. In the packaged install B111 converts them, once (A5v-r1-01). At the first start of a release that holds B111, a worker of the kind volume that finds the variable set writes the token as that account's file in the volume, by token-add's writer: the account keeps its row, its label and its credential generation (the fingerprint is the same), and no token call is made for it. Log and status then say that the line of .env is to be removed. From then on the file is read: the same token still in the line changes nothing but that sentence; another token in the line is never sent, and the status says that a renewal is the page's or token-add's. The account is then renewed and removed as any other. The release's file keeps the variable under worker for this conversion and drops it in the release after, which §2.1 counts as a major |
make token-add, elo token-add | Stay, for a machine without a browser and as the pages' fall-back. One writer and one lock: a token added by the page and one added by the command leave the same files, and neither writes beside the other |
The variables of MM §3.2 (the shell, .env.local) | §3.7 |
make doctor's lines about .env | The repository install's; in the packaged one ./elo.sh doctor's (§2.3), until the line is gone |
3.6 The first loads as a page
Decision: the status is data first, and the terminal's text and the page are two renderings of it.
elo_worker.status builds a structure: sections, and in each its lines with a key, a kind (plain, needs
attention, not looked at), their values, and for the terminal the sentence as it is today. The command prints
the sentences; GET /setup/status answers the structure. Reason: a page with its own queries would say
something else than the command on the day it matters. **The first criterion of B113 is that make status
prints what it printed, byte for byte, on the demo stack and in its tests.**
It comes from the lane and not from the API because it reads what elo_api may not: the jobs and their runs
(ops.job*), the egress's owner record, the notices about token files [code] (docs/storage.md). The
session is needed because it shows labels, as the terminal does.
| On the page ("Status") | From |
|---|---|
| Per account: its state, the days its token has left, its metering points found, and the first load as "n af m perioder hentet" | The account's lines and the chunks' counts (ops §3, §7.3) |
| Per dataset of Energi Data Service: loaded from and through, the windows of its first load done and left, and in words what it waits for | The datasets' lines; the plain lines such as awaiting the emission's inputs (MM §3.6) |
| How long the first loads take | The plan's own numbers (ops §2), said as what they are: calls at the service's pace, which on 26 November was one in about five minutes and not one a minute (MM §3.4). Never a promised hour |
| A first load of about 50 metering points, the first company install (§6) | The calls done of the calls planned, never minutes: for 50 hourly points about 127 calls (ops §7.7), one at a time, each the API's latency and a second; 11 minutes at 5 s a call and an hour at 30 are calculated, and the API's latency at that size is not measured. Points are counted, and only those that need attention are listed by name: a company's login holds points that are listed and not loaded, and points without a price area (ops §7.3) |
| What needs attention, each with what to do | The ! lines, with the third column of ops §3 in Danish. A part that could not be looked at is said as that, never as fine |
| Rule of the page | Detail |
|---|---|
| What may be shown | The pages' rules, not the terminal's: a metering point by its alias or number, a municipality by the rule of MM §4 (a number unless the names are on), never an upstream error's text, only its code |
| How often | The page asks every 20 seconds while it is open. The status makes no call and writes nothing [code]; the lane computes one at a time and answers a second request within ten seconds from the first's result; a write of the lane drops what it kept (§3.5) |
| After the first run | The same page stays in the shell's menu; with no session it shows the command for a code and nothing else |
What of R2 leans on the scale of the pages. Nothing of the lane: the status is the worker's and reads no
figure. But the first run ends on the overview, and at 50 metering points the overview is not yet shown to hold:
ADR-004 measured its first query to break at about 81 roots (23 November), and B94 measured the emission's
month query at about 2 s for 22 points, asked three times by one page. The measurement at 50 and 100 points and
its remedy are a step of docs/roadmap.md §2, in the API's lane, before the first company install; B113 and
B114 are tested at 50 generated points for their own part.
3.7 The settings
Three settings become a page: the wanted municipalities (auto, or a list), the default method, and whether a
municipality's name may be shown. Not the pace's four (the worker cannot loosen its own pace, B03v-01, and a
page that could would undo that), not the port, not the project.
**Decision (the lead's ruling on A5v-r2b-02 and A5v-r2b-04): a setting saved in a page wins over a variable that is not set; a variable that is set wins over the page, and the page says so. Nothing is replaced silently, and nothing overrides unseen.**
Where each thing is kept. The values stay where they are [code]: the municipalities and the names are two
columns of the one row of ingest.municipality_setting, the default method is the flag is_default on a row of
ref.method. What is new is a table of three rows, ingest.setting_origin, one per setting: where its value
came from (default, variable, page), since when, and, when a variable replaced a page's value, that it did.
Each setting has its own row, so that a variable for one never locks or resets another.
How migrate tells "not set" from "set, and empty". Today deploy/compose.yaml gives it
${ELO_MUNICIPALITIES:-auto} [code], which is the same text whether the variable is absent, empty or auto.
For the three it becomes ${ELO_…-__unset__}: Compose's form without the colon puts the marker in only where the
variable is not set at all, and passes an empty one as empty [TBC, B112]. migrate reads the marker as "not
set", an empty value as "set to the default" (B92's rule, "an empty value is the default", and ops §2's "the shell
wins, empty or not"), anything else as the value. The demo's blanked list [code] is therefore "set".
| The variable at this start | The origin before | What migrate does | The origin after | What the page shows |
|---|---|---|---|---|
| Set to a value | Any | Validates it and installs it, as today | variable | The value, the control disabled: "sat af installationen" with the variable's name and the time of that start |
| Set, and empty | Any | Installs the default | variable | The default, disabled, the same sentence |
Set (either), and the origin before was page with another value | page | The same, and records that it replaced a saved value; its log says so in one line that names the setting and never a value | variable | Also: "erstattede en gemt indstilling" with the time. The page's value is gone, also after the variable is |
| Not set | default | Installs the default, as today | default | The default, which may be changed |
| Not set | variable | Installs the default: B92's flow, "remove the line, then make up: auto" (ops §2), holds | default | The default, which may be changed |
| Not set | page | Leaves it | page | The saved value, which may be changed |
| – (a save in the page) | default or page | – | page | The saved value |
| – (a save in the page) | variable | – (refused: set_by_install) | variable | – |
The origin is what the last start that ran migrate saw. migrate runs at docker compose up -d and at
make up, not when Docker restarts the containers (§2.4): a variable taken out of a file changes nothing, on the
page either, until the next such start, and the page's sentence carries the time for that reason. A variable set
once in a shell for one start is a variable: it replaces a saved value, is shown as that, and the start after it
without the variable installs the default.
| Rule | Detail |
|---|---|
| Who writes | Three functions owned by elo_owner, executable by elo_worker alone: one for each setting, with the validation migrate applies (three digits and a row of ref.municipality; an available method; on or off), which refuse a setting whose origin is variable, and set the origin page. migrate installs through the same validation, so a value is judged by one rule. elo_worker gains no right on the tables |
| What the page says before it saves | For the municipalities, the sentences of ops §2: a request names the chosen municipalities to Energi Data Service from this install's address; a municipality taken off loses its stored shares at the next run. For the names: the conditions of MM §4 |
| When it takes effect | The default method and the names at once (the data version is raised, so the pages ask again). The municipalities at the next run of eds-recoverage, which the lane queues at once; it waits its turn in its lane |
| The list | Chosen from ref.municipality, by name where the names are seeded (the lead's ruling of MM §3.3), else by code |
| The one test that changes | B92's test of the Compose file's text for these variables [code] (test_b92_setting.py) asserts the new expression. Every other assertion of B92 holds as it is, "an empty value is auto" among them |
3.8 Renewing a token, removing an account
A renewal is the token's form again for an account that exists, with its party and company fixed: the file is replaced under the same label, under the store's lock, the account's row gets its new credential generation in the same request [code], and the page says the new expiry and that the old token is to be deleted at eloverblik.dk. The pages say from 60 days before that a renewal is due [code]; that notice now links to the form.
**Decision (the lead's rulings on A5v-r2b-01 and A5v-r2b-03): a removal is not made from the browser in R2. The page prepares it and shows what will go; one command at the terminal carries it out; the page shows the result. The worker's role gains nothing.** A removal is for good (P2 §6.3, ops §7.8), and it deletes what a token cannot fetch again once the API's window has moved (ops §1). Made by the worker it would be a job that meets its own claimed row, beside a lane of Energi Data Service that holds rows of the same table, in a process that listens to a browser; made by what makes it today it has none of those. **R2 therefore keeps one command more than the pairing code's**, and a removal wholly from the browser is R4's, with a login.
| Step | Where | What |
|---|---|---|
| 1. The page prepares | GET /setup/accounts/{id}/removal, with a session | What the worker's own role can read: the company, the number of metering points and roots, the first and last stored day, whether the company goes with the account, the files' names. And the command, with the label in it, to copy: ./elo.sh account-remove --label <label> (in a checkout make account-remove LABEL=<label>). The page says that this one step is made at the terminal, and why |
| 2. The command carries it out | The host, and admin (§2.5) | As today: the worker stopped by the host's command; the lock; the command's own question, with the owner's function's full statement of what goes, and the label typed again; the journal; the one transaction as the owner's role; the files; the statistics; the worker started again. Nothing of this is new in R2 |
| 3. The page shows the result | Without a session, from meta.context [code] | While the worker is stopped, the setup pages say that it is (a removal or an update is being made) and the other pages stay. When it is back, the account and, where it was its last, the company are gone from the list and from the selection; the session ended with the worker, so the next change needs a code. A removal that did not finish is a line of the status, with the command that ends it (§2.4) |
The account env of a .env is refused by the command, as today (converted, it is an account like the others:
§3.5); the last account may go, and the install is then at its first run. The closing sentence is the command's:
what the removal cannot reach (ops §7.8), and from B120 on whatever was exported (§4.3).
3.9 What stays a command on purpose
| Command | Why |
|---|---|
elo setup-code | The trust begins at the terminal (§3.3). A page that could pair a browser would be the guard asking itself |
account-remove | §3.8: the one destructive act stays where the owner's role is and no browser reaches. R4 moves it, with a login |
Stopping and starting, the update, backup and restore (§2.6) | They are Docker's, or must work while the stack does not |
| The purge of §2.5 | Nothing in the stack deletes the volume it runs on; and the last resort must not depend on a page |
| The pace's four settings, the port | §3.7 |
verify, withdraw-day, set-price-area, unset-price-area, refetch, probe-window | Not asked for as pages (§1) |
token-add | It stays beside the page: a machine without a browser, and a way in when the lane does not listen |
| The demo | §1 |
3.10 What a shared install needs on top (R4: named, not specified)
| R2, on one machine | What a shared install needs in its place |
|---|---|
| Loopback and plain HTTP | TLS and a public address; the refusal of the API and of the lane to start off loopback is lifted only together with the rest of this table |
| A code from the terminal, one session, no names | Named users who log in at an identity provider; sessions on the server, an HttpOnly cookie and a CSRF header (S §8.2) |
| Whoever is paired may do everything | Roles: who may add a token, remove an account, change a setting, see which metering points (S §8.2, §8.3; the seam is there: elo_api sets app.user_id [code]) |
| A token file in the worker's volume | The sealed store (S §8.1): the entry is then exposed, and what is stored must not be readable from there. Whether the entry stays in the worker's lane or moves to the API is R4's decision |
| A removal is a command at the terminal (§3.8) | A removal from the browser, by a named user who has the role for it, recorded |
| Nobody records who changed what | Audit events (P2 §6.1) |
| The roles' passwords are public values (§1) | Secrets of the install |
| The pages read without a session | Every read behind the login, with row-level security |
The Host allowlist, the client header and the Origin check stay under all of it.
4. The outward form of the results
Today the product's results leave it one way: as the answers of the named queries, shaped for its own pages
(docs/queries.md). A reader outside it (a semantic model, an export to files) needs relations with a fixed
grain and a rule for how they change. No export, no model and no way in for such a reader is built here; the
form is fixed so that one can be built on it.
4.1 The decision and its rules
**Decision: the outward form is a schema of its own, result, and nothing else in the database is a result for
a reader outside the product.** Its relations are read by a role of its own, elo_reader, which may SELECT
in result and nowhere else, and which cannot log in until an epic gives a reader a way in (a gateway, an
export job: R6). **The form carries what a reader needs to reproduce the blocks of Eloverblik's report from it
alone** (A5v-r2b-05): its definitions are those of the functions that are validated against the report
(ref.mix_group of migration 0216 with B78's nine groups, report.footprint, MM §2.4's municipal part), not a
second set.
| Rule | Detail, and why |
|---|---|
| One grain for every fact | A metering point and an hour (UTC), with the hour's Danish day as a column. It is the grain of every factor and share; quarter-hour readings and prices are summed into it. A coarser relation would fix a calendar in the form; a reader sums to days and months itself, since every measure is additive |
| Only quantities that can be added | No ratio is a column of a fact. A share or an intensity is a numerator and a denominator, each a column, as report.footprint carries amount and per_kwh [code]. A model would sum a ratio. The one weight in the form is a constant of the reference, not a result: renewable_share of a source group (below) |
| Never a zero for "not known" | A figure that cannot be given is NULL with a reason, and the energy it would have covered is a column or a row of its own. P1 §9.3: a pending hour is never read as zero, and it is outside a share's numerator and its denominator (P2 §3.3) |
| Four keys partition a measure: the method, the GWP set, the basis, the geography | The form's one trap: the emission of an hour is there once per method, GWP set and basis, the sources once per geography and basis. A measure is summed over metering points and hours, and never over these; a reader names the one value of each it reads. Each has a dimension relation that says which value is the install's default. A relation gets such a key only at a new major (§4.4): the cost therefore has none, and is the spot cost by its columns' names |
| E17 roots only | A figure is a root's; a parent and its children are never added (L2, docs/queries.md). The energy sold is a column of the root's row (its export child's series, E03). A point whose identifier was found invalid (status 4) is in no relation, as meta.context leaves it out [code] |
| A view or a table is not part of the form | Version 1 is views over calc (nothing derived is stored: P1 §9.1, ADR-004). A reader filters by metering point and time; the form promises that such a filter reaches the readings by their key (§4.5). Storing a relation later changes no reader |
| Keys are the install's own | mp_key and company_key are the database's keys: stable in an install, never used again for another point, without meaning in another install or after a purge. Never a GSRN |
4.2 The relations
Units are in the column's name. Types: a key is bigint or text, an energy or an amount numeric, an hour
timestamptz on a whole UTC hour.
| Relation | Grain and key | Columns | Notes |
|---|---|---|---|
result.contract | One row | major, minor, calculation, product_version, data_version, data_changed_at | §4.4. data_version is ops.data_version [code]; calculation counts the releases that changed how a value is computed |
result.company | A company: company_key | name | The owner's own text for a token (docs/queries.md, B74). NULL unless every account of the company is a company's: a private account's company is named by its label [code] |
result.metering_point | An E17 root: mp_key | company_key, party_kind (company, private, unclassified), alias, price_area, municipality_ordinal, municipality_code, municipality_name, first_local_date, last_local_date | party_kind is the owning account's (ingest.source_account [code]; a company may hold accounts of several kinds). alias and the municipality by §4.3 |
result.method | An available method: method_code | geography, allocation_pct, name_da, is_default | ref.method [code] |
result.gwp_set, result.basis, result.geography | The value | name, is_default | ref.gwp_set; best and final, the default best; price_area and municipality, the default the default method's |
result.source_group | group_code | name_da, renewable_share (0 to 1), nuclear, municipal, in_figures, sort | ref.mix_group as it is [code]: the nine groups of B78, waste with Energinet's 0,55, nuclear marked, and local (municipal, a part only under the municipal geography, MM §2.4). Two rows more, with in_figures false: pending and not_available |
result.origin_area | area_code | name_da, known, municipal, in_figures | The connected areas of ref.code; an area the reference does not know under its own code with known false, as mix.structure has it [code]; local, which is no connected area and is the first part under the municipal geography (MM §2.4); pending and not_available |
result.consumption_hour | mp_key, hour_utc | local_date, bought_kwh, bought_minutes, sold_kwh, sold_minutes | E01 and E03: every stored quantity of the hour, with the minutes they cover (60 for a whole hour). No row for an hour without a stored interval. sold_* NULL for a root without an export child |
result.emission_hour | mp_key, hour_utc, method_code, gwp_set, basis | local_date, kwh, co2e_g, co2_g, ch4_mg, n2o_mg, biogenic_co2_g, transmission_loss_co2e_g, distribution_loss_co2e_g, local_kwh, factor_version, factor_generated, pending_kwh, reason | With a factor under the basis: kwh and the amounts, as calc.v_emission_interval has them, summed over the hour. Without: the amounts NULL, pending_kwh the hour's consumption, reason one of P1 §9.3's and MM §5's. local_kwh under a municipal method only. The report's blocks are sums of these columns (docs/queries.md, report.footprint); an intensity is Σ of its amount ÷ Σ kwh |
result.cost_hour | mp_key, hour_utc | local_date, bought_spot_dkk, bought_priced_kwh, sold_spot_dkk, sold_priced_kwh, unpriced_kwh, price_generated, reason | The day-ahead price of the point's price area, without tariffs, taxes and VAT (P2 §3.2): said by the columns' names. A full price would be new columns or a new relation, never a second row for the hour |
result.source_hour | mp_key, hour_utc, geography, basis, group_code | local_date, kwh, reason | The hour's consumption by the groups of the mix: by P2 §3.3's steps under price_area, with MM §2.4's municipal part first under municipality. The rows of an hour sum to its consumption. What has a price area and no complete mix under the basis is the row pending; what cannot have a mix (no price area; under municipality, no municipality, one that is not loaded, no share) is the row not_available, with its reason. Neither is a source |
result.origin_hour | mp_key, hour_utc, geography, basis, area_code | local_date, kwh, reason | The same by connected area (P2 §3.3 step 6), with local first under municipality and the same two rows outside the figures |
The report's shares from these relations alone, over any set of points and hours, for one geography and one
basis, with F the rows of source_hour whose group is in_figures:
| Figure | From |
|---|---|
| The renewable energy (E07) | Σ over F of kwh × the group's renewable_share |
| The renewable share without nuclear (E11a) | E07 ÷ Σ over F of kwh |
| The same with nuclear (E11b) | (E07 + Σ kwh of the groups marked nuclear) ÷ the same |
| What the figures do not cover | Σ kwh of the rows pending, and of not_available: outside numerator and denominator |
Not in version 1: the comparison of two periods and its variances (a reader's own measure over the hours); the
weekday-hour cells (the same); the municipal table by municipality (MM §2.4); postcode and city (P2 §3.5 puts
them after wave B, which has not specified them); master data beyond the columns above; anything about the
ingestion but data_version.
4.3 What is never in them
| Never | Rule it comes from |
|---|---|
| A token, a fingerprint, a credential generation, an account's label as such, a file's name | P1 §12.1; docs/queries.md, "What may leave the database" (B74) |
Anything of raw: a request, a response, an upstream error's text | elo_api cannot read raw [code]; elo_reader cannot either |
| A GSRN; a consumer's name or contact (not stored); CVR numbers, names and GLNs of supplier and grid operator, the location's description, the DAR reference, a meter number | The catalogue's refusal list [code], applied to the views' text (§4.5) |
| An address, in any part: street, house number, floor, door, postcode, city | P2 §3.5: never for a private or unclassified account, and for a company's only after wave B. A report names a site by the alias |
| An alias, unless the owning account is a company's and the point's current version has a name known to be unprotected and an address that is not protected | The alias is the customer's own text and may hold a name or a street: on the pages it is shown to the owner of the data [code] (meta/context.sql); a reader outside is not that. N4, as docs/queries.md applies it to an address |
| A municipality, other than as the pages show it (A5v-r2b-06; the lead's ruling) | The install's own rule, MM §4. municipality_ordinal is the number the pages write ("Kommune 1", "Kommune 2": by the lowest mp_id of a municipality's roots, over the install's roots), which says nothing of the code. municipality_code and municipality_name are NULL unless the names are on (ELO_MUNICIPALITY_NAMES) and every root of the install in that municipality passes N4. The view takes all three from calc.municipality_parts, the one function that returns a label, and names neither municipality_code of a table nor ref.municipality itself |
| Jobs, runs, logs, the status of the ingestion | The product's own operation |
A copy outside the product is the reader's. The views show a removed account's rows no longer the moment its
removal commits; a file or a model that was filled before still holds them. So every fact carries mp_key,
every point its company_key, and keys are never used again: a copy can be purged by key, an export epic must
do so on a removal, and the removal's closing sentence names what was exported (§3.8). The same holds for a
municipality's name after the names are turned off: the views stop showing it, a copy keeps it.
4.4 The rule of change
result.contract says which form a reader is looking at.
| Change | Allowed within a major (the minor goes up) | Needs a new major |
|---|---|---|
| A relation | A new one | One removed or renamed |
| A column | A new one, last in its relation, NULL allowed | One removed, renamed or moved; its type, unit or scale changed |
| A key or a grain | – | Any change. A new key that partitions a measure in a relation that had none is such a change: a reader that summed the relation would count every hour twice |
| A new member of an enumeration (A5v-r2b-05) | Allowed, because the reader is told what to do with one it does not know, per kind. Of a partitioning key (method_code, gwp_set, basis, geography): a reader reads only the values it named (§4.1), so a new one is not read. Of a classifying column (group_code, area_code, reason, factor_version, party_kind): a reader keeps the row's energy and files it under "unknown"; the dimension's own columns (renewable_share, nuclear, in_figures) still say how it counts, so the shares of §4.2 stay right without the reader knowing the name | A member removed, or its meaning changed |
| Which rows exist for the keys there are | – | Any change (children added to a figure, say) |
| The values of a row, by the data | At any time, where the data behind them changed: a factor that became Final, a re-pull, a restated municipal share (P1 §9.3, MM §3.5). data_version says that something changed, not what | – |
| The values of a row, by a corrected calculation | Within a major: the release raises calculation, and its note names the relation and what moved | – |
A new major is a second schema (result_v2) beside the first for at least one minor release of the product,
named in the release's note, and the first goes only in a major release (§2.1).
A copy is made anew, not patched. By the data: whole, or from the earliest day a re-pull reaches (1 January
of the year before for the price area's methods, ops §2; the first day for the municipal methods, whose share is
restated whole, MM §3.4). **By the calculation: whole, from the first day, whenever calculation is not the one
the copy was made under**: a window would leave old years computed the old way beside new ones.
4.5 How a test holds them
| # | What is held | How |
|---|---|---|
| 1 | The form is a file | services/api/contract/result-v1.yaml: each relation with its grain, key, and columns in order with type, unit and whether NULL is allowed, and for each enumeration its kind (§4.4). After the migrations the catalogue of the schema result equals the file, name for name and in order. docs/results.md is generated from it, as the columns of docs/queries.md are from catalog.yaml [code] |
| 2 | The rule of change | The file as it was at the newest release tag is kept beside it. A test (elo_devtools.result_rules) reads both and passes only the differences §4.4 allows for the minor the file declares; anything else fails with "this needs a new major". A migration that replaces a function a relation reads, without calculation raised, fails the same test |
| 3 | Keys and grain | On the demo organisation every key is unique; every mp_key of a fact is a row of result.metering_point; no relation has a row for a child or for a point of status 4 |
| 4 | The figures are the product's | On the demo organisation, for every method, GWP set, basis and geography, the sums over a year equal the named queries' answers to the last decimal: bought_kwh and the emission columns against report.footprint's blocks, the cost against energy.split, the groups and the areas against mix.structure, local among them under the municipal geography. E07, E11a and E11b computed by §4.2's table from the relations alone equal report.footprint's rows (the waste's 0,55 and the nuclear part are then in the form and not in the test). The rows of every hour of source_hour and of origin_hour sum to its bought_kwh exactly |
| 5 | What is never there | The catalogue's refusal words searched in the views' own text and column names; elo_reader's grants are exactly SELECT on the relations of result; B75's search with sentinels (a GSRN, a name, each part of an address, a token's shape) finds none in any relation. With the names off, no relation holds a municipality's code or name (the search with ZZ8 and ZZ9), and the ordinals are there; with them on, a municipality with one protected root has neither, and the other has both. A private account's point, a protected one, and a private account's point in a company that also holds a company's account have no alias; a company with a private account has no name. After ops.remove_account no relation holds a key of the removed account |
| 6 | A reader's filter is cheap | For each fact relation, a month of one point is answered from the readings by their key (the plan, read as ADR-004 reads plans); the report gives the times at the demo's size and at ADR-004's 420 roots. No threshold is a criterion; a relation that reads every partition for one point is a failure |
5. Delivery
5.1 Rules for every epic
Those of P1 §13.1, P2 §7.1 and MM §8.1. Further:
- The repository install is not changed by an epic of R1 or R2 but where its row says so:
make up, the capture, the stack check and every existing test pass with their assertions unchanged. - No test file holds a literal in the shape of a token (the guard refuses it): a test of the lane makes its
token at run time, as the tests of
token-adddo. - A test that breaks a guard breaks that guard alone, so that it fails for the reason it names.
- An epic that owns a [TBC] of §8 measures it and says in its report: confirmed, or what was found instead and which sentence of this document changes.
- An epic of pages runs
design.specwith its own specs, and no two Playwright runs of a worktree overlap. - An epic brings its documents up to date:
docs/stack.md(B100, B101),docs/install.md, new, the packaged install's guide (B102, B104, B103),docs/operations.md(B101, B112),docs/setup.md, new, the lane (B110 to B114),docs/daily-run.md(B113),docs/pages.md(B114),docs/storage.md(every epic with a migration),docs/results.md, generated (B120).
5.2 The epics
| Epic | Scope | Acceptance criteria | The lead's validation | Depends on | Owns | Size | Agent · model · effort | Review |
|---|---|---|---|---|---|---|---|---|
| B101 The worker in a volume; one worker, by the lock the egress rests on | §2.4: the kind volume of ELO_STATE_MOUNT (the stricter check, no ticket), the image's fixed user and its /data/state; the link count in the directory's check of both installs; the pace store and the lock elo.worker made by __main__ at every start, with the order of a start, the question at every poll and before a send, the gap of 2 s, the clock, the call's one deadline of 130 s, the exit that leaves the egress alone, the successor's wait and Egress._may_take_over; ingest.state_home, what its migration writes, and the refusal on it; the journal read at the start; what the restart policy asks of the API and the worker. Both installs | On Linux (CI), with a Compose file of the test's own that mounts a named volume: a first start leaves the volume the worker's user's, 0700, and the worker healthy without a ticket; in the volume an entry of another owner, a link, a directory of mode 0750, a file of mode 0640 (a token's or the handoff record), or a regular file with two links refuses the start with the path and the fault, before any call or lock, also under tokens/ with no token configured; the host directory's check accepts and refuses what it did, and now refuses a file with two links; with volume set over a bind of a host path the worker refuses, or the report says why it cannot tell. A worker with no token configured holds elo.worker, and a second one beside it starts neither lane and is not healthy. The first read's sequence, against the stand-in: a worker's call is held open and its database session ended; it sends nothing further, and exits without removing the egress's owner record or writing the handoff record; a second worker, waiting, takes the lock, and the stand-in records no request of it while the first's is open nor before 150 s on its clock after the lock; then one, after the recovery of P1 §5.2 step 0. A worker stopped gracefully is followed without the wait. With a clock the test moves (A5v2-02): the lock answered and the clock moved 3 s before the send, the lock is asked again and, its connection gone, nothing is sent; moved 1 s, the call is sent on the first answer; a call whose answer comes in pieces is given up 130 s after its send; the takeover is refused at 149 s and allowed at 150 s; a jump of the wall clock changes none of the four. A database restarted under an idle worker: within two polls the worker has stopped, and has not touched the egress. The home: a migrated database that held an account, and one each that held only a stored request, a job, a capture's import, says host; one made new has no row and takes the first worker's kind; a packaged worker that is first on a host database takes no lock, writes no notice of an absent account, stays up saying the sentence, and goes on by itself when the row is set; a worker of a bind kind on volume exits with its sentence and make up fails with it. After a restart of Docker's daemon every service is healthy with no command; an account whose removal journal is there is not made, and status says so; in the repository install make up, the stack check and the mount tests pass unchanged and the ticket is still asked | A packaged stack started by docker compose up -d beside nothing else on the lead's machine; the worker restarted by hand keeps running | – | elo_worker/__main__.py, state.py, queue.py, eloverblik/store.py, eloverblik/runtime.py (the store handed in); elo_sources/eloverblik/statedir.py, egress.py, client.py (the question, the gap, the deadline); services/worker/Dockerfile (the user, /data/state); deploy/smoke.py (its new cases); migrations 0390–0394. Every file the text makes it change is here (A5v2-01): a file it must touch beyond these is a finding of its read | L | Claude · Opus · high | Codex x |
| B100 The release | §2.1 to §2.3: the version from the tag (a build argument, the image's environment, elo_api's settings, meta.context and the footer); the four images, two-stage, for two architectures, with what each holds (§2.2) and .dockerignore; elo_devtools.release (the generated Compose file, the image files, SHA256SUMS with the images' identifiers, the note's frame); make release; the workflow on a tag; a release mode of deploy/smoke.py. No push: the registry's way is not built | make release VERSION=0.1.0 in a clean checkout of the tag writes the release's folder and contacts no registry; it refuses a dirty tree and a version that is not the tag's; the generated file differs from deploy/compose.yaml in the rows of §2.3 and in nothing else (the test fails on an unlisted difference); docker compose config of it shows one published port, on 127.0.0.1, no bind mount, no build, pull_policy: never on the product's images, the token's variable under worker alone as today, the owner's credentials under migrate and admin alone, and no socket mounted anywhere; for each image and each architecture the content test of §2.2 passes, and fails on an image built without a licence file or with a planted .env.x, data/ or orchestration/ file; a .env.x planted under web/ and under services/ is in no build context; the stack check in its release mode passes against a stack started from the generated file and the loaded image file in an empty folder, on CI's Linux (amd64) and in the Mac's VM (arm64): the checks that are of both installs (the roles, the token in the worker alone, loopback, Host, the client header, the logs) run as they are, those of the host directory, the ticket and make run in the repository mode alone with their assertions untouched, and the release mode has its own (the volume, the restart policy, no mount of the host); the sums of SHA256SUMS hold and a loaded image's identifier is the recorded one; meta.context answers the version and B66's fixture holds but for the new member; for a patch tag the test of §2.1 holds, and fails on a migration added to it; the report gives the images' sizes, the files' sizes and the minutes of the build per architecture, and what was ruled for docs/legal/ | The lead makes v0.1.0 and starts it from the folder alone, on the Mac and on B96's Linux VM | B101 | .dockerignore; the Dockerfiles (two changed, two new); deploy/compose.yaml, the Makefile, the workflows; deploy/smoke.py (the release mode); tools/src/elo_devtools/release.py; elo_api/settings.py, analytics/runner.py (the one member) | L | Claude · Sonnet · high | Codex high |
B102 The command elo and its places | §2.5: the entry point in the worker's image; the services tools and admin; status, tools doctor, token-add, account-remove by the lock and a direct connection, the four maintenance commands; the modules moved out of elo_devtools, one implementation for both installs | In a packaged stack with no checkout: elo status prints what make status prints on the same database, with the same exit codes; tools doctor, run with --no-deps, answers when migrate has failed and when the database is stopped, and says which; tools and admin are given the database by Compose when it is down (docker compose config: both depend on postgres healthy, neither on migrate or worker); tools token-add takes a token on standard input alone, refuses one in an argument or a variable naming the variable and never the value, and leaves the files make token-add leaves; every refusal of ops §7.7 and §7.8 is met by the test that met it, run against the moved module; admin account-remove beside a running worker refuses by the lock and changes nothing; with the worker stopped it holds the lock from its first check to its last file, and a worker started while it waits at its question makes no call until it has ended; stopped after its transaction, it is finished by the same command, also after the database's volume is gone; each of verify, withdraw-day, set-price-area, unset-price-area through admin leaves the rows and prints the words its make target does on the same database, the same name given to the worker (exec worker elo withdraw-day) is refused as no command of the worker, and the test of the roles' grants passes unchanged; tools' environment holds no owner's credential; make token-add, make account-remove, make doctor and the four targets in the repository install behave as before | The lead adds a second account on the packaged stack by the command | B100 | elo_worker/cli.py (new); elo_devtools/state_dir.py (the token writer), account_remove.py, doctor.py while it runs; the rows tools and admin of the release's differences | M | Claude · Sonnet · high | Codex x |
| B104 The script, the state's move, the demo from an image | §2.2 (load), §2.4 ("The state has one home": the move's four steps, adopt-state, token-add's refusal by the home), §2.5: elo.sh with its hidden question to Compose and doctor's host half, token-add, account-remove, purge and import-state as orders of commands; make export-state and admin import-state; the service demo-load and demo.env | elo.sh passes under the shell of CI's Linux and under macOS's, and no line of it is one system's alone; with a sentinel as .env's line, no output of any of its commands holds the sentinel, also when the line is one Compose cannot parse; ./elo.sh doctor names a .env of mode 0644, one of two lines and a missing one, and repeats migrate's refusal, never a value; purge without the word typed changes nothing, and with it names an unfinished removal; each command of §2.5's table of needs, run with the database down, has it started or says its line, and on a schema older than the release says the one line and writes nothing; ./elo.sh account-remove starts afterwards only a worker that ran before, and no migrate runs in it; after make down, ./elo.sh import-state <checkout> alone makes the move (A5v2-04): the database is started by its second step and no worker runs before its fourth; the volume then holds every carried file byte for byte, 0600 and 0700, the image's user's; the move is refused when the volume holds anything, when a file of data/state/ has two links or another's write bit, when tokens/ holds an entry that is no label's file (named without its name where that could be an identifier), when a worker runs, when an owner record is left, when a removal is unfinished; an import killed half-way, a temporary name of its own left behind, is finished by the same line and by no other archive; afterwards make up refuses on the row and the packaged worker starts, and its first call is no earlier than the handoff record's deadlines (the stand-in's clock); docker compose up -d typed before the move, on a database of an earlier version that holds two accounts: no account is marked absent, the worker says the move's sentence, and after the move it goes on without a restart; make token-add on volume and tools token-add on host write nothing and say the sentence; adopt-state sets the row only with the word typed and only where every account of the database has its files in the volume; the demo's two commands give the demo stack from the loaded images with no checkout and no call recorded, and the loader removes the one price area in both installs | The owner's install is the first to move: the lead makes the move on it, on the owner's word | B102 | deploy/elo.sh (new), demo.env; elo_worker/cli.py (the import, adopt-state, token-add's question of the home), elo_worker/state_move.py (new: the archive, the import, adopt-state); elo_devtools/state_dir.py (the export, make token-add's question), demo_load.py; the Makefile (export-state, the demo's line); the row demo-load of the differences | M | Claude · Sonnet · high | Codex x |
| B103 The update, the guide, the trials | §2.6 to §2.8: ops.product_version and migrate's two refusals, the update page of elo-web, backup and restore in elo.sh with admin restore-prepare, docs/install.md, the measurements, the trials | Started from the image of the release before, on a database migrated by the newer one, migrate refuses in one line with both versions and nothing is written; a later minor that holds no migration has started, then the minor before: refused by the version's row; a lower patch of the same minor starts; an update from one generated release to the next keeps every row (counts and verify) and the pages answer the update page while migrate runs; the five steps of a restore give a database on which verify passes; restore refuses while the volume is there, and restore-prepare a database that holds a schema of the product's and one a worker holds the lock on; docs/install.md is followed literally, by somebody who did not write it, on Linux (B96's VM) and on macOS, with Docker and no other tool of ops §1, from the release's folder to the demo's pages, and holds no step of one system alone; the guide says, in the words of §2.4, that whoever may run Docker can read the volume and .env, and that on Linux this is every member of the group docker (A5v2-05); the report gives disk in use, the loaded size and the memory of the five containers at rest, during the demo's load and for a generated organisation of 50 metering points | The guide on the x86-64 Linux laptop the owner offered; then the owner walks B96's checklist under WSL2 with the release's folder (R3's first part) | B104 | elo_api/db/migrate.py (the refusals), deploy/Caddyfile (the update page), deploy/elo.sh (after B104) while it runs; docs/install.md; migrations 0395–0399 | M | Claude · Sonnet · high | Agy; the lead's validation is the second read |
| B110 The setup lane and its guards | §3.2 to §3.4: the listener and its thread; ELO_PUBLIC_ADDRESS and ELO_PORT for worker in deploy/compose.yaml and the one source the guards compare with; Caddy's route and its rule for the web build; the socket in /tmp and elo setup-code; the session; the nine guards; the pages' headers; GET /setup/state, unpair | Through Caddy and at the lane directly, on the demo stack, on port 8080 and on another: each guard of §3.4 has a request that breaks it alone and gets its answer (another Host; no client header; no Origin, another origin's, the right host with another port, Sec-Fetch-Site: cross-site; a form's content type; 17 KiB; an unknown and a repeated key; no session, a wrong one, an ended one); docker compose config gives api, worker and caddy the port by one expression; with a public address that is not loopback, and with either variable taken from the worker, the lane does not listen, the log and the status say why, the pages answer, and elo setup-code prints the reason and no code; no line of the worker's log, of any start with or without an account, holds a code (the suite's captured logs are searched for every code it was given); a code is made only by the command, is good once, for 15 minutes, and not after five wrong attempts or a newer code; the socket is 0600, the worker's user's, and gone after a restart; a session ends after 30 minutes without a request and at a restart of the worker; no response sets a cookie; no answer and no error of the suite holds a code, a session value or anything that was sent; a lane made to fail on a request leaves the main loop running its jobs; pages.spec passes on every existing page with the content policy enforced | – | B101; B100 for the Compose file | elo_worker/setup/ (new), elo_worker/__main__.py, elo_worker/cli.py (setup-code), deploy/Caddyfile, the two variables' lines of deploy/compose.yaml while it runs | M | Claude · Opus · high | Codex x |
| B111 Accounts through the lane; the worker from its stored accounts alone | §3.5, §3.8: the token's route with every check in the request, the store's lock, the file and the row written before the answer; the runtime's holder and the loop's take-up of a change; the worker's start with no variable, from tokens/ alone, with none, one or several accounts (the four places that test the variable); the conversion of the account env in the packaged install; the renewal; the removal's page (GET …/removal), which changes nothing | Against the stand-in of the Customer API: a stack with no variable and one stored account fetches: its token call and its first data request are recorded; one with no account makes no call, holds its lock and is healthy; an account added by the page is fetched without a restart: on an idle worker its token call is recorded within 90 s of the answer (two polls and a token spacing), and behind a backfill run in progress within 90 s of that run's end; from the answer on, meta.context lists the account and the status shows it as saved with its first fetch pending, and at no moment of the suite does an account's row exist without its token file (a test that stops the request between the two writes finds the file removed and no row); each refusal of ops §7.7, those only the database knows among them (a company's name taken, the first account's company, a known fingerprint, an unfinished removal), comes back in the request as its code and leaves neither file nor row; a page's request and a token-add at the same moment leave one account or one refusal, never two files for one company's name; no response, log line, job payload or row holds the token, a part of it or its fingerprint outside the tables that hold a fingerprint today (B75's search); the page's token and the command's leave the same files; a renewal raises that account's credential generation and no other's; the conversion: a packaged stack that ran with the token in .env writes, at the first start of this release, the account's file in the volume, keeps its row and its credential generation, makes no token call for it and says that the line is to be removed; with the line removed the account runs on; another token in the line is never sent, and the status says so; a repository install without a token in .env and without a file opens nothing, as today; the removal's route changes no row and no file, and elo_worker's grants are what they were (the test of the roles' grants passes unchanged) | The lead adds an account in the browser on the demo stack, and removes it by the command the page shows | B110, B102 | elo_worker/setup/accounts.py; elo_worker/state.py, __main__.py, eloverblik/runtime.py, eloverblik/account.py, status.py where they test the variable or hold the runtime; the token writer's lock; the variable's row of the release's differences. No migration is foreseen (0400–0404 are its block) | L | Claude · Opus · high | Codex x |
| B112 The settings through the lane | §3.7: ingest.setting_origin, the three functions, migrate and the marker for a variable that is not set in deploy/compose.yaml, the routes | The table of §3.7, row by row, each a test: a value set; set and empty (the default is installed, B92's assertion unchanged); set over a saved value (replaced, recorded, said in migrate's log by the setting's name and never a value, and shown by the route); not set after default, after variable (B92's "remove the line" holds) and after page (two restarts leave the saved value); a save refused while the origin is variable (set_by_install); a variable for one setting neither locks nor resets another (the names set by a variable, the municipalities saved in the page, a restart: both as they were); docker compose config shows the marker only where the variable is absent; the route refuses what migrate refuses, by the same validation, naming the setting and the item's position and never a value; elo_worker has no write on the tables that hold the values; a saved list queues eds-recoverage, and a municipality taken off is forgotten by that run (MM §3.2); tests name municipalities ZZ8 and ZZ9; the one assertion of test_b92_setting.py on the Compose file's text is the only one of B92's that changes | – | B110, B100 | elo_api/db/migrate.py, the three variables' lines of deploy/compose.yaml, elo_worker/setup/settings.py; migrations 0405–0409 | S | Claude · Sonnet · high | Codex high |
| B113 The status as data | §3.6: the structure behind elo_worker.status, the terminal's rendering, GET /setup/status with the pages' rules | make status prints what it printed, byte for byte, on the demo stack and in every existing test of the status; each ! line of ops §3 that a test produces today is in the structure with its key and kind; a part not looked at is that kind and never absent; the route's answer holds no municipality code or name with the names off, no upstream text, and no label without a session; two requests within ten seconds compute once, and a write of the lane drops what was kept (the status asked right after a token's answer shows the account); the report gives the time of one status at 50 and at 420 generated roots (B73's bulk generator) | – | B110 for the route; the structure needs none | elo_worker/status.py while it runs (after B95) | M | Claude · Sonnet · high | Codex high |
| B114 The pages | §3.5 to §3.8 in the web app: the first run, the status, the settings, the accounts with the renewal and the removal's page; the words in Danish | Playwright on the demo stack through Caddy at 390 and 1 280 px in the three themes, without a console message, overflow or a content-policy violation: with no account the shell shows the first run and no other page, with the command for a code; the address elo setup-code prints pairs without typing; the token's field shows nothing, is empty after sending, no storage of the browser holds its value, and the report says for each browser engine of the suite what keeps its password store from offering the field; after the token's answer the shell leaves the first run and the account reads "gemt, første hentning afventer"; an ended session keeps what was typed but the token; a setting whose origin is a variable is disabled with "sat af installationen" and the variable's name, and one that replaced a saved value says so; the removal's page shows what will go and the command with the label, and holds no control that removes; with the worker stopped the setup pages say so and the other pages answer; each state of the status page is asserted from an answer that carries it; with 50 generated metering points the status page names only the points that need attention and counts the rest, without overflow at 390 px; design.spec passes | The lead shows the first run to the owner on a fresh packaged stack | B111, B112, B113 | web/packages/shell (the first-run switch), the app's new directories, e2e/ (its own specs) | M | Claude · Sonnet · high | Agy |
| B120 The outward form | §4: the schema result version 1, elo_reader, the form's file with each enumeration's kind, the rule's test, the generated document | The six rows of §4.5, each a test; the price-area methods' answers of every named query equal B66's fixture (the epic adds relations and changes no function's result) | The lead reads a year of the owner's result.emission_hour against report.footprint on the owner's stack, and E11a from result.source_hour against the report's line: equal or the difference | MM's B88 | The schema result; services/api/contract/; elo_devtools/result_rules.py; migrations 0420–0429 | M | Claude · Opus · high | Codex x |
Where Codex's limit is reached, its review falls to Claude or Agy (the lead's standing rule); nothing waits.
5.3 Lanes and order
| Lane | Shared files | Order |
|---|---|---|
| The stack and the release | deploy/compose.yaml, the Makefile, the workflows, the Dockerfiles, deploy/smoke.py | B101 → B100 → B102 → B104 → B103. B110 (two lines for worker) and B112 (three for migrate) change deploy/compose.yaml after B100 |
| The worker's process | elo_worker/__main__.py, state.py, eloverblik/runtime.py, the accounts' start code | B101 → B110 → B111 |
| The commands of the image | elo_worker/cli.py, deploy/elo.sh | B102 → B104 → B103 |
| Caddy | deploy/Caddyfile | B110 (the route, the headers) and B103 (the update page) each add a block of their own; the lead resolves the merge, neither waits |
| The settings' path | migrate.py, deploy/compose.yaml | B100 → B112. In migrate.py B103 (the two refusals) and B112 (the unset variable) change different functions: the second to merge rebases |
| The status | elo_worker/status.py | After B95, which holds it now (the roster): B113 |
| The web app | web/packages/shell | B114, after the municipality method's B90 |
- At once: B101, on Linux from its first test (§2.8). B113's structure as soon as B95 has merged; B120 as soon as MM's B88 has. 2. When B101 has merged: B100 and B110, beside each other; B110's two lines of the Compose file follow B100's merge. 3. When B100 has merged: B102, then B104, then B103. When B110 has merged: B111 (also after B102) and B112 (also after B100). 4. When B111, B112 and B113 have merged: B114.
The smallest first delivery the owner can hold: B101, B100, B102: a release the lead starts from its folder
on the Mac and on a Linux VM, with the token in .env as today. B104 moves the owner's own install into it;
B103 makes it something to hand over, and its validation is the first install under WSL2. **Beside all of it,
and before the first company install: the scale at 50 and 100 metering points** (docs/roadmap.md §2), which is
the API's lane and no epic of this document. R2 (B110 to B114) is then five epics on a worker that already runs
without make.
5.4 Exit
- On a Linux machine with Docker and no other tool, somebody who did not write the guide starts the product from
a release's folder with one command and sees their own data; after a restart of the machine the stack is up
without a command. The same under WSL2 on the owner's Windows machine, or the checklist's line that says why
not.
2. An update keeps the data and says that it is updating; an older release on a newer database refuses.
3. The owner's install has moved its state into the volume once, lost nothing, and cannot be started the old way
by mistake.
4. From a first run: one command for a code, and then the token, the first loads, the settings and a renewal in
the browser; a removal prepared in the browser and made by one command; every guard of §3.4 has a test that
breaks it.
5. A checkout runs as before:
make up, the capture, every test. 6.resultversion 1 equals its file, its sums are the named queries', and a change the rule forbids fails CI.
6. For the owner
Both questions of version 1 are answered (26 November 2026).
| # | Question | The owner's answer | What it changed here |
|---|---|---|---|
| 1 | Hvem er den første bruger efter dig selv? | 15:05: "det bliver nok mig selv med et virksomhedslogin, på enten Windows eller Linux WSL." 15:13: "jeg tænker der er omkring 50 målere på dén jeg tager." | Linux is R1's first platform (§2.8): both architectures, the volume's ownership measured on Linux, no step of one system. The trial under WSL2 is the validation of B103, and an installer for Windows without WSL is not planned. About 50 metering points are the size the status page, the measurements and the first load are written for (§2.7, §3.6); the scale of the pages at that size is a precondition outside this document (docs/roadmap.md §2) |
| 2 | Skal kildekoden være offentlig? | 15:05: "Ikke til at starte med. I første omgang får de fil/login, alt efter hvad du anbefaler. Senere måske offentligt, alt efter hvad en direktør i mit selskab vurderer." The lead recommended the file | The images as a file to named users is the one way B100 builds; the registry's way stays specified (§2.2). The integrity of a file and the announcement of an update are the sender's (§2.2) |
What is still the owner's:
| # | Open | Until then |
|---|---|---|
| 1 | Whether, and when, the source becomes public: the owner's company decides | A file to named users. A public source is the registry's column of §2.2 and, first, a read of the repository's whole history for what must not be public |
| 2 | The Windows machine for the walk through B96's checklist, and the Linux laptop for B103's trial | B96's VM on the Mac (arm64): x86-64 is then untried |
| 3 | The word for moving the owner's own install into the volume (B104) | It stays a repository install, which nothing here changes |
| 4 | Which legal text an image that is handed out must carry (§2.2): the lead's ruling, with the owner's company where it has a view | No image leaves the owner's machines |
One answer the owner asked for, which needs no decision. "Kræver det virkelig 60 GB?": no. The measurements of 26 November are in §2.7; 60 GB was the room given to a machine that also builds the product.
7. The sentences that change
| Where | Today | Becomes | By |
|---|---|---|---|
docs/stack.md, "The launch contract"; P1 §1.2 | The supported start of the worker is make up, nothing else | … of the repository install. Of the packaged install it is docker compose up -d, and a restart is a start (§2.4) | B101 |
docs/stack.md | The worker has no restart policy | … in the repository install; unless-stopped in the packaged one | B101 |
| P1 §5.2, "A lock left by a crash" | The worker can prove its predecessor has stopped because Compose runs exactly one worker container | … and because it holds the database's lock elo.worker on the pace store's connection, and has waited 150 s where the owner record was left (§2.4) | B101 |
docs/stack.md, "The state directory is private"; P1 §5.2, the start check | The check judges the owner, the modes, the links and the ACLs | … and that a regular file has one link, in both installs | B101 |
docs/storage.md | – | ingest.state_home (its migration writes host for a database that holds an install; a worker writes its kind on a new one; import-state and adopt-state set volume); ops.product_version (migrate's) | B101, B104, B103 |
P1 §5.2, the client's timeouts; docs/eloverblik-client.md | A connect timeout of 10 s and a read timeout of 120 s for each read | … and one deadline of 130 s for a whole call; the lock asked before a send and again after a gap of 2 s | B101 |
docs/stack.md, the stack check | One mode | A release mode beside it; the checks of both installs are one code | B100 |
| P1 §12.1, "Refresh token" (with P2 §6.3) | In the owner's .env, and a file per further account in data/state/tokens/ | R1: unchanged, with .env beside the Compose file and the files in the volume elo_state. From B111 on, in the packaged install: a file per account, the first included; .env's line is converted once and then removed (§3.5) | B111 |
| P1 §12.1, "State directory" | data/state/, 0700, the host user's, checked by both halves | … In the packaged install a named volume the worker alone mounts, checked by the worker's half | B101 |
| P1 §1.3, "Commands a person runs" | The make targets | … and in the packaged install the subcommands of elo (§2.5) | B102 |
| ops §6 | Two ways after a restart: type make up, or make autostart | … in the repository install. The packaged install returns with Docker | B103 |
P1 §1.2, the rows worker and caddy | The worker listens to nothing; Caddy passes /api | The worker has the setup lane, on the stack's network, which never calls out; Caddy passes /setup to it | B110 |
| P2 §6.1, "Where a refresh token lives … the sealed box … exists for a token entered through a page of an exposed API" | – | Unchanged, and made exact: a token entered through a page on one machine goes to the worker's lane and a file; the sealed box is R4's | B111 |
| MM §3.2, "The path of the setting"; ops §2, "every run installs what it is given" | A variable that is not set installs the default, and the Compose file passes a default in its place | … unless a page saved the setting. A variable that is set wins over the page and is shown as that. The Compose file passes a marker for a variable that is not set (§3.7) | B112 |
docs/storage.md | – | ingest.setting_origin, three rows; three functions the worker may execute | B112 |
docs/stack.md, the worker's start; ops §3, "no refresh token is configured" | The worker opens tokens/ and builds its runtime only when the variable of .env is set | It starts from the stored accounts alone; the variable is the repository install's first account, and in the packaged install it is converted once (§3.5) | B111 |
docs/stack.md, "Configuration"; P1 §1.2 | ELO_PUBLIC_ADDRESS and ELO_PORT are the API's and Caddy's | … and the worker's, for the lane's guards | B110 |
ops §3, docs/daily-run.md | make status is a text | … rendered from a structure the lane also answers | B113 |
8. Not known, and to be confirmed
Nothing was run for this document, and no address was called. It is written from the repository as it is at
2bfd466 and from the roster; versions 1.1 to 1.3 also from the lines of the code the static read cites, which
were not read again for it. Every [TBC] above, with the epic that measures it:
| # | Statement | Whose |
|---|---|---|
| 1 | What a registry asks of a public and of a private package (a login, a charge) | Nobody now: the registry's way is not built (§2.2). The lead, before it is |
| 2 | CI can build arm64 natively, or only by emulation, and at what cost | B100 |
| 3 | docker load reads the compressed archive; with pull_policy: never Compose uses the loaded image and pulls nothing; a loaded image's identifier is the one recorded when it was saved, on both architectures and whichever image store Docker uses | B100 |
| 4 | Where Docker keeps a named volume on each platform, and that no other user of the host can read it there | B101 |
| 5 | An empty named volume takes the owner and the mode of the image's directory at its mount point | B101 (its first criterion, on Linux) |
| 6 | A container can tell a named volume from a bind of a host path | B101 |
| 7 | Docker's daemon restarts the containers of a stack without waiting for one another; what two docker compose up -d at once do | B101 |
| 8 | A session advisory lock is released when its session ends, by whatever cause, and not before; how long PostgreSQL takes to notice a session whose client is gone without closing | B101 (the read's sequence) |
| 8a | The clock the worker reads counts the time a stopped process and a sleeping host lose, also inside Docker's VM on macOS and under WSL2 | B101 on Linux; the owner's walk under WSL2 for the rest |
| 9 | COMPOSE_PROJECT_NAME of an --env-file names the project over the file's name:, as the environment's does today [code] | B104 (the demo) |
| 10 | Compose's ${VAR-marker} gives the marker only for a variable that is not set, also when the variable would come from an --env-file | B112 |
| 10a | A socket of the file system in the tmpfs of a container with a read-only root is made by the worker and reached by docker compose exec as the same user | B110 |
| 11 | The loaded size of the images, and the memory of the five containers | B103 |
| 12 | Docker Desktop's terms for an organisation and whether it starts at login; Colima at login | B103 reports |
| 13 | Everything of WSL2 that a Linux machine does not show (§2.8) | B96 writes the checklist; the owner walks it on the Windows machine |
| 14 | Windows without WSL | Nobody: not planned |
| 15 | Every statement about Azure and Fabric | docs/roadmap.md §3: before R5 or R6 is planned |
Open point for the lead: what an image that is handed out must carry, with this document's proposal (§2.2). Ruled since version 1.1, and written in: the worker's role gains nothing (§3.8); the outward form follows the install's own rule for a municipality (§4.3); the setup code is never in a log (§3.3).
The static read A5v: what was done
Part r1: prebuilt images
The read reviews/build/A5-agy-r1.md (26 November 2026: four blockers, two majors, on R1) with the lead's
rulings (orchestration/tasks/a5f-fixes.md). All six were accepted in substance. Part r2 follows below.
| Finding | What was wrong | What was changed |
|---|---|---|
| A5v-r1-01 (blocker) | R1 took the token's variable and the account env away, while the worker reads tokens/ only when the variable is set and builds its runtime on the first account: a packaged install of R1 would have read no token until R2's B111 | R1 changes nothing about how a token enters (§2.3, the decision and its table): .env's one line beside the Compose file, and token-add through the new command. The row of the variable left the table of differences. What R1 loses with make (Compose's output hidden, make doctor's look at .env) is said and given to elo.sh. The variable's removal, the worker's test of it and the conversion of the account env are B111's (§3.5, its row, §7) |
| A5v-r1-02 (blocker) | .dockerignore admits only the Python workspace, so the licence files, the web and the factors' fixtures reach no build; the images carry tools/ and uv; the stack check asserts the repository install; product.version was given to a SQL file that cannot hold it; a fixed container name broke the demo | §2.2 says per image what it holds and what no image holds, with a test of the built images, and gives .dockerignore to B100 (the three patterns at any depth). Two-stage builds; a fourth image, elo-demo, carries the generator and the fixtures. The stack check gains a release mode whose shared checks run unchanged (B100's row and criteria). The version travels by the build to elo_api's settings (§2.1, B100's "Owns"). The names stay as today (§2.3). The proposal for the licence files of an image that is handed out is in §2.2, for the lead |
| A5v-r1-03 (blocker) | verify, withdraw-day, set-price-area and unset-price-area were put in the worker, whose role may execute none of them, by design | The four run in admin, the one-shot service with the owner's credentials, calling the functions the SQL files call (§2.5, the table and its reasons); the worker's grants are unchanged, which is a criterion of B102, as is the worker's refusal of the same names |
| A5v-r1-04 (blocker) | tools had the worker's role alone and no Docker, while account-remove, doctor and demo-load ask Docker and need the owner's role | No container gets the socket (§2.4). §2.5 names four places and gives each command one: account-remove in admin, knowing a worker by the lock instead of by Docker, with the stop and the start typed on the host by elo.sh; doctor in two halves, the host's (.env, the logs of migrate) and tools'; demo-load in a service of its own with the image that holds what it needs. The owner's credentials are under migrate and admin alone (§2.3; B100's and B102's criteria). Neither one-shot service waits for migrate; what each command depends on was said in full by the re-read (A5v2-04, below) |
| A5v-r1-05 (major) | The lock was on a connection of its own: it could be freed while a call was in flight on another, and a waiting worker then took the egress, which its mode takes over without a test | The lock and the egress are one decision (§2.4, the table of seven steps): the lock is on the pace store's connection; the order of a start; the question before each send; the loser exits and leaves the egress alone; the successor waits 150 s where an owner record is left; _may_take_over tests both. The read's sequence is B101's criterion. The restore has its path: five steps, an absent volume, admin restore-prepare under the lock, the database's own pg_restore (§2.6; B103's criteria). ops.product_version closes the read's note on a minor without a migration |
| A5v-r1-06 (major) | An existing install's state had no way into the volume and nothing refused two states on one database; the check of the directory was said to hold a link count that it never held | "The state has one home, and moves once" (§2.4): ingest.state_home, the refusal of a worker of the other kind, make export-state piped into tools import-state, what each checks, what is carried, refusal when the volume holds anything, an interrupted import finished by the same line. The link count joins the directory's check in both installs (the guard's row; B101's criteria). The owner's install is the first, on the owner's word (B104's row; §6) |
What the owner's answers changed (§6): Linux and WSL2 are R1's first platform (§2.8, the three things that hold from the first epic; B103's trial and validation); the first company install of about 50 metering points sizes §2.7 and §3.6; the file is the one way of distribution that is built (§2.2). What the round cost: R1 is five epics, L, L, M, M, M, where it was four of M; B104 is new.
Part r2: the setup in the browser and the outward form
The reads reviews/build/A5-agy-r2a.md and A5-agy-r2b.md (26 November 2026: four blockers, six majors, two
minors) with the lead's rulings (orchestration/tasks/a5f2-fixes.md). All twelve were accepted in substance.
| Finding | What was wrong | What was changed |
|---|---|---|
| A5v-r2a-01 (blocker) | The worker cannot start from stored tokens without the variable, and a runtime made later by a reload is not what the running loop holds | B111 owns the start from the stored accounts alone (the four places that test the variable) and the holder through which the loop reads the runtime (§3.5). Two criteria hold it: a stack with no variable and one stored account fetches; an account added by the page is fetched without a restart, within 90 s on an idle worker and within 90 s of the end of a job in hand |
| A5v-r2a-02 (blocker) | The worker is given neither the public address nor the port, so the lane's Host and Origin checks would compare with a default | One source (§3.2): worker gets the two variables by api's expressions and judges them with the API's functions; where the address is not loopback or a variable is missing, the lane does not listen, the pages stay, and log, status and elo setup-code say why. The guards are tested on another port as well (§3.4, B110) |
| A5v-r2a-03 (major) | The answer came before a queued reload: for minutes a token had no account, the page said "no account", and the database's refusals came after "saved" | Every check, the database's among them, is made in the request under one lock that token-add shares; the answer is the store's write: the file, then the row, and a row that fails takes the file away (§3.5). No job of the queue; the page shows "gemt, første hentning afventer" from the row; a write of the lane drops the kept status (§3.6, B113) |
| A5v-r2a-04 (major) | A pairing code was printed into the worker's log at every start without an account | The code is never in a log (§3.3): it is made and shown by the one command, at that moment; a start prints that the command exists. The exception in §7 is gone, and B110 searches every captured log for every code |
| A5v-r2a-05 (minor) | Nothing said how the command reaches the worker's process | A socket of the file system in the worker's /tmp, 0600, made by the lane, reached by docker compose exec as the worker's user; chosen over a database row and over a route, with the reasons (§3.3) |
| A5v-r2a-06 (minor) | The content policy as written blocked the page's own icon | The policy as the pages need it, images from data: and fonts from the origin among it, held by the pages' own console test (§3.4, guard 9) |
| A5v-r2b-01 (blocker) | A removal as a job of the worker's loop meets its own claimed row, the other lane's rows and its own journal | The removal is not a job of the queue and is not made from the browser in R2 (§3.8): the page prepares it and shows what will go, the command of §2.5 carries it out with its own question, the page shows the result. The routes removal-preview and remove, the rule of ten minutes and the job are gone; one route that changes nothing is left |
| A5v-r2b-03 (major) | The worker's role would have gained the right to remove an account, on a reason that does not hold (a token cannot fetch again what the API no longer gives) | The worker's role gains nothing. The decision of §3.8 is withdrawn with its reason; §7's row and §8's statement on the maintenance right are gone; B111's criterion is that the grants are what they were |
| A5v-r2b-02 (blocker) | "Unset passed as empty" made an unset variable and an empty one the same text: either every start wiped a saved setting or an empty variable could no longer reset one | The Compose file passes a marker only for a variable that is not set (${VAR-marker}, without the colon); migrate reads marker, empty and value as three things, and B92's "an empty value is the default" holds (§3.7). The one assertion of B92 on the Compose file's text changes, and is named |
| A5v-r2b-04 (major) | Two origins could not tell a default from a variable; "three rows" matched no table; a variable for one setting would have locked another | ingest.setting_origin: three rows, one per setting, three origins (default, variable, page), the values where they are (§3.7). The table of every case: a saved setting wins over a variable that is not set; a set variable wins over the page and is shown as "sat af installationen" with its name and time; a replaced value is recorded and said. The origin is the last start's that ran migrate, and the page says when |
| A5v-r2b-05 (major) | The source groups lost the waste's 0,55 and the nuclear mark; the origin had no dimension, no local, no place for what is outside the figures; a second price basis within a major would have doubled a reader's cost; a corrected calculation left a windowed copy half old | result.source_group is ref.mix_group as it is; result.origin_area; the rows pending and not_available; a table that gives E07, E11a and E11b from the relations alone, and a test that they equal the report's rows (§4.2, §4.5). The cost has no partitioning key and is the spot cost by its columns' names; a relation gets such a key only at a new major. Chosen for a new member of an enumeration: allowed within a major, because the form tells the reader what to do with one it does not know, per kind (§4.4). calculation in the contract: a copy made under another value is reloaded whole |
| A5v-r2b-06 (major) | The municipality's code went outward whatever the names' setting; the alias for protected and private points; the party kind on the company, which may hold accounts of several kinds | The outward form follows the install's own rule for a municipality (§4.3): the ordinal the pages write, and code and name only with the names on and N4, from calc.municipality_parts. The alias only for a company's account under N4; postcode and city are not in version 1; the party kind is the owning account's, on the point; a company's name only where every account is a company's; status 4 is in no relation |
What R2 keeps as a command, on purpose (§3.9): elo setup-code, where the trust begins, and
account-remove, the one act that deletes; with them the commands that are Docker's or must work without the
stack (the start, the update, backup and restore, the purge) and the pace's settings. Everything else of the
setup is a page: the token, the first loads, the three settings, a renewal.
The re-read of §2.4 and B101 (A5v2)
The read reviews/build/A5-agy-reread.md (26 November 2026: one blocker, three majors, one minor, on §2.4 and
B101's row as version 1.2 had them), with the lead's rulings. All five were accepted in substance.
| Finding | What was wrong | What was changed |
|---|---|---|
| A5v2-01 (major) | B101 did not own runtime.py, where the pace store is made, and only when a token is configured: built within its files, the lock was on a second connection or taken after the lanes had started, and a worker without a token held none | __main__ makes the store and takes the lock at every start, token or not, and hands the store to the runtime (§2.4, "Who makes it, and when"); the lanes start after the lock, and a waiting worker is not healthy. B101's "Owns" names every file the text makes it change (runtime.py, queue.py, client.py among them), and says that a file beyond them is a finding of its read |
| A5v2-02 (major) | The text claimed that no second call can be in flight. A process stopped between the lock's answer and the send, a read timeout that bounds each read and no call, a wait on a clock that jumps, and an idle worker that never asks its lock each broke it | The residual is said, and bounded (§2.4): the lock is asked again where more than 2 s of a clock that counts stops and sleeps have passed before the send; a call has one deadline of 130 s; the successor waits 150 s on its own clock, more than 130 s + 2 s; the loop asks the lock at every poll. The claim now excepts the one call. B101 holds the bound with a clock the test moves |
| A5v2-03 (major) | The migration left the home's row empty on a database that an install already used, so a packaged worker first on it would have written volume over an empty volume and marked every stored account absent; the same after a restore of an older dump | The migration writes host for a database that holds an account, a stored request, a job or a capture's import (§2.4). A worker of the other kind takes no lock, marks nothing absent and names the move; the packaged one stays up and goes on when the row is set. token-add refuses by the home. After a restore over a moved state, admin adopt-state sets the row under the lock, only where every account has its files |
| A5v2-04 (blocker) | The move's line could not run: make down stops the database, tools depended on nothing, and the row's table does not exist before migrate has run | The move is four steps that ./elo.sh import-state types, the second of them docker compose run --rm migrate, which starts the database and brings the row without starting a worker (§2.4). tools and admin depend on the database being healthy; doctor alone runs without it. §2.5 has a table of every command: what it needs running, what starts it, the line it says when it is not there; a schema older than the release is one such line. export-state refuses every stray entry of tokens/, and an import finishes over its own leftover temporary names |
| A5v2-05 (minor) | "Directories 0700" was written of a check that refuses only a write bit, and that skips tokens/ without a token; the user of a packaged install was never told who can read the volume | The volume's check is the stricter one (the guard's row of §2.4): 0700 on every directory, 0600 on every file, the worker's user, tokens/ always; what the host directory's check keeps is said beside it. The install guide carries the sentence about who may run Docker (B103's criterion) |
| B104 (major) | import-state was placed in tools, whose role (the worker's) may select and insert ingest.state_home and cannot change it (migration 0390; test_storage pins the grants): the move could not set the row to volume last, and a grant would have let a running worker flip it | The worker's role cannot set the row (the lead's ruling, B104). import-state is a command of admin, as adopt-state is: the owner's role, the state volume, and elo.worker held on the session that sets the row. tools keeps token-add, doctor and status. Changed: §2.4 (the move's third step, "What import-state checks"), §2.5 (the commands' table, the table of needs), the row B104 of §5.2. A consequence held by a test: the archive reaches admin on standard input and admin's environment holds the owner's credential, so admin import-state prints nothing of its environment and no member's content |
Kilde: docs/architecture/packaging-and-setup.md i løsningens
repository.